Skip to content

Commit

Permalink
file input: Show accepted media types.
Browse files Browse the repository at this point in the history
  • Loading branch information
thet committed Mar 14, 2024
1 parent 96db8cc commit 5b49d4d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions plone/formwidget/namedfile/file_input.pt
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,14 @@
maxlength view/maxlength;
"
/>
<div class="form-text"
tal:condition="view/accept"
i18n:translate="namedfile_accepted_types"
>
Allowed types:
<tal:i18n i18n:name="accepted_types">${view/accept}</tal:i18n>.
</div>

<script type="text/javascript"
tal:condition="python:allow_nochange and action != 'replace'"
tal:content="string:document.getElementById('${view/id}-input').disabled=true;"
Expand Down
8 changes: 8 additions & 0 deletions plone/formwidget/namedfile/image_input.pt
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,14 @@
maxlength view/maxlength;
"
/>
<div class="form-text"
tal:condition="view/accept"
i18n:translate="namedfile_accepted_types"
>
Allowed types:
<tal:i18n i18n:name="accepted_types">${view/accept}</tal:i18n>.
</div>

<script type="text/javascript"
tal:condition="python:allow_nochange and action != 'replace'"
tal:content="string:document.getElementById('${view/id}-input').disabled=true;"
Expand Down

0 comments on commit 5b49d4d

Please sign in to comment.