username.html 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. {% extends "cranefly/usercp/layout.html" %}
  2. {% load i18n %}
  3. {% load url from future %}
  4. {% import "_forms.html" as form_theme with context %}
  5. {% import "cranefly/macros.html" as macros with context %}
  6. {% block title %}{{ macros.page_title(title=_('Change your Username')) }}{% endblock %}
  7. {% block action %}
  8. <div class="form-container">
  9. <div class="form-header">
  10. <h1>{% trans %}Change your Username{% endtrans %}</h1>
  11. </div>
  12. {% if message %}
  13. <div class="messages-list">
  14. {{ macros.draw_message(message) }}
  15. </div>
  16. {% endif %}
  17. <form action="{% url 'usercp_username' %}" method="post">
  18. <div class="form-fields">
  19. {% if changes_left == 0 %}
  20. {% do form.fields['username']['attrs'].update({'disabled': 'disabled'}) %}
  21. {% endif %}
  22. {{ form_theme.form_widget(form, width=9) }}
  23. </div>
  24. <div class="form-actions">
  25. <button name="save" type="submit" class="btn btn-primary"{% if changes_left == 0 %} disabled="disabled"{% endif %}>{% trans %}Change Name{% endtrans %}</button>
  26. <span class="form-actions-protip">{% if changes_left > 0 -%}
  27. {% trans count=changes_left -%}
  28. You can change your username one more time.
  29. {%- pluralize -%}
  30. You can change your username {{ count }} more times.
  31. {%- endtrans %}
  32. {%- elif acl.usercp.changes_expire() -%}
  33. {% trans next_change=next_change|reldate|low %}You will be able to change your username on {{ next_change }}{% endtrans %}
  34. {%- else -%}
  35. {% trans %}You have exceeded the maximum number of name changes.{% endtrans %}
  36. {%- endif %}
  37. </span>
  38. </div>
  39. </form>
  40. </div>
  41. {% endblock %}