Updated download links
authorThierry Florac <thierry.florac@onf.fr>
Tue, 08 Sep 2015 17:17:08 +0200
changeset 23 3dbc8df88f2d
parent 22 3a1769d9a4e2
child 24 0ae2f9d50bb6
Updated download links
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	Tue Sep 08 17:16:34 2015 +0200
+++ b/src/pyams_file/widget/templates/file-display.pt	Tue Sep 08 17:17:08 2015 +0200
@@ -8,7 +8,9 @@
 			&nbsp;&ndash;&nbsp;
 			<i18n:var i18n:translate=""><span i18n:name="size" tal:content="python:round(value.get_size() / 1024)"></span> Kb</i18n:var>
 			<a class="btn btn-xs btn-default" target="download_window"
-			   tal:attributes="href extension:absolute_url(value)" i18n:translate="">Download</a>
+			   tal:define="href extension:absolute_url(value)"
+			   tal:attributes="href string:${href}?download=1"
+			   i18n:translate="">Download</a>
 		</div>
 	</div>
 </i18n:block>
--- a/src/pyams_file/widget/templates/file-input.pt	Tue Sep 08 17:16:34 2015 +0200
+++ b/src/pyams_file/widget/templates/file-input.pt	Tue Sep 08 17:17:08 2015 +0200
@@ -29,7 +29,9 @@
 				 tal:define="actions extension:context_actions(value)"
 				 tal:omit-tag="not:actions">
 				<a class="btn btn-xs btn-default" target="download_window"
-				   tal:attributes="href extension:absolute_url(value)" i18n:translate="">
+				   tal:define="href extension:absolute_url(value)"
+				   tal:attributes="href string:${href}?download=1"
+				   i18n:translate="">
 					Download
 				</a>
 				<tal:if condition="actions">
--- a/src/pyams_file/widget/templates/image-display.pt	Tue Sep 08 17:16:34 2015 +0200
+++ b/src/pyams_file/widget/templates/image-display.pt	Tue Sep 08 17:17:08 2015 +0200
@@ -22,7 +22,9 @@
 			<i18n:var i18n:translate=""><span i18n:name="size" tal:content="python:round(value.get_size() / 1024)"></span> Kb</i18n:var>
 			<br />
 			<a class="btn btn-xs btn-default" target="download_window"
-			   tal:attributes="href extension:absolute_url(value)" i18n:translate="">
+			   tal:define="href extension:absolute_url(value)"
+			   tal:attributes="href string:${href}?download=1"
+			   i18n:translate="">
 				Download
 			</a>
 		</div>
--- a/src/pyams_file/widget/templates/image-input.pt	Tue Sep 08 17:16:34 2015 +0200
+++ b/src/pyams_file/widget/templates/image-input.pt	Tue Sep 08 17:17:08 2015 +0200
@@ -42,7 +42,9 @@
 				 tal:define="actions extension:context_actions(value)"
 				 tal:omit-tag="not:actions">
 				<a class="btn btn-xs btn-default" target="download_window"
-				   tal:attributes="href extension:absolute_url(value)" i18n:translate="">
+				   tal:define="href extension:absolute_url(value)"
+				   tal:attributes="href string:${href}?download=1"
+				   i18n:translate="">
 					Download
 				</a>
 				<tal:if condition="actions">