Changeset 2561

Show
Ignore:
Timestamp:
12/27/09 23:39:38
Author:
bleibson
Message:

o largely reworked grid-html skin and moved to new category scheme.
o prettified grid-json (no changes)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/deployment/feeder/webapp/resources/demoskins/MainCampus/default/default/grid-html.xsl

    r2557 r2561  
    4848  <xsl:variable name="privateCal" select="concat($bwCalendarHostURL,'/ucal')"/> 
    4949 
    50   <!-- MAIN TEMPLATE --> 
     50   
    5151  <xsl:template match="/"> 
     52        <!-- grab category filters.  -->         
     53    <xsl:choose> 
     54          <xsl:when test="/bedework/appvar/key = 'filter'"> 
     55            <xsl:variable name="filterName" select="substring-before(/bedework/appvar[key='filter']/value,':')"/> 
     56            <xsl:variable name="filterVal" select="substring-after(/bedework/appvar[key='filter']/value,':')"/> 
     57            <xsl:choose> 
     58              <xsl:when test="$filterName = 'grpAndCats'"> 
     59                    <xsl:call-template name="main"> 
     60                  <xsl:with-param name="andCat" select="substring-before($filterVal, '~')"/> 
     61                  <xsl:with-param name="orCats" select="substring-after($filterVal, '~')"/> 
     62                </xsl:call-template> 
     63              </xsl:when> 
     64              <xsl:otherwise> 
     65                    <xsl:call-template name="main"> 
     66                  <xsl:with-param name="andCat" select="'all'" /> 
     67                      <xsl:with-param name="orCats" select="'all'" /> 
     68                    </xsl:call-template> 
     69                  </xsl:otherwise> 
     70                </xsl:choose> 
     71          </xsl:when> 
     72          <xsl:otherwise> 
     73            <xsl:call-template name="main"> 
     74          <xsl:with-param name="andCat" select="'all'" /> 
     75              <xsl:with-param name="orCats" select="'all'" /> 
     76            </xsl:call-template> 
     77          </xsl:otherwise>             
     78        </xsl:choose> 
     79  </xsl:template> 
     80 
     81  <xsl:template name='main'> 
     82        <xsl:param name="andCat" /> 
     83        <xsl:param name="orCats" /> 
    5284    <html lang="en"> 
    5385      <head> 
     
    98130        <xsl:choose> 
    99131              <xsl:when test="/bedework/periodname='Day'"> 
    100                 <xsl:call-template name="listView"/> 
     132                <xsl:call-template name="listView"> 
     133                      <xsl:with-param name="andCat" select="$andCat" /> 
     134                          <xsl:with-param name="orCats" select="$orCats" /> 
     135                        </xsl:call-template>                
    101136              </xsl:when> 
    102137              <xsl:when test="/bedework/periodname='Week' or /bedework/periodname=''"> 
    103138                <xsl:choose> 
    104139                  <xsl:when test="/bedework/appvar[key='weekViewMode']/value='list'"> 
    105                     <xsl:call-template name="listView"/> 
     140                    <xsl:call-template name="listView"> 
     141                              <xsl:with-param name="andCat" select="$andCat" /> 
     142                                  <xsl:with-param name="orCats" select="$orCats" /> 
     143                                </xsl:call-template> 
    106144                  </xsl:when> 
    107145                  <xsl:otherwise> 
    108                     <xsl:call-template name="weekView"/> 
     146                    <xsl:call-template name="weekView"> 
     147                              <xsl:with-param name="andCat" select="$andCat" /> 
     148                                  <xsl:with-param name="orCats" select="$orCats" /> 
     149                                </xsl:call-template> 
    109150                  </xsl:otherwise> 
    110151                </xsl:choose> 
     
    113154                <xsl:choose> 
    114155                  <xsl:when test="/bedework/appvar[key='monthViewMode']/value='list'"> 
    115                     <xsl:call-template name="listView"/> 
     156                    <xsl:call-template name="listView"> 
     157                              <xsl:with-param name="andCat" select="$andCat" /> 
     158                                  <xsl:with-param name="orCats" select="$orCats" /> 
     159                                </xsl:call-template> 
    116160                  </xsl:when> 
    117161                  <xsl:otherwise> 
    118                     <xsl:call-template name="monthView"/> 
     162                    <xsl:call-template name="monthView"> 
     163                              <xsl:with-param name="andCat" select="$andCat" /> 
     164                                  <xsl:with-param name="orCats" select="$orCats" /> 
     165                                </xsl:call-template> 
    119166                  </xsl:otherwise> 
    120167                </xsl:choose> 
    121168              </xsl:when> 
    122169              <xsl:otherwise> 
    123                 <xsl:call-template name="yearView"/> 
     170                <xsl:call-template name="yearView"> 
     171                      <xsl:with-param name="andCat" select="$andCat" /> 
     172                          <xsl:with-param name="orCats" select="$orCats" /> 
     173                        </xsl:call-template> 
    124174              </xsl:otherwise> 
    125175        </xsl:choose> 
     
    130180  <!--==== SINGLE EVENT ====--> 
    131181  <xsl:template match="event"> 
     182        <xsl:param name="andCat" /> 
     183        <xsl:param name="orCats" /> 
    132184    <xsl:variable name="calPath" select="calendar/encodedPath"/> 
    133185    <xsl:variable name="guid" select="guid"/> 
     
    144196       <xsl:copy-of select="$bwStr-SgEv-LinkToThisEvent"/> 
    145197     </a> 
    146       <xsl:if test="status='CANCELLED'"><xsl:copy-of select="$bwStr-SgEv-Canceled"/><xsl:text> </xsl:text></xsl:if> 
     198      <xsl:if test="status='CANCELLED'"> 
     199            <xsl:copy-of select="$bwStr-SgEv-Canceled"/><xsl:text> </xsl:text> 
     200          </xsl:if> 
    147201      <xsl:choose> 
    148202        <xsl:when test="link != ''"> 
     
    372426              <br /><xsl:value-of select="contact/phone"/> 
    373427            </xsl:if> 
    374             <!-- If you want to display email addresses, uncomment the 
    375                  following 8 lines. --> 
    376             <!-- <xsl:if test="contact/email!=''"> 
    377               <br /> 
    378               <xsl:variable name="email" select="contact/email"/> 
    379               <xsl:variable name="subject" select="summary"/> 
    380               <a href="mailto:{$email}&amp;subject={$subject}"> 
    381                 <xsl:value-of select="contact/email"/> 
    382               </a> 
    383             </xsl:if> --> 
    384428          </td> 
    385429        </tr> 
     
    437481  <!--==== LIST VIEW  (for day, week, and month) ====--> 
    438482  <xsl:template name="listView"> 
     483        <xsl:param name="andCat" /> 
     484        <xsl:param name="orCats" /> 
    439485    <table id="listTable" border="0" cellpadding="0" cellspacing="0"> 
    440486      <xsl:choose> 
     
    452498                <td colspan="5" class="dateRow"> 
    453499                   <xsl:variable name="date" select="date"/> 
    454                    <!-- <a href="{$listEvents}&amp;startDate={$date}&amp;endDate={$date}"> --> 
    455  
    456                  <xsl:choose> 
    457                 <xsl:when test="/bedework/appvar/key = 'filter'"> 
    458                     <xsl:variable name="filterName" select="substring-before(/bedework/appvar[key='filter']/value,':')"/> 
    459                   <xsl:variable name="filterVal" select="substring-after(/bedework/appvar[key='filter']/value,':')"/> 
    460                   <!-- Define filters here: --> 
    461                   <xsl:choose> 
    462                     <xsl:when test="$filterName = 'grpAndCats'"> 
    463                     <xsl:variable name="group" select="substring-before($filterVal, '~')" /> 
    464                 <xsl:variable name="cats" select="substring-after($filterVal, '~')" /> 
    465               <a href="{$bwCacheHostUrl}/v1.0/genFeedPeriod/day/{$date}/grid-html/{$group}/{$cats}"> 
    466                       <xsl:value-of select="name"/>, <xsl:value-of select="longdate"/> 
    467                     </a> 
    468                     </xsl:when> 
    469                     <xsl:otherwise> 
    470                       <!-- Filter name not defined? Turn off filtering. --> 
    471                       <a href="{$bwCacheHostUrl}/v1.0/genFeedPeriod/day/{$date}/grid-html/all/all"> 
    472                       <xsl:value-of select="name"/>, <xsl:value-of select="longdate"/> 
    473                     </a> 
    474                       </xsl:otherwise> 
    475                   </xsl:choose> 
    476                 </xsl:when> 
    477                 <xsl:otherwise> 
    478                   <a href="{$bwCacheHostUrl}/v1.0/genFeedPeriod/day/{$date}/grid-html/all/all"> 
    479                   <xsl:value-of select="name"/>, <xsl:value-of select="longdate"/> 
    480                     </a> 
    481                 </xsl:otherwise> 
    482                </xsl:choose> 
    483  
     500                   <a href="{$bwCacheHostUrl}/v1.0/genFeedPeriod/day/{$date}/grid-html/{$andCat}/{$orCats}"> 
     501                     <xsl:value-of select="name"/>, <xsl:value-of select="longdate"/> 
     502                   </a> 
    484503                </td> 
    485504              </tr> 
     
    516535                                  start/time = end/time"> 
    517536                    <td class="{$dateRangeStyle} center" colspan="3"> 
    518                       <!--<a href="{$eventView}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}"> 
    519                         <xsl:value-of select="start/time"/> --> 
    520537                      <a href="{$bwCacheHostUrl}/v1.0/event/list-html/{$recurrenceId}/{$guid}"> 
    521538                      </a> 
     
    524541                  <xsl:otherwise> 
    525542                    <td class="{$dateRangeStyle} right"> 
    526                       <a href="{$eventView}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}"> 
     543                      <a href="{$bwCacheHostUrl}/v1.0/event/list-html/{$recurrenceId}/{$guid}"> 
    527544                      <xsl:choose> 
    528                         <xsl:when test="start/allday = 'true' and 
    529                                         parent::day/shortdate = start/shortdate"> 
     545                        <xsl:when test="start/allday = 'true' and parent::day/shortdate = start/shortdate"> 
    530546                          <xsl:copy-of select="$bwStr-LsVw-Today"/> 
    531547                        </xsl:when> 
     
    541557                    </td> 
    542558                    <td class="{$dateRangeStyle} center"> 
    543                     <a href="{$bwCacheHostUrl}/v1.0/event/list-html/{$recurrenceId}/{$guid}"></a> 
    544                       <!-- <a href="{$eventView}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}">-</a> --> 
     559                      <a href="{$bwCacheHostUrl}/v1.0/event/list-html/{$recurrenceId}/{$guid}"></a> 
    545560                    </td> 
    546561                    <td class="{$dateRangeStyle} left"> 
    547                     <a href="{$bwCacheHostUrl}/v1.0/event/list-html/{$recurrenceId}/{$guid}"> 
    548                       <!-- <a href="{$eventView}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}"> --> 
     562                      <a href="{$bwCacheHostUrl}/v1.0/event/list-html/{$recurrenceId}/{$guid}"> 
    549563                      <xsl:choose> 
    550564                        <xsl:when test="end/allday = 'true' and 
     
    584598                  <xsl:choose> 
    585599                    <xsl:when test="/bedework/appvar[key='summaryMode']/value='details'"> 
    586                     <a href="{$bwCacheHostUrl}/v1.0/event/list-html/{$recurrenceId}/{$guid}"> 
    587                       <!-- ><a href="{$eventView}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}"> --> 
     600                      <a href="{$bwCacheHostUrl}/v1.0/event/list-html/{$recurrenceId}/{$guid}"> 
    588601                        <strong> 
    589602                          <xsl:value-of select="summary"/>: 
     
    598611                            <xsl:value-of select="cost"/>.&#160; 
    599612                          </xsl:if> 
    600                           <xsl:if test="contact/name!='none'"> 
    601                             <xsl:copy-of select="$bwStr-LsVw-Contact"/><xsl:text> </xsl:text><xsl:value-of select="contact/name"/> 
    602                           </xsl:if> 
    603                         </em> 
    604                        
    605                         <span class="eventSubscription"> 
    606                           <xsl:if test="xproperties/X-BEDEWORK-ALIAS"> 
    607                             <xsl:for-each select="xproperties/X-BEDEWORK-ALIAS"> 
    608                               <xsl:call-template name="substring-afterLastInstanceOf"> 
    609                                 <xsl:with-param name="string" select="values/text"/> 
    610                                 <xsl:with-param name="char">/</xsl:with-param> 
    611                               </xsl:call-template> 
    612                               <xsl:if test="position()!=last()">, </xsl:if> 
    613                             </xsl:for-each> 
    614                           </xsl:if> 
    615                         </span> 
     613                            <xsl:if test="contact/name!='none'"> 
     614                              <xsl:copy-of select="$bwStr-LsVw-Contact"/><xsl:text> </xsl:text><xsl:value-of select="contact/name"/> 
     615                            </xsl:if> 
     616                          </em> 
     617                         
     618                          <span class="eventSubscription"> 
     619                            <xsl:if test="xproperties/X-BEDEWORK-ALIAS"> 
     620                              <xsl:for-each select="xproperties/X-BEDEWORK-ALIAS"> 
     621                                <xsl:call-template name="substring-afterLastInstanceOf"> 
     622                                  <xsl:with-param name="string" select="values/text"/> 
     623                                  <xsl:with-param name="char">/</xsl:with-param> 
     624                                </xsl:call-template> 
     625                                <xsl:if test="position()!=last()">, </xsl:if> 
     626                              </xsl:for-each> 
     627                            </xsl:if> 
     628                          </span> 
    616629                      </a> 
    617630                      <xsl:if test="link != ''"> 
     
    660673  <!--==== LIST EVENTS - for listing discrete events ====--> 
    661674  <xsl:template match="events" mode="eventList"> 
     675        <xsl:param name="andCat" /> 
     676        <xsl:param name="orCats" /> 
    662677    <h2 class="bwStatusConfirmed"> 
    663       <!-- <form name="bwListEventsForm" action="{$listEvents}" method="post"> 
    664         <input type="hidden" name="setappvar"/>--> 
    665         <xsl:copy-of select="$bwStr-LsEv-Next7Days"/> 
    666         <!-- 
    667         <span id="bwListEventsFormControls"> 
    668           <select name="catuid" onchange="this.form.submit();"> 
    669             <option value="">filter by category...</option> 
    670             <xsl:for-each select="/bedework/categories/category"> 
    671               <option> 
    672                 <xsl:attribute name="value"><xsl:value-of select="id"/></xsl:attribute> 
    673                 <xsl:value-of select="value"/> 
    674               </option> 
    675             </xsl:for-each> 
    676           </select> 
    677           <select name="days" onchange="this.form.submit();"> 
    678             <xsl:call-template name="buildListEventsDaysOptions"> 
    679               <xsl:with-param name="i">1</xsl:with-param> 
    680               <xsl:with-param name="total">31</xsl:with-param> 
    681             </xsl:call-template> 
    682           </select> 
    683         </span> 
    684       </form>--> 
    685678    </h2> 
    686679 
     
    716709                  </xsl:if> 
    717710                </xsl:if> 
    718  
    719711                <xsl:text> </xsl:text> 
    720712                <a href="{$privateCal}/event/addEventRef.do?calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}" title="{$bwStr-LsVw-AddEventToMyCalendar}" target="myCalendar"> 
     
    811803  <!--==== WEEK CALENDAR VIEW ====--> 
    812804  <xsl:template name="weekView"> 
     805        <xsl:param name="andCat" /> 
     806        <xsl:param name="orCats" /> 
    813807    <table id="monthCalendarTable" border="0" cellpadding="0" cellspacing="0"> 
    814808      <tr> 
     
    826820              </xsl:if> 
    827821              <xsl:variable name="dayDate" select="date"/> 
    828               <!-- ><a href="{$setViewPeriod}&amp;viewType=dayView&amp;date={$dayDate}" class="dayLink">  --> 
    829               <a href="{$bwCacheHostUrl}/v1.0/genFeedPeriod/day/{$dayDate}/grid-html/all/all" class="dayLink"> 
     822              <a href="{$bwCacheHostUrl}/v1.0/genFeedPeriod/day/{$dayDate}/grid-html/{$andCat}/{$orCats}" class="dayLink"> 
    830823                <xsl:value-of select="value"/> 
    831824              </a> 
    832825              <xsl:if test="event"> 
    833826                <ul> 
    834                 <xsl:choose> 
    835                   <xsl:when test="/bedework/appvar/key = 'filter'"> 
    836                       <xsl:variable name="filterName" select="substring-before(/bedework/appvar[key='filter']/value,':')"/> 
    837                     <xsl:variable name="filterVal" select="substring-after(/bedework/appvar[key='filter']/value,':')"/> 
    838                     <!-- Define filters here: --> 
    839                     <xsl:choose> 
    840                       <xsl:when test="$filterName = 'grpAndCats'"> 
    841                         <xsl:call-template name="processGrpAndCats"> 
    842                         <xsl:with-param name="list" select="$filterVal"/> 
    843                         <xsl:with-param name="dayPos" select="$dayPos"/> 
    844                       </xsl:call-template> 
    845                       </xsl:when> 
    846                       <xsl:otherwise> 
    847                         <!-- Filter name not defined? Turn off filtering. --> 
    848                         <xsl:apply-templates select="event" mode="calendarLayout"> 
    849                         <xsl:with-param name="dayPos" select="$dayPos"/> 
    850                         </xsl:apply-templates> 
    851                         </xsl:otherwise> 
    852                     </xsl:choose> 
    853                   </xsl:when> 
    854                   <xsl:otherwise> 
    855                     <xsl:apply-templates select="event" mode="calendarLayout"> 
     827                  <xsl:call-template name="processCats"> 
     828                        <xsl:with-param name="andCat" select="$andCat"/> 
     829                    <xsl:with-param name="orCats" select="$orCats"/> 
    856830                    <xsl:with-param name="dayPos" select="$dayPos"/> 
    857                     </xsl:apply-templates> 
    858                   </xsl:otherwise> 
    859             </xsl:choose> 
     831                  </xsl:call-template>  
    860832                </ul> 
    861833              </xsl:if> 
     
    869841  <!--==== MONTH CALENDAR VIEW ====--> 
    870842  <xsl:template name="monthView"> 
     843        <xsl:param name="andCat" /> 
     844        <xsl:param name="orCats" /> 
    871845    <table id="monthCalendarTable" border="0" cellpadding="0" cellspacing="0"> 
    872846      <tr> 
     
    889863                  </xsl:if> 
    890864                  <xsl:variable name="dayDate" select="date"/> 
    891                   <xsl:choose> 
    892             <xsl:when test="/bedework/appvar/key = 'filter'"> 
    893                   <xsl:variable name="filterName" select="substring-before(/bedework/appvar[key='filter']/value,':')"/> 
    894                   <xsl:variable name="filterVal" select="substring-after(/bedework/appvar[key='filter']/value,':')"/> 
    895                   <!-- Define filters here: --> 
    896                   <xsl:choose> 
    897                     <xsl:when test="$filterName = 'grpAndCats'"> 
    898                     <xsl:variable name="group" select="substring-before($filterVal, '~')" /> 
    899                 <xsl:variable name="cats" select="substring-after($filterVal, '~')" /> 
    900               <a href="{$bwCacheHostUrl}/v1.0/genFeedPeriod/day/{$dayDate}/grid-html/{$group}/{$cats}"> 
    901                       <xsl:value-of select="value"/> 
    902                     </a> 
    903                     </xsl:when> 
    904                     <xsl:otherwise> 
    905                       <!-- Filter name not defined? Turn off filtering. --> 
    906                       <a href="{$bwCacheHostUrl}/v1.0/genFeedPeriod/day/{$dayDate}/grid-html/all/all"> 
    907                       <xsl:value-of select="value"/> 
    908                     </a> 
    909                       </xsl:otherwise> 
    910                   </xsl:choose> 
    911                 </xsl:when> 
    912                 <xsl:otherwise> 
    913                   <a href="{$bwCacheHostUrl}/v1.0/genFeedPeriod/day/{$dayDate}/grid-html/all/all"> 
    914                   <xsl:value-of select="value"/> 
    915                     </a> 
    916                 </xsl:otherwise> 
    917               </xsl:choose> 
     865                  <a href="{$bwCacheHostUrl}/v1.0/genFeedPeriod/day/{$dayDate}/grid-html/{$andCat}/{$orCats}"> 
     866                    <xsl:value-of select="value"/> 
     867                  </a> 
    918868                  <xsl:if test="event"> 
    919869                    <ul> 
    920                     <xsl:choose> 
    921                   <xsl:when test="/bedework/appvar/key = 'filter'"> 
    922                       <xsl:variable name="filterName" select="substring-before(/bedework/appvar[key='filter']/value,':')"/> 
    923                     <xsl:variable name="filterVal" select="substring-after(/bedework/appvar[key='filter']/value,':')"/> 
    924                     <!-- Define filters here: --> 
    925                     <xsl:choose> 
    926                       <xsl:when test="$filterName = 'grpAndCats'"> 
    927                         <xsl:call-template name="processGrpAndCats"> 
    928                         <xsl:with-param name="list" select="$filterVal"/> 
     870                      <xsl:call-template name="processCats"> 
     871                        <xsl:with-param name="andCat" select="$andCat"/> 
     872                        <xsl:with-param name="orCats" select="$orCats"/> 
    929873                        <xsl:with-param name="dayPos" select="$dayPos"/> 
    930874                      </xsl:call-template> 
    931                       </xsl:when> 
    932                       <xsl:otherwise> 
    933                         <!-- Filter name not defined? Turn off filtering. --> 
    934                         <xsl:apply-templates select="event" mode="calendarLayout"> 
    935                         <xsl:with-param name="dayPos" select="$dayPos"/> 
    936                         </xsl:apply-templates> 
    937                         </xsl:otherwise> 
    938                     </xsl:choose> 
    939                   </xsl:when> 
    940                   <xsl:otherwise> 
    941                     <xsl:apply-templates select="event" mode="calendarLayout"> 
    942                     <xsl:with-param name="dayPos" select="$dayPos"/> 
    943                     </xsl:apply-templates> 
    944                   </xsl:otherwise> 
    945                 </xsl:choose> 
    946875                    </ul> 
    947876                  </xsl:if> 
     
    1066995  <!--==== YEAR VIEW ====--> 
    1067996  <xsl:template name="yearView"> 
     997        <xsl:param name="andCat" /> 
     998        <xsl:param name="orCats" /> 
    1068999    <table id="yearCalendarTable" border="0" cellpadding="0" cellspacing="0"> 
    10691000      <tr> 
     
    10841015  <!-- year view month tables --> 
    10851016  <xsl:template match="month"> 
     1017    <xsl:param name="andCat" /> 
     1018        <xsl:param name="orCats" /> 
    10861019    <td> 
    10871020      <table class="yearViewMonthTable" border="0" cellpadding="0" cellspacing="0"> 
     
    10891022          <td colspan="8" class="monthName"> 
    10901023            <xsl:variable name="firstDayOfMonth" select="week/day/date"/> 
    1091             <a href="{$bwCacheHostUrl}/v1.0/genFeedPeriod/month/{$firstDayOfMonth}/grid-html/all/all"> 
    1092             <!-- <a href="{$setViewPeriod}&amp;viewType=monthView&amp;date={$firstDayOfMonth}">  --> 
    1093               <xsl:value-of select="longname"/> 
    1094             </a> 
     1024            <a href="{$bwCacheHostUrl}/v1.0/genFeedPeriod/month/{$firstDayOfMonth}/grid-html/{$andCat}/{$orCats}"> 
     1025                      <xsl:value-of select="longname"/> 
     1026                    </a>         
    10951027          </td> 
    10961028        </tr> 
     
    11051037            <td class="weekCell"> 
    11061038              <xsl:variable name="firstDayOfWeek" select="day/date"/> 
    1107               <a href="{$bwCacheHostUrl}/v1.0/genFeedPeriod/week/{$firstDayOfWeek}/grid-html/all/all"> 
    1108               <!-- <a href="{$setViewPeriod}&amp;viewType=weekView&amp;date={$firstDayOfWeek}"> --> 
     1039              <a href="{$bwCacheHostUrl}/v1.0/genFeedPeriod/week/{$firstDayOfWeek}/grid-html/{$andCat}/{$orCats}"> 
    11091040                <xsl:value-of select="value"/> 
    11101041              </a> 
     
    11211052                    </xsl:if> 
    11221053                    <xsl:variable name="dayDate" select="date"/> 
    1123                     <a href="{$bwCacheHostUrl}/v1.0/genFeedPeriod/day/{$dayDate}/grid-html/all/all"> 
    1124                     <!-- <a href="{$setViewPeriod}&amp;viewType=dayView&amp;date={$dayDate}"> --> 
     1054                    <a href="{$bwCacheHostUrl}/v1.0/genFeedPeriod/day/{$dayDate}/grid-html/{$andCat}/{$orCats}"> 
    11251055                      <xsl:attribute name="class">today</xsl:attribute> 
    11261056                      <xsl:value-of select="value"/> 
     
    11811111  </xsl:template> 
    11821112 
    1183   <xsl:template name="processGrpAndCats"> 
    1184     <xsl:param name="list" /> 
    1185     <xsl:param name="dayPos" /> 
    1186     <xsl:variable name="group" select="substring-before($list, '~')" /> 
    1187     <xsl:variable name="remaining" select="substring-after($list, '~')" /> 
    1188     <xsl:call-template name="processCategories"> 
    1189     <xsl:with-param name="group" select="$group" /> 
    1190       <xsl:with-param name="list" select="$remaining" /> 
    1191       <xsl:with-param name="dayPos" select="$dayPos" /> 
    1192     </xsl:call-template> 
    1193   </xsl:template> 
    1194  
    1195   <xsl:template name="processCategories"> 
    1196   <xsl:param name="group" /> 
    1197     <xsl:param name="list" /> 
    1198     <xsl:param name="dayPos" /> 
    1199     <xsl:choose> 
    1200     <xsl:when test="contains($list, '~')"> 
    1201     <!-- Grab the first off the list and process --> 
    1202       <xsl:variable name="catid" select="substring-before($list, '~')" /> 
    1203       <xsl:variable name="remaining" select="substring-after($list, '~')" /> 
    1204       <xsl:choose> 
    1205       <xsl:when test="$group = 'all'"> 
    1206 >               <xsl:apply-templates select="event[categories/category/id = $catid]" mode="calendarLayout"> 
    1207             <xsl:with-param name="dayPos" select="$dayPos"/> 
    1208           </xsl:apply-templates> 
    1209         </xsl:when> 
    1210         <xsl:otherwise> 
    1211           <xsl:apply-templates select="event[categories/category/id = $catid]" mode="calendarLayout"> 
    1212             <xsl:with-param name="dayPos" select="$dayPos"/> 
    1213           </xsl:apply-templates> 
    1214         </xsl:otherwise> 
    1215       </xsl:choose> 
    1216  
    1217     <!-- now use recursion to process the remaining categories --> 
    1218       <xsl:call-template name="processCategories"> 
    1219         <xsl:with-param name="group" select="$group" /> 
    1220         <xsl:with-param name="list" select="$remaining" /> 
    1221         <xsl:with-param name="dayPos" select="$dayPos" /> 
     1113<xsl:template name="processCats"> 
     1114  <xsl:param name="andCat" /> 
     1115  <xsl:param name="orCats" /> 
     1116  <xsl:param name="dayPos" /> 
     1117  <xsl:choose> 
     1118    <xsl:when test="contains($orCats, '~')">    
     1119        <!-- There are 2 or more on the "or" list.  --> 
     1120        <xsl:variable name="orCats" select="substring-before($orCats, '~')" /> 
     1121        <xsl:variable name="remainingOrCats" select="substring-after($orCats, '~')" /> 
     1122        <!-- Process the first one --> 
     1123        <xsl:call-template name="processAndOr"> 
     1124              <xsl:with-param name="andCat" select="$andCat"/> 
     1125              <xsl:with-param name="orCats" select="$orCats"/> 
     1126              <xsl:with-param name="dayPos" select="$dayPos"/> 
     1127            </xsl:call-template> 
     1128        <!-- and use recursion to process the remaining categories --> 
     1129        <xsl:call-template name="processCats"> 
     1130              <xsl:with-param name="andCat" select="$andCat"/> 
     1131          <xsl:with-param name="orCats" select="$remainingOrCats" /> 
     1132          <xsl:with-param name="dayPos" select="$dayPos"/> 
    12221133      </xsl:call-template> 
    12231134    </xsl:when> 
    12241135    <xsl:otherwise> 
    1225       <!-- No more tildes, so this is the last category.  Process it --> 
    1226     <xsl:choose> 
    1227       <xsl:when test="$group = 'all'"> 
     1136      <!-- No more tildes, so this is the last or only "or" category.  Call processAndOr to process it --> 
     1137      <xsl:call-template name="processAndOr"> 
     1138              <xsl:with-param name="andCat" select="$andCat"/> 
     1139              <xsl:with-param name="orCats" select="$orCats"/> 
     1140                  <xsl:with-param name="dayPos" select="$dayPos"/> 
     1141            </xsl:call-template> 
     1142    </xsl:otherwise> 
     1143 
     1144  </xsl:choose> 
     1145</xsl:template> 
     1146 
     1147<xsl:template name="processAndOr"> 
     1148  <xsl:param name="andCat"/> 
     1149  <xsl:param name="orCats" /> 
     1150  <xsl:param name="dayPos"/> 
     1151        <xsl:choose> 
     1152    <xsl:when test="$andCat = 'all'"> 
    12281153      <xsl:choose> 
    1229         <xsl:when test="$list = 'all'"> 
    1230               <xsl:apply-templates select="event" mode="calendarLayout"> 
    1231               <xsl:with-param name="dayPos" select="$dayPos"/> 
    1232             </xsl:apply-templates> 
    1233             </xsl:when> 
    1234             <xsl:otherwise> 
    1235             <xsl:apply-templates select="event[categories/category/id = $list]" mode="calendarLayout"> 
     1154        <xsl:when test="$orCats = 'all'"> 
     1155        <!-- all categories should be displayed --> 
     1156          <xsl:apply-templates select="event" mode="calendarLayout"> 
    12361157            <xsl:with-param name="dayPos" select="$dayPos"/> 
    1237             </xsl:apply-templates> 
    1238           </xsl:otherwise> 
    1239           </xsl:choose> 
     1158              </xsl:apply-templates> 
    12401159        </xsl:when> 
    12411160        <xsl:otherwise> 
    1242         <xsl:choose> 
    1243         <xsl:when test="$list = 'all'"> 
    1244               <xsl:apply-templates select="event[creator = $group]" /> 
    1245             </xsl:when> 
    1246             <xsl:otherwise> 
    1247             <xsl:choose> 
    1248               <xsl:when test="event/creator = $group"> 
    1249               <xsl:apply-templates select="event[categories/category/id = $list]" mode="calendarLayout"> 
    1250               <xsl:with-param name="dayPos" select="$dayPos"/> 
    1251               </xsl:apply-templates> 
    1252               </xsl:when> 
    1253             </xsl:choose> 
    1254           </xsl:otherwise> 
    1255       </xsl:choose> 
     1161          <!-- nothing being anded; display event if it matches "or" category--> 
     1162          <xsl:apply-templates select="event[categories/category/uid = $orCats]" mode="calendarLayout"> 
     1163            <xsl:with-param name="dayPos" select="$dayPos"/> 
     1164              </xsl:apply-templates> 
    12561165        </xsl:otherwise> 
    12571166      </xsl:choose> 
    1258     </xsl:otherwise> 
    1259   </xsl:choose> 
    1260   </xsl:template> 
     1167    </xsl:when> 
     1168    <xsl:otherwise> 
     1169      <xsl:choose> 
     1170        <xsl:when test="$orCats = 'all'"> 
     1171          <!-- no or's; display if it matches "and" category --> 
     1172          <xsl:apply-templates select="event[categories/category/uid = $andCat]" mode="calendarLayout"> 
     1173            <xsl:with-param name="dayPos" select="$dayPos"/> 
     1174              </xsl:apply-templates> 
     1175        </xsl:when> 
     1176        <xsl:otherwise> 
     1177          <xsl:choose> 
     1178            <!-- an "and" and an "or", so display if they are both present --> 
     1179            <xsl:when test="event/category/uid = $andCat"> 
     1180              <xsl:apply-templates select="event[categories/category/uid = $orCats]"    mode="calendarLayout"> 
     1181                        <xsl:with-param name="dayPos" select="$dayPos"/> 
     1182                          </xsl:apply-templates> 
     1183            </xsl:when> 
     1184          </xsl:choose> 
     1185        </xsl:otherwise> 
     1186      </xsl:choose> 
     1187          </xsl:otherwise> 
     1188  </xsl:choose>  
     1189</xsl:template> 
    12611190 
    12621191</xsl:stylesheet> 
  • trunk/deployment/feeder/webapp/resources/demoskins/MainCampus/default/default/grid-json.xsl

    r2559 r2561  
    9292            "shortdate" : "<xsl:value-of select='shortdate'/>", 
    9393            "events" : [ 
    94                 <xsl:choose> 
    95                 <xsl:when test="/bedework/appvar/key = 'filter'"> 
    96                     <xsl:variable name="filterName" select="substring-before(/bedework/appvar[key='filter']/value,':')"/> 
    97                   <xsl:variable name="filterVal" select="substring-after(/bedework/appvar[key='filter']/value,':')"/> 
    98                   <!-- Define filters here: --> 
    99                   <xsl:choose> 
    100                     <xsl:when test="$filterName = 'grpAndCats'"> 
    101                       <xsl:call-template name="preprocessCats"> 
    102                             <xsl:with-param name="allCats" select="$filterVal"/> 
    103                           </xsl:call-template> 
    104                     </xsl:when> 
    105                     <xsl:otherwise> 
    106                       <!-- Filter name not defined? Turn off filtering. --> 
    107                       <xsl:apply-templates select="event"/> 
    108                     </xsl:otherwise> 
    109                   </xsl:choose> 
    110                 </xsl:when> 
    111                 <xsl:otherwise> 
    112                   <xsl:apply-templates select="event"/> 
    113                 </xsl:otherwise> 
    114               </xsl:choose> 
     94               <xsl:choose> 
     95                <xsl:when test="/bedework/appvar/key = 'filter'"> 
     96                   <xsl:variable name="filterName" select="substring-before(/bedework/appvar[key='filter']/value,':')"/> 
     97                  <xsl:variable name="filterVal" select="substring-after(/bedework/appvar[key='filter']/value,':')"/> 
     98                  <!-- Define filters here: --> 
     99                  <xsl:choose> 
     100                    <xsl:when test="$filterName = 'grpAndCats'"> 
     101                      <xsl:call-template name="preprocessCats"> 
     102                            <xsl:with-param name="allCats" select="$filterVal"/> 
     103                          </xsl:call-template> 
     104                    </xsl:when> 
     105                    <xsl:otherwise> 
     106                      <!-- Filter name not defined? Turn off filtering. --> 
     107                      <xsl:apply-templates select="event"/> 
     108                    </xsl:otherwise> 
     109                  </xsl:choose> 
     110                </xsl:when> 
     111                <xsl:otherwise> 
     112                  <xsl:apply-templates select="event"/> 
     113                </xsl:otherwise> 
     114              </xsl:choose> 
    115115              ] 
    116116            </xsl:otherwise> 
    117           </xsl:choose> 
     117            </xsl:choose> 
    118118        }<xsl:if test="position() != last()">,</xsl:if> 
    119119  </xsl:template>