From 22a78c58bc2bbaeceed8fc9e6da32e3e7205a8c0 Mon Sep 17 00:00:00 2001 From: Felipe Henrique de Almeida Bormann Date: Thu, 2 Feb 2017 16:25:56 -0300 Subject: [PATCH] modified translation messages on links and corrected some english in templates --- links/locale/pt_BR/LC_MESSAGES/django.po | 6 ++++-- subjects/templates/subjects/list_search.html | 2 +- subjects/templates/subjects/resource_card.html | 6 +++++- subjects/views.py | 7 ++----- 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/links/locale/pt_BR/LC_MESSAGES/django.po b/links/locale/pt_BR/LC_MESSAGES/django.po index 52954d8..a7a4d55 100644 --- a/links/locale/pt_BR/LC_MESSAGES/django.po +++ b/links/locale/pt_BR/LC_MESSAGES/django.po @@ -131,14 +131,16 @@ msgstr "" msgid "" "The Link \"%s\" was added to the Topic \"%s\" of the virtual environment " "\"%s\" successfully!" -msgstr "O link \"%s\" foi adicionado com sucesso ao Topico \"%s\" do ambiente virtual "\"%s\"" " +msgstr "O link \"%s\" foi adicionado com sucesso ao Topico \"%s\" do ambiente virtual " +"\"%s\" " #: links/views.py:163 #, python-format msgid "" "The Website Link \"%s\" was removed successfully from virtual environment " "\"%s\"!" -msgstr "O Link do site \"%s\" foi removido com sucesso do ambiente virtual "\"%s\" " " +msgstr "O Link do site \"%s\" foi removido com sucesso do ambiente virtual " +"\"%s\" " #: links/views.py:288 msgid "Update Website Link" diff --git a/subjects/templates/subjects/list_search.html b/subjects/templates/subjects/list_search.html index 078a346..e230056 100644 --- a/subjects/templates/subjects/list_search.html +++ b/subjects/templates/subjects/list_search.html @@ -6,7 +6,7 @@ {% block breadcrumbs %} {% clear_breadcrumbs %} {% breadcrumb 'Home' 'subjects:home' %} - {% with "You search for "|add:tags as term %} + {% with "You searched for "|add:tags as term %} {% breadcrumb term 'subjects:index' %} {% endwith %} diff --git a/subjects/templates/subjects/resource_card.html b/subjects/templates/subjects/resource_card.html index 76ef31a..4d44f78 100644 --- a/subjects/templates/subjects/resource_card.html +++ b/subjects/templates/subjects/resource_card.html @@ -55,8 +55,12 @@

{{resource.brief_description|safe}}

{% endif %} + {% if resource.link_url %} +

teste

+ {% else %} + {% trans "Access Resource" %} + {% endif %} - {% trans "Access Resource" %} diff --git a/subjects/views.py b/subjects/views.py index 3c1011f..aad42de 100644 --- a/subjects/views.py +++ b/subjects/views.py @@ -606,14 +606,11 @@ class SubjectSearchView(LoginRequiredMixin, LogMixin, ListView): q = q | Q(tags__name__unaccent__icontains=tag ) subjects = Subject.objects.filter(q).distinct() - self.resources = Resource.objects.filter(q).distinct() - #pk = self.request.user.pk - #my_subjects = Subject.objects.filter(Q(students__pk=pk) | Q(professor__pk=pk) | Q(category__coordinators__pk=pk) & Q(tags__name__in=tags) ).distinct() + self.totals = {'resources': self.resources.count(), 'my_subjects': subjects.count()} - #if self.kwargs.get('option'): - # subjects = my_subjects + option = self.kwargs.get('option') if option and option == 'resources': return self.resources -- libgit2 0.21.2