Changeset 2561
- Timestamp:
- 12/27/09 23:39:38
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/deployment/feeder/webapp/resources/demoskins/MainCampus/default/default/grid-html.xsl
r2557 r2561 48 48 <xsl:variable name="privateCal" select="concat($bwCalendarHostURL,'/ucal')"/> 49 49 50 <!-- MAIN TEMPLATE -->50 51 51 <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" /> 52 84 <html lang="en"> 53 85 <head> … … 98 130 <xsl:choose> 99 131 <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> 101 136 </xsl:when> 102 137 <xsl:when test="/bedework/periodname='Week' or /bedework/periodname=''"> 103 138 <xsl:choose> 104 139 <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> 106 144 </xsl:when> 107 145 <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> 109 150 </xsl:otherwise> 110 151 </xsl:choose> … … 113 154 <xsl:choose> 114 155 <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> 116 160 </xsl:when> 117 161 <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> 119 166 </xsl:otherwise> 120 167 </xsl:choose> 121 168 </xsl:when> 122 169 <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> 124 174 </xsl:otherwise> 125 175 </xsl:choose> … … 130 180 <!--==== SINGLE EVENT ====--> 131 181 <xsl:template match="event"> 182 <xsl:param name="andCat" /> 183 <xsl:param name="orCats" /> 132 184 <xsl:variable name="calPath" select="calendar/encodedPath"/> 133 185 <xsl:variable name="guid" select="guid"/> … … 144 196 <xsl:copy-of select="$bwStr-SgEv-LinkToThisEvent"/> 145 197 </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> 147 201 <xsl:choose> 148 202 <xsl:when test="link != ''"> … … 372 426 <br /><xsl:value-of select="contact/phone"/> 373 427 </xsl:if> 374 <!-- If you want to display email addresses, uncomment the375 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}&subject={$subject}">381 <xsl:value-of select="contact/email"/>382 </a>383 </xsl:if> -->384 428 </td> 385 429 </tr> … … 437 481 <!--==== LIST VIEW (for day, week, and month) ====--> 438 482 <xsl:template name="listView"> 483 <xsl:param name="andCat" /> 484 <xsl:param name="orCats" /> 439 485 <table id="listTable" border="0" cellpadding="0" cellspacing="0"> 440 486 <xsl:choose> … … 452 498 <td colspan="5" class="dateRow"> 453 499 <xsl:variable name="date" select="date"/> 454 <!-- <a href="{$listEvents}&startDate={$date}&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> 484 503 </td> 485 504 </tr> … … 516 535 start/time = end/time"> 517 536 <td class="{$dateRangeStyle} center" colspan="3"> 518 <!--<a href="{$eventView}&calPath={$calPath}&guid={$guid}&recurrenceId={$recurrenceId}">519 <xsl:value-of select="start/time"/> -->520 537 <a href="{$bwCacheHostUrl}/v1.0/event/list-html/{$recurrenceId}/{$guid}"> 521 538 </a> … … 524 541 <xsl:otherwise> 525 542 <td class="{$dateRangeStyle} right"> 526 <a href="{$ eventView}&calPath={$calPath}&guid={$guid}&recurrenceId={$recurrenceId}">543 <a href="{$bwCacheHostUrl}/v1.0/event/list-html/{$recurrenceId}/{$guid}"> 527 544 <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"> 530 546 <xsl:copy-of select="$bwStr-LsVw-Today"/> 531 547 </xsl:when> … … 541 557 </td> 542 558 <td class="{$dateRangeStyle} center"> 543 <a href="{$bwCacheHostUrl}/v1.0/event/list-html/{$recurrenceId}/{$guid}"></a> 544 <!-- <a href="{$eventView}&calPath={$calPath}&guid={$guid}&recurrenceId={$recurrenceId}">-</a> --> 559 <a href="{$bwCacheHostUrl}/v1.0/event/list-html/{$recurrenceId}/{$guid}"></a> 545 560 </td> 546 561 <td class="{$dateRangeStyle} left"> 547 <a href="{$bwCacheHostUrl}/v1.0/event/list-html/{$recurrenceId}/{$guid}"> 548 <!-- <a href="{$eventView}&calPath={$calPath}&guid={$guid}&recurrenceId={$recurrenceId}"> --> 562 <a href="{$bwCacheHostUrl}/v1.0/event/list-html/{$recurrenceId}/{$guid}"> 549 563 <xsl:choose> 550 564 <xsl:when test="end/allday = 'true' and … … 584 598 <xsl:choose> 585 599 <xsl:when test="/bedework/appvar[key='summaryMode']/value='details'"> 586 <a href="{$bwCacheHostUrl}/v1.0/event/list-html/{$recurrenceId}/{$guid}"> 587 <!-- ><a href="{$eventView}&calPath={$calPath}&guid={$guid}&recurrenceId={$recurrenceId}"> --> 600 <a href="{$bwCacheHostUrl}/v1.0/event/list-html/{$recurrenceId}/{$guid}"> 588 601 <strong> 589 602 <xsl:value-of select="summary"/>: … … 598 611 <xsl:value-of select="cost"/>.  599 612 </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> 616 629 </a> 617 630 <xsl:if test="link != ''"> … … 660 673 <!--==== LIST EVENTS - for listing discrete events ====--> 661 674 <xsl:template match="events" mode="eventList"> 675 <xsl:param name="andCat" /> 676 <xsl:param name="orCats" /> 662 677 <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>-->685 678 </h2> 686 679 … … 716 709 </xsl:if> 717 710 </xsl:if> 718 719 711 <xsl:text> </xsl:text> 720 712 <a href="{$privateCal}/event/addEventRef.do?calPath={$calPath}&guid={$guid}&recurrenceId={$recurrenceId}" title="{$bwStr-LsVw-AddEventToMyCalendar}" target="myCalendar"> … … 811 803 <!--==== WEEK CALENDAR VIEW ====--> 812 804 <xsl:template name="weekView"> 805 <xsl:param name="andCat" /> 806 <xsl:param name="orCats" /> 813 807 <table id="monthCalendarTable" border="0" cellpadding="0" cellspacing="0"> 814 808 <tr> … … 826 820 </xsl:if> 827 821 <xsl:variable name="dayDate" select="date"/> 828 <!-- ><a href="{$setViewPeriod}&viewType=dayView&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"> 830 823 <xsl:value-of select="value"/> 831 824 </a> 832 825 <xsl:if test="event"> 833 826 <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"/> 856 830 <xsl:with-param name="dayPos" select="$dayPos"/> 857 </xsl:apply-templates> 858 </xsl:otherwise> 859 </xsl:choose> 831 </xsl:call-template> 860 832 </ul> 861 833 </xsl:if> … … 869 841 <!--==== MONTH CALENDAR VIEW ====--> 870 842 <xsl:template name="monthView"> 843 <xsl:param name="andCat" /> 844 <xsl:param name="orCats" /> 871 845 <table id="monthCalendarTable" border="0" cellpadding="0" cellspacing="0"> 872 846 <tr> … … 889 863 </xsl:if> 890 864 <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> 918 868 <xsl:if test="event"> 919 869 <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"/> 929 873 <xsl:with-param name="dayPos" select="$dayPos"/> 930 874 </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>946 875 </ul> 947 876 </xsl:if> … … 1066 995 <!--==== YEAR VIEW ====--> 1067 996 <xsl:template name="yearView"> 997 <xsl:param name="andCat" /> 998 <xsl:param name="orCats" /> 1068 999 <table id="yearCalendarTable" border="0" cellpadding="0" cellspacing="0"> 1069 1000 <tr> … … 1084 1015 <!-- year view month tables --> 1085 1016 <xsl:template match="month"> 1017 <xsl:param name="andCat" /> 1018 <xsl:param name="orCats" /> 1086 1019 <td> 1087 1020 <table class="yearViewMonthTable" border="0" cellpadding="0" cellspacing="0"> … … 1089 1022 <td colspan="8" class="monthName"> 1090 1023 <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}&viewType=monthView&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> 1095 1027 </td> 1096 1028 </tr> … … 1105 1037 <td class="weekCell"> 1106 1038 <xsl:variable name="firstDayOfWeek" select="day/date"/> 1107 <a href="{$bwCacheHostUrl}/v1.0/genFeedPeriod/week/{$firstDayOfWeek}/grid-html/all/all"> 1108 <!-- <a href="{$setViewPeriod}&viewType=weekView&date={$firstDayOfWeek}"> --> 1039 <a href="{$bwCacheHostUrl}/v1.0/genFeedPeriod/week/{$firstDayOfWeek}/grid-html/{$andCat}/{$orCats}"> 1109 1040 <xsl:value-of select="value"/> 1110 1041 </a> … … 1121 1052 </xsl:if> 1122 1053 <xsl:variable name="dayDate" select="date"/> 1123 <a href="{$bwCacheHostUrl}/v1.0/genFeedPeriod/day/{$dayDate}/grid-html/all/all"> 1124 <!-- <a href="{$setViewPeriod}&viewType=dayView&date={$dayDate}"> --> 1054 <a href="{$bwCacheHostUrl}/v1.0/genFeedPeriod/day/{$dayDate}/grid-html/{$andCat}/{$orCats}"> 1125 1055 <xsl:attribute name="class">today</xsl:attribute> 1126 1056 <xsl:value-of select="value"/> … … 1181 1111 </xsl:template> 1182 1112 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"/> 1222 1133 </xsl:call-template> 1223 1134 </xsl:when> 1224 1135 <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'"> 1228 1153 <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"> 1236 1157 <xsl:with-param name="dayPos" select="$dayPos"/> 1237 </xsl:apply-templates> 1238 </xsl:otherwise> 1239 </xsl:choose> 1158 </xsl:apply-templates> 1240 1159 </xsl:when> 1241 1160 <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> 1256 1165 </xsl:otherwise> 1257 1166 </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> 1261 1190 1262 1191 </xsl:stylesheet> trunk/deployment/feeder/webapp/resources/demoskins/MainCampus/default/default/grid-json.xsl
r2559 r2561 92 92 "shortdate" : "<xsl:value-of select='shortdate'/>", 93 93 "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> 115 115 ] 116 116 </xsl:otherwise> 117 </xsl:choose>117 </xsl:choose> 118 118 }<xsl:if test="position() != last()">,</xsl:if> 119 119 </xsl:template>
