diff --git a/shelfzilla/apps/users/urls.py b/shelfzilla/apps/users/urls.py index 937d4e4..6722565 100644 --- a/shelfzilla/apps/users/urls.py +++ b/shelfzilla/apps/users/urls.py @@ -1,17 +1,17 @@ from django.conf.urls import patterns, url -from .views import LoginView, LogoutView, ProfileView +from .views import LoginView, LogoutView,UserProfileView urlpatterns = patterns( '', url(r'^login/$', LoginView.as_view(), name="login"), url(r'^logout/$', LogoutView.as_view(), name="logout"), url( - r'^profile/$', - ProfileView.as_view(), + r'^user/(?P[\w\d\-\.]+)/$', + UserProfileView.as_view(), name="profile"), url( - r'^profile/(?P
\w+)/$', - ProfileView.as_view(), + r'^user/(?P[\w\d\-\.]+)/(?P
\w+)/$', + UserProfileView.as_view(), name="profile"), ) diff --git a/shelfzilla/apps/users/views.py b/shelfzilla/apps/users/views.py index 99298e8..d43aa74 100644 --- a/shelfzilla/apps/users/views.py +++ b/shelfzilla/apps/users/views.py @@ -1,6 +1,6 @@ from django.views.generic import View from django.template import RequestContext -from django.shortcuts import render_to_response +from django.shortcuts import render_to_response, get_object_or_404 from django.contrib.auth import logout from django.utils.translation import ugettext as _ from django.http import HttpResponseRedirect, Http404 @@ -62,25 +62,22 @@ class LogoutView(View): return HttpResponseRedirect('/') -class ProfileView(View): +class UserProfileView(View): 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) - } - 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) - return render_to_response(template, context_instance=ctx) + def get(self, request, username, section='summary'): + data = { + 'item': get_object_or_404(User, username=username) + } + if section != 'summary': + template = self.template_section.format(section) else: - raise Http404 + template = self.tempalte + data = self.get_context_from_section(request, section, data) + + ctx = RequestContext(request, data) + return render_to_response(template, context_instance=ctx) def get_summary(self, request, context): context['SUMMARY'] = 'Y' diff --git a/shelfzilla/locale/es/LC_MESSAGES/django.mo b/shelfzilla/locale/es/LC_MESSAGES/django.mo index 28cbdad..be1642a 100644 Binary files a/shelfzilla/locale/es/LC_MESSAGES/django.mo and b/shelfzilla/locale/es/LC_MESSAGES/django.mo differ diff --git a/shelfzilla/locale/es/LC_MESSAGES/django.po b/shelfzilla/locale/es/LC_MESSAGES/django.po index 7e6c619..01da42a 100644 --- a/shelfzilla/locale/es/LC_MESSAGES/django.po +++ b/shelfzilla/locale/es/LC_MESSAGES/django.po @@ -8,8 +8,8 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2014-08-24 17:18+0200\n" -"PO-Revision-Date: 2014-08-24 17:18+0200\n" +"POT-Creation-Date: 2014-08-24 18:02+0200\n" +"PO-Revision-Date: 2014-08-24 18:02+0200\n" "Last-Translator: Felipe Martin \n" "Language-Team: LANGUAGE \n" "MIME-Version: 1.0\n" @@ -76,13 +76,13 @@ msgstr "Avanzado" #: apps/manga/admin.py:78 apps/manga/models.py:118 apps/manga/models.py:119 #: themes/bootflat/templates/_layout.html:33 -#: themes/bootflat/templates/manga/publishers/detail.html:18 +#: themes/bootflat/templates/manga/publishers/detail.html:24 #: themes/bootflat/templates/manga/series/list.html:4 msgid "Series" msgstr "Series" #: apps/manga/admin.py:93 apps/manga/admin.py:121 apps/manga/models.py:150 -#: themes/bootflat/templates/manga/publishers/detail.html:21 +#: themes/bootflat/templates/manga/publishers/detail.html:27 msgid "Volumes" msgstr "Volúmenes" @@ -177,7 +177,7 @@ msgid "wants" msgstr "quiere" #: apps/manga/views/search.py:11 apps/manga/views/search.py:13 -#: themes/bootflat/templates/_layout.html:71 +#: themes/bootflat/templates/_layout.html:72 #: themes/bootflat/templates/_admin/volumes/includes/cover.html:6 #: themes/bootflat/templates/_admin/volumes/includes/cover.html:15 msgid "Search" @@ -227,7 +227,7 @@ msgstr "Has accedido correctamente." msgid "Logged out successfully" msgstr "Sesión finalizada." -#: settings/base.py:121 +#: settings/base.py:124 msgid "Spanish" msgstr "Español" @@ -251,25 +251,18 @@ msgstr "" msgid "Toggle navigation" msgstr "Mostrar/Ocultar navegación" -#: themes/bootflat/templates/_layout.html:48 +#: themes/bootflat/templates/_layout.html:42 +#: themes/bootflat/templates/_layout.html:50 #: themes/bootflat/templates/users/profile-pjax.html:4 #: themes/bootflat/templates/users/profile.html:4 msgid "Profile" msgstr "Perfil" -#: themes/bootflat/templates/_layout.html:51 -msgid "My collection" -msgstr "Mi colección" - -#: themes/bootflat/templates/_layout.html:52 -msgid "My wishlist" -msgstr "Mi lista de deseados" - #: themes/bootflat/templates/_layout.html:55 msgid "Logout" msgstr "Cerrar sesión" -#: themes/bootflat/templates/_layout.html:61 +#: themes/bootflat/templates/_layout.html:62 msgid "Log in" msgstr "Entrar" @@ -324,22 +317,23 @@ msgstr "Buscando..." msgid "No results" msgstr "Sin resultados" -#: themes/bootflat/templates/manga/publishers/detail.html:14 -#: themes/bootflat/templates/manga/publishers/detail.html:43 +#: themes/bootflat/templates/manga/publishers/detail.html:10 +#: themes/bootflat/templates/manga/series/detail.html:10 +#: themes/bootflat/templates/manga/series/includes/volume.html:42 +msgid "Edit in admin" +msgstr "Editar en el admin" + +#: themes/bootflat/templates/manga/publishers/detail.html:20 +#: themes/bootflat/templates/manga/publishers/detail.html:49 #: themes/bootflat/templates/manga/series/detail.html:25 #: themes/bootflat/templates/manga/series/includes/volume.html:25 msgid "Requires review" msgstr "Requiere revisión" -#: themes/bootflat/templates/manga/publishers/detail.html:25 +#: themes/bootflat/templates/manga/publishers/detail.html:31 msgid "Homepage" msgstr "Página principal" -#: themes/bootflat/templates/manga/series/detail.html:10 -#: themes/bootflat/templates/manga/series/includes/volume.html:42 -msgid "Edit in admin" -msgstr "Editar en el admin" - #: themes/bootflat/templates/manga/series/detail.html:29 msgid "Status" msgstr "Estado" @@ -375,17 +369,21 @@ msgstr "Entrar" #: themes/bootflat/templates/users/profile.html:30 #: themes/bootflat/templates/users/profile/collection.html:4 msgid "Collection" -msgstr "Mi colección" +msgstr "Colección" #: themes/bootflat/templates/users/profile.html:34 #: themes/bootflat/templates/users/profile/wishlist.html:4 msgid "Wishlist" msgstr "Lista de deseados" -#: themes/bootflat/templates/users/profile.html:44 +#: themes/bootflat/templates/users/profile.html:46 msgid "Edit my profile" msgstr "Editar mi perfil" +#: themes/bootflat/templates/users/profile.html:50 +msgid "My preferences" +msgstr "Mis preferencias" + #: themes/bootflat/templates/users/profile/achievements.html:4 msgid "Achievements" msgstr "Logros" @@ -398,6 +396,12 @@ msgstr "Volúmenes" msgid "Volumes wishlisted" msgstr "Deseados" +#~ msgid "My collection" +#~ msgstr "Mi colección" + +#~ msgid "My wishlist" +#~ msgstr "Mi lista de deseados" + #~ msgid "all" #~ msgstr "todos" diff --git a/shelfzilla/themes/bootflat/templates/_layout.html b/shelfzilla/themes/bootflat/templates/_layout.html index 59a9b6d..544d051 100644 --- a/shelfzilla/themes/bootflat/templates/_layout.html +++ b/shelfzilla/themes/bootflat/templates/_layout.html @@ -39,18 +39,18 @@ {% endif %}