Commit 1498bce19df2ab89762faf65dff600db9225d10a

Authored by Felipe Bormann
1 parent f06d0c2a

date formating in table and in date colector are correct

dashboards/locale/pt_BR/LC_MESSAGES/django.po
... ... @@ -8,7 +8,7 @@ msgid ""
8 8 msgstr ""
9 9 "Project-Id-Version: PACKAGE VERSION\n"
10 10 "Report-Msgid-Bugs-To: \n"
11   -"POT-Creation-Date: 2017-05-25 23:31-0300\n"
  11 +"POT-Creation-Date: 2017-06-01 21:27-0300\n"
12 12 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13 13 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14 14 "Language-Team: LANGUAGE <LL@li.org>\n"
... ... @@ -18,122 +18,128 @@ msgstr &quot;&quot;
18 18 "Content-Transfer-Encoding: 8bit\n"
19 19 "Plural-Forms: nplurals=2; plural=(n > 1);\n"
20 20  
21   -#: dashboards/templates/dashboards/category.html:18
  21 +#: .\templates\dashboards\category.html:18
22 22 msgid "Analytics Category"
23 23 msgstr "Análise de Categoria"
24 24  
25   -#: dashboards/templates/dashboards/category.html:31
26   -#: dashboards/templates/dashboards/general.html:30
  25 +#: .\templates\dashboards\category.html:31
  26 +#: .\templates\dashboards\general.html:34
27 27 msgid "Platform Report"
28 28 msgstr "Report da Plataforma"
29 29  
30   -#: dashboards/templates/dashboards/category.html:36
31   -#: dashboards/templates/dashboards/category.html:48
32   -#: dashboards/templates/dashboards/general.html:33
  30 +#: .\templates\dashboards\category.html:36
  31 +#: .\templates\dashboards\category.html:48
  32 +#: .\templates\dashboards\general.html:37
33 33 msgid "Category Report"
34 34 msgstr "Report da Categoria"
35 35  
36   -#: dashboards/templates/dashboards/category.html:39
37   -#: dashboards/templates/dashboards/general.html:36
  36 +#: .\templates\dashboards\category.html:39
  37 +#: .\templates\dashboards\general.html:40
38 38 msgid "Subject Report"
39 39 msgstr "Report do Assunto"
40 40  
41   -#: dashboards/templates/dashboards/category.html:56
42   -#: dashboards/templates/dashboards/general.html:49
  41 +#: .\templates\dashboards\category.html:56
  42 +#: .\templates\dashboards\general_body.html:8
  43 +#: .\templates\dashboards\log.html:35
43 44 msgid "Focus"
44 45 msgstr "Destaques"
45 46  
46   -#: dashboards/templates/dashboards/category.html:59
47   -#: dashboards/templates/dashboards/general.html:52
  47 +#: .\templates\dashboards\category.html:59
  48 +#: .\templates\dashboards\general_body.html:11
  49 +#: .\templates\dashboards\log.html:38
48 50 msgid "Log"
49 51 msgstr "Log"
50 52  
51   -#: dashboards/templates/dashboards/category.html:69
52   -#: dashboards/templates/dashboards/general.html:62
53   -msgid "most used tags"
54   -msgstr "tags mais usadas"
55   -
56   -#: dashboards/templates/dashboards/general.html:18
  53 +#: .\templates\dashboards\general.html:22
57 54 msgid "Dashboards General"
58 55 msgstr "Dashboards Geral"
59 56  
60   -#: dashboards/templates/dashboards/general.html:45
  57 +#: .\templates\dashboards\general_body.html:4
  58 +#: .\templates\dashboards\log.html:31
61 59 msgid "Amadeus Report"
62 60 msgstr "Report do Amadeus"
63 61  
64   -#: dashboards/templates/dashboards/general.html:72
  62 +#: .\templates\dashboards\general_body.html:21
65 63 msgid "Most accessed "
66 64 msgstr "Mais acessadas"
67 65  
68   -#: dashboards/templates/dashboards/general.html:77
  66 +#: .\templates\dashboards\general_body.html:26
69 67 msgid "Categories"
70 68 msgstr "Categorias"
71 69  
72   -#: dashboards/templates/dashboards/general.html:82
  70 +#: .\templates\dashboards\general_body.html:31
73 71 msgid "Subjects"
74 72 msgstr "Assuntos"
75 73  
76   -#: dashboards/templates/dashboards/general.html:87
  74 +#: .\templates\dashboards\general_body.html:36
77 75 msgid "Resource"
78 76 msgstr "Recursos"
79 77  
80   -#: dashboards/templates/dashboards/general.html:96
  78 +#: .\templates\dashboards\general_body.html:45
81 79 msgid "Most active users"
82 80 msgstr "Usuários mais ativos"
83 81  
84   -#: dashboards/templates/dashboards/general.html:102
  82 +#: .\templates\dashboards\general_body.html:51
