mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-06-30 12:18:19 -04:00
Force example CSV to download, not open in browser
We wouldn’t wan’t anyone just seeing the raw CSV data in their browser – it isn’t clear what a user would do with it at that point. And we wouldn’t want it navigating them away from the send page, because this might cause them to lose their place. This commit forces the file to download using the HTML5 `download` attribute: > This attribute instructs browsers to download a URL instead of navigating to it, so the user will be prompted to save it as a local file. – https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-download
This commit is contained in:
@@ -40,7 +40,7 @@
|
||||
{% endcall %}
|
||||
</div>
|
||||
<p class="table-show-more-link">
|
||||
<a href="{{ url_for('.get_example_csv', service_id=current_service.id, template_id=template.id) }}">Download this example</a>
|
||||
<a href="{{ url_for('.get_example_csv', service_id=current_service.id, template_id=template.id) }}" download="download">Download this example</a>
|
||||
</p>
|
||||
|
||||
<h2 class="heading-medium">Your file will populate this template ({{ template.name }})</h2>
|
||||
|
||||
Reference in New Issue
Block a user