Updated file and image widgets templates
authortflorac@xsup98-004.onf.fr
Thu, 12 Oct 2017 22:21:17 +0200
changeset 60 999277853005
parent 59 6e6aa46a5d87
child 61 9ef00182d11a
Updated file and image widgets templates
src/pyams_file/widget/templates/file-display.pt
src/pyams_file/widget/templates/file-input.pt
src/pyams_file/widget/templates/image-display.pt
src/pyams_file/widget/templates/image-input.pt
--- a/src/pyams_file/widget/templates/file-display.pt	Wed Sep 20 14:04:03 2017 +0200
+++ b/src/pyams_file/widget/templates/file-display.pt	Thu Oct 12 22:21:17 2017 +0200
@@ -17,7 +17,7 @@
 			<span tal:content="python:view.get_human_size(value.get_size())"></span>
 			<a class="btn btn-xs btn-default" target="download_window"
 			   tal:define="href extension:absolute_url(value)"
-			   tal:attributes="href string:${href}?download=1"
+			   tal:attributes="href string:${href}?download=1&_=${view/timestamp}"
 			   i18n:translate="">Download</a>
 		</div>
 	</div>
--- a/src/pyams_file/widget/templates/file-input.pt	Wed Sep 20 14:04:03 2017 +0200
+++ b/src/pyams_file/widget/templates/file-input.pt	Thu Oct 12 22:21:17 2017 +0200
@@ -1,5 +1,5 @@
-<div class="input-file" i18n:domain="pyams_file">
-	<div>
+<i18n:block domain="pyams_file">
+	<div class="input-file">
 		<div class="button">
 			<input type="file" onchange="this.parentNode.nextSibling.value = this.value;"
 				   tal:attributes="name view/name;
@@ -7,18 +7,18 @@
 			<tal:var i18n:translate="">Browse...</tal:var>
 		</div><input type="text" placeholder="Please select a file..." readonly i18n:attributes="placeholder" />
 	</div>
-	<div class="pull-right" tal:condition="view/deletable">
-		<label class="checkbox">
-			<input type="checkbox" value="on"
-				   tal:attributes="id string:${view/id}.__deleted;
-								   name string:${view/name}__deleted;" />
-			<i></i>
-			<span i18n:translate="">Delete content</span>
-		</label>
-	</div>
 	<div class="current-value"
 		 tal:define="value view/current_value"
 		 tal:condition="value">
+		<div class="pull-right" tal:condition="view/deletable">
+			<label class="checkbox">
+				<input type="checkbox" value="on"
+					   tal:attributes="id string:${view/id}.__deleted;
+									   name string:${view/name}__deleted;" />
+				<i></i>
+				<span i18n:translate="">Delete content</span>
+			</label>
+		</div>
 		<div class="pull-left margin-5 margin-right-10">
 			<a tal:define="target view/get_thumbnail_target"
 			   tal:omit-tag="not:target"
@@ -41,11 +41,11 @@
 				</tal:loop>
 				<a class="btn btn-xs btn-primary" target="download_window"
 				   tal:define="href extension:absolute_url(value)"
-				   tal:attributes="href string:${href}?download=1"
+				   tal:attributes="href string:${href}?download=1&_=${view/timestamp}"
 				   i18n:translate="">
 					Download
 				</a>
 			</div>
 		</div>
 	</div>
-</div>
+</i18n:block>
--- a/src/pyams_file/widget/templates/image-display.pt	Wed Sep 20 14:04:03 2017 +0200
+++ b/src/pyams_file/widget/templates/image-display.pt	Thu Oct 12 22:21:17 2017 +0200
@@ -12,7 +12,8 @@
 		   title="Zoom image" i18n:attributes="title">
 			<img class="thumbnail"
 				 tal:define="thumbnail python:thumbnails.get_thumbnail('128x128', 'jpeg');"
-				 tal:attributes="src extension:absolute_url(thumbnail)" src="" alt="" />
+				 tal:attributes="src extension:absolute_url(thumbnail);
+								 title i18n:context.title;" title="" src="" alt="" />
 		</a>
 		<div class="margin-top-5">
 			<span i18n:translate="">Current value: </span>
@@ -24,7 +25,7 @@
 			<br />
 			<a class="btn btn-xs btn-default" target="download_window"
 			   tal:define="href extension:absolute_url(value)"
-			   tal:attributes="href string:${href}?download=1"
+			   tal:attributes="href string:${href}?download=1&_=${view/timestamp}"
 			   i18n:translate="">
 				Download
 			</a>
--- a/src/pyams_file/widget/templates/image-input.pt	Wed Sep 20 14:04:03 2017 +0200
+++ b/src/pyams_file/widget/templates/image-input.pt	Thu Oct 12 22:21:17 2017 +0200
@@ -1,5 +1,5 @@
-<div class="input-file" i18n:domain="pyams_file">
-	<div>
+<i18n:block domain="pyams_file">
+	<div class="input-file">
 		<div class="button">
 			<input type="file" onchange="this.parentNode.nextSibling.value = this.value;"
 				   tal:attributes="name view/name;
@@ -7,18 +7,18 @@
 			<tal:var i18n:translate="">Browse...</tal:var>
 		</div><input type="text" placeholder="Please select a file..." readonly i18n:attributes="placeholder" />
 	</div>
-	<div class="pull-right" tal:condition="view/deletable">
-		<label class="checkbox">
-			<input type="checkbox" value="on"
-				   tal:attributes="id string:${view/id}.__deleted;
-								   name string:${view/name}__deleted;" />
-			<i></i>
-			<span i18n:translate="">Delete content</span>
-		</label>
-	</div>
 	<div class="current-value"
 		 tal:define="value view/current_value"
 		 tal:condition="value">
+		<div class="pull-right" tal:condition="view/deletable">
+			<label class="checkbox">
+				<input type="checkbox" value="on"
+					   tal:attributes="id string:${view/id}.__deleted;
+									   name string:${view/name}__deleted;" />
+				<i></i>
+				<span i18n:translate="">Delete content</span>
+			</label>
+		</div>
 		<a class="fancybox hint pull-left margin-5 margin-right-10" data-toggle
 		   data-ams-fancybox-type="image"
 		   data-ams-hint-gravity="e"
@@ -29,7 +29,8 @@
 		   title="Zoom image" i18n:attributes="title">
 			<img class="thumbnail"
 				 tal:define="thumbnail python:thumbnails.get_thumbnail('128x128', 'jpeg');"
-				 tal:attributes="src extension:absolute_url(thumbnail)" src="" alt="" />
+				 tal:attributes="src extension:absolute_url(thumbnail);
+								 title i18n:context.title;" title="" src="" alt="" />
 		</a>
 		<div class="margin-top-5">
 			<span i18n:translate="">Current value: </span>
@@ -47,11 +48,11 @@
 				</tal:loop>
 				<a class="btn btn-xs btn-primary" target="download_window"
 				   tal:define="href extension:absolute_url(value)"
-				   tal:attributes="href string:${href}?download=1"
+				   tal:attributes="href string:${href}?download=1&_=${view/timestamp}"
 				   i18n:translate="">
 					Download
 				</a>
 			</div>
 		</div>
 	</div>
-</div>
+</i18n:block>