Changeset 3563

Show
Ignore:
Timestamp:
06/22/12 13:40:51
Author:
johnsa
Message:

admin client: begin adding registration UI elements to event form

Files:

Legend:

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

    r3515 r3563  
    521521  width: 160px; 
    522522} 
     523#bwRegistrationFields { 
     524        margin: 1em; 
     525} 
    523526.shown { 
    524527  display: inline; 
  • trunk/deployment/webadmin/webapp/resources/default/default/default.xsl

    r3558 r3563  
    364364                                pmLabel: "<xsl:value-of select="$bwStr-Cloc-PM"/>" 
    365365                              }); 
     366                               
     367                              // registration open dates 
     368                  $("#xBwRegistrationOpensDate").datepicker({ 
     369                    <xsl:choose> 
     370                      <xsl:when test="false"><!-- add a test for the existence of a regOpen xprop and use it --> 
     371                        defaultDate: new Date(<xsl:value-of select="/bedework/formElements/form/start/yearText/input/@value"/>, <xsl:value-of select="number(/bedework/formElements/form/start/month/select/option[@selected = 'selected']/@value) - 1"/>, <xsl:value-of select="/bedework/formElements/form/start/day/select/option[@selected = 'selected']/@value"/>) 
     372                      </xsl:when> 
     373                      <xsl:otherwise> 
     374                        defaultDate: new Date(<xsl:value-of select="/bedework/formElements/form/start/yearText/input/@value"/>, <xsl:value-of select="number(/bedework/formElements/form/start/month/select/option[@selected = 'selected']/@value) - 1"/>, <xsl:value-of select="/bedework/formElements/form/start/day/select/option[@selected = 'selected']/@value"/>) 
     375                      </xsl:otherwise> 
     376                    </xsl:choose> 
     377                  }).attr("readonly", "readonly"); 
     378                  $("#xBwRegistrationOpensDate").val('<xsl:value-of select="substring-before(/bedework/formElements/form/start/rfc3339DateTime,'T')"/>'); 
     379                               
     380                              // registration open time 
     381                  $("#xBwRegistrationOpensClock").bwTimePicker({ 
     382                    hour24: <xsl:value-of select="/bedework/hour24"/>, 
     383                    attachToId: "xBwRegistrationOpensTimeFields", 
     384                    hourIds: ["xBwRegistrationOpensHour"], 
     385                    minuteIds: ["xBwRegistrationOpensMinute"], 
     386                    ampmIds: ["xBwRegistrationOpensAmpm"], 
     387                    hourLabel: "<xsl:value-of select="$bwStr-Cloc-Hour"/>", 
     388                    minuteLabel: "<xsl:value-of select="$bwStr-Cloc-Minute"/>", 
     389                    amLabel: "<xsl:value-of select="$bwStr-Cloc-AM"/>", 
     390                    pmLabel: "<xsl:value-of select="$bwStr-Cloc-PM"/>" 
     391                  }); 
     392 
     393                  // registration close dates 
     394                  $("#xBwRegistrationClosesDate").datepicker({ 
     395                    <xsl:choose> 
     396                      <xsl:when test="false"><!-- add a test for the existence of a regOpen xprop and use it --> 
     397                        defaultDate: new Date(<xsl:value-of select="/bedework/formElements/form/start/yearText/input/@value"/>, <xsl:value-of select="number(/bedework/formElements/form/start/month/select/option[@selected = 'selected']/@value) - 1"/>, <xsl:value-of select="/bedework/formElements/form/start/day/select/option[@selected = 'selected']/@value"/>) 
     398                      </xsl:when> 
     399                      <xsl:otherwise> 
     400                        defaultDate: new Date(<xsl:value-of select="/bedework/formElements/form/start/yearText/input/@value"/>, <xsl:value-of select="number(/bedework/formElements/form/start/month/select/option[@selected = 'selected']/@value) - 1"/>, <xsl:value-of select="/bedework/formElements/form/start/day/select/option[@selected = 'selected']/@value"/>) 
     401                      </xsl:otherwise> 
     402                    </xsl:choose> 
     403                  }).attr("readonly", "readonly"); 
     404                  $("#xBwRegistrationClosesDate").val('<xsl:value-of select="substring-before(/bedework/formElements/form/start/rfc3339DateTime,'T')"/>'); 
     405                   
     406                  // registration close time 
     407                  $("#xBwRegistrationClosesClock").bwTimePicker({ 
     408                    hour24: <xsl:value-of select="/bedework/hour24"/>, 
     409                    attachToId: "xBwRegistrationClosesTimeFields", 
     410                    hourIds: ["xBwRegistrationClosesHour"], 
     411                    minuteIds: ["xBwRegistrationClosesMinute"], 
     412                    ampmIds: ["xBwRegistrationClosesAmpm"], 
     413                    hourLabel: "<xsl:value-of select="$bwStr-Cloc-Hour"/>", 
     414                    minuteLabel: "<xsl:value-of select="$bwStr-Cloc-Minute"/>", 
     415                    amLabel: "<xsl:value-of select="$bwStr-Cloc-AM"/>", 
     416                    pmLabel: "<xsl:value-of select="$bwStr-Cloc-PM"/>" 
     417                  }); 
     418                                     
    366419                } 
    367420                </xsl:comment> 
     
    28282881          </tr> 
    28292882        </xsl:if> 
     2883         
     2884        <!-- Registration settings --> 
     2885        <tr class="optional"> 
     2886          <xsl:if test="$canEdit = 'false'"><xsl:attribute name="class">invisible</xsl:attribute></xsl:if> 
     2887          <td class="fieldName">Registration:</td> 
     2888          <td> 
     2889            <input type="checkbox" id="bwIsRegisterableEvent" onclick="showRegistrationFields(this);"> 
     2890              <xsl:if test="form/xproperties/node()[name()='X-BEDEWORK-MAX-TICKETS']"><xsl:attribute name="checked">checked</xsl:attribute></xsl:if> 
     2891            </input>  
     2892            <label for="bwIsRegisterableEvent">Users may register for this event</label> 
     2893             
     2894            <div id="bwRegistrationFields" class="invisible"> 
     2895              <xsl:if test="form/xproperties/node()[name()='X-BEDEWORK-MAX-TICKETS']"><xsl:attribute name="class">visible</xsl:attribute></xsl:if> 
     2896               
     2897                    <label for="xBwMaxTicketsHolder" class="interiorLabel">Max tickets:</label>  
     2898                    <input type="text"  name="xBwMaxTicketsHolder" id="xBwMaxTicketsHolder" size="3"/>  
     2899                    <xsl:text> </xsl:text><span class="fieldInfo">(maximum number of tickets allowed for the event)</span><br/> 
     2900                     
     2901                    <label for="xBwMaxTicketsPerUserHolder" class="interiorLabel">Tickets allowed:</label>  
     2902              <input type="text"  name="xBwMaxTicketsPerUserHolder" id="xBwMaxTicketsPerUserHolder" value="1" size="3"/>  
     2903                    <xsl:text> </xsl:text><span class="fieldInfo">(maximum number of tickets per user)</span><br/> 
     2904                     
     2905                    <label for="xBwRegistrationOpensDate" class="interiorLabel">Registration opens:</label>   
     2906              <div class="dateFields"> 
     2907                 <input type="text" name="xBwRegistrationOpensDate" id="xBwRegistrationOpensDate" size="10"/> 
     2908              </div> 
     2909              <div class="timeFields" id="xBwRegistrationOpensTimeFields"> 
     2910                 <select name="xBwRegistrationOpens.hour" id="xBwRegistrationOpensHour"> 
     2911                   <xsl:copy-of select="form/start/hour/select/*"/> 
     2912                 </select> 
     2913                 <select name="xBwRegistrationOpens.minute" id="xBwRegistrationOpensMinute"> 
     2914                   <xsl:copy-of select="form/start/minute/select/*"/> 
     2915                 </select> 
     2916                 <xsl:if test="form/start/ampm"> 
     2917                   <select name="xBwRegistrationOpens.ampm" id="xBwRegistrationOpensAmpm"> 
     2918                     <xsl:copy-of select="form/start/ampm/select/*"/> 
     2919                   </select> 
     2920                 </xsl:if> 
     2921                 <xsl:text> </xsl:text> 
     2922                 <img src="{$resourcesRoot}/resources/clockIcon.gif" width="16" height="15" border="0" id="xBwRegistrationOpensClock" alt="*"/> 
     2923 
     2924                 <select name="xBwRegistrationOpens.tzid" id="xBwRegistrationOpensTzid" class="timezones"> 
     2925                   <xsl:if test="form/floating/input/@checked='checked'"><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if> 
     2926                   <option value="-1"><xsl:copy-of select="$bwStr-AEEF-SelectTimezone"/></option> 
     2927                   <xsl:variable name="xBwRegistrationOpensTzId" select="form/start/tzid"/> 
     2928                   <xsl:for-each select="/bedework/timezones/timezone"> 
     2929                     <option> 
     2930                       <xsl:attribute name="value"><xsl:value-of select="id"/></xsl:attribute> 
     2931                       <xsl:if test="$xBwRegistrationOpensTzId = id"><xsl:attribute name="selected">selected</xsl:attribute></xsl:if> 
     2932                       <xsl:value-of select="name"/> 
     2933                     </option> 
     2934                   </xsl:for-each> 
     2935                 </select> 
     2936              </div> 
     2937                    <xsl:text> </xsl:text><span class="fieldInfo">(date/time registration becomes available)</span><br/> 
     2938                     
     2939                    <label for="xBwRegistrationClosesDate" class="interiorLabel">Registration closes:</label> 
     2940              <div class="dateFields"> 
     2941                <input type="text" name="xBwRegistrationClosesDate" id="xBwRegistrationClosesDate" size="10"/> 
     2942              </div> 
     2943              <div class="timeFields" id="startTimeFields"> 
     2944                <select name="xBwRegistrationCloses.hour" id="xBwRegistrationClosesHour"> 
     2945                  <xsl:copy-of select="form/start/hour/select/*"/> 
     2946                </select> 
     2947                <select name="xBwRegistrationCloses.minute" id="xBwRegistrationClosesMinute"> 
     2948                  <xsl:copy-of select="form/start/minute/select/*"/> 
     2949                </select> 
     2950                <xsl:if test="form/start/ampm"> 
     2951                  <select name="xBwRegistrationCloses.ampm" id="xBwRegistrationClosesAmpm"> 
     2952                    <xsl:copy-of select="form/start/ampm/select/*"/> 
     2953                  </select> 
     2954                </xsl:if> 
     2955                <xsl:text> </xsl:text> 
     2956                <img src="{$resourcesRoot}/resources/clockIcon.gif" width="16" height="15" border="0" id="bwRegistrationClosesClock" alt="*"/> 
     2957 
     2958                <select name="xBwRegistrationCloses.tzid" id="xBwRegistrationClosesTzid" class="timezones"> 
     2959                  <xsl:if test="form/floating/input/@checked='checked'"><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if> 
     2960                  <option value="-1"><xsl:copy-of select="$bwStr-AEEF-SelectTimezone"/></option> 
     2961                  <xsl:variable name="xBwRegistrationClosesTzId" select="form/start/tzid"/> 
     2962                  <xsl:for-each select="/bedework/timezones/timezone"> 
     2963                    <option> 
     2964                      <xsl:attribute name="value"><xsl:value-of select="id"/></xsl:attribute> 
     2965                      <xsl:if test="$xBwRegistrationClosesTzId = id"><xsl:attribute name="selected">selected</xsl:attribute></xsl:if> 
     2966                      <xsl:value-of select="name"/> 
     2967                    </option> 
     2968                  </xsl:for-each> 
     2969                </select> 
     2970              </div> 
     2971                    <xsl:text> </xsl:text><span class="fieldInfo">(date/time of registration cut off)</span> 
     2972                  </div> 
     2973          </td> 
     2974        </tr> 
    28302975 
    28312976        <!-- Topical area  --> 
     
    30473192            <xsl:variable name="virtualPath">/user<xsl:for-each select="ancestor-or-self::calendar/name">/<xsl:value-of select="."/></xsl:for-each></xsl:variable> 
    30483193            <xsl:variable name="displayName" select="summary"/> 
    3049             <input type="checkbox" name="alias" onclick="toggleBedeworkXProperty('X-BEDEWORK-ALIAS','{$displayName}','{$virtualPath}',this.checked)"> 
     3194            <input type="checkbox" name="alias" id="{generate-id(path)}" onclick="toggleBedeworkXProperty('X-BEDEWORK-ALIAS','{$displayName}','{$virtualPath}',this.checked)"> 
    30503195              <xsl:attribute name="value"><xsl:value-of select="$virtualPath"/></xsl:attribute> 
    30513196              <xsl:if test="$virtualPath = /bedework/formElements/form/xproperties//X-BEDEWORK-ALIAS/values/text"><xsl:attribute name="checked"><xsl:value-of select="checked"/></xsl:attribute></xsl:if> 
     
    30533198              <xsl:if test="/bedework/formElements/form/xproperties//X-BEDEWORK-SUBMIT-ALIAS/values/text = substring-after(aliasUri,'bwcal://')"><xsl:attribute name="checked"><xsl:value-of select="checked"/></xsl:attribute></xsl:if> 
    30543199            </input> 
     3200            <label for="{generate-id(path)}"> 
    30553201            <xsl:choose> 
    30563202              <xsl:when test="$virtualPath = /bedework/formElements/form/xproperties//X-BEDEWORK-ALIAS/values/text"> 
     
    30673213              </xsl:otherwise> 
    30683214            </xsl:choose> 
     3215            </label> 
    30693216          </xsl:otherwise> 
    30703217        </xsl:choose> 
  • trunk/deployment/webadmin/webapp/resources/resources/bedeworkEventForm.js

    r3506 r3563  
    712712  return true; 
    713713} 
    714  
     714function showRegistrationFields(obj) { 
     715  // toggle the registration fields 
     716  if (obj.checked) { 
     717    changeClass('bwRegistrationFields','visible'); 
     718  } else { 
     719    changeClass('bwRegistrationFields','invisible'); 
     720  } 
     721
    715722function resetPublishBox(calSelectId) { 
    716723  // User has closed the publish box without publishing.