From 4e2aa45b9185a12416f784caa2451f623bf7ae77 Mon Sep 17 00:00:00 2001 From: Carlos Santiago Date: Wed, 6 Sep 2023 11:37:57 -0500 Subject: [PATCH 1/4] Initial project, models, dependencies, docker --- admin_tools_stats/forms.py | 16 +++++++------- admin_tools_stats/templates/admin/index.html | 12 ++++++++--- .../admin_tools_stats/chart_container.html | 21 ++++++++++++------- .../admin_tools_stats/chart_containers.html | 2 +- .../admin_tools_stats/chart_form.html | 14 ++++++++----- 5 files changed, 41 insertions(+), 24 deletions(-) diff --git a/admin_tools_stats/forms.py b/admin_tools_stats/forms.py index 0c5560dd..477c482b 100644 --- a/admin_tools_stats/forms.py +++ b/admin_tools_stats/forms.py @@ -19,7 +19,7 @@ def __init__(self, stats, user=None, *args, **kwargs): ) self.fields[f"select_box_dynamic_{ch_filter.id}"].widget.attrs[ "class" - ] = "chart-input" + ] = "chart-input form-control" self.fields["graph_key"] = forms.CharField( initial=stats.graph_key, @@ -42,7 +42,7 @@ def __init__(self, stats, user=None, *args, **kwargs): ) self.fields["select_box_multiple_series"].widget.attrs[ "class" - ] = "chart-input select_box_multiple_series" + ] = "chart-input form-control select_box_multiple_series" if len(stats.allowed_type_operation_field_name) > 1: self.fields["select_box_operation"] = forms.ChoiceField( @@ -50,7 +50,7 @@ def __init__(self, stats, user=None, *args, **kwargs): label="Operation", initial=stats.type_operation_field_name, ) - self.fields["select_box_operation"].widget.attrs["class"] = "chart-input" + self.fields["select_box_operation"].widget.attrs["class"] = "chart-input form-control" operations_list = stats.get_operations_list() if operations_list and len(operations_list) > 1: @@ -59,7 +59,7 @@ def __init__(self, stats, user=None, *args, **kwargs): label="Field", initial=operations_list[0], ) - self.fields["select_box_operation_field"].widget.attrs["class"] = "chart-input" + self.fields["select_box_operation_field"].widget.attrs["class"] = "chart-input form-control" if len(stats.allowed_time_scales) > 1: self.fields["select_box_interval"] = forms.ChoiceField( @@ -67,7 +67,7 @@ def __init__(self, stats, user=None, *args, **kwargs): label="Scale", initial=stats.default_time_scale, ) - self.fields["select_box_interval"].widget.attrs["class"] = "chart-input" + self.fields["select_box_interval"].widget.attrs["class"] = "chart-input form-control" if len(stats.allowed_chart_types) > 1: self.fields["select_box_chart_type"] = forms.ChoiceField( @@ -77,19 +77,19 @@ def __init__(self, stats, user=None, *args, **kwargs): ) self.fields["select_box_chart_type"].widget.attrs[ "class" - ] = "chart-input select_box_chart_type" + ] = "chart-input form-control select_box_chart_type" self.fields["time_since"] = forms.DateField( label="Since", initial=(now() - timedelta(days=stats.default_time_period)).strftime("%Y-%m-%d"), widget=forms.TextInput( - attrs={"type": "date", "class": "chart-input select_box_date_since"} + attrs={"type": "date", "class": "chart-input form-control select_box_date_since"} ), ) self.fields["time_until"] = forms.DateField( label="Until", initial=now().strftime("%Y-%m-%d"), widget=forms.TextInput( - attrs={"type": "date", "class": "chart-input select_box_date_until"} + attrs={"type": "date", "class": "chart-input form-control select_box_date_until"} ), ) diff --git a/admin_tools_stats/templates/admin/index.html b/admin_tools_stats/templates/admin/index.html index baf85844..f100d566 100644 --- a/admin_tools_stats/templates/admin/index.html +++ b/admin_tools_stats/templates/admin/index.html @@ -12,11 +12,17 @@ padding: 20px 40px; } + {% endblock %} -{% block footer %} +{% block content %} + {{ block.super }} {% if request.resolver_match.view_name == 'admin:index' %} - {% chart_containers %} +
+ {% chart_containers %} +
{% endif %} - {{ block.super }} {% endblock %} + diff --git a/admin_tools_stats/templates/admin_tools_stats/chart_container.html b/admin_tools_stats/templates/admin_tools_stats/chart_container.html index 0cf1cb65..62f294e2 100644 --- a/admin_tools_stats/templates/admin_tools_stats/chart_container.html +++ b/admin_tools_stats/templates/admin_tools_stats/chart_container.html @@ -1,10 +1,17 @@ {% load admin_chart_tags %}
-
-

