Changeset 1070

Show
Ignore:
Timestamp:
11/07/06 17:19:00
Author:
johnsa
Message:

search funtionality for admin client (not complete)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/deployment/webadmin/webapp/resources/default/default/default.css

    r1032 r1070  
    55  font-family: Arial, Helvetica, sans-serif; 
    66  font-size: 100%; 
     7  min-width: 680px; 
    78} 
    89#header { 
     
    3738  background-color: inherit; 
    3839  color: #ff9; 
     40} 
     41#adminLeftColumn { 
     42  float: left; 
     43} 
     44#adminRightColumn { 
     45  float: right; 
     46  margin: 1em; 
    3947} 
    4048#statusBarTable { 
     
    145153  display: inline; 
    146154} 
     155#searchForm { 
     156  font-size: 0.8em; 
     157  margin: 0 0 0 3px; 
     158} 
     159#searchForm input { 
     160  font-size: 0.7em; 
     161} 
    147162.adminMenu { 
    148163  margin-top: 0em; 
     
    544559} 
    545560#footer { 
     561  clear: both; 
    546562  padding: 1em; 
    547563  margin-top: 2em; 
    548   text-align: center; 
    549   border-top: medium groove #eee; 
    550   font-size: 0.8em; 
    551 
     564  border-top: 1px solid #999; 
     565  font-size: 0.7em; 
     566  background-color: transparent; 
     567  color: #999; 
     568
     569#footer a { 
     570  color: #999; 
     571  background-color: inherit; 
     572
  • trunk/deployment/webadmin/webapp/resources/default/default/default.xsl

    r1060 r1070  
    6767  <xsl:variable name="setup" select="/bedeworkadmin/urlPrefixes/setup/a/@href"/> 
    6868  <xsl:variable name="logout" select="/bedeworkadmin/urlPrefixes/logout/a/@href"/> 
     69  <xsl:variable name="search" select="/bedeworkadmin/urlPrefixes/search/search/a/@href"/> 
     70  <xsl:variable name="search-next" select="/bedeworkadmin/urlPrefixes/search/next/a/@href"/> 
    6971  <!-- events --> 
    7072  <xsl:variable name="event-showEvent" select="/bedeworkadmin/urlPrefixes/event/showEvent/a/@href"/> 
     
    316318                  <xsl:call-template name="deleteAdminGroupConfirm"/> 
    317319                </xsl:when> 
     320                <xsl:when test="/bedeworkadmin/page='searchResult'"> 
     321                  <xsl:call-template name="searchResult"/> 
     322                </xsl:when> 
    318323                <xsl:when test="/bedeworkadmin/page='noGroup'"> 
    319324                  <h2>No administrative group</h2> 
     
    369374  <!--+++++++++++++++ Main Menu ++++++++++++++++++++--> 
    370375  <xsl:template name="mainMenu"> 
    371     <h2 class="menuTitle">Main Menu</h2> 
    372     <table id="mainMenuTable"> 
    373       <tr> 
    374         <th>Events</th> 
    375         <td> 
    376           <a id="addEventLink" href="{$event-initAddEvent}"> 
    377             Add 
    378           </a> 
    379         </td> 
    380         <td> 
    381           <a href="{$event-initUpdateEvent}"> 
    382             Edit / Delete 
    383           </a> 
    384         </td> 
    385         <!-- 
    386         Disable direct selection by ID; we'll need to find another way 
    387         of quickly getting to events: search and grid views should be implemented. --> 
    388         <!-- 
    389         <td> 
    390           Event ID: 
    391           <xsl:copy-of select="/bedeworkadmin/formElements/*"/> 
    392         </td>--> 
    393       </tr> 
    394       <tr> 
    395         <th>Contacts</th> 
    396         <td> 
    397           <a id="addSponsorLink" href="{$sponsor-initAdd}"> 
    398             Add 
    399           </a> 
    400         </td> 
    401         <td> 
    402           <a href="{$sponsor-initUpdate}"> 
    403             Edit / Delete 
    404           </a> 
    405         </td> 
    406       </tr> 
    407       <tr> 
    408         <th>Locations</th> 
    409         <td> 
    410           <a id="addLocationLink" href="{$location-initAdd}"> 
    411             Add 
    412           </a> 
    413         </td> 
    414         <td> 
    415           <a href="{$location-initUpdate}"> 
    416             Edit / Delete 
    417           </a> 
    418         </td> 
    419       </tr> 
    420       <tr> 
    421         <th>Categories</th> 
    422         <td> 
    423           <a id="addCategoryLink" href="{$category-initAdd}"> 
    424             Add 
    425           </a> 
    426         </td> 
    427         <td> 
    428           <a href="{$category-initUpdate}"> 
    429             Edit / Delete 
    430           </a> 
    431         </td> 
    432       </tr> 
    433     </table> 
    434  
    435     <xsl:if test="/bedeworkadmin/currentCalSuite/currentAccess/current-user-privilege-set/privilege/write or /bedeworkadmin/userInfo/superUser='true'"> 
    436       <h4 class="menuTitle"> 
    437         Manage Calendar Suite: 
    438         <em><xsl:value-of select="/bedeworkadmin/currentCalSuite/name"/> 
    439         </em> 
    440       </h4> 
    441       <ul class="adminMenu"> 
    442         <li> 
    443           <a href="{$calendar-fetch}"> 
    444             Manage calendars 
    445           </a> 
    446         </li> 
    447         <li> 
    448           <a href="{$subscriptions-fetch}"> 
    449             Manage subscriptions 
    450           </a> 
    451         </li> 
    452         <li> 
    453           <a href="{$view-fetch}"> 
    454             Manage views 
    455           </a> 
    456         </li> 
    457         <li> 
    458           <a href="{$calsuite-fetchPrefsForUpdate}"> 
    459             Manage preferences 
    460           </a> 
    461         </li> 
    462         <li> 
    463           <a href="{$event-initUpload}"> 
    464             Upload iCAL file 
    465           </a> 
    466         </li> 
    467       </ul> 
    468     </xsl:if> 
    469  
    470     <xsl:if test="/bedeworkadmin/userInfo/contentAdminUser='true'"> 
    471       <h4 class="menuTitle">User management</h4> 
    472       <ul class="adminMenu"> 
    473         <xsl:if test="/bedeworkadmin/userInfo/userMaintOK='true'"> 
     376    <div id="adminLeftColumn"> 
     377      <h2 class="menuTitle">Main Menu</h2> 
     378      <table id="mainMenuTable"> 
     379        <tr> 
     380          <th>Events</th> 
     381          <td> 
     382            <a id="addEventLink" href="{$event-initAddEvent}"> 
     383              Add 
     384            </a> 
     385          </td> 
     386          <td> 
     387            <a href="{$event-initUpdateEvent}"> 
     388              Edit / Delete 
     389            </a> 
     390          </td> 
     391          <!-- 
     392          Disable direct selection by ID; we'll need to find another way 
     393          of quickly getting to events: search and grid views should be implemented. --> 
     394          <!-- 
     395          <td> 
     396            Event ID: 
     397            <xsl:copy-of select="/bedeworkadmin/formElements/*"/> 
     398          </td>--> 
     399        </tr> 
     400        <tr> 
     401          <th>Contacts</th> 
     402          <td> 
     403            <a id="addSponsorLink" href="{$sponsor-initAdd}"> 
     404              Add 
     405            </a> 
     406          </td> 
     407          <td> 
     408            <a href="{$sponsor-initUpdate}"> 
     409              Edit / Delete 
     410            </a> 
     411          </td> 
     412        </tr> 
     413        <tr> 
     414          <th>Locations</th> 
     415          <td> 
     416            <a id="addLocationLink" href="{$location-initAdd}"> 
     417              Add 
     418            </a> 
     419          </td> 
     420          <td> 
     421            <a href="{$location-initUpdate}"> 
     422              Edit / Delete 
     423            </a> 
     424          </td> 
     425        </tr> 
     426        <tr> 
     427          <th>Categories</th> 
     428          <td> 
     429            <a id="addCategoryLink" href="{$category-initAdd}"> 
     430              Add 
     431            </a> 
     432          </td> 
     433          <td> 
     434            <a href="{$category-initUpdate}"> 
     435              Edit / Delete 
     436            </a> 
     437          </td> 
     438        </tr> 
     439      </table> 
     440 
     441      <h4 class="menuTitle">Event search:</h4> 
     442      <form name="searchForm" method="post" action="{$search}" id="searchForm"> 
     443        <input type="text" name="query" size="30"> 
     444          <xsl:attribute name="value"><xsl:value-of select="/bedeworkadmin/searchResults/query"/></xsl:attribute> 
     445        </input> 
     446        <input type="submit" name="submit" value="go"/> 
     447        <div id="searchFields"> 
     448          Limit to: 
     449          <input type="radio" name="searchLimit" value="future"/>future 
     450          <input type="radio" name="searchLimit" value="future"/>past 
     451          <input type="radio" name="searchLimit" value="all" checked="checked"/>all dates 
     452        </div> 
     453      </form> 
     454 
     455    </div> 
     456 
     457    <div id="adminRightColumn"> 
     458      <xsl:if test="/bedeworkadmin/currentCalSuite/currentAccess/current-user-privilege-set/privilege/write or /bedeworkadmin/userInfo/superUser='true'"> 
     459        <h4 class="menuTitle"> 
     460          Manage calendar suite: 
     461          <em><xsl:value-of select="/bedeworkadmin/currentCalSuite/name"/> 
     462          </em> 
     463        </h4> 
     464        <ul class="adminMenu"> 
    474465          <li> 
    475             <a href="{$authuser-initUpdate}"> 
    476               Manage public event administrators 
     466            <a href="{$calendar-fetch}"> 
     467              Manage calendars 
    477468            </a> 
    478469          </li> 
    479         </xsl:if> 
    480         <xsl:if test="/bedeworkadmin/userInfo/adminGroupMaintOk='true'"> 
    481470          <li> 
    482             <a href="{$admingroup-initUpdate}"> 
    483               Manage admin group
     471            <a href="{$subscriptions-fetch}"> 
     472              Manage subscription
    484473            </a> 
    485474          </li> 
    486         </xsl:if> 
    487         <li> 
    488           <a href="{$admingroup-switch}"> 
    489             Choose/change group... 
    490           </a> 
    491         </li> 
    492         <xsl:if test="/bedeworkadmin/userInfo/userMaintOK='true'"> 
    493475          <li> 
    494             <form action="{$prefs-fetchForUpdate}" method="post"> 
    495               Edit user preferences (enter userid): <input type="text" name="user" size="15"/> 
    496               <input type="submit" name="getPrefs" value="go"/> 
    497             </form> 
     476            <a href="{$view-fetch}"> 
     477              Manage views 
     478            </a> 
    498479          </li> 
    499         </xsl:if> 
    500       </ul> 
    501     </xsl:if> 
    502  
    503     <xsl:if test="/bedeworkadmin/userInfo/superUser='true'"> 
    504       <h4 class="menuTitle">Super user features</h4> 
    505       <ul class="adminMenu"> 
    506         <li> 
    507           <a href="{$calsuite-fetch}"> 
    508             Manage calendar suites 
    509           </a> 
    510         </li> 
    511         <li> 
    512           <a href="{$system-fetch}"> 
    513             Manage system preferences 
    514           </a> 
    515         </li> 
    516         <li> 
    517           <a href="{$timezones-initUpload}"> 
    518             Upload and replace system timezones 
    519           </a> 
    520         </li> 
    521         <li> 
    522           System statistics: 
    523           <ul> 
     480          <li> 
     481            <a href="{$calsuite-fetchPrefsForUpdate}"> 
     482              Manage preferences 
     483            </a> 
     484          </li> 
     485          <li> 
     486            <a href="{$event-initUpload}"> 
     487              Upload iCAL file 
     488            </a> 
     489          </li> 
     490        </ul> 
     491      </xsl:if> 
     492 
     493      <xsl:if test="/bedeworkadmin/userInfo/contentAdminUser='true'"> 
     494        <h4 class="menuTitle">Manage users:</h4> 
     495        <ul class="adminMenu"> 
     496          <xsl:if test="/bedeworkadmin/userInfo/userMaintOK='true'"> 
    524497            <li> 
    525               <a href="{$stats-update}&amp;fetch=yes"> 
    526                 admin web client 
     498              <a href="{$authuser-initUpdate}"> 
     499                Manage public event administrators 
    527500              </a> 
    528501            </li> 
     502          </xsl:if> 
     503          <xsl:if test="/bedeworkadmin/userInfo/adminGroupMaintOk='true'"> 
    529504            <li> 
    530               <a href="{$publicCal}/stats.do" target="pubClient"> 
    531                 public web client 
     505              <a href="{$admingroup-initUpdate}"> 
     506                Manage admin groups 
    532507              </a> 
    533508            </li> 
    534           </ul> 
    535         </li> 
    536       </ul> 
    537     </xsl:if> 
     509          </xsl:if> 
     510          <li> 
     511            <a href="{$admingroup-switch}"> 
     512              Choose/change group... 
     513            </a> 
     514          </li> 
     515          <xsl:if test="/bedeworkadmin/userInfo/userMaintOK='true'"> 
     516            <li> 
     517              <form action="{$prefs-fetchForUpdate}" method="post"> 
     518                Edit user preferences (enter userid):<br/> 
     519                <input type="text" name="user" size="15"/> 
     520                <input type="submit" name="getPrefs" value="go"/> 
     521              </form> 
     522            </li> 
     523          </xsl:if> 
     524        </ul> 
     525      </xsl:if> 
     526 
     527      <xsl:if test="/bedeworkadmin/userInfo/superUser='true'"> 
     528        <h4 class="menuTitle">Super user features:</h4> 
     529        <ul class="adminMenu"> 
     530          <li> 
     531            <a href="{$calsuite-fetch}"> 
     532              Manage calendar suites 
     533            </a> 
     534          </li> 
     535          <li> 
     536            <a href="{$system-fetch}"> 
     537              Manage system preferences 
     538            </a> 
     539          </li> 
     540          <li> 
     541            <a href="{$timezones-initUpload}"> 
     542              Upload and replace system timezones 
     543            </a> 
     544          </li> 
     545          <li> 
     546            System statistics: 
     547            <ul> 
     548              <li> 
     549                <a href="{$stats-update}&amp;fetch=yes"> 
     550                  admin web client 
     551                </a> 
     552              </li> 
     553              <li> 
     554                <a href="{$publicCal}/stats.do" target="pubClient"> 
     555                  public web client 
     556                </a> 
     557              </li> 
     558            </ul> 
     559          </li> 
     560        </ul> 
     561      </xsl:if> 
     562    </div> 
    538563  </xsl:template> 
    539564 
     
    38233848  </xsl:template> 
    38243849 
     3850  <!--==== SEARCH RESULT ====--> 
     3851  <xsl:template name="searchResult"> 
     3852    <h2 class="bwStatusConfirmed"> 
     3853      <div id="searchFilter"> 
     3854        Limit search to: 
     3855        <input type="radio" name="searchLimit" value="future"/>today forward 
     3856        <input type="radio" name="searchLimit" value="future"/>past dates 
     3857        <input type="radio" name="searchLimit" value="all" checked="checked"/>all dates 
     3858      </div> 
     3859      Search Result 
     3860    </h2> 
     3861    <table id="searchTable" cellpadding="0" cellspacing="0"> 
     3862      <tr> 
     3863        <th colspan="5"> 
     3864          <xsl:if test="/bedeworkadmin/searchResults/numPages &gt; 1"> 
     3865            <xsl:variable name="curPage" select="/bedeworkadmin/searchResults/curPage"/> 
     3866            <div id="searchPageForm"> 
     3867              page: 
     3868              <xsl:if test="/bedeworkadmin/searchResults/curPage != 1"> 
     3869                <xsl:variable name="prevPage" select="number($curPage) - 1"/> 
     3870                &lt;<a href="{$search-next}&amp;pageNum={$prevPage}">prev</a> 
     3871              </xsl:if> 
     3872              <xsl:text> </xsl:text> 
     3873 
     3874              <xsl:call-template name="searchResultPageNav"> 
     3875                <xsl:with-param name="page"> 
     3876                  <xsl:choose> 
     3877                    <xsl:when test="number($curPage) - 10 &lt; 1">1</xsl:when> 
     3878                    <xsl:otherwise><xsl:value-of select="number($curPage) - 6"/></xsl:otherwise> 
     3879                  </xsl:choose> 
     3880                </xsl:with-param> 
     3881              </xsl:call-template> 
     3882 
     3883              <xsl:text> </xsl:text> 
     3884              <xsl:choose> 
     3885                <xsl:when test="$curPage != /bedeworkadmin/searchResults/numPages"> 
     3886                  <xsl:variable name="nextPage" select="number($curPage) + 1"/> 
     3887                  <a href="{$search-next}&amp;pageNum={$nextPage}">next</a>&gt; 
     3888                </xsl:when> 
     3889                <xsl:otherwise> 
     3890                  <span class="hidden">next&gt;</span><!-- occupy the space to keep the navigation from moving around --> 
     3891                </xsl:otherwise> 
     3892              </xsl:choose> 
     3893            </div> 
     3894          </xsl:if> 
     3895          <xsl:value-of select="/bedeworkadmin/searchResults/resultSize"/> 
     3896          result<xsl:if test="/bedeworkadmin/searchResults/resultSize != 1">s</xsl:if> returned 
     3897          for <em><xsl:value-of select="/bedeworkadmin/searchResults/query"/></em> 
     3898        </th> 
     3899      </tr> 
     3900      <xsl:if test="/bedeworkadmin/searchResults/searchResult"> 
     3901        <tr class="fieldNames"> 
     3902          <td> 
     3903            relevance 
     3904          </td> 
     3905          <td> 
     3906            summary 
     3907          </td> 
     3908          <td> 
     3909            date &amp; time 
     3910          </td> 
     3911          <td> 
     3912            calendar 
     3913          </td> 
     3914          <td> 
     3915            location 
     3916          </td> 
     3917        </tr> 
     3918      </xsl:if> 
     3919      <xsl:for-each select="/bedeworkadmin/searchResults/searchResult"> 
     3920        <xsl:variable name="subscriptionId" select="event/subscription/id"/> 
     3921        <xsl:variable name="calPath" select="event/calendar/encodedPath"/> 
     3922        <xsl:variable name="guid" select="event/guid"/> 
     3923        <xsl:variable name="recurrenceId" select="event/recurrenceId"/> 
     3924        <tr> 
     3925          <td class="relevance"> 
     3926            <xsl:value-of select="ceiling(number(score)*100)"/>% 
     3927            <img src="{$resourcesRoot}/images/spacer.gif" height="4" class="searchRelevance"> 
     3928              <xsl:attribute name="width"><xsl:value-of select="ceiling((number(score)*100) div 1.5)"/></xsl:attribute> 
     3929            </img> 
     3930          </td> 
     3931          <td> 
     3932            <a href="{$event-showEvent}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}"> 
     3933              <xsl:value-of select="event/summary"/> 
     3934            </a> 
     3935          </td> 
     3936          <td> 
     3937            <xsl:value-of select="event/start/longdate"/> 
     3938            <xsl:text> </xsl:text> 
     3939            <xsl:value-of select="event/start/time"/> 
     3940            <xsl:choose> 
     3941              <xsl:when test="event/start/longdate != event/end/longdate"> 
     3942                - <xsl:value-of select="event/start/longdate"/> 
     3943                <xsl:text> </xsl:text> 
     3944                <xsl:value-of select="event/end/time"/> 
     3945              </xsl:when> 
     3946              <xsl:when test="event/start/time != event/end/time"> 
     3947                - <xsl:value-of select="event/end/time"/> 
     3948              </xsl:when> 
     3949            </xsl:choose> 
     3950          </td> 
     3951          <td> 
     3952            <xsl:value-of select="event/calendar/name"/> 
     3953          </td> 
     3954          <td> 
     3955            <xsl:value-of select="event/location/address"/> 
     3956          </td> 
     3957        </tr> 
     3958      </xsl:for-each> 
     3959    </table> 
     3960  </xsl:template> 
     3961 
     3962  <xsl:template name="searchResultPageNav"> 
     3963    <xsl:param name="page">1</xsl:param> 
     3964    <xsl:variable name="curPage" select="/bedeworkadmin/searchResults/curPage"/> 
     3965    <xsl:variable name="numPages" select="/bedeworkadmin/searchResults/numPages"/> 
     3966    <xsl:variable name="endPage"> 
     3967      <xsl:choose> 
     3968        <xsl:when test="number($curPage) + 6 &gt; number($numPages)"><xsl:value-of select="$numPages"/></xsl:when> 
     3969        <xsl:otherwise><xsl:value-of select="number($curPage) + 6"/></xsl:otherwise> 
     3970      </xsl:choose> 
     3971    </xsl:variable> 
     3972    <xsl:choose> 
     3973      <xsl:when test="$page = $curPage"> 
     3974        <xsl:value-of select="$page"/> 
     3975      </xsl:when> 
     3976      <xsl:otherwise> 
     3977        <a href="{$search-next}&amp;pageNum={$page}"> 
     3978          <xsl:value-of select="$page"/> 
     3979        </a> 
     3980      </xsl:otherwise> 
     3981    </xsl:choose> 
     3982    <xsl:text> </xsl:text> 
     3983    <xsl:if test="$page &lt; $endPage"> 
     3984       <xsl:call-template name="searchResultPageNav"> 
     3985         <xsl:with-param name="page" select="number($page)+1"/> 
     3986      </xsl:call-template> 
     3987    </xsl:if> 
     3988  </xsl:template> 
     3989 
    38253990  <!--==== HEADER TEMPLATES and NAVIGATION  ====--> 
    38263991 
     
    39114076          <a href="{$publicCal}" target="calendar">Launch Calendar</a> | 
    39124077          <a href="{$logout}">Log Out</a> 
    3913           <!-- Enable the following two items when debugging skins only --> 
    3914           | <a href="?refreshXslt=yes">Refresh XSL</a> | 
    3915           <a href="?noxslt=yes">Show XML</a> (view source) 
    39164078        </td> 
    39174079        <xsl:if test="/bedeworkadmin/userInfo/user"> 
     
    39474109  <xsl:template name="footer"> 
    39484110    <div id="footer"> 
    3949       <a href="http://www.bedework.org/">Bedework website</a> 
     4111      <a href="http://www.bedework.org/">Bedework Calendar</a> | 
     4112      <!-- Enable the following two items when debugging skins only --> 
     4113      <a href="?noxslt=yes">show XML</a> | 
     4114      <a href="?refreshXslt=yes">refresh XSLT</a> 
    39504115    </div> 
    39514116  </xsl:template>