Commit b7f99269 authored by Michal Čihař's avatar Michal Čihař

Disable buttons when locked (issue #169)

parent e921168e
......@@ -139,14 +139,14 @@
{% endif %}
<tr><td></td><td>
{% if perms.trans.save_translation %}
<input class="button" type="submit" value="{% trans "Save" %}" name="save" tabindex="150" />
<input class="button" type="submit" value="{% trans "Save" %}" name="save" tabindex="150" {% if locked %}disabled="disabled"{% endif %} />
{% else %}
{% url 'django.contrib.auth.views.login' as login_url %}
{% with unit.translation.get_translate_url as translate_url %}
{% blocktrans %}<a href="{{ login_url }}?next={{ translate_url }}">Log in</a> for saving translations.{% endblocktrans %}
{% endwith %}
{% endif %}
<input class="button" type="submit" value="{% trans "Suggest" %}" name="suggest" tabindex="151" />
<input class="button" type="submit" value="{% trans "Suggest" %}" name="suggest" tabindex="151" {% if project_locked %}disabled="disabled"{% endif %} />
</td></tr>
</table>
......
......@@ -1186,6 +1186,9 @@ def translate(request, project, subproject, lang):
'search_exact': bool2str(search_exact),
'search_target': bool2str(search_target),
'search_context': bool2str(search_context),
'locked': locked,
'user_locked': user_locked,
'project_locked': project_locked,
}))
@login_required
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment