name_history.html 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. {% extends "misago/profile/base.html" %}
  2. {% load humanize i18n misago_avatars misago_capture misago_pagination %}
  3. {% block meta-description %}{% blocktrans trimmed with user=profile changes=name_changes.paginator.count|intcomma joined_on=profile.joined_on|date count counter=name_changes.paginator.count %}
  4. {{ user }} username was changed {{ changes }} time since {{ joined_on }}.
  5. {% plural %}
  6. {{ user }} username was changed {{ changes }} times since {{ joined_on }}.
  7. {% endblocktrans %}{% endblock meta-description %}
  8. {% block page %}
  9. {% if name_changes.object_list %}
  10. <p class="lead">
  11. {% if is_authenticated_user %}
  12. {% blocktrans trimmed with changes=name_changes.paginator.count|intcomma count counter=name_changes.paginator.count %}
  13. Your username was changed {{ changes }} time.
  14. {% plural %}
  15. Your username was changed {{ changes }} times.
  16. {% endblocktrans %}
  17. {% else %}
  18. {% blocktrans trimmed with user=profile changes=name_changes.paginator.count|intcomma count counter=name_changes.paginator.count %}
  19. {{ user }} username was changed {{ changes }} time.
  20. {% plural %}
  21. {{ user }} username was changed {{ changes }} times.
  22. {% endblocktrans %}
  23. {% endif %}
  24. </p>
  25. <div class="username-history">
  26. {% for change in name_changes.object_list %}
  27. {% capture trimmed as old_username %}
  28. <strong>{{ change.old_username }}</strong>
  29. {% endcapture %}
  30. {% capture trimmed as new_username %}
  31. <strong>{{ change.new_username }}</strong>
  32. {% endcapture %}
  33. <p>
  34. {% if not change.changed_by_id or change.changed_by_id != profile.pk %}
  35. {% if change.changed_by_id %}
  36. <a href="{% url USER_PROFILE_URL user_slug=change.changed_by_slug user_id=change.changed_by_id %}">
  37. <img src="{{ change.changed_by_id|avatar:22 }}" class="tooltip-top" title="{{ change.changed_by_username }}">
  38. </a>
  39. {% else %}
  40. <img src="{% blankavatar 22 %}" class="tooltip-top" title="{{ change.changed_by_username }}">
  41. {% endif %}
  42. {% capture trimmed as changed_by %}
  43. {% if change.changed_by_id %}
  44. <a href="{% url USER_PROFILE_URL user_slug=change.changed_by_slug user_id=change.changed_by_id %}">{{ change.changed_by_username }}</a>
  45. {% else %}
  46. <strong>{{ change.changed_by_username }}</strong>
  47. {% endif %}
  48. {% endcapture %}
  49. {% blocktrans trimmed with changed_by=changed_by|safe old_username=old_username|safe new_username=new_username|safe %}
  50. {{ changed_by }} changed {{ old_username }}'s name to {{ new_username }}
  51. {% endblocktrans %}
  52. {% else %}
  53. <img src="{{ profile.pk|avatar:22 }}" class="tooltip-top" title="{{ profile }}">
  54. {% blocktrans trimmed with old_username=old_username|safe new_username=new_username|safe %}
  55. {{ old_username }} changed name to {{ new_username }}
  56. {% endblocktrans %}
  57. {% endif %}
  58. <abbr class="pull-right text-muted tooltip-top dynamic time-ago" title="{{ change.changed_on }}" data-timestamp="{{ change.changed_on|date:"c" }}">
  59. {{ change.changed_on|date }}
  60. </abbr>
  61. </p>
  62. <hr>
  63. {% endfor%}
  64. </div>
  65. {% pagination name_changes "misago/profile/pagination.html" 'misago:user_name_history' user_slug=profile.slug user_id=profile.pk %}
  66. {% else %}
  67. <p class="lead">
  68. {% if is_authenticated_user %}
  69. {% blocktrans trimmed with user=profile %}
  70. Your username was never changed, {{ user }}.
  71. {% endblocktrans %}
  72. {% else %}
  73. {% blocktrans trimmed with user=profile %}
  74. {{ user }}'s username was never changed.
  75. {% endblocktrans %}
  76. {% endif %}
  77. </p>
  78. {% endif %}
  79. {% endblock page %}