warnings.html 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. {% extends "cranefly/profiles/profile.html" %}
  2. {% import "cranefly/macros.html" as macros with context %}
  3. {% block title %}{{ macros.page_title(_('Warnings'), profile.username) }}{% endblock %}
  4. {% block tab %}
  5. {% if warning_level %}
  6. <div class="warning-level warning-active">
  7. <h3><i class="icon-warning-sign"></i> {{ warning_level.name }}</h3>
  8. {% if warning_level.description %}
  9. <p class="lead">{{ warning_level.description }}</p>
  10. {% endif %}
  11. {% if profile.warning_level_update_on %}
  12. <p class="warning-expiration">{% trans expires=format_warning_expiration(profile.warning_level_update_on|reldate|lower) %}This warning level will expire {{ expires }}.{% endtrans %}</p>
  13. {% else %}
  14. <p class="warning-expiration">{% trans %}This warning level will not expire and will have to be decreased manually by forum team member.{% endtrans %}</p>
  15. {% endif %}
  16. </div>
  17. {% else %}
  18. <div class="warning-level warning-clean">
  19. {% if user.is_authenticated() and user.pk == profile.pk %}
  20. <p class="lead"><i class="icon-ok"></i> {% trans username=profile.username %}{{ username }}, your account has no warning level set. Good job!{% endtrans %}</p>
  21. {% else %}
  22. <p class="lead"><i class="icon-ok"></i> {% trans username=profile.username %}{{ username }}'s account has no warning level set.{% endtrans %}</p>
  23. {% endif %}
  24. </div>
  25. {% endif %}
  26. <h2>{% if items_total -%}
  27. {%- trans count=items_total, total=items_total|intcomma, username=profile.username -%}
  28. {{ username }} received one warning
  29. {%- pluralize -%}
  30. {{ username }} received {{ total }} warnings
  31. {%- endtrans -%}
  32. {%- else -%}
  33. {% trans username=profile.username %}{{ username }} received no warnings{% endtrans %}
  34. {%- endif %}</h2>
  35. {% if items_total %}
  36. <div class="content-list user-warnings">
  37. {% for item in items %}
  38. <div class="media">
  39. <div class="pull-left">
  40. <div class="warning-icon ">
  41. {% if item.canceled %}
  42. <i class="icon-remove warning-canceled tooltip-top" title="{% trans %}This warning has been canceled.{% endtrans %}"></i>
  43. {% else %}
  44. <i class="icon-warning-sign warning-active"></i>
  45. {% endif %}
  46. </div>
  47. </div>
  48. <div class="media-body">
  49. {% if item.reason %}
  50. <div class="warning-reason">
  51. {{ item.reason_preparsed|safe }}
  52. </div>
  53. {% else %}
  54. <em>{% trans %}No warning reason was provided by warning giver.{% endtrans %}</em>
  55. {% endif %}
  56. <div class="media-footer">
  57. {% if acl.users.can_see_users_trails() %}
  58. {% trans user=warning_giver(item), date=item.given_on|reltimesince|low, ip=item.giver_ip %}Given by {{ user }} {{ date }} from ip {{ ip }}.{% endtrans %}
  59. {% else %}
  60. {% trans user=warning_giver(item), date=item.given_on|reltimesince|low %}Given by {{ user }} {{ date }}.{% endtrans %}
  61. {% endif %}
  62. {% if item.canceled %}
  63. {% if acl.users.can_see_users_trails() %}
  64. {% trans user=warning_canceler(item), date=item.canceled_on|reltimesince|low, ip=item.canceler_ip %}Canceled by {{ user }} {{ date }} from ip {{ ip }}.{% endtrans %}
  65. {% else %}
  66. {% trans user=warning_canceler(item), date=item.canceled_on|reltimesince|low %}Canceled by {{ user }} {{ date }}.{% endtrans %}
  67. {% endif %}
  68. {% endif %}
  69. </div>
  70. </div>
  71. </div>
  72. <hr>
  73. {% endfor %}
  74. {{ pager() }}
  75. </div>
  76. {% endif %}
  77. {% endblock %}
  78. {% macro format_warning_expiration(expires) %}
  79. <strong>{{ expires }}</strong>
  80. {% endmacro %}
  81. {% macro warning_giver(item) -%}
  82. {% if item.giver_id %}
  83. <a href="{{ url('user', user=item.giver_id, username=item.giver_slug) }}">{{ item.giver_username }}</a>
  84. {% else %}
  85. <strong>{{ item.giver_username }}</strong>
  86. {% endif %}
  87. {%- endmacro %}
  88. {% macro warning_canceler(item) -%}
  89. {% if item.canceler_id %}
  90. <a href="{{ url('user', user=item.canceler_id, username=item.canceler_slug) }}">{{ item.canceler_username }}</a>
  91. {% else %}
  92. <strong>{{ item.canceler_username }}</strong>
  93. {% endif %}
  94. {%- endmacro %}
  95. {% macro pager() -%}
  96. {% if pagination['total'] > 1 %}
  97. <div class="pagination">
  98. <ul>
  99. <li class="count">{{ macros.pager_label(pagination) }}</li>
  100. {%- if pagination['prev'] > 1 %}<li><a href="{{ url('user_warnings', user=profile.id, username=profile.username_slug) }}" class="tooltip-top" title="{% trans %}Lastest Warnings{% endtrans %}"><i class="icon-chevron-left"></i> {% trans %}Latest{% endtrans %}</a></li>{% endif -%}
  101. {%- if pagination['prev'] > 0 %}<li><a href="{%- if pagination['prev'] > 1 %}{{ url('user_warnings', user=profile.id, username=profile.username_slug, page=pagination['prev']) }}{% else %}{{ url('user_warnings', user=profile.id, username=profile.username_slug) }}{% endif %}" class="tooltip-top" title="{% trans %}Newer Warnings{% endtrans %}"><i class="icon-chevron-left"></i></a></li>{% endif -%}
  102. {%- if pagination['next'] > 0 %}<li><a href="{{ url('user_warnings', user=profile.id, username=profile.username_slug, page=pagination['next']) }}" class="tooltip-top" title="{% trans %}Older Warnings{% endtrans %}"><i class="icon-chevron-right"></i></a></li>{% endif -%}
  103. </ul>
  104. </div>
  105. {% endif %}
  106. {%- endmacro %}