Update of /var/cvs/contributions/CMSContainer/cmsc/edit-webapp/src/webapp/editors/editwizards_new/xsl In directory james.mmbase.org:/tmp/cvs-serv7994
Modified Files: wizard.xsl Log Message: CMSC-933 image, attachment improvment, change edit_wizard show file size with different unit See also: http://cvs.mmbase.org/viewcvs/contributions/CMSContainer/cmsc/edit-webapp/src/webapp/editors/editwizards_new/xsl See also: http://www.mmbase.org/jira/browse/CMSC-933 Index: wizard.xsl =================================================================== RCS file: /var/cvs/contributions/CMSContainer/cmsc/edit-webapp/src/webapp/editors/editwizards_new/xsl/wizard.xsl,v retrieving revision 1.15 retrieving revision 1.16 diff -u -b -r1.15 -r1.16 --- wizard.xsl 7 Oct 2008 09:57:27 -0000 1.15 +++ wizard.xsl 8 Oct 2008 07:42:03 -0000 1.16 @@ -801,7 +801,16 @@ </a> <br/> <xsl:if test="@size > 0"> - <img src="{node:saxonFunction($cloud, string(@number), concat('servletpath(', $cloudkey, ',cache(', $imagesize, '))'))}" hspace="0" vspace="0" border="0" title="[EMAIL PROTECTED]'description']}"/>(<xsl:value-of select="round((@size) div 100) div 10"/>K) + <img src="{node:saxonFunction($cloud, string(@number), concat('servletpath(', $cloudkey, ',cache(', $imagesize, '))'))}" hspace="0" vspace="0" border="0" title="[EMAIL PROTECTED]'description']}"/> + <xsl:if test="@size < 2048"> + (<xsl:value-of select="@size"/><xsl:text>byte</xsl:text>) + </xsl:if> + <xsl:if test="@size > =2048 and @size < (2*1024*1024)"> + (<xsl:value-of select="format-number(@size div 1024,'#,##0.0')"/><xsl:text>K</xsl:text>) + </xsl:if> + <xsl:if test="@size > =(2*1024*1024)"> + (<xsl:value-of select="format-number(@size div (1024*1024),'#,##0.0')"/><xsl:text>M</xsl:text>) + </xsl:if> <br/> <a href="{node:saxonFunction($cloud, string(@number), concat('servletpath(', $cloudkey,')'))}" @@ -827,7 +836,15 @@ <span> <xsl:value-of select="upload/@name"/> <xsl:text disable-output-escaping="yes">&nbsp;</xsl:text> - (<xsl:value-of select="round((upload/@size) div 100) div 10"/>K) + <xsl:if test="upload/@size < 2048"> + (<xsl:value-of select="upload/@size"/><xsl:text>byte</xsl:text>) + </xsl:if> + <xsl:if test="upload/@size > =2048 and upload/@size < (2*1024*1024)"> + (<xsl:value-of select="format-number(upload/@size div 1024,'#,##0.0')"/><xsl:text>K</xsl:text>) + </xsl:if> + <xsl:if test="upload/@size > =(2*1024*1024)"> + (<xsl:value-of select="format-number(upload/@size div (1024*1024),'#,##0.0')"/><xsl:text>M</xsl:text>) + </xsl:if> </span> <br/> <a href="{$uploadpage}&popupid={$popupid}&[EMAIL PROTECTED]&wizard={/wizard/@instance}&[EMAIL PROTECTED]" onclick="return doStartUpload(this);"> @@ -855,4 +872,71 @@ </span> </xsl:if> </xsl:template> + + <xsl:template name="ftype-file"> + <xsl:choose> + <xsl:when test="@dttype='data' or @maywrite='false'"> + <a href="{node:saxonFunction($cloud, string(@number), concat('servletpath(', $cloudkey, ',number)'))}"> + <xsl:call-template name="prompt_do_download"/> + </a> + </xsl:when> + <xsl:otherwise> + <xsl:choose> + <xsl:when test="not(upload)"> + <input type="hidden" name="[EMAIL PROTECTED]" value="" dttype="binary" ftype="file" > + <xsl:if test="@dtrequired='true' and @size <= 0"> + <xsl:attribute name="dtrequired">true</xsl:attribute> + </xsl:if> + </input> + <xsl:if test="@size <= 0"> + <xsl:call-template name="prompt_no_file"/><br/> + </xsl:if> + <xsl:if test="@size > 0"> + <a href="{node:saxonFunction($cloud, string(@number), concat('servletpath(', $cloudkey, ',number)'))}"> + <xsl:text disable-output-escaping="yes">&nbsp;</xsl:text> + <xsl:call-template name="prompt_do_download"/> + <xsl:if test="@size < 2048"> + (<xsl:value-of select="@size"/><xsl:text>byte</xsl:text>) + </xsl:if> + <xsl:if test="@size > =2048 and @size < (2*1024*1024)"> + (<xsl:value-of select="format-number(@size div 1024,'#,##0.0')"/><xsl:text>K</xsl:text>) + </xsl:if> + <xsl:if test="@size > =(2*1024*1024)"> + (<xsl:value-of select="format-number(@size div (1024*1024),'#,##0.0')"/><xsl:text>M</xsl:text>) + </xsl:if> + </a> + <br/> + </xsl:if> + </xsl:when> + <xsl:otherwise> + <input type="hidden" name="[EMAIL PROTECTED]" value="YES" dttype="binary" ftype="file" > + <xsl:if test="@dtrequired='true'"> + <xsl:attribute name="dtrequired">true</xsl:attribute> + </xsl:if> + </input> + <xsl:call-template name="prompt_uploaded"/> + <xsl:value-of select="upload/@name"/> + <xsl:text disable-output-escaping="yes">&nbsp;</xsl:text> + <xsl:if test="upload/@size < 2048"> + (<xsl:value-of select="upload/@size"/><xsl:text>byte</xsl:text>) + </xsl:if> + <xsl:if test="upload/@size > =2048 and upload/@size < (2*1024*1024)"> + (<xsl:value-of select="format-number(upload/@size div 1024,'#,##0.0')"/><xsl:text>K</xsl:text>) + </xsl:if> + <xsl:if test="upload/@size > =(2*1024*1024)"> + (<xsl:value-of select="format-number(upload/@size div (1024*1024),'#,##0.0')"/><xsl:text>M</xsl:text>) + </xsl:if> + <br/> + <a href="file://{upload/path}"> + <xsl:call-template name="prompt_do_download"/> + </a> + <br/> + </xsl:otherwise> + </xsl:choose> + <a href="{$uploadpage}&popupid={$popupid}&[EMAIL PROTECTED]&wizard={/wizard/@instance}&[EMAIL PROTECTED]" onclick="return doStartUpload(this);"> + <xsl:call-template name="prompt_do_upload"/> + </a> + </xsl:otherwise> + </xsl:choose> + </xsl:template> </xsl:stylesheet> \ No newline at end of file _______________________________________________ Cvs mailing list Cvs@lists.mmbase.org http://lists.mmbase.org/mailman/listinfo/cvs