{% load i18n %}
{% comment %}
Add Script button for a Script Project whose source is uploaded.
Rendered inert rather than hidden when the user cannot declare a script file, so an operator sees
which permission is missing instead of meeting a refusal after choosing a file. An upload declares
a script file, reusing the Script File row when the path already has one, which is why the route needs
that permission as well as the project's.
Context:
- url: The project's upload route
- label: The button label
- uploadable: Whether this project takes uploads at all
- may_declare: Whether the user holds the Script File add permission
{% endcomment %}
{% if uploadable %}
{% if may_declare %}
{{ label }}
{% else %}
{% comment %}
The title sits on the wrapper: a disabled .btn gets pointer-events:none, so a title on the
button itself never surfaces.
{% endcomment %}
{% endif %}
{% endif %}