From c22c62bc0a7f685b3dbcb83d2e690efabfdd0e01 Mon Sep 17 00:00:00 2001 From: Rafael JPD Date: Thu, 13 Jun 2024 23:48:40 -0300 Subject: [PATCH 01/56] =?UTF-8?q?Remove=20template=20relacionado=20=C3=A0?= =?UTF-8?q?=20composi=C3=A7=C3=A3o=20de=20Issues?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../website/publication_size_issues.mako | 22 ------------------- 1 file changed, 22 deletions(-) delete mode 100644 analytics/templates/website/publication_size_issues.mako diff --git a/analytics/templates/website/publication_size_issues.mako b/analytics/templates/website/publication_size_issues.mako deleted file mode 100644 index 76a7a2b..0000000 --- a/analytics/templates/website/publication_size_issues.mako +++ /dev/null @@ -1,22 +0,0 @@ -## coding: utf-8 -
-

- - -
${_(u'loading')}
-
-
- ${_(u'fascículos')} -

-
- From 0837089a703f97e462ac168c13647b1403366659 Mon Sep 17 00:00:00 2001 From: Rafael JPD Date: Thu, 13 Jun 2024 23:53:06 -0300 Subject: [PATCH 02/56] =?UTF-8?q?Remove=20inclus=C3=A3o=20de=20template=20?= =?UTF-8?q?de=20issues=20em=20outros=20templates?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- analytics/templates/website/home_collection.mako | 9 +++------ analytics/templates/website/home_journal.mako | 7 ++----- analytics/templates/website/home_network.mako | 9 +++------ 3 files changed, 8 insertions(+), 17 deletions(-) diff --git a/analytics/templates/website/home_collection.mako b/analytics/templates/website/home_collection.mako index 0139893..70548f4 100644 --- a/analytics/templates/website/home_collection.mako +++ b/analytics/templates/website/home_collection.mako @@ -6,16 +6,13 @@

${_(u'Composição da coleção')}

-
+
<%include file="publication_size_journals.mako"/>
-
- <%include file="publication_size_issues.mako"/> -
-
+
<%include file="publication_size_documents.mako"/>
-
+
<%include file="publication_size_citations.mako"/>
diff --git a/analytics/templates/website/home_journal.mako b/analytics/templates/website/home_journal.mako index 90949a8..bb06dc0 100644 --- a/analytics/templates/website/home_journal.mako +++ b/analytics/templates/website/home_journal.mako @@ -6,13 +6,10 @@

${_(u'Composição da coleção')}

-
- <%include file="publication_size_issues.mako"/> -
-
+
<%include file="publication_size_documents.mako"/>
-
+
<%include file="publication_size_citations.mako"/>
diff --git a/analytics/templates/website/home_network.mako b/analytics/templates/website/home_network.mako index 0b46d61..c21450d 100644 --- a/analytics/templates/website/home_network.mako +++ b/analytics/templates/website/home_network.mako @@ -6,16 +6,13 @@

${_(u'Composição da coleção')}

