Browse Source

Given some more love to warnings list. #37

Rafał Pitoń 11 years ago
parent
commit
77b6edc943
1 changed files with 23 additions and 1 deletions
  1. 23 1
      templates/cranefly/profiles/warnings.html

+ 23 - 1
templates/cranefly/profiles/warnings.html

@@ -39,7 +39,21 @@
 {% if items_total %}
 {% if items_total %}
 <div class="content-list user-warnings">
 <div class="content-list user-warnings">
   {% for item in items %}
   {% for item in items %}
-  {{ item.reason }}
+  <div class="media">
+    <a href="{{ url('user', user=profile.pk, username=profile.username_slug) }}" class="pull-left">
+      <img class="media-object" src="{{ profile.get_avatar(52) }}">
+    </a>
+    <div class="media-body">
+      {% if item.reason %}
+      {{ item.reason_preparsed|safe }}
+      {% else %}
+      <em>{% trans %}No warning reason was provided by warning giver.{% endtrans %}</em>
+      {% endif %}
+      <div class="media-footer">
+        {% trans user=warning_giver(item), date=item.gived_on|reltimesince|low %}Given by {{ user }} {{ date }}{% endtrans %}
+      </div>
+    </div>
+  </div>
   <hr>
   <hr>
   {% endfor %}
   {% endfor %}
   {{ pager() }}
   {{ pager() }}
@@ -52,6 +66,14 @@
 <strong>{{ expires }}</strong>
 <strong>{{ expires }}</strong>
 {% endmacro %}
 {% endmacro %}
 
 
+{% macro warning_giver(item) -%}
+{% if item.giver_id %}
+<a href="{{ url('user', user=item.giver_id, username=item.giver_slug) }}">{{ item.giver_username }}</a>
+{% else %}
+<strong>{{ item.giver_username }}</strong>
+{% endif %}
+{%- endmacro %}
+
 {% macro pager() -%}
 {% macro pager() -%}
 {% if pagination['total'] > 1 %}
 {% if pagination['total'] > 1 %}
 <div class="pagination">
 <div class="pagination">