username.html 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. <h2>{% trans %}Change your Username{% endtrans %}</h2>
  9. {% if message %}{{ macros.draw_message(message, 'alert-form') }}{% endif %}
  10. <p class="lead">{% if changes_left > 0 -%}
  11. {% trans count=changes_left -%}
  12. You can change your username one more time.
  13. {%- pluralize -%}
  14. You can change your username {{ count }} more times.
  15. {%- endtrans %}
  16. {%- else -%}
  17. {% trans %}You have exceeded the maximum number of name changes.{% endtrans %}
  18. {%- if acl.usercp.changes_expire() -%}
  19. <br>
  20. {% trans next_change=next_change|reldate|low %}You will be able to change your username on {{ next_change }}{% endtrans %}
  21. {%- endif %}
  22. {%- endif %}</p>
  23. {% if changes_left > 0 %}
  24. <form action="{% url 'usercp_username' %}" method="post">
  25. {{ form_theme.form_widget(form, width=9) }}
  26. <div class="form-actions">
  27. <button name="save" type="submit" class="btn btn-primary">{% trans %}Change Name{% endtrans %}</button>
  28. </div>
  29. </form>
  30. {% endif %}
  31. {% if changes_history|length > 0 %}
  32. <h3>{% trans count=changes_history|length -%}
  33. Last name changes
  34. {%- pluralize -%}
  35. Last {{ count }} name changes
  36. {%- endtrans %}</h3>
  37. <table class="table table-striped">
  38. <thead>
  39. <tr>
  40. <th class="span3">{% trans %}Old Name{% endtrans %}</th>
  41. <th>{% trans %}Change Date{% endtrans %}</th>
  42. </tr>
  43. </thead>
  44. <tbody>
  45. {% for change in changes_history %}
  46. <tr>
  47. <td><strong>{{ change.old_username }}</strong></td>
  48. <td>{{ change.date|reltimesince }}</td>
  49. </tr>
  50. {% endfor %}
  51. </tbody>
  52. </table>
  53. {% endif %}
  54. {% endblock %}