From 54304f2c28c35416cd30d37219c64d6aaf30096c Mon Sep 17 00:00:00 2001 From: Jailson Dias Date: Fri, 5 May 2017 17:21:40 -0300 Subject: [PATCH] resolvendo problemas com traduções nos relatorios de webpage --- webpage/locale/pt_BR/LC_MESSAGES/django.po | 125 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------------------------ webpage/templates/webpages/relatorios.html | 9 ++++----- webpage/views.py | 26 -------------------------- 3 files changed, 87 insertions(+), 73 deletions(-) diff --git a/webpage/locale/pt_BR/LC_MESSAGES/django.po b/webpage/locale/pt_BR/LC_MESSAGES/django.po index cfb1eee..1844337 100644 --- a/webpage/locale/pt_BR/LC_MESSAGES/django.po +++ b/webpage/locale/pt_BR/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-04-28 20:41-0300\n" +"POT-Creation-Date: 2017-05-05 17:14-0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -18,26 +18,30 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" -#: forms.py:25 +#: forms.py:27 msgid "Tags" msgstr "Tags" -#: forms.py:31 +#: forms.py:33 msgid "Webpage name" msgstr "Nome da Página Web" -#: forms.py:32 +#: forms.py:34 msgid "Webpage content" msgstr "Conteúdo da Página Web" -#: forms.py:53 +#: forms.py:55 msgid "This subject already has a webpage with this name" msgstr "Esse assunto já possui uma Página Web com esse nome" -#: forms.py:64 +#: forms.py:66 forms.py:112 msgid "This field is required." msgstr "Esse campo é obrigatório." +#: forms.py:124 +msgid "The image is too large. It should have less than 5MB." +msgstr "A imagem é muito grande. Deve ser menor do que 5MB" + #: models.py:8 msgid "Webpage Content" msgstr "Conteúdo da Página Web" @@ -82,59 +86,87 @@ msgstr "Atribuir grupos de estudo à Página Web" msgid "Save" msgstr "Salvar" -#: templates/webpages/create.html:20 views.py:221 +#: templates/webpages/create.html:20 views.py:227 msgid "Create Webpage" msgstr "Criar Página Web" -#: templates/webpages/relatorios.html:16 templates/webpages/relatorios.html:30 -#: templates/webpages/relatorios.html:37 +#: templates/webpages/relatorios.html:17 templates/webpages/relatorios.html:37 msgid "User" msgstr "Usuário" -#: templates/webpages/relatorios.html:16 templates/webpages/relatorios.html:30 -#: templates/webpages/relatorios.html:37 +#: templates/webpages/relatorios.html:17 templates/webpages/relatorios.html:37 msgid "Group" msgstr "Grupo" -#: templates/webpages/relatorios.html:16 templates/webpages/relatorios.html:30 +#: templates/webpages/relatorios.html:17 msgid "Action" msgstr "Ação" -#: templates/webpages/relatorios.html:16 templates/webpages/relatorios.html:30 +#: templates/webpages/relatorios.html:17 msgid "Date of Action" msgstr "Data da ação" -#: templates/webpages/relatorios.html:135 -#: templates/webpages/relatorios.html:155 +#: templates/webpages/relatorios.html:37 +msgid "Send message" +msgstr "Enviar Mensagem" + +#: templates/webpages/relatorios.html:37 +#| msgid "Action" +msgid "Action don't realized" +msgstr "Ação não realizada" + +#: templates/webpages/relatorios.html:151 +#: templates/webpages/relatorios.html:171 msgid "Reports" msgstr "Relatórios" -#: templates/webpages/relatorios.html:162 +#: templates/webpages/relatorios.html:178 msgid "Report of the resource " msgstr "Relatórios do recurso " -#: templates/webpages/relatorios.html:165 +#: templates/webpages/relatorios.html:187 msgid "Select the period: " msgstr "Selecione o período: " -#: templates/webpages/relatorios.html:179 +#: templates/webpages/relatorios.html:196 msgid "Search" msgstr "Pesquisar" -#: templates/webpages/relatorios.html:201 +#: templates/webpages/relatorios.html:220 msgid "Filter: " msgstr "Filtro: " +#: templates/webpages/relatorios.html:244 +#: templates/webpages/relatorios.html:329 +msgid "record(s)" +msgstr "Relatório(s)" + +#: templates/webpages/send_message.html:38 +msgid "Click or drop the picture here" +msgstr "Clique ou arraste a imagem aqui" + +#: templates/webpages/send_message.html:40 +msgid "The picture could not exceed 5MB." +msgstr "A imagem não pode exceder 5MB." + +#: templates/webpages/send_message.html:62 +msgid "Close" +msgstr "Fechar" + +#: templates/webpages/send_message.html:63 +msgid "Send" +msgstr "Enviar" + #: templates/webpages/update.html:20 msgid "Edit: " msgstr "Editar: " -#: views.py:148 views.py:161 views.py:279 views.py:281 views.py:297 -#: views.py:299 +#: views.py:155 views.py:168 views.py:285 views.py:287 views.py:303 +#: views.py:305 msgid "Visualize" msgstr "Visualizar" -#: views.py:232 +#: views.py:238 #, python-format msgid "" "The Webpage \"%s\" was added to the Topic \"%s\" of the virtual environment " @@ -143,50 +175,59 @@ msgstr "" "A Página Web \"%s\" foi adicionado ao tópico \"%s\" do ambiente virtual \"%s" "\" com sucesso!" -#: views.py:343 +#: views.py:349 msgid "Update Webpage" msgstr "Atualizar Página Web" -#: views.py:354 +#: views.py:360 #, python-format msgid "The Webpage \"%s\" was updated successfully!" msgstr "A Página Web \"%s\" foi atualizada com sucesso!" -#: views.py:390 +#: views.py:396 #, python-format msgid "" "The webpage \"%s\" was removed successfully from virtual environment \"%s\"!" msgstr "" "A Página Web \"%s\" foi removida do ambiente virtual \"%s\" com sucesso!" -#: views.py:460 +#: views.py:455 msgid "Webpage Reports" msgstr "Nome da Página Web" -#: views.py:478 -msgid "Users who viewed" -msgstr "Usuários que visualizaram" +#: views.py:474 +msgid "Realized" +msgstr "Realizado" -#: views.py:478 -msgid "Users who did not viewed" -msgstr "Usuários que não visualizaram" +#: views.py:474 +msgid "Unrealized" +msgstr "Não Realizado" -#: views.py:478 +#: views.py:474 msgid "Historic" msgstr "Histórico" -#: views.py:515 -msgid "Webpage" -msgstr "Nome da Página Web" - -#: views.py:516 +#: views.py:492 views.py:501 msgid "View" msgstr "Visualizar" -#: views.py:520 -msgid "Students viewing the webpage" -msgstr "Estudantes que visualizaram a webpage" +#: views.py:500 +msgid "Webpage" +msgstr "Nome da Página Web" + +#: views.py:505 +msgid "Actions about resource" +msgstr "Ações sobre o recurso" -#: views.py:521 +#: views.py:506 msgid "Quantity" msgstr "Quantidade" + +#~ msgid "Users who viewed" +#~ msgstr "Usuários que visualizaram" + +#~ msgid "Users who did not viewed" +#~ msgstr "Usuários que não visualizaram" + +#~ msgid "Students viewing the webpage" +#~ msgstr "Estudantes que visualizaram a webpage" diff --git a/webpage/templates/webpages/relatorios.html b/webpage/templates/webpages/relatorios.html index dcfa856..17f7ced 100644 --- a/webpage/templates/webpages/relatorios.html +++ b/webpage/templates/webpages/relatorios.html @@ -34,7 +34,7 @@ array_n_did.push([input,"{{data_json.1}}","{{data_json.2}}","{{data_json.3}}"]); {% endfor%} var json_n_did = {"data":array_n_did}; - var column_n_did = [{"string":' {% trans "Send message" %}'},{"string":'{% trans "User" %}'},{"string":'{% trans "Group" %}'},{"string":"Action don't realized"}]; + var column_n_did = [{"string":' {% trans "Send message" %}'},{"string":'{% trans "User" %}'},{"string":'{% trans "Group" %}'},{"string":"{% trans "Action don't realized" %}"}]; @@ -74,6 +74,7 @@ json_n_did["data"][i][2],json_n_did["data"][i][3]]); } searcher(col, tabela_atual,true); + } else if (col == "{{did_table}}"){ tabela_atual = true; search = []; @@ -92,6 +93,7 @@ chart.draw(data, options); } + var sortAscending = {0:false,1:false,2:false,3:false}; function drawTable(columns = column_history,rows = pagination(json_history["data"],1),isdate = true,columndate = 3) { var data_table = new google.visualization.DataTable(); @@ -197,6 +199,7 @@
    +
    @@ -376,8 +379,6 @@ .appendTo('#text_chat_form'); var formData = new FormData($('#text_chat_form').get(0)); - console.log("formData"); - console.log(formData); $.ajax({ url: "{% url 'webpages:send_message' webpage.slug %}", type: "POST", @@ -392,7 +393,6 @@ $( "#modal-message" ).empty(); $(".modal-backdrop.fade.in").remove(); } else { - console.log("teste"); $( "#modal-message" ).empty(); $(".modal-backdrop.fade.in").remove(); $( "#modal-message" ).append( data ); @@ -401,7 +401,6 @@ }, error: function(data){ console.log("erro"); - console.log(data); } }); } diff --git a/webpage/views.py b/webpage/views.py index 1501bc2..9240292 100644 --- a/webpage/views.py +++ b/webpage/views.py @@ -196,9 +196,6 @@ class CreateView(LoginRequiredMixin, LogMixin, generic.edit.CreateView): if not self.object.topic.visible and not self.object.topic.repository: self.object.visible = False - - # if form.cleaned_data["all_students"]: - # self.object.students.add(*self.object.topic.subject.students.all()) self.object.save() pend_form = pendencies_form.save(commit = False) @@ -416,17 +413,6 @@ class DeleteView(LoginRequiredMixin, LogMixin, generic.DeleteView): return reverse_lazy('subjects:view', kwargs = {'slug': self.object.topic.subject.slug}) -def get_chart(request,slug): - webpage = get_object_or_404(Webpage, slug=slug) - alunos = webpage.students.all() - visualizou = Log.objects.filter(context__contains={'webpage_id':webpage.id},resource="webpage",action="view",user_email__in=(aluno.email for aluno in alunos)).distinct("user_email") - re = [] - c_visualizou = visualizou.count() - re.append(["Página Web","Fez","Não fez"]) - re.append(["Visualizar",c_visualizou, alunos.count() - c_visualizou]) - return JsonResponse({"dados":re}) - - class StatisticsView(LoginRequiredMixin, LogMixin, generic.DetailView): log_component = 'resources' log_action = 'view_statistics' @@ -566,15 +552,3 @@ class SendMessage(LoginRequiredMixin, LogMixin, generic.edit.FormView): return context -def sendMessage(request, slug): - message = request.GET.get('message','') - users = request.GET.getlist('users[]','') - user = request.user - subject = get_object_or_404(Subject,slug = slug) - - for u in users: - to_user = User.objects.get(email=u) - talk, create = Conversation.objects.get_or_create(user_one=user,user_two=to_user) - created = TalkMessages.objects.create(text=message,talk=talk,user=user,subject=subject) - - return JsonResponse({"message":"ok"}) -- libgit2 0.21.2