85 83 msgid "Amount of access in: "
86 84 msgstr "Quantidade de acessos em: "
87 85  
88   -#: dashboards/templates/dashboards/general.html:117
  86 +#: .\templates\dashboards\general_body.html:66
89 87 msgid "Select the begin of the week: "
90 88 msgstr "Selecione o dia da semana: "
91 89  
92   -#: dashboards/views.py:54
  90 +#: .\templates\dashboards\log.html:28
  91 +msgid "search"
  92 +msgstr "Pesquisar"
  93 +
  94 +#: .\templates\dashboards\tags_body.html:6
  95 +msgid "most used tags"
  96 +msgstr "tags mais usadas"
  97 +
  98 +#: .\views.py:58
93 99 msgid "January"
94 100 msgstr "Janeiro"
95 101  
96   -#: dashboards/views.py:54
  102 +#: .\views.py:58
97 103 msgid "February"
98 104 msgstr "Fevereiro"
99 105  
100   -#: dashboards/views.py:54
  106 +#: .\views.py:58
101 107 msgid "March"
102 108 msgstr "Março"
103 109  
104   -#: dashboards/views.py:54
  110 +#: .\views.py:58
105 111 msgid "April"
106 112 msgstr "Abril"
107 113  
108   -#: dashboards/views.py:54
  114 +#: .\views.py:58
109 115 msgid "May"
110 116 msgstr "Maio"
111 117  
112   -#: dashboards/views.py:54
  118 +#: .\views.py:58
113 119 msgid "June"
114 120 msgstr "Junho"
115 121  
116   -#: dashboards/views.py:54
  122 +#: .\views.py:58
117 123 msgid "July"
118 124 msgstr "Julho"
119 125  
120   -#: dashboards/views.py:55
  126 +#: .\views.py:59
121 127 msgid "August"
122 128 msgstr "Agosto"
123 129  
124   -#: dashboards/views.py:55
  130 +#: .\views.py:59
125 131 msgid "September"
126 132 msgstr "Setembro"
127 133  
128   -#: dashboards/views.py:55
  134 +#: .\views.py:59
129 135 msgid "October"
130 136 msgstr "Outubro"
131 137  
132   -#: dashboards/views.py:55
  138 +#: .\views.py:59
133 139 msgid "November"
134 140 msgstr "Novembro"
135 141  
136   -#: dashboards/views.py:55
  142 +#: .\views.py:59
137 143 msgid "December"
138 144 msgstr "Dezembro"
139 145  
... ...
dashboards/static/dashboards/js/logbehavior.js
... ... @@ -3,10 +3,12 @@ $(document).ready(function(){
3 3 d.setDate(d.getDate() - 30);
4 4 $('#init_date').datetimepicker({
5 5 defaultDate: d,
  6 + format: 'L'
6 7 });
7 8 $('#end_date').datetimepicker({
8 9 useCurrent: false, //Important! See issue #1075
9   - defaultDate: new Date()
  10 + defaultDate: new Date(),
  11 + format: 'L'
10 12 });
11 13 $("#init_date").on("dp.change", function (e) {
12 14 $('#end_date').data("DateTimePicker").minDate(e.date);
... ... @@ -38,7 +40,7 @@ $(document).ready(function(){
38 40 var log = {
39 41  
40 42 refresh_log_data: function(init_date, end_date){
41   - $.get("/dashboards/get_log_data", {init_date: init_date.format("YYYY-MM-DD HH:mm"), end_date: end_date.format("YYYY-MM-DD HH:mm")}).done(function(data){
  43 + $.get("/dashboards/get_log_data", {init_date: init_date.format("YYYY-MM-DD"), end_date: end_date.format("YYYY-MM-DD")}).done(function(data){
42 44 log.render_table("log-body", data);
43 45 })
44 46 },
... ...
dashboards/views.py
... ... @@ -128,9 +128,9 @@ class LogView(LogMixin, generic.TemplateView):
128 128  
129 129 def load_log_data(request):
130 130 params = request.GET
131   - init_date = datetime.strptime(params['init_date'], '%Y-%m-%d %H:%M')
  131 + init_date = datetime.strptime(params['init_date'], '%Y-%m-%d')
132 132  
133   - end_date = datetime.strptime(params['end_date'], '%Y-%m-%d %H:%M')
  133 + end_date = datetime.strptime(params['end_date'], '%Y-%m-%d')
134 134  
135 135 if params.get('category'):
136 136 print("has category")
... ... @@ -145,7 +145,7 @@ def parse_log_queryset_to_JSON(logs):
145 145 datum = {}
146 146 datum['user'] = log.user
147 147 datum['resource'] = log.resource
148   - datum['datetime'] = log.datetime
  148 + datum['datetime'] = log.datetime.strftime("%d/%m/%Y")
149 149 datum['action'] = log.action
150 150 datum['context'] = log.context
151 151 datum['component'] = log.component
... ...