Changeset 1993

Show
Ignore:
Timestamp:
12/23/08 17:21:31
Author:
johnsa
Message:

admin client: more work on implementing new subscription model

Files:

Legend:

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

    r1987 r1993  
    390390                <xsl:when test="/bedework/page='subscriptions' or 
    391391                                /bedework/page='modSubscription'"> 
    392                   <xsl:apply-templates select="/bedework/subscriptions"/> 
     392                  <xsl:apply-templates select="/bedework/calendars" mode="subscriptions"/> 
    393393                </xsl:when> 
    394394                <xsl:when test="/bedework/page='views'"> 
     
    44584458 
    44594459  <!--+++++++++++++++ Subscriptions ++++++++++++++++++++--> 
    4460   <xsl:template match="subscriptions"> 
    4461     <table id="subsTable"> 
     4460  <!-- 
     4461    Calendar and subscription templates depend heavily on calendar types: 
     4462 
     4463    calTypes: 0 - Folder 
     4464              1 - Calendar 
     4465              2 - Trash 
     4466              3 - Deleted 
     4467              4 - Busy 
     4468              5 - Inbox 
     4469              6 - Outbox 
     4470              7 - Alias 
     4471              8 - External subscription 
     4472              9 - Resource collection 
     4473  --> 
     4474 
     4475  <xsl:template match="calendars" mode="subscriptions"> 
     4476    <table id="calendarTable"> 
    44624477      <tr> 
    44634478        <td class="cals"> 
    4464           <h3>Public calendars</h3> 
    4465           <p class="smaller"> 
    4466             Select a calendar below to add a <em><strong>new</strong> 
    4467             </em> 
    4468             internal subscription. <!-- or 
    4469             <a href="{$subscriptions-initAdd}&amp;calUri=please enter a calendar uri"> 
    4470             subscribe to an external calendar</a>.--> 
    4471           </p> 
     4479          <h3>Subscription Tree</h3> 
    44724480          <ul id="calendarTree"> 
    4473             <xsl:apply-templates select="/bedework/subscriptions/subscribe/calendars/calendar" mode="subscribe"/> 
     4481            <xsl:apply-templates select="/bedework/publicCalendars/calendar[number(calType) = 0 or number(calType) &gt; 6]" mode="listForUpdateSubscription"/> 
    44744482          </ul> 
    44754483        </td> 
    4476         <td class="subs"> 
     4484        <td class="calendarContent"> 
    44774485          <xsl:choose> 
    44784486            <xsl:when test="/bedework/page='subscriptions'"> 
    4479               <xsl:call-template name="subscriptionList"/> 
     4487              <xsl:call-template name="subscriptionIntro"/> 
    44804488            </xsl:when> 
    44814489            <xsl:when test="/bedework/creating='true'"> 
    4482               <xsl:apply-templates select="subscription" mode="addSubscription"/> 
     4490              <xsl:apply-templates select="/bedework/currentCalendar" mode="addSubscription"/> 
    44834491            </xsl:when> 
    44844492            <xsl:otherwise> 
    4485               <xsl:apply-templates select="subscription" mode="modSubscription"/> 
     4493              <xsl:apply-templates select="/bedework/currentCalendar" mode="modSubscription"/> 
    44864494            </xsl:otherwise> 
    44874495          </xsl:choose> 
     
    44894497      </tr> 
    44904498    </table> 
     4499  </xsl:template> 
     4500 
     4501  <xsl:template name="subscriptionIntro"> 
     4502    <h3>Managing Subscriptions</h3> 
     4503    <ul> 
     4504      <li>Select an item from the tree on the left to modify a subscription.</li> 
     4505      <li>Select the 
     4506      <img src="{$resourcesRoot}/resources/calAddIcon.gif" width="13" height="13" alt="true" border="0"/> 
     4507      icon to add a new subscription or folder to the tree. 
     4508      </li> 
     4509    </ul> 
     4510  </xsl:template> 
     4511 
     4512  <xsl:template match="calendar" mode="listForUpdateSubscription"> 
     4513    <xsl:variable name="calPath" select="encodedPath"/> 
     4514    <xsl:variable name="itemClass"> 
     4515      <xsl:choose> 
     4516        <xsl:when test="calendarCollection='false'">folder</xsl:when> 
     4517        <xsl:otherwise>calendar</xsl:otherwise> 
     4518      </xsl:choose> 
     4519    </xsl:variable> 
     4520    <li class="{$itemClass}"> 
     4521      <xsl:if test="calendarCollection='false'"> 
     4522        <!-- test the open state of the folder; if it's open, 
     4523             build a URL to close it and vice versa --> 
     4524        <xsl:choose> 
     4525          <xsl:when test="open = 'true'"> 
     4526            <a href="{$subscriptions-openCloseMod}&amp;calPath={$calPath}&amp;open=false"> 
     4527              <img src="{$resourcesRoot}/resources/minus.gif" width="9" height="9" alt="close" border="0" class="bwPlusMinusIcon"/> 
     4528            </a> 
     4529          </xsl:when> 
     4530          <xsl:otherwise> 
     4531            <a href="{$subscriptions-openCloseMod}&amp;calPath={$calPath}&amp;open=true"> 
     4532              <img src="{$resourcesRoot}/resources/plus.gif" width="9" height="9" alt="open" border="0" class="bwPlusMinusIcon"/> 
     4533            </a> 
     4534          </xsl:otherwise> 
     4535        </xsl:choose> 
     4536      </xsl:if> 
     4537      <a href="{$subscriptions-fetchForUpdate}&amp;calPath={$calPath}" title="update"> 
     4538        <xsl:value-of select="name"/> 
     4539      </a> 
     4540      <xsl:if test="calendarCollection='false'"> 
     4541        <xsl:text> </xsl:text> 
     4542        <a href="{$subscriptions-initAdd}&amp;calPath={$calPath}" title="add a calendar or folder"> 
     4543          <img src="{$resourcesRoot}/resources/calAddIcon.gif" width="13" height="13" alt="add a calendar or folder" border="0"/> 
     4544        </a> 
     4545      </xsl:if> 
     4546      <xsl:if test="calendar"> 
     4547        <ul> 
     4548          <xsl:apply-templates select="calendar[number(calType) = 0 or number(calType) &gt; 6]" mode="listForUpdateSubscription"> 
     4549            <!--<xsl:sort select="title" order="ascending" case-order="upper-first"/>--></xsl:apply-templates> 
     4550        </ul> 
     4551      </xsl:if> 
     4552    </li> 
    44914553  </xsl:template> 
    44924554