Skip to content

Commit

Permalink
Merge pull request #1100 from dustin10/dowload-attribute
Browse files Browse the repository at this point in the history
💄 add download attribute
  • Loading branch information
garak committed Feb 6, 2020
2 parents 4bb1a55 + 3d28742 commit 2823211
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions templates/Form/fields.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
{%- endif -%}

{%- if download_uri -%}
<a href="{{ asset_helper is same as(true) ? asset(download_uri) : download_uri }}">{{ translation_domain is same as(false) ? download_label : download_label|trans({}, translation_domain) }}</a>
<a href="{{ asset_helper is same as(true) ? asset(download_uri) : download_uri }}" download>
{{ translation_domain is same as(false) ? download_label : download_label|trans({}, translation_domain) }}
</a>
{%- endif -%}
</div>
{%- endblock -%}
Expand All @@ -29,10 +31,14 @@
{%- endif -%}

{%- if image_uri -%}
<a href="{{ asset_helper is same as(true) ? asset(image_uri) : image_uri }}"><img src="{{ asset_helper is same as(true) ? asset(image_uri) : image_uri }}" alt="" /></a>
<a href="{{ asset_helper is same as(true) ? asset(image_uri) : image_uri }}" download>
<img src="{{ asset_helper is same as(true) ? asset(image_uri) : image_uri }}" alt="" />
</a>
{%- endif -%}
{%- if download_uri -%}
<a href="{{ asset_helper is same as(true) ? asset(download_uri) : download_uri }}">{{ translation_domain is same as(false) ? download_label : download_label|trans({}, translation_domain) }}</a>
<a href="{{ asset_helper is same as(true) ? asset(download_uri) : download_uri }}" download>
{{ translation_domain is same as(false) ? download_label : download_label|trans({}, translation_domain) }}
</a>
{%- endif -%}
</div>
{%- endblock -%}
Expand Down

0 comments on commit 2823211

Please sign in to comment.