{{ chart.graph_title }}

- {% get_control_form chart request.user as form %} - {% include "./chart_form.html" %} -
-
-
+
+
+
+
{{ chart.graph_title }}
+
+
+ {% get_control_form chart request.user as form %} + {% include "./chart_form.html" %} +
+ +
+
+
+
diff --git a/admin_tools_stats/templates/admin_tools_stats/chart_containers.html b/admin_tools_stats/templates/admin_tools_stats/chart_containers.html index 060361d8..d27cfc4c 100644 --- a/admin_tools_stats/templates/admin_tools_stats/chart_containers.html +++ b/admin_tools_stats/templates/admin_tools_stats/chart_containers.html @@ -3,6 +3,6 @@ {% include "./chart_container.html" with chart=chart %} {% empty %}

- No charts available, please configure them + No hay gráficas disponibles, configure los gráficos haciendo clic acá

{% endfor %} diff --git a/admin_tools_stats/templates/admin_tools_stats/chart_form.html b/admin_tools_stats/templates/admin_tools_stats/chart_form.html index a414d054..f8f67105 100644 --- a/admin_tools_stats/templates/admin_tools_stats/chart_form.html +++ b/admin_tools_stats/templates/admin_tools_stats/chart_form.html @@ -18,8 +18,8 @@ no-repeat; } -
- ⇒  + + ⇒   {% csrf_token %} {% for w in form %} {% if not w.is_hidden %} @@ -27,9 +27,13 @@ {% endif %} {{ w }} {% endfor %} -   +
+   + {% if chart.cache_values %} -   +   + {% endif %} -  analytics +   + {% comment %} Vista completa {% endcomment %}
From ff9459d633c29c344dae8e55d8a3e7d7bc8331e2 Mon Sep 17 00:00:00 2001 From: Carlos Santiago Date: Wed, 6 Sep 2023 18:07:42 -0500 Subject: [PATCH 2/4] Adding spanish language, Jazzmin theme adaptation --- admin_tools_stats/admin.py | 37 +- admin_tools_stats/apps.py | 3 +- admin_tools_stats/forms.py | 10 +- .../locale/es/LC_MESSAGES/django.po | 431 ++++++ admin_tools_stats/models.py | 57 +- .../admin_tools_stats/analytics.html | 23 +- .../admin_tools_stats/chart_containers.html | 3 +- .../admin_tools_stats/chart_form.html | 7 +- demoproject/demoproject/settings.py | 8 +- demoproject/locale/es/LC_MESSAGES/django.po | 1286 +++++++++++++++++ 10 files changed, 1798 insertions(+), 67 deletions(-) create mode 100644 admin_tools_stats/locale/es/LC_MESSAGES/django.po create mode 100644 demoproject/locale/es/LC_MESSAGES/django.po diff --git a/admin_tools_stats/admin.py b/admin_tools_stats/admin.py index f7129755..de10d9ce 100644 --- a/admin_tools_stats/admin.py +++ b/admin_tools_stats/admin.py @@ -71,6 +71,8 @@ class DashboardStatsCriteriaInline(admin.TabularInline): ) autocomplete_fields = ("criteria",) extra = 0 + verbose_name = _("Criteria") + verbose_name_plural = _("Criterias") def criteria__dynamic_criteria_field_name(self, obj): return format_html( @@ -105,16 +107,8 @@ class DashboardStatsAdmin(admin.ModelAdmin): "fields": ( "graph_key", "graph_title", - ("model_app_name", "model_name", "date_field_name"), - ("operation_field_name", "distinct"), - ("user_field_name", "show_to_users"), - ("allowed_type_operation_field_name", "type_operation_field_name"), - ("allowed_chart_types", "default_chart_type"), - ( - "allowed_time_scales", - "default_time_scale", - "default_time_period", - ), + "operation_field_name", "distinct", + "user_field_name", "show_to_users", "y_axis_format", "default_multiseries_criteria", "is_visible", @@ -122,6 +116,29 @@ class DashboardStatsAdmin(admin.ModelAdmin): ), }, ), + ( _("Related model"), + { + "fields": ("model_app_name", "model_name", "date_field_name"), + } + ), + ( + _("Time scale"), + { + "fields": ( + "allowed_time_scales", + "default_time_scale", + "default_time_period", + ), + } + ), + ( + _("Chart type"),{ + "fields": ("allowed_type_operation_field_name", + "type_operation_field_name", + "allowed_chart_types", + "default_chart_type"), + } + ) ) list_display = ( "id", diff --git a/admin_tools_stats/apps.py b/admin_tools_stats/apps.py index 16961eb8..0dc4413b 100644 --- a/admin_tools_stats/apps.py +++ b/admin_tools_stats/apps.py @@ -1,6 +1,7 @@ from django.apps import AppConfig - +from django.utils.translation import gettext_lazy as _ class AdminChartsConfig(AppConfig): default_auto_field = "django.db.models.BigAutoField" name = "admin_tools_stats" + verbose_name = _("Tools stats") diff --git a/admin_tools_stats/forms.py b/admin_tools_stats/forms.py index 477c482b..7a02c49b 100644 --- a/admin_tools_stats/forms.py +++ b/admin_tools_stats/forms.py @@ -2,7 +2,7 @@ from django import forms from django.utils.timezone import now - +from django.utils.translation import gettext_lazy as _ class ChartSettingsForm(forms.Form): def __init__(self, stats, user=None, *args, **kwargs): @@ -64,7 +64,7 @@ def __init__(self, stats, user=None, *args, **kwargs): if len(stats.allowed_time_scales) > 1: self.fields["select_box_interval"] = forms.ChoiceField( choices=stats.allowed_time_scales_choices(), - label="Scale", + label=_("Scale"), initial=stats.default_time_scale, ) self.fields["select_box_interval"].widget.attrs["class"] = "chart-input form-control" @@ -72,7 +72,7 @@ def __init__(self, stats, user=None, *args, **kwargs): if len(stats.allowed_chart_types) > 1: self.fields["select_box_chart_type"] = forms.ChoiceField( choices=stats.allowed_chart_types_choices(), - label="Chart", + label=_("Chart"), initial=stats.default_chart_type, ) self.fields["select_box_chart_type"].widget.attrs[ @@ -80,14 +80,14 @@ def __init__(self, stats, user=None, *args, **kwargs): ] = "chart-input form-control select_box_chart_type" self.fields["time_since"] = forms.DateField( - label="Since", + label=_("Since"), initial=(now() - timedelta(days=stats.default_time_period)).strftime("%Y-%m-%d"), widget=forms.TextInput( attrs={"type": "date", "class": "chart-input form-control select_box_date_since"} ), ) self.fields["time_until"] = forms.DateField( - label="Until", + label=_("Until"), initial=now().strftime("%Y-%m-%d"), widget=forms.TextInput( attrs={"type": "date", "class": "chart-input form-control select_box_date_until"} diff --git a/admin_tools_stats/locale/es/LC_MESSAGES/django.po b/admin_tools_stats/locale/es/LC_MESSAGES/django.po new file mode 100644 index 00000000..9bdfd860 --- /dev/null +++ b/admin_tools_stats/locale/es/LC_MESSAGES/django.po @@ -0,0 +1,431 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2023-09-06 18:05-0500\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: CARLOS SANTIAGO BENITEZ \n" +"Language-Team: SPANISH \n" +"Language: SPANISH\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: .\admin_tools_stats\admin.py:27 +msgid "Admin Tools Stats" +msgstr "Herramientas estadísticas" + +#: .\admin_tools_stats\admin.py:74 +msgid "Criteria" +msgstr "Criterio de gráficas" + +#: .\admin_tools_stats\admin.py:75 +msgid "Criterias" +msgstr "Criterios de gráficas" + +#: .\admin_tools_stats\admin.py:119 +msgid "Related model" +msgstr "Modelo relacionado" + +#: .\admin_tools_stats\admin.py:125 .\admin_tools_stats\models.py:1012 +msgid "Time scale" +msgstr "Escala de tiempo" + +#: .\admin_tools_stats\admin.py:135 +msgid "Chart type" +msgstr "Tipo de gráfica" + +#: .\admin_tools_stats\apps.py:7 +msgid "Tools stats" +msgstr "Herramientas estadísticas" + +#: .\admin_tools_stats\forms.py:67 +msgid "Scale" +msgstr "Escalar" + +#: .\admin_tools_stats\forms.py:75 +#, fuzzy +#| msgid "Chart type" +msgid "Chart" +msgstr "Tipo de gráfica" + +#: .\admin_tools_stats\forms.py:83 +msgid "Since" +msgstr "Desde" + +#: .\admin_tools_stats\forms.py:90 +msgid "Until" +msgstr "Hasta" + +#: .\admin_tools_stats\models.py:65 +msgid "Count" +msgstr "Contar" + +#: .\admin_tools_stats\models.py:66 +msgid "Sum" +msgstr "Sumar" + +#: .\admin_tools_stats\models.py:67 +msgid "Average" +msgstr "Promedio" + +#: .\admin_tools_stats\models.py:68 +msgid "Average count per active model instance" +msgstr "Recuento promedio por instancia de modelo activo" + +#: .\admin_tools_stats\models.py:69 +msgid "Max" +msgstr "Máximo" + +#: .\admin_tools_stats\models.py:70 +msgid "Min" +msgstr "Mínimo" + +#: .\admin_tools_stats\models.py:71 +msgid "StdDev" +msgstr "Desviación estandar" + +#: .\admin_tools_stats\models.py:72 +msgid "Variance" +msgstr "Varianza" + +#: .\admin_tools_stats\models.py:76 +msgid "Bar" +msgstr "Barras" + +#: .\admin_tools_stats\models.py:77 +msgid "Line" +msgstr "Lineas" + +#: .\admin_tools_stats\models.py:78 +msgid "Multi Bar" +msgstr "Barras múltiples" + +#: .\admin_tools_stats\models.py:79 +msgid "Pie" +msgstr "Torta" + +#: .\admin_tools_stats\models.py:80 +msgid "Stacked Area" +msgstr "Área fija" + +#: .\admin_tools_stats\models.py:81 +msgid "Multi Bar Horizontal" +msgstr "Barras multiples horizontales" + +#: .\admin_tools_stats\models.py:82 +msgid "Line Plus Bar" +msgstr "Lineas y barras" + +#: .\admin_tools_stats\models.py:83 +msgid "Scatter" +msgstr "Puntos" + +#: .\admin_tools_stats\models.py:84 +msgid "Cumulative Line" +msgstr "Linea acumulativa" + +#: .\admin_tools_stats\models.py:85 +msgid "Line With Focus" +msgstr "Linea con enfoque" + +#: .\admin_tools_stats\models.py:88 +msgid "Hours" +msgstr "Horas" + +#: .\admin_tools_stats\models.py:89 +msgid "Days" +msgstr "Días" + +#: .\admin_tools_stats\models.py:90 +msgid "Weeks" +msgstr "Semanas" + +#: .\admin_tools_stats\models.py:91 +msgid "Months" +msgstr "Meses" + +#: .\admin_tools_stats\models.py:92 +msgid "Quarters" +msgstr "Cuartos" + +#: .\admin_tools_stats\models.py:93 +msgid "Years" +msgstr "Años" + +#: .\admin_tools_stats\models.py:185 +msgid "criteria name" +msgstr "Nombre del criterio" + +#: .\admin_tools_stats\models.py:186 +msgid "it needs to be one word unique. Ex. status, yesno" +msgstr "Es una palabra única. Ejemplo: estado, cantidad" + +#: .\admin_tools_stats\models.py:191 +msgid "fixed criteria / value" +msgstr "Valor o criterio fijo" + +#: .\admin_tools_stats\models.py:192 +msgid "a JSON dictionary of key-value pairs that will be used for the criteria" +msgstr "" +"Se indica en formato JSON donde los objetos serán usados para el criterio" + +#: .\admin_tools_stats\models.py:198 +msgid "dynamic criteria field name" +msgstr "Nombre del criterio dinámico" + +#: .\admin_tools_stats\models.py:199 +msgid "ex. for call records - disposition" +msgstr "Ejemplo: usuarios - cantidad" + +#: .\admin_tools_stats\models.py:204 +msgid "dynamic criteria / value" +msgstr "Criterio o valor dinámico" + +#: .\admin_tools_stats\models.py:207 +msgid "" +"a JSON dictionary with records in two following possible formats:
" +"\"key_value\": \"name\"
\"key\": [value, \"name\"]
use blank key for " +"no filter
Example:
{
\"\": [null, \"All\"],
\"True" +"\": [true, \"True\"],
\"False\": [false, \"False\"]
}

Left blank to exploit all choices of CharField with choices" +msgstr "" +"Un diccionario JSON con campos basado en dos posibles formatos:
" +"\"key_value\": \"name\"
\"key\": [value, \"name\"]
Use una key en " +"blanco para no filtrar
Ejemplo:
{
\"\": [null, \"All\"]," +"
\"True\": [true, \"True\"],
\"False\": [false, \"False\"]
}" +"

Left blank to exploit all choices of CharField with choices" + +#: .\admin_tools_stats\models.py:221 .\admin_tools_stats\models.py:419 +msgid "date" +msgstr "Fecha de creación" + +#: .\admin_tools_stats\models.py:222 +msgid "updated_date" +msgstr "Fecha de actualización" + +#: .\admin_tools_stats\models.py:234 .\admin_tools_stats\models.py:235 +msgid "dashboard stats criteria" +msgstr "Criterios de gráficas" + +#: .\admin_tools_stats\models.py:262 +msgid "graph identifier" +msgstr "Identificador de gráfica" + +#: .\admin_tools_stats\models.py:265 +msgid "Only small alphanumeric characters and underscore allowed." +msgstr "Solo cacteres alfanuméricos o guiones bajos." + +#: .\admin_tools_stats\models.py:268 +msgid "it needs to be one word unique. ex. auth, mygraph" +msgstr "Debe ser una palabra única. Ejemplo: migrafica, vehiculos" + +#: .\admin_tools_stats\models.py:273 +msgid "graph title" +msgstr "Título" + +#: .\admin_tools_stats\models.py:274 +msgid "heading title of graph box" +msgstr "Título de gráfica. Ejemplo: Cantidad de usuarios" + +#: .\admin_tools_stats\models.py:278 +msgid "app name" +msgstr "Nombre de la app" + +#: .\admin_tools_stats\models.py:279 +msgid "ex. auth, dialer_cdr" +msgstr "Ejemplo: auth, ubicacion" + +#: .\admin_tools_stats\models.py:283 +msgid "model name" +msgstr "Nombre del modelo" + +#: .\admin_tools_stats\models.py:284 +msgid "ex. User" +msgstr "Ejemplo: User" + +#: .\admin_tools_stats\models.py:288 +msgid "date field name" +msgstr "Nombre del campo de fecha" + +#: .\admin_tools_stats\models.py:289 +msgid "ex. date_joined, invitation__invitation_date" +msgstr "Ejemplo. date_joined, invitation__invitation_date" + +#: .\admin_tools_stats\models.py:293 +msgid "user field name" +msgstr "Nombre de campo de usuario" + +#: .\admin_tools_stats\models.py:297 +msgid "" +"User field that will limit chart data only for currently logged user (if not " +"superuser)
ex. owner, invitation__owner" +msgstr "" +"Campo limitado o oculto según el tipo de usuario (Si no es superusuario)
Ejemplo. funcionario, invitation__usuario" + +#: .\admin_tools_stats\models.py:302 +msgid "show to ordinary users" +msgstr "Mostrar a todos los usuarios" + +#: .\admin_tools_stats\models.py:306 +msgid "Be carefull and test if it still doesn't expose sensitive data" +msgstr "Tener cuidado de no exponer datos sensibles" + +#: .\admin_tools_stats\models.py:310 +msgid "Operate field name" +msgstr "Campo adicional" + +#: .\admin_tools_stats\models.py:314 +msgid "" +"The field you want to aggregate, ex. amount, " +"salaries__total_income.
Can contain multiple fields divided by " +"comma." +msgstr "" +"Es el campo que se desea agregar (agregación), Ejemplo. Cantidad, " +"salaries__total_income.
Puede tener multiples campos divididos " +"por una coma." + +#: .\admin_tools_stats\models.py:323 +msgid "" +"Note: Distinct is supported only for Count, Sum, Avg " +"and 'Avgerage count per active model instance'.
Django>=3.0 is " +"needed for distinct Sum and Avg." +msgstr "" + +#: .\admin_tools_stats\models.py:329 +msgid "cache charts values" +msgstr "Valores de gráficos de cache" + +#: .\admin_tools_stats\models.py:334 +msgid "" +"If chart's values are cached, you will always get cached values, unless you " +"pres reload/reload_all button" +msgstr "" +"Si los valores del gráfico están almacenados en caché, siempre obtendrá " +"valores almacenados en caché, a menos de que presione el botón de refrescar." + +#: .\admin_tools_stats\models.py:340 .\admin_tools_stats\models.py:348 +msgid "Choose Type operation" +msgstr "Seleccione el tipo de operación" + +#: .\admin_tools_stats\models.py:344 +msgid "Choose the type operation what you want to aggregate." +msgstr "" + +#: .\admin_tools_stats\models.py:352 .\admin_tools_stats\models.py:369 +#: .\admin_tools_stats\models.py:391 +msgid "More than one selected field will display chooser on the chart." +msgstr "Mas de un campo seleccionado mostrará un selector en la gráfica." + +#: .\admin_tools_stats\models.py:356 +msgid "Default chart type" +msgstr "Tipo de gráfica por defecto" + +#: .\admin_tools_stats\models.py:364 +msgid "Allowed chart types" +msgstr "Tipos de gráfica permitidos" + +#: .\admin_tools_stats\models.py:372 +msgid "Default period" +msgstr "Periodo por defecto" + +#: .\admin_tools_stats\models.py:373 +msgid "Number of days" +msgstr "Número de días" + +#: .\admin_tools_stats\models.py:379 +msgid "Default time scale" +msgstr "Escala de tiempo por defecto" + +#: .\admin_tools_stats\models.py:388 +msgid "Allowed time scales" +msgstr "Escalas de tiempo permitidas" + +#: .\admin_tools_stats\models.py:395 +msgid "Y axis format" +msgstr "Fomato de eje Y" + +#: .\admin_tools_stats\models.py:397 +msgid "" +"Format of Y axis.See description of possible values." +msgstr "" +"Formato de eje Y.Revisar los posibles valores." + +#: .\admin_tools_stats\models.py:418 +msgid "visible" +msgstr "" + +#: .\admin_tools_stats\models.py:425 .\admin_tools_stats\models.py:426 +msgid "dashboard stats" +msgstr "Estadísticas" + +#: .\admin_tools_stats\models.py:841 +msgid "criteria field prefix" +msgstr "Prefijo del campo de criterio" + +#: .\admin_tools_stats\models.py:843 +msgid "prefix, that will be added befor all lookup paths of criteria" +msgstr "El prefijo sera añadido para realizar busquedas por criterio" + +#: .\admin_tools_stats\models.py:850 +msgid "Use dynamic criteria as" +msgstr "Usar criterio dinámico como" + +#: .\admin_tools_stats\models.py:863 +msgid "Default filter criteria option" +msgstr "Opción de filtro de criterio por defecto" + +#: .\admin_tools_stats\models.py:864 +msgid "Works only with Chart filter criteri" +msgstr "Funciona solo con el filtro por criterio" + +#: .\admin_tools_stats\models.py:869 +msgid "Choices are dependend on chart time range" +msgstr "Las opciones dependenden del rango de tiempo" + +#: .\admin_tools_stats\models.py:870 +msgid "Choices are not cached if this is set to true" +msgstr "Las opciones no se guardan en cache si la opción esta marcada" + +#: .\admin_tools_stats\models.py:1060 +msgid "Cached Value" +msgstr "Valor en caché" + +#: .\admin_tools_stats\models.py:1061 +msgid "Stored Values" +msgstr "Valores en caché" + +#: .\admin_tools_stats\templates\admin_tools_stats\analytics.html:64 +msgid "No charts available, please " +msgstr "No hay gráficas disponibles, por favor" + +#: .\admin_tools_stats\templates\admin_tools_stats\analytics.html:64 +msgid "configure them" +msgstr "configure." + +#: .\admin_tools_stats\templates\admin_tools_stats\chart_containers.html:7 +msgid "There aren't charts for display, please setup making" +msgstr "No hay gráficas disponibles, agregue una haciendo " + +#: .\admin_tools_stats\templates\admin_tools_stats\chart_form.html:36 +msgid "all" +msgstr "Todos" + +#: .\admin_tools_stats\templates\admin_tools_stats\chart_form.html:39 +msgid "analytics" +msgstr "Análisis" + +#, fuzzy +#~| msgid "cache charts values" +#~ msgid "Cached Values" +#~ msgstr "Valores de gráficos de cache" diff --git a/admin_tools_stats/models.py b/admin_tools_stats/models.py index c5f05ec6..3a25b1df 100644 --- a/admin_tools_stats/models.py +++ b/admin_tools_stats/models.py @@ -62,35 +62,35 @@ def get_charts_timezone(): logger = logging.getLogger(__name__) operation = ( - ("Count", "Count"), - ("Sum", "Sum"), - ("Avg", "Avgerage"), - ("AvgCountPerInstance", "Avgerage count per active model instance"), - ("Max", "Max"), - ("Min", "Min"), - ("StdDev", "StdDev"), - ("Variance", "Variance"), + ("Count", _("Count")), + ("Sum", _("Sum")), + ("Avg", _("Average")), + ("AvgCountPerInstance", _("Average count per active model instance")), + ("Max", _("Max")), + ("Min", _("Min")), + ("StdDev", _("StdDev")), + ("Variance", _("Variance")), ) chart_types = ( - ("discreteBarChart", "Bar"), - ("lineChart", "Line"), - ("multiBarChart", "Multi Bar"), - ("pieChart", "Pie"), - ("stackedAreaChart", "Stacked Area"), - ("multiBarHorizontalChart", "Multi Bar Horizontal"), - ("linePlusBarChart", "Line Plus Bar"), - ("scatterChart", "Scatter"), - ("cumulativeLineChart", "Cumulative Line"), - ("lineWithFocusChart", "Line With Focus"), + ("discreteBarChart", _("Bar")), + ("lineChart", _("Line")), + ("multiBarChart", _("Multi Bar")), + ("pieChart", _("Pie")), + ("stackedAreaChart", _("Stacked Area")), + ("multiBarHorizontalChart", _("Multi Bar Horizontal")), + ("linePlusBarChart", _("Line Plus Bar")), + ("scatterChart", _("Scatter")), + ("cumulativeLineChart", _("Cumulative Line")), + ("lineWithFocusChart", _("Line With Focus")), ) time_scales = ( - ("hours", "Hours"), - ("days", "Days"), - ("weeks", "Weeks"), - ("months", "Months"), - ("quarters", "Quarters"), - ("years", "Years"), + ("hours", _("Hours")), + ("days", _("Days")), + ("weeks", _("Weeks")), + ("months", _("Months")), + ("quarters", _("Quarters")), + ("years", _("Years")), ) @@ -204,7 +204,7 @@ class DashboardStatsCriteria(models.Model): verbose_name=_("dynamic criteria / value"), help_text=_( mark_safe( - "a JSON dictionary with records in two following possible formats:" + _("a JSON dictionary with records in two following possible formats:" '
"key_value": "name"' '
"key": [value, "name"]' "
use blank key for no filter" @@ -214,12 +214,12 @@ class DashboardStatsCriteria(models.Model): '
"True": [true, "True"],' '
"False": [false, "False"]' "
}" - "
Left blank to exploit all choices of CharField with choices", + "
Left blank to exploit all choices of CharField with choices") ), ), ) created_date = models.DateTimeField(auto_now_add=True, verbose_name=_("date")) - updated_date = models.DateTimeField(auto_now=True) + updated_date = models.DateTimeField(auto_now=True, verbose_name=_("updated_date")) def criteria_dynamic_mapping_preview(self): if self.criteria_dynamic_mapping: @@ -1055,7 +1055,10 @@ class CachedValue(models.Model): ) class Meta: + app_label = "admin_tools_stats" ordering = ("order",) + verbose_name = _("Cached Value") + verbose_name_plural = _("Stored Values") @receiver(post_save, sender=DashboardStatsCriteria) diff --git a/admin_tools_stats/templates/admin_tools_stats/analytics.html b/admin_tools_stats/templates/admin_tools_stats/analytics.html index aba7318c..f1031050 100644 --- a/admin_tools_stats/templates/admin_tools_stats/analytics.html +++ b/admin_tools_stats/templates/admin_tools_stats/analytics.html @@ -1,5 +1,6 @@ {% extends "admin/base.html" %} {% load admin_chart_tags %} +{% load i18n %} {% load static %} {% block extrastyle %} @@ -26,22 +27,6 @@ .chrt_container svg { bottom: 0px !important; } - #content, .chrt_container { - flex-grow: 1; - } - body { - position: absolute; - top: 0px; - bottom: 0px; - } - #container, .chrt_flex { - display: flex !important; - flex-direction: column !important; - } - #container, .admin_charts, .chrt_flex, .chrt_container, .chrt_svg_container { - height: 100%; - position: relative; - } .modal { display: none; @@ -73,14 +58,14 @@ {% block content %} {% for chart in nonuser_charts %} - + {% empty %}

- No charts available, please configure them + {% trans "No charts available, please " %}{% trans "configure them" %}

{% endfor %} {% for chart in charts %} -
+
{% endfor %}