Changeset 1059

Show
Ignore:
Timestamp:
10/27/06 16:26:27
Author:
johnsa
Message:

Subscriptions now pass css style information into public client as set in the admin client. The subscription style is an open field, but a default set of colors are provided (like those in the personal client). This feature may be used to override the default colors and other styles of events as they appear in the grid and list views of the public client.

Files:

Legend:

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

    r1057 r1059  
    188188        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> 
    189189        <link rel="stylesheet" href="{$resourcesRoot}/default/default/default.css"/> 
     190        <link rel="stylesheet" href="{$resourcesRoot}/default/default/subColors.css"/> 
    190191        <xsl:if test="/bedeworkadmin/page='modEvent'"> 
    191192          <script type="text/javascript" src="{$resourcesRoot}/resources/includes.js"></script> 
     
    25092510          <td> 
    25102511            <xsl:variable name="subStyle" select="style"/> 
    2511             <input type="text" value="{$subStyle}" name="subscription.style" size="60"/> 
     2512            <input type="text" value="{$subStyle}" name="subscription.style" size="50"/><br/> 
     2513            <div style="width: 400px"> 
     2514              Enter a css class to style events rendered in the list and grid 
     2515              views.  Leave blank to render with the default colors, or select from 
     2516              one of the system-wide choices: 
     2517              <select name="bwColors" onchange="document.subscribeForm['subscription.style'].value = this.value"> 
     2518                <option value="">default</option> 
     2519                <xsl:for-each select="document('subColors.xml')/subscriptionColors/color"> 
     2520                  <xsl:variable name="subColor" select="."/> 
     2521                  <option value="{$subColor}" class="{$subColor}"> 
     2522                    <xsl:value-of select="@name"/> 
     2523                  </option> 
     2524                </xsl:for-each> 
     2525              </select> 
     2526            </div> 
    25122527          </td> 
    25132528        </tr> 
     
    25852600            <xsl:variable name="subStyle" select="style"/> 
    25862601            <input type="text" value="{$subStyle}" name="subscription.style" size="60"/> 
     2602            <div style="width: 400px"> 
     2603              Enter a css class to style events rendered in the list and grid 
     2604              views.  Leave blank to render with the default colors, or select from 
     2605              one of the system-wide choices: 
     2606              <select name="bwColors" onchange="document.subscribeForm['subscription.style'].value = this.value"> 
     2607                <option value="">default</option> 
     2608                <xsl:for-each select="document('subColors.xml')/subscriptionColors/color"> 
     2609                  <xsl:variable name="subColor" select="."/> 
     2610                  <option value="{$subColor}" class="{$subColor}"> 
     2611                    <xsl:value-of select="@name"/> 
     2612                  </option> 
     2613                </xsl:for-each> 
     2614              </select> 
     2615            </div> 
    25872616          </td> 
    25882617        </tr> 
  • trunk/deployment/webpublic/webapp/resources/demoskins/MainCampus/default/default/default.xsl

    r1058 r1059  
    113113          </xsl:otherwise> 
    114114        </xsl:choose> 
     115        <link rel="stylesheet" href="{$resourcesRoot}/default/default/subColors.css"/> 
    115116        <link rel="icon" type="image/ico" href="{$resourcesRoot}/images/bedework.ico" /> 
    116117      </head> 
     
    944945  </xsl:template> 
    945946 
     947  <!--== EVENTS IN THE CALENDAR GRID ==--> 
    946948  <xsl:template match="event" mode="calendarLayout"> 
    947949    <xsl:param name="dayPos"/> 
     
    955957        <xsl:when test="status='CANCELLED'">eventCancelled</xsl:when> 
    956958        <xsl:when test="status='TENTATIVE'">eventTentative</xsl:when> 
    957         <xsl:when test="calendar/name='Holidays'">holiday</xsl:when> 
    958         <!-- Alternating colors for all standard events --> 
     959        <!-- Default alternating colors for all standard events --> 
    959960        <xsl:when test="position() mod 2 = 1">eventLinkA</xsl:when> 
    960961        <xsl:otherwise>eventLinkB</xsl:otherwise> 
    961962      </xsl:choose> 
    962963    </xsl:variable> 
     964    <!-- Subscription styles. 
     965         These are set in the add/modify subscription forms in the admin client; 
     966         if present, these override the background-color set by eventClass. The 
     967         subscription styles should not be used for cancelled events (tentative is ok). --> 
     968    <xsl:variable name="subscriptionClass"> 
     969      <xsl:if test="status != 'CANCELLED' and 
     970                    subscription/subStyle != '' and 
     971                    subscription/subStyle != 'default'"><xsl:value-of select="subscription/subStyle"/></xsl:if> 
     972    </xsl:variable> 
    963973    <li> 
    964       <a href="{$eventView}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}" class="{$eventClass}"> 
     974      <a href="{$eventView}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}" class="{$eventClass} {$subscriptionClass}"> 
    965975        <xsl:if test="status='CANCELLED'">CANCELLED: </xsl:if> 
    966976        <xsl:choose> 
  • trunk/deployment/webuser/webapp/resources/demoskins/default/default/default.xsl

    r1044 r1059  
    876876                  </xsl:choose> 
    877877                </xsl:variable> 
    878                 <xsl:variable name="subStyle" select="subscription/style"/> 
     878                <xsl:variable name="subStyle" select="subscription/subStyle"/> 
    879879                <td class="{$descriptionClass} {$subStyle}"> 
    880880                  <xsl:if test="status='CANCELLED'"><strong>CANCELLED: </strong></xsl:if> 
     
    10431043  </xsl:template> 
    10441044 
     1045  <!--== EVENTS IN THE CALENDAR GRID ==--> 
    10451046  <xsl:template match="event" mode="calendarLayout"> 
    10461047    <xsl:param name="dayPos"/> 
     
    10711072         override the background-color set by eventClass. User styles should 
    10721073         not be used for cancelled events (tentative is ok). --> 
    1073     <xsl:variable name="subColor"> 
    1074       <xsl:choose> 
    1075          <xsl:when test="status != 'CANCELLED' and 
    1076                         subscription/style != '' and 
    1077                         subscription/style != 'default'"><xsl:value-of select="subscription/style"/></xsl:when> 
    1078         <xsl:otherwise></xsl:otherwise> 
    1079       </xsl:choose> 
     1074    <xsl:variable name="subscriptionClass"> 
     1075      <xsl:if test="status != 'CANCELLED' and 
     1076                    subscription/subStyle != '' and 
     1077                    subscription/subStyle != 'default'"><xsl:value-of select="subscription/subStyle"/></xsl:if> 
    10801078    </xsl:variable> 
    10811079    <li> 
    10821080      <a href="{$eventView}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}" 
    1083         class="{$eventRootClass} {$eventClass} {$subColor}"> 
     1081        class="{$eventRootClass} {$eventClass} {$subscriptionClass}"> 
    10841082        <xsl:if test="status='CANCELLED'">CANCELLED: </xsl:if> 
    10851083        <xsl:value-of select="summary"/> 
  • trunk/deployment/webuser/webapp/resources/demoskins/default/default/subColors.css

    r1057 r1059  
    1 /* Subscription colors for user client
     1/* Subscription colors for web clients
    22   These colors correspond to subColors.xml, which is used 
    33   to create the web forms. Background-color must be 
    44   "important" to override more specific selectors in 
    5    the default.css stylesheet.  Note - class names must not 
    6    begin with a number, so all color classes are prepended with "c" */ 
     5   the default.css stylesheet. */ 
    76 
    87.bwwhite {