1 <?xml version="1.0" encoding="UTF-8"?> 2 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 3 xmlns:m="http://msqr.us/xsd/matte" 4 xmlns:x="http://msqr.us/xsd/jaxb-web" 5 exclude-result-prefixes="m x"> 6 7 <!-- <xsl:import href="global-variables.xsl"/> --> 8 9 <!-- helper vars --> 10 <xsl:variable name="form.collectionId" 11 select="x:x-data/x:x-auxillary[1]/x:x-param[@key='collectionId']"/> 12 <xsl:variable name="form.localTz" 13 select="x:x-data/x:x-auxillary[1]/x:x-param[@key='localTz']"/> 14 <xsl:variable name="form.mediaTz" 15 select="x:x-data/x:x-auxillary[1]/x:x-param[@key='mediaTz']"/> 16 17 <xsl:template match="x:x-data" mode="add-media-form"> 18 19 <form id="upload-media-form" method="post" class="simple-form" 20 action="{$web-context}{$ctx/x:path}" enctype="multipart/form-data"> 21 <p> 22 <xsl:value-of select="key('i18n','upload.media.intro')"/> 23 </p> 24 <div> 25 <label for="tempFile"> 26 <xsl:value-of select="key('i18n','file.displayName')"/> 27 </label> 28 <div> 29 <input type="file" name="tempFile" id="tempFile"/> 30 <div class="caption"><xsl:value-of 31 select="key('i18n','upload.media.file.caption')" 32 disable-output-escaping="yes"/></div> 33 </div> 34 </div> 35 <div> 36 <label for="collectionId"> 37 <xsl:value-of select="key('i18n','collection.displayName')"/> 38 </label> 39 <div> 40 <select name="collectionId" id="collectionId"> 41 <xsl:apply-templates select="$aux/m:model/m:collection"/> 42 </select> 43 </div> 44 </div> 45 <div> 46 <label for="mediaTz"> 47 <xsl:if test="$err[@field='mediaTz']"> 48 <xsl:attribute name="class">error</xsl:attribute> 49 </xsl:if> 50 <xsl:value-of select="key('i18n','upload.media.timeZone.displayName')"/> 51 </label> 52 <div> 53 <select name="mediaTz" id="mediaTz"> 54 <xsl:for-each select="$aux/m:model/m:time-zone"> 55 <option value="{@code}"> 56 <xsl:if test="$form.mediaTz = @code"> 57 <xsl:attribute name="selected"> 58 <xsl:text>selected</xsl:text> 59 </xsl:attribute> 60 </xsl:if> 61 <xsl:value-of select="@name"/> 62 </option> 63 </xsl:for-each> 64 </select> 65 <div class="caption"> 66 <xsl:value-of select="key('i18n','upload.media.timeZone.caption')"/> 67 </div> 68 </div> 69 </div> 70 <div> 71 <label for="localTz"> 72 <xsl:if test="$err[@field='localTz']"> 73 <xsl:attribute name="class">error</xsl:attribute> 74 </xsl:if> 75 <xsl:value-of select="key('i18n','upload.media.localTimeZone.displayName')"/> 76 </label> 77 <div> 78 <select name="localTz" id="localTz"> 79 <xsl:for-each select="$aux/m:model/m:time-zone"> 80 <option value="{@code}"> 81 <xsl:if test="$form.localTz = @code"> 82 <xsl:attribute name="selected"> 83 <xsl:text>selected</xsl:text> 84 </xsl:attribute> 85 </xsl:if> 86 <xsl:value-of select="@name"/> 87 </option> 88 </xsl:for-each> 89 </select> 90 <div class="caption"> 91 <xsl:value-of select="key('i18n','upload.media.localTimeZone.caption')"/> 92 </div> 93 </div> 94 </div> 95 <div> 96 <label for="autoAlbum"> 97 <xsl:if test="$err[@field='autoAlbum']"> 98 <xsl:attribute name="class">error</xsl:attribute> 99 </xsl:if> 100 <xsl:value-of select="key('i18n','upload.media.autoAlbum.displayName')"/> 101 </label> 102 <div> 103 <input type="checkbox" name="autoAlbum" id="autoAlbum" value="true"/> 104 <div class="caption"> 105 <xsl:value-of select="key('i18n','upload.media.autoAlbum.caption')"/> 106 </div> 107 </div> 108 </div> 109 <div class="submit"> 110 <input type="submit" value="{key('i18n','add.displayName')}"/> 111 </div> 112 </form> 113 </xsl:template> 114 115 <xsl:template match="m:collection"> 116 <option value="{@collection-id}"> 117 <xsl:if test="$form.collectionId = @collection-id"> 118 <xsl:attribute name="selected"> 119 <xsl:text>selected</xsl:text> 120 </xsl:attribute> 121 </xsl:if> 122 <xsl:value-of select="@name"/> 123 </option> 124 </xsl:template> 125 126 </xsl:stylesheet>