-
+
<%include file="publication_size_journals.mako"/>
-
- <%include file="publication_size_issues.mako"/> -
-
+
<%include file="publication_size_documents.mako"/>
-
+
<%include file="publication_size_citations.mako"/>
From 2dcd47d0d1797b5184fa26efb36d4363e9dca637 Mon Sep 17 00:00:00 2001 From: Rafael JPD Date: Thu, 13 Jun 2024 23:55:39 -0300 Subject: [PATCH 03/56] =?UTF-8?q?Adiciona=20rota=20relacionada=20=C3=A0=20?= =?UTF-8?q?tela=20de=20acessos=20por=20idioma=20de=20documento?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- analytics/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/analytics/__init__.py b/analytics/__init__.py index c2f737f..65fb620 100644 --- a/analytics/__init__.py +++ b/analytics/__init__.py @@ -36,6 +36,7 @@ def add_chartsconfig(request): config.add_route('reports', '/w/reports') config.add_route('usage_report_chart', '/ajx/usage/usage_report_chart') config.add_route('accesses_web', '/w/accesses') + config.add_route('accesses_list_journals_language', '/w/accesses/list/journals/language') config.add_route('accesses_journal_usage_data_web', '/w/accesses/journal/usage_data') config.add_route('publication_size_web', '/w/publication/size') config.add_route('publication_size', '/ajx/publication/size') From c3b416356d5d7986aac220fd4eacc9acd413bb01 Mon Sep 17 00:00:00 2001 From: Rafael JPD Date: Thu, 13 Jun 2024 23:59:27 -0300 Subject: [PATCH 04/56] Adiciona conversor de json sushi p/tabela de acessos gerais e por idioma --- analytics/controller.py | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/analytics/controller.py b/analytics/controller.py index 1ddcff4..e5adc94 100644 --- a/analytics/controller.py +++ b/analytics/controller.py @@ -1033,6 +1033,35 @@ def _get_j1_chart(self, json_results): } return chart_data + + def _title_report_to_table_data(self, json_results): + data = [] + + for i in json_results.get('Report_Items', [{},]): + if i.get('Title', '') == '': + continue + + i_res = { + 'title': i['Title'], + 'article_language': choices.ISO_639_1.get(i.get('Article_Language', '').upper(), 'Undefined'), + 'unique_item_requests': 0, + 'total_item_requests': 0 + } + i_res.update({x['Type']: x['Value'] for x in i['Item_ID']}) + i_res['issn'] = i_res.get('Print_ISSN') or i_res.get('Online_ISSN') or '' + + for p in i.get('Performance', {}): + p_metric_label = p.get('Instance', {}).get('Metric_Type', '') + p_metric_value = p.get('Instance', {}).get('Count', 0) + + if p_metric_label == 'Unique_Item_Requests': + i_res['unique_item_requests'] += int(p_metric_value) + elif p_metric_label == 'Total_Item_Requests': + i_res['total_item_requests'] += int(p_metric_value) + + data.append(i_res) + + return sorted(data, key=lambda x: x.get('total_item_requests', 0), reverse=True) def get_usage_report(self, issn, collection, begin_date, end_date, granularity='monthly', report_code='tr_j1', api_version='v2'): url_tr = urllib.parse.urljoin(self.base_url, 'reports/%s' % report_code) From 268fabfc7c34f47930c7efd30aa3108a93a8f06a Mon Sep 17 00:00:00 2001 From: Rafael JPD Date: Fri, 14 Jun 2024 00:10:30 -0300 Subject: [PATCH 05/56] =?UTF-8?q?Melhora=20m=C3=A9todo=20que=20limpa=20par?= =?UTF-8?q?=C3=A2metros=20de=20URL=20para=20consulta=20SUSHI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- analytics/controller.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/analytics/controller.py b/analytics/controller.py index e5adc94..6eba00c 100644 --- a/analytics/controller.py +++ b/analytics/controller.py @@ -994,15 +994,15 @@ def _format_date(self, date): return ms_unix_epoch - def _clean_params_according_to_report(self, params, report_code): - attrs_to_remove = set() + def _clean_url_params(self, params, report_code): + attrs_to_remove = set([k for k, v in params.items() if v is None or v == '']) if report_code == 'cr_j1': - attrs_to_remove = ('issn', 'pid',) + attrs_to_remove = attrs_to_remove.union(set(['issn', 'pid',])) elif report_code == 'ir_a1': - attrs_to_remove = ('issn',) + attrs_to_remove = attrs_to_remove.union(set(['issn',])) elif report_code == 'tr_j1': - attrs_to_remove = ('pid',) + attrs_to_remove = attrs_to_remove.union(set(['pid',])) for attr in attrs_to_remove: if attr in params: @@ -1075,7 +1075,7 @@ def get_usage_report(self, issn, collection, begin_date, end_date, granularity=' 'api': api_version, } - self._clean_params_according_to_report(params, report_code) + self._clean_url_params(params, report_code) response = requests.get( url=url_tr, From 7bfd1272f717c577adad0c7383534fd09d8e6609 Mon Sep 17 00:00:00 2001 From: Rafael JPD Date: Fri, 14 Jun 2024 00:13:23 -0300 Subject: [PATCH 06/56] Organiza chamada a conversores de json sushi para table ou chart --- analytics/controller.py | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/analytics/controller.py b/analytics/controller.py index 6eba00c..c5d3a67 100644 --- a/analytics/controller.py +++ b/analytics/controller.py @@ -1063,8 +1063,8 @@ def _title_report_to_table_data(self, json_results): return sorted(data, key=lambda x: x.get('total_item_requests', 0), reverse=True) - def get_usage_report(self, issn, collection, begin_date, end_date, granularity='monthly', report_code='tr_j1', api_version='v2'): - url_tr = urllib.parse.urljoin(self.base_url, 'reports/%s' % report_code) + def get_usage_report(self, issn, collection, begin_date, end_date, granularity='monthly', report_code='tr_j1', api_version='v2', target='chart'): + url_report = urllib.parse.urljoin(self.base_url, 'reports/%s' % report_code) params = { 'issn': issn, @@ -1078,7 +1078,7 @@ def get_usage_report(self, issn, collection, begin_date, end_date, granularity=' self._clean_url_params(params, report_code) response = requests.get( - url=url_tr, + url=url_report, params=params ) @@ -1087,7 +1087,15 @@ def get_usage_report(self, issn, collection, begin_date, end_date, granularity=' except requests.HTTPError: ... - if response.status_code == 200 and report_code in ('cr_j1', 'tr_j1'): - return self._get_j1_chart(response.json()) + if response.status_code == 200: + if report_code in ('cr_j1', 'tr_j1', 'lr_j1'): + if target == 'chart': + return self._title_report_to_chart_data(response.json()) + elif target == 'table': + return self._title_report_to_table_data(response.json()) + + if report_code in ('gr_j1',): + if target == 'chart': + return self._geolocation_title_report_to_chart_data(response.json()) return {} From b5705ff09980899211cbe80be1827e542c6c3358 Mon Sep 17 00:00:00 2001 From: Rafael JPD Date: Fri, 14 Jun 2024 00:14:23 -0300 Subject: [PATCH 07/56] Renomeia conversor existente e cria dois novos para tabela e geomap --- analytics/controller.py | 42 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 40 insertions(+), 2 deletions(-) diff --git a/analytics/controller.py b/analytics/controller.py index c5d3a67..5539e26 100644 --- a/analytics/controller.py +++ b/analytics/controller.py @@ -1008,11 +1008,11 @@ def _clean_url_params(self, params, report_code): if attr in params: del params[attr] - def _get_j1_chart(self, json_results): + def _title_report_to_chart_data(self, json_results): serie_total_requests = [] serie_unique_requests = [] - for i in json_results.get('Report_Items', {}): + for i in json_results.get('Report_Items', [{},]): for p in i.get('Performance', {}): p_metric_label = p.get('Instance', {}).get('Metric_Type', '') p_metric_value = p.get('Instance', {}).get('Count', 0) @@ -1099,3 +1099,41 @@ def get_usage_report(self, issn, collection, begin_date, end_date, granularity=' return self._geolocation_title_report_to_chart_data(response.json()) return {} + + + def _geolocation_title_report_to_chart_data(self, json_results): + country_to_metrics = {} + + for i in json_results.get('Report_Items', {}): + code = i['Access_Country_Code_'] + if code not in country_to_metrics: + country_to_metrics[code] = {'Total_Item_Requests': 0} + + for p in i.get('Performance', {}): + p_metric_label = p.get('Instance', {}).get('Metric_Type', '') + + if p_metric_label == 'Total_Item_Requests': + p_metric_value = p.get('Instance', {}).get('Count', 0) + country_to_metrics[code][p_metric_label] += int(p_metric_value) + + return [{'value': v['Total_Item_Requests'], 'code': k, 'name': k} for k, v in country_to_metrics.items() if v['Total_Item_Requests'] > 0] + + + def _item_report_to_table_data(self, json_results): + data = [] + + for i in json_results.get('Report_Items', {}): + i_res = {'code': '', 'total_item_requests': 0, 'unique_item_requests': 0} + for p in i.get('Performance', {}): + p_metric_label = p.get('Instance', {}).get('Metric_Type', '') + p_metric_value = p.get('Instance', {}).get('Count', 0) + + if p_metric_label == 'Total_Item_Requests': + i_res['total_item_requests'] += int(p_metric_value) + elif p_metric_label == 'Unique_Item_Requests': + i_res['unique_item_requests'] += int(p_metric_value) + + if i_res['total_item_requests'] > 0: + data.append(i_res) + + return data From 1476cf7fcad39be95a494f1736923d43d1d2d746 Mon Sep 17 00:00:00 2001 From: Rafael JPD Date: Fri, 14 Jun 2024 00:15:36 -0300 Subject: [PATCH 08/56] =?UTF-8?q?Importa=20choices=20p/convers=C3=A3o=20de?= =?UTF-8?q?=20termo=20pt=20para=20Portuguese=20e=20afins?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- analytics/controller.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/analytics/controller.py b/analytics/controller.py index 5539e26..f5f8e96 100644 --- a/analytics/controller.py +++ b/analytics/controller.py @@ -15,7 +15,7 @@ from citedby import custom_query from altmetric import Altmetric, AltmetricHTTPException -from analytics import utils +from analytics import choices, utils PAGE_SIZE = 20 From a2354d6de188cd5af2874fbc7eac86d65e835d0d Mon Sep 17 00:00:00 2001 From: Rafael JPD Date: Fri, 14 Jun 2024 00:16:36 -0300 Subject: [PATCH 09/56] =?UTF-8?q?Adiciona=20template=20para=20visualizar?= =?UTF-8?q?=20tabela=20de=20acessos=20aos=20peri=C3=B3dicos?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../website/accesses_list_journals.mako | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 analytics/templates/website/accesses_list_journals.mako diff --git a/analytics/templates/website/accesses_list_journals.mako b/analytics/templates/website/accesses_list_journals.mako new file mode 100644 index 0000000..0194ca5 --- /dev/null +++ b/analytics/templates/website/accesses_list_journals.mako @@ -0,0 +1,32 @@ +## coding: utf-8 +<%inherit file="central_container_without_filters.mako"/> + +<%block name="central_container"> + <%include file="access_datepicker.mako"/> +

${_(u'Acessos aos documentos por periódico')}

+ + + + + + + % for item in usage: + + + + + + % endfor +
${_(u'Periódico')}${_(u'Requisições Únicas')}${_(u'Requisições Totais')}
+ + + + + ${item['title']} + + ${item['unique_item_requests']}${item['total_item_requests']}
+ + +<%block name="extra_js"> + + \ No newline at end of file From d682cf9a4fc107121cf82e3d0e68b032390e3859 Mon Sep 17 00:00:00 2001 From: Rafael JPD Date: Fri, 14 Jun 2024 00:18:08 -0300 Subject: [PATCH 10/56] Adiciona view (geral e idioma) e rota (geral) p/tabela de acessos --- analytics/__init__.py | 1 + analytics/views_website.py | 39 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/analytics/__init__.py b/analytics/__init__.py index 65fb620..f54b82b 100644 --- a/analytics/__init__.py +++ b/analytics/__init__.py @@ -36,6 +36,7 @@ def add_chartsconfig(request): config.add_route('reports', '/w/reports') config.add_route('usage_report_chart', '/ajx/usage/usage_report_chart') config.add_route('accesses_web', '/w/accesses') + config.add_route('accesses_list_journals_web', '/w/accesses/list/journals') config.add_route('accesses_list_journals_language', '/w/accesses/list/journals/language') config.add_route('accesses_journal_usage_data_web', '/w/accesses/journal/usage_data') config.add_route('publication_size_web', '/w/publication/size') diff --git a/analytics/views_website.py b/analytics/views_website.py index 9197f9e..ac20152 100644 --- a/analytics/views_website.py +++ b/analytics/views_website.py @@ -161,6 +161,45 @@ def accesses(request): return data +@view_config(route_name='accesses_list_journals_web', renderer='templates/website/accesses_list_journals.mako') +@base_data_manager +def accesses_list_journals(request): + + data = request.data_manager + data['page'] = 'accesses' + + data['usage'] = request.stats.usage.get_usage_report( + issn=data['selected_code'] if len(data['selected_code']) >= 8 else '', + collection=data['selected_collection_code'], + begin_date=data['range_start'], + end_date=data['range_end'], + granularity='totals', + report_code='tr_j1', + target='table', + ) + + return data + + +@view_config(route_name='accesses_list_journals_language', renderer='templates/website/accesses_list_journals_language.mako') +@base_data_manager +def accesses_list_journals_language(request): + + data = request.data_manager + data['page'] = 'accesses' + + data['usage'] = request.stats.usage.get_usage_report( + issn=data['selected_code'] if len(data['selected_code']) >= 8 else '', + collection=data['selected_collection_code'], + begin_date=data['range_start'], + end_date=data['range_end'], + granularity='totals', + report_code='lr_j1', + target='table', + ) + + return data + @view_config(route_name='accesses_journal_usage_data_web', renderer='templates/website/accesses_journal_usage_data.mako') @base_data_manager def accesses_journal_usage_data_web(request): From 40369dfdbdfb59c2bf1ca85a4037dc1984f2065e Mon Sep 17 00:00:00 2001 From: Rafael JPD Date: Fri, 14 Jun 2024 00:20:28 -0300 Subject: [PATCH 11/56] Adiciona links no menu para visualizar tabela de acessos --- analytics/templates/website/navbar_collection.mako | 2 ++ analytics/templates/website/navbar_journal.mako | 2 ++ 2 files changed, 4 insertions(+) diff --git a/analytics/templates/website/navbar_collection.mako b/analytics/templates/website/navbar_collection.mako index b561f86..5c12508 100644 --- a/analytics/templates/website/navbar_collection.mako +++ b/analytics/templates/website/navbar_collection.mako @@ -7,6 +7,8 @@
  • diff --git a/analytics/templates/website/navbar_journal.mako b/analytics/templates/website/navbar_journal.mako index 8360614..cd59dc4 100644 --- a/analytics/templates/website/navbar_journal.mako +++ b/analytics/templates/website/navbar_journal.mako @@ -8,6 +8,8 @@
  • From 7771bf175a42deecb212eb5f2b7c91d8d74df4cd Mon Sep 17 00:00:00 2001 From: Rafael JPD Date: Fri, 14 Jun 2024 00:21:00 -0300 Subject: [PATCH 12/56] =?UTF-8?q?Adiciona=20template=20de=20tabela=20de=20?= =?UTF-8?q?acessos=20aos=20peri=C3=B3dicos=20por=20idioma?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../accesses_list_journals_language.mako | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 analytics/templates/website/accesses_list_journals_language.mako diff --git a/analytics/templates/website/accesses_list_journals_language.mako b/analytics/templates/website/accesses_list_journals_language.mako new file mode 100644 index 0000000..c4ebf8a --- /dev/null +++ b/analytics/templates/website/accesses_list_journals_language.mako @@ -0,0 +1,34 @@ +## coding: utf-8 +<%inherit file="central_container_without_filters.mako"/> + +<%block name="central_container"> + <%include file="access_datepicker.mako"/> +

    ${_(u'Acessos aos periódicos por idioma de documento')}

    + + + + + + + + % for item in usage: + + + + + + + % endfor +
    ${_(u'Periódico')}${_(u'Idioma de documento')}${_(u'Requisições Únicas')}${_(u'Requisições Totais')}
    + + + + + ${item['title']} + + ${item['article_language']}${item['unique_item_requests']}${item['total_item_requests']}
    + + +<%block name="extra_js"> + + \ No newline at end of file From f64d09568e0200c720137b1ce2f9de867c2d7657 Mon Sep 17 00:00:00 2001 From: Rafael JPD Date: Fri, 14 Jun 2024 00:21:20 -0300 Subject: [PATCH 13/56] =?UTF-8?q?Adiciona=20template=20para=20mostrar=20ma?= =?UTF-8?q?pa=20de=20acessos=20por=20pa=C3=ADs=20de=20origem?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- analytics/templates/website/usage_gr_j1.mako | 22 ++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 analytics/templates/website/usage_gr_j1.mako diff --git a/analytics/templates/website/usage_gr_j1.mako b/analytics/templates/website/usage_gr_j1.mako new file mode 100644 index 0000000..35659cc --- /dev/null +++ b/analytics/templates/website/usage_gr_j1.mako @@ -0,0 +1,22 @@ +## coding: utf-8 +
    + + +
    ${_(u'Carregando')}
    +
    +
    + From 585155285d8736718cbf154c8076355032314cc4 Mon Sep 17 00:00:00 2001 From: Rafael JPD Date: Fri, 14 Jun 2024 00:22:07 -0300 Subject: [PATCH 14/56] =?UTF-8?q?Adiciona=20configura=C3=A7=C3=A3o=20de=20?= =?UTF-8?q?gr=C3=A1fico=20para=20mapa=20de=20acessos=20por=20pa=C3=ADs=20d?= =?UTF-8?q?e=20origem?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- analytics/charts_config.py | 40 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/analytics/charts_config.py b/analytics/charts_config.py index 7a161c2..ed43095 100644 --- a/analytics/charts_config.py +++ b/analytics/charts_config.py @@ -136,6 +136,46 @@ def usage_report(self, data): return {'options': chart} + def usage_report_geolocation(self, data): + chart = self.highchart + del chart['chart'] + del chart['legend'] + del chart['yAxis'] + + chart['credits'] = {'href': 'https://usage.apis.scielo.br','text': self._(u'Fonte: SciELO SUSHI API')} + chart['title'] = {'text': self._(u'Acessos por país de origem')} + chart['legend'] = { + 'title': { + 'text': self._(u'Total de acessos') + } + } + chart['colorAxis'] = { + 'min': 1, + 'max': max([k['value'] for k in data]), + 'type': 'logarithmic' + } + chart['mapNavigation'] = { + 'enabled': True, + 'buttonOptions': { + 'verticalAlign': 'bottom' + } + } + chart['series'] = [{ + 'data': data, + 'joinBy': ['iso-a2', 'code'], + 'name': self._(u'Total de acessos'), + 'states': { + 'hover': { + 'color': '#BADA55' + } + } + }] + chart['tooltip'] = { + 'headerFormat': '', + 'pointFormat': u'\u25CF' + self._(u'País de origem de acesso') + ' {point.name}
    {series.name}: {point.value}' + } + return {'options': chart} + def bibliometrics_google_h5m5(self, data): chart = self.highchart From e1b05c5320a857ae1993f7ada8abe1368fd497b0 Mon Sep 17 00:00:00 2001 From: Rafael JPD Date: Fri, 14 Jun 2024 00:23:13 -0300 Subject: [PATCH 15/56] =?UTF-8?q?Inclui=20mapa=20de=20acessos=20por=20pa?= =?UTF-8?q?=C3=ADs=20de=20origem=20em=20templates?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- analytics/templates/website/accesses.mako | 15 ++++++++++++--- analytics/templates/website/home_journal.mako | 6 ++++++ 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/analytics/templates/website/accesses.mako b/analytics/templates/website/accesses.mako index a8a80e9..3e54e4f 100644 --- a/analytics/templates/website/accesses.mako +++ b/analytics/templates/website/accesses.mako @@ -1,15 +1,24 @@ ## coding: utf-8 -<%inherit file="central_container_for_article_filters.mako"/> +<%inherit file="central_container_without_filters.mako"/> <%block name="central_container"> <%include file="access_datepicker.mako"/> -

    ${_(u'Gráfico da evolução de acessos aos documentos')}

    - % if selected_journal_code: + % if selected_journal_code: +

    ${_(u'Gráfico da evolução de acessos aos documentos')}

    +
    <%include file="usage_tr_j1.mako"/> +
    +

    ${_(u'Mapa de acessos por país de origem')}

    +
    + <%include file="usage_gr_j1.mako"/> +
    % else: +

    ${_(u'Gráfico da evolução de acessos aos documentos da coleção')}

    +
    <%include file="usage_cr_j1.mako"/> +
    % endif
    diff --git a/analytics/templates/website/home_journal.mako b/analytics/templates/website/home_journal.mako index bb06dc0..7f15e18 100644 --- a/analytics/templates/website/home_journal.mako +++ b/analytics/templates/website/home_journal.mako @@ -30,6 +30,12 @@ <%include file="usage_tr_j1.mako"/>
  • + +
    +
    + <%include file="usage_gr_j1.mako"/> +
    +
    From 8ea614060657af53366a0464f1e9e947d53f6fc4 Mon Sep 17 00:00:00 2001 From: Rafael JPD Date: Fri, 14 Jun 2024 00:24:03 -0300 Subject: [PATCH 16/56] =?UTF-8?q?Atualiza=20view=20p/obter=20dados=20por?= =?UTF-8?q?=20m=C3=AAs=20(para=20gr=C3=A1fico=20de=20linha=20j=C3=A1=20exi?= =?UTF-8?q?stente)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- analytics/views_ajax.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/analytics/views_ajax.py b/analytics/views_ajax.py index ea72eec..2c279a6 100644 --- a/analytics/views_ajax.py +++ b/analytics/views_ajax.py @@ -74,6 +74,7 @@ def usage_report_chart(request): range_start = request.GET.get('range_start', None) range_end = request.GET.get('range_end', None) report_code = request.GET.get('report_code', 'tr_j1') + granularity = request.GET.get('granularity', 'monthly') selected_code = data['selected_code'] selected_collection_code = data['selected_collection_code'] @@ -84,8 +85,12 @@ def usage_report_chart(request): end_date = range_end, report_code = report_code, api_version = api_version, + granularity = granularity, ) + if report_code == 'gr_j1': + return request.chartsconfig.usage_report_geolocation(data_chart) + return request.chartsconfig.usage_report(data_chart) From 4cbaae52957f1fb31ce9da8412a7acf0975cbbb9 Mon Sep 17 00:00:00 2001 From: Rafael JPD Date: Fri, 14 Jun 2024 00:26:26 -0300 Subject: [PATCH 17/56] =?UTF-8?q?Padroniza=20algumas=20tradu=C3=A7=C3=B5es?= =?UTF-8?q?=20(loading=20para=20Carregando,=20entre=20outras)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- analytics/charts_config.py | 2 +- .../website/bibliometrics_journal_h5m5.mako | 2 +- ...journal_jcr_average_impact_factor_percentile.mako | 2 +- .../bibliometrics_journal_jcr_eigen_factor.mako | 2 +- .../bibliometrics_journal_jcr_impact_factor.mako | 2 +- ...bibliometrics_journal_jcr_received_citations.mako | 2 +- .../templates/website/journal_selector_modal.mako | 8 ++++---- analytics/templates/website/navbar_document.mako | 2 +- .../website/publication_article_affiliations.mako | 2 +- .../publication_article_affiliations_map.mako | 2 +- ...cation_article_affiliations_publication_year.mako | 2 +- .../website/publication_article_authors.mako | 2 +- .../publication_article_citable_documents.mako | 2 +- .../website/publication_article_document_type.mako | 2 +- ...ation_article_document_type_publication_year.mako | 2 +- .../website/publication_article_languages.mako | 2 +- ...blication_article_languages_publication_year.mako | 2 +- .../website/publication_article_licenses.mako | 2 +- ...ublication_article_licenses_publication_year.mako | 2 +- .../website/publication_article_references.mako | 2 +- .../website/publication_article_subject_areas.mako | 2 +- ...ation_article_subject_areas_publication_year.mako | 2 +- .../templates/website/publication_article_year.mako | 2 +- .../website/publication_journal_licenses.mako | 2 +- .../website/publication_journal_status.mako | 2 +- .../website/publication_journal_subject_areas.mako | 2 +- .../templates/website/publication_journal_year.mako | 2 +- .../website/publication_size_citations.mako | 4 ++-- .../website/publication_size_documents.mako | 4 ++-- .../templates/website/publication_size_journals.mako | 4 ++-- analytics/templates/website/reports.mako | 12 ++++++------ analytics/templates/website/usage_cr_j1.mako | 2 +- analytics/templates/website/usage_tr_j1.mako | 2 +- 33 files changed, 44 insertions(+), 44 deletions(-) diff --git a/analytics/charts_config.py b/analytics/charts_config.py index ed43095..0253db6 100644 --- a/analytics/charts_config.py +++ b/analytics/charts_config.py @@ -119,7 +119,7 @@ def usage_report(self, data): chart = self.highchart chart['credits'] = {'href': 'https://usage.apis.scielo.br','text': self._(u'Fonte: SciELO SUSHI API')} - chart['title'] = {'text': self._(u'Total de acessos por ano e mês (API SUSHI)')} + chart['title'] = {'text': self._(u'Total de acessos por ano e mês')} chart['series'] = data['series'] chart['legend'] = {'enabled': True} chart['yAxis']['title'] = {'text': self._(u'Métricas')} diff --git a/analytics/templates/website/bibliometrics_journal_h5m5.mako b/analytics/templates/website/bibliometrics_journal_h5m5.mako index d6dc487..8ba9554 100644 --- a/analytics/templates/website/bibliometrics_journal_h5m5.mako +++ b/analytics/templates/website/bibliometrics_journal_h5m5.mako @@ -2,7 +2,7 @@
    -
    ${_(u'loading')}
    +
    ${_(u'Carregando')}