From a12f419a47c50b818f350dadc0d7d4c5d22a2683 Mon Sep 17 00:00:00 2001 From: Felipe Martin Date: Fri, 4 Apr 2014 15:15:50 +0200 Subject: [PATCH] Fixed profile page --- shelfzilla/apps/users/views.py | 9 ++++++--- shelfzilla/themes/bootflat/templates/users/profile.html | 6 ++++-- .../themes/bootflat/templates/users/profile/summary.html | 2 ++ 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/shelfzilla/apps/users/views.py b/shelfzilla/apps/users/views.py index d5ec01d..99298e8 100644 --- a/shelfzilla/apps/users/views.py +++ b/shelfzilla/apps/users/views.py @@ -63,15 +63,18 @@ class LogoutView(View): class ProfileView(View): - template = 'users/profile/{}.html' + tempalte = 'users/profile.html' + template_section = 'users/profile/{}.html' def get(self, request, section='summary'): if request.user.is_authenticated(): data = { 'item': User.objects.get(pk=request.user.pk) } - - template = self.template.format(section) + if section != 'summary': + template = self.template_section.format(section) + else: + template = self.tempalte data = self.get_context_from_section(request, section, data) ctx = RequestContext(request, data) diff --git a/shelfzilla/themes/bootflat/templates/users/profile.html b/shelfzilla/themes/bootflat/templates/users/profile.html index 98fd7e3..702f343 100644 --- a/shelfzilla/themes/bootflat/templates/users/profile.html +++ b/shelfzilla/themes/bootflat/templates/users/profile.html @@ -23,7 +23,7 @@
- + {% trans "Summary" %} {% trans "Collection" %} @@ -35,7 +35,9 @@
- {% block profile_content %}{% endblock %} + {% block profile_content %} + {% include "users/profile/summary.html" %} + {% endblock %}
diff --git a/shelfzilla/themes/bootflat/templates/users/profile/summary.html b/shelfzilla/themes/bootflat/templates/users/profile/summary.html index f7bcbf9..4fc316b 100644 --- a/shelfzilla/themes/bootflat/templates/users/profile/summary.html +++ b/shelfzilla/themes/bootflat/templates/users/profile/summary.html @@ -1,7 +1,9 @@ +{% comment %} {% extends 'users/profile.html'|pjax:request %} {% load i18n %} {% block page_title %}{{ block.super }}{% endblock %} +{% endcomment %} {% block profile_content %}