warnings.html 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. {{ item.reason }}
  39. <hr>
  40. {% endfor %}
  41. {{ pager() }}
  42. </div>
  43. {% endif %}
  44. {% endblock %}
  45. {% macro format_warning_expiration(expires) %}
  46. <strong>{{ expires }}</strong>
  47. {% endmacro %}
  48. {% macro pager() -%}
  49. {% if pagination['total'] > 1 %}
  50. <div class="pagination">
  51. <ul>
  52. <li class="count">{{ macros.pager_label(pagination) }}</li>
  53. {%- 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 -%}
  54. {%- 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 -%}
  55. {%- 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 -%}
  56. </ul>
  57. </div>
  58. {% endif %}
  59. {%- endmacro %}