Browse Source

Giving <3 to warnings list. #37

Rafał Pitoń 11 years ago
parent
commit
1ccbd40aa9

+ 1 - 1
misago/apps/profiles/warnings/views.py

@@ -6,7 +6,6 @@ from django.shortcuts import redirect
 from django.utils import timezone
 from misago.apps.profiles.decorators import profile_view
 from misago.apps.profiles.template import RequestContext
-from misago.models import Forum
 from misago.shortcuts import render_to_response
 from misago.utils.pagination import make_pagination
 
@@ -24,6 +23,7 @@ def warnings(request, user, page=0):
                                   'profile': user,
                                   'tab': 'warnings',
                                   'items_total': count,
+                                  'warning_level': user.get_current_warning_level(),
                                   'items': queryset.order_by('-id')[pagination['start']:pagination['stop']],
                                   'pagination': pagination,
                                   }));

+ 4 - 0
static/cranefly/css/cranefly/profiles.less

@@ -160,5 +160,9 @@
         }
       }
     }
+
+    &.user-warnings {
+
+    }
   }
 }

+ 19 - 11
templates/cranefly/profiles/warnings.html

@@ -4,20 +4,28 @@
 {% block title %}{{ macros.page_title(_('Warnings'), profile.username) }}{% endblock %}
 
 {% block tab %}
-<div class="stat-header">
-  <h2>{% if items_total -%}
-      {%- trans count=items_total, total=items_total|intcomma, username=profile.username -%}
-      {{ username }} received one warning
-      {%- pluralize -%}
-      {{ username }} received {{ total }} warnings
-      {%- endtrans -%}
-      {%- else -%}
-      {% trans username=profile.username %}{{ username }} received no warnings{% endtrans %}
-      {%- endif %}</h2>
+<h2>{% if items_total -%}
+    {%- trans count=items_total, total=items_total|intcomma, username=profile.username -%}
+    {{ username }} received one warning
+    {%- pluralize -%}
+    {{ username }} received {{ total }} warnings
+    {%- endtrans -%}
+    {%- else -%}
+    {% trans username=profile.username %}{{ username }} received no warnings{% endtrans %}
+    {%- endif %}</h2>
+
+{% if warning_level %}
+<div class="warning-level">
+  EVULZ!
+</div>
+{% else %}
+<div class="warning-level">
+  NOPE!
 </div>
+{% endif %}
 
 {% if items_total %}
-<div class="content-list user-threads">
+<div class="content-list user-warnings">
   {% for item in items %}
   {{ item.reason }}
   <hr>