Changeset 2134

Show
Ignore:
Timestamp:
04/15/09 17:36:41
Author:
johnsa
Message:

admin client: added category filtering in event list

Files:

Legend:

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

    r2131 r2134  
    10821082  margin: 1em 0 -1em 1em; 
    10831083} 
     1084#bwEventListControls form { 
     1085  display: inline; 
     1086  padding-right: 2em; 
     1087} 
    10841088#filterTable { 
    10851089  font-size: 0.9em; 
  • trunk/deployment/webadmin/webapp/resources/default/default/default.xsl

    r2133 r2134  
    3939    special, consequential, or incidental damages related to the software, 
    4040    to the maximum extent the law permits. --> 
     41 
     42  <!-- GENERATE KEYS --> 
     43  <!-- Pick out unique categories from a collection of events 
     44       for filtering in the manage event list. --> 
     45  <xsl:key name="catUid" match="category" use="uid"/> 
    4146 
    4247  <!-- DEFINE INCLUDES --> 
     
    903908    </p> 
    904909 
    905     <form name="calForm" id="bwManageEventListControls" method="post" action="{$event-initUpdateEvent}"> 
    906       Show: 
    907       <xsl:copy-of select="/bedework/formElements/form/listAllSwitchFalse/*"/> 
    908       Active 
    909       <xsl:copy-of select="/bedework/formElements/form/listAllSwitchTrue/*"/> 
    910       All 
    911     </form> 
    912  
     910    <div id="bwEventListControls"> 
     911      <form name="calForm" id="bwManageEventListControls" method="post" action="{$event-initUpdateEvent}"> 
     912        Show: 
     913        <xsl:copy-of select="/bedework/formElements/form/listAllSwitchFalse/*"/> 
     914        Active 
     915        <xsl:copy-of select="/bedework/formElements/form/listAllSwitchTrue/*"/> 
     916        All 
     917      </form> 
     918 
     919      <form name="filterEventsForm" 
     920            id="bwFilterEventsForm" 
     921            action="{$event-initUpdateEvent}"> 
     922        Filter by: 
     923        <select name="setappvar" onchange="this.form.submit();"> 
     924          <option value="catFilter(none)">select a category</option> 
     925          <xsl:for-each select="/bedework/events//event/categories//category[generate-id() = generate-id(key('catUid',uid)[1])]"> 
     926            <xsl:variable name="uid" select="uid"/> 
     927            <option value="catFilter({$uid})"> 
     928              <xsl:if test="/bedework/appvar[key='catFilter']/value = uid"> 
     929                <xsl:attribute name="selected">selected</xsl:attribute> 
     930              </xsl:if> 
     931              <xsl:value-of select="keyword"/> 
     932            </option> 
     933          </xsl:for-each> 
     934        </select> 
     935        <xsl:if test="/bedework/appvar[key='catFilter'] and /bedework/appvar[key='catFilter']/value != 'none'"> 
     936          <input type="submit" value="clear filter" onclick="this.form.setappvar.selectedIndex = 0"/> 
     937        </xsl:if> 
     938      </form> 
     939    </div> 
    913940    <xsl:call-template name="eventListCommon"/> 
    914941  </xsl:template> 
     
    927954      </tr> 
    928955 
    929       <xsl:for-each select="/bedework/events/event"> 
    930         <xsl:variable name="subscriptionId" select="subscription/id"/> 
    931         <xsl:variable name="calPath" select="calendar/encodedPath"/> 
    932         <xsl:variable name="guid" select="guid"/> 
    933         <xsl:variable name="recurrenceId" select="recurrenceId"/> 
    934         <tr> 
    935           <td> 
    936             <xsl:choose> 
    937               <xsl:when test="$pending = 'true'"> 
    938                 <a href="{$event-fetchForUpdatePending}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}"> 
    939                   <xsl:choose> 
    940                     <xsl:when test="summary != ''"> 
    941                       <xsl:value-of select="summary"/> 
    942                     </xsl:when> 
    943                     <xsl:otherwise> 
    944                       <em>no title</em> 
    945                     </xsl:otherwise> 
    946                   </xsl:choose> 
    947                 </a> 
    948               </xsl:when> 
    949               <xsl:otherwise> 
    950                 <a href="{$event-fetchForUpdate}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}"> 
    951                   <xsl:choose> 
    952                     <xsl:when test="summary != ''"> 
    953                       <xsl:value-of select="summary"/> 
    954                     </xsl:when> 
    955                     <xsl:otherwise> 
    956                       <em>no title</em> 
    957                     </xsl:otherwise> 
    958                   </xsl:choose> 
    959                 </a> 
    960               </xsl:otherwise> 
    961             </xsl:choose> 
    962           </td> 
    963           <td class="date"> 
    964             <xsl:value-of select="start/shortdate"/> 
    965             <xsl:text> </xsl:text> 
    966             <xsl:value-of select="start/time"/> 
    967           </td> 
    968           <td class="date"> 
    969             <xsl:value-of select="end/shortdate"/> 
    970             <xsl:text> </xsl:text> 
    971             <xsl:value-of select="end/time"/> 
    972           </td> 
    973           <td class="calcat"> 
    974             <xsl:for-each select="xproperties/X-BEDEWORK-ALIAS"> 
    975               <xsl:call-template name="substring-afterLastInstanceOf"> 
    976                 <xsl:with-param name="string" select="values/text"/> 
    977                 <xsl:with-param name="char">/</xsl:with-param> 
    978               </xsl:call-template><br/> 
    979             </xsl:for-each> 
    980           </td> 
    981           <td class="calcat"> 
    982             <xsl:for-each select="categories/category"> 
    983               <xsl:sort select="word"/> 
    984               <xsl:value-of select="word"/><br/> 
    985             </xsl:for-each> 
    986           </td> 
    987           <!-- <td> 
    988             <xsl:value-of select="calendar/name"/> 
    989           </td>--> 
    990           <td> 
    991             <xsl:value-of select="description"/> 
    992             <xsl:if test="recurring = 'true' or recurrenceId != ''"> 
    993               <div class="recurrenceEditLinks"> 
    994                 Recurring event. 
    995                 Edit: 
    996                 <a href="{$event-fetchForUpdate}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}"> 
    997                   master 
    998                 </a> | 
    999                 <a href="{$event-fetchForUpdate}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}"> 
    1000                   instance 
    1001                 </a> 
    1002               </div> 
    1003             </xsl:if> 
    1004           </td> 
    1005         </tr> 
    1006       </xsl:for-each> 
     956      <xsl:choose> 
     957        <xsl:when test="/bedework/appvar[key='catFilter'] and /bedework/appvar[key='catFilter']/value != 'none'"> 
     958          <xsl:apply-templates select="/bedework/events/event[categories//category/uid = /bedework/appvar[key='catFilter']/value]" mode="eventListCommon"> 
     959            <xsl:with-param name="pending"><xsl:value-of select="$pending"/></xsl:with-param> 
     960          </xsl:apply-templates> 
     961        </xsl:when> 
     962        <xsl:otherwise> 
     963          <xsl:apply-templates select="/bedework/events/event" mode="eventListCommon"> 
     964            <xsl:with-param name="pending"><xsl:value-of select="$pending"/></xsl:with-param> 
     965          </xsl:apply-templates> 
     966        </xsl:otherwise> 
     967      </xsl:choose> 
     968 
    1007969    </table> 
     970  </xsl:template> 
     971 
     972  <xsl:template match="event" mode="eventListCommon"> 
     973    <xsl:param name="pending">false</xsl:param> 
     974    <xsl:variable name="subscriptionId" select="subscription/id"/> 
     975    <xsl:variable name="calPath" select="calendar/encodedPath"/> 
     976    <xsl:variable name="guid" select="guid"/> 
     977    <xsl:variable name="recurrenceId" select="recurrenceId"/> 
     978    <tr> 
     979      <td> 
     980        <xsl:choose> 
     981          <xsl:when test="$pending = 'true'"> 
     982            <a href="{$event-fetchForUpdatePending}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}"> 
     983              <xsl:choose> 
     984                <xsl:when test="summary != ''"> 
     985                  <xsl:value-of select="summary"/> 
     986                </xsl:when> 
     987                <xsl:otherwise> 
     988                  <em>no title</em> 
     989                </xsl:otherwise> 
     990              </xsl:choose> 
     991            </a> 
     992          </xsl:when> 
     993          <xsl:otherwise> 
     994            <a href="{$event-fetchForUpdate}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}"> 
     995              <xsl:choose> 
     996                <xsl:when test="summary != ''"> 
     997                  <xsl:value-of select="summary"/> 
     998                </xsl:when> 
     999                <xsl:otherwise> 
     1000                  <em>no title</em> 
     1001                </xsl:otherwise> 
     1002              </xsl:choose> 
     1003            </a> 
     1004          </xsl:otherwise> 
     1005        </xsl:choose> 
     1006      </td> 
     1007      <td class="date"> 
     1008        <xsl:value-of select="start/shortdate"/> 
     1009        <xsl:text> </xsl:text> 
     1010        <xsl:value-of select="start/time"/> 
     1011      </td> 
     1012      <td class="date"> 
     1013        <xsl:value-of select="end/shortdate"/> 
     1014        <xsl:text> </xsl:text> 
     1015        <xsl:value-of select="end/time"/> 
     1016      </td> 
     1017      <td class="calcat"> 
     1018        <xsl:for-each select="xproperties/X-BEDEWORK-ALIAS"> 
     1019          <xsl:call-template name="substring-afterLastInstanceOf"> 
     1020            <xsl:with-param name="string" select="values/text"/> 
     1021            <xsl:with-param name="char">/</xsl:with-param> 
     1022          </xsl:call-template><br/> 
     1023        </xsl:for-each> 
     1024      </td> 
     1025      <td class="calcat"> 
     1026        <xsl:for-each select="categories/category"> 
     1027          <xsl:sort select="word"/> 
     1028          <xsl:value-of select="word"/><br/> 
     1029        </xsl:for-each> 
     1030      </td> 
     1031      <!-- <td> 
     1032        <xsl:value-of select="calendar/name"/> 
     1033      </td>--> 
     1034      <td> 
     1035        <xsl:value-of select="description"/> 
     1036        <xsl:if test="recurring = 'true' or recurrenceId != ''"> 
     1037          <div class="recurrenceEditLinks"> 
     1038            Recurring event. 
     1039            Edit: 
     1040            <a href="{$event-fetchForUpdate}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}"> 
     1041              master 
     1042            </a> | 
     1043            <a href="{$event-fetchForUpdate}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}"> 
     1044              instance 
     1045            </a> 
     1046          </div> 
     1047        </xsl:if> 
     1048      </td> 
     1049    </tr> 
    10081050  </xsl:template> 
    10091051