From fc8c13be8fc1fd5faac4ca45b6e1fdc962f5dfe7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felipe=20Mart=C3=ADn?= Date: Sun, 11 Oct 2015 09:29:05 +0200 Subject: [PATCH] Modified profile header with more info --- amiibofindr/apps/profile/views.py | 8 ++++- amiibofindr/static/less/style.less | 4 +++ amiibofindr/templates/profile/main.html | 40 ++++++++++++++++++------- 3 files changed, 41 insertions(+), 11 deletions(-) diff --git a/amiibofindr/apps/profile/views.py b/amiibofindr/apps/profile/views.py index 8146291..3259811 100644 --- a/amiibofindr/apps/profile/views.py +++ b/amiibofindr/apps/profile/views.py @@ -32,5 +32,11 @@ class ProfileView(View): 'this_user': user, 'amiibo_list': amiibo_list, 'type': type, - 'relation': relation + 'relation': relation, + 'stats': { + 'figures_count': UserAmiibo.objects.filter( + user=user, _amiibo__type='figure', own=True).count(), + 'cards_count': UserAmiibo.objects.filter( + user=user, _amiibo__type='card', own=True).count(), + } }) diff --git a/amiibofindr/static/less/style.less b/amiibofindr/static/less/style.less index 31a731f..85227b6 100644 --- a/amiibofindr/static/less/style.less +++ b/amiibofindr/static/less/style.less @@ -36,6 +36,10 @@ white-space: nowrap; } +.no-margin-bottom { + margin-bottom: 0 !important; +} + .relation-buttons { position: absolute; left: 6px; diff --git a/amiibofindr/templates/profile/main.html b/amiibofindr/templates/profile/main.html index 11d8f81..1ad6092 100644 --- a/amiibofindr/templates/profile/main.html +++ b/amiibofindr/templates/profile/main.html @@ -5,31 +5,51 @@ {% block main_content %}
-
-

-
+
+
+
+
+

{{ this_user.username }}
{% blocktrans with username=this_user.username trimmed %} Here you can browse over {{ username }}'s collection {% endblocktrans %}
+
+
+
+ {{ stats.figures_count }} +
+
+ {% trans 'Figures' %} +
+
+
+
+ {{ stats.cards_count }} +
+
+ {% trans 'Cards' %} +
+
+

- {% if user.pk == this_user.pk %} +
+ {% if user.pk == this_user.pk %} +
-

- {% trans "Want everyone to see your collection? Spread the word!" %} -

+ {% trans "Want everyone to see your collection? Spread the word!" %}
- {% endif %} -
+

+ {% endif %}