summaryrefslogtreecommitdiff
path: root/ishtar_common
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2023-01-09 18:49:20 +0100
committerÉtienne Loks <etienne.loks@iggdrasil.net>2023-01-09 18:49:20 +0100
commitac839d9481b863c93a9c0f92011118bb581f7c2d (patch)
tree327417278d0390255434258f7ab8c41d31bf213a /ishtar_common
parentbf2f51538bac27ee9716e3acd3383c8ee535d33f (diff)
downloadIshtar-ac839d9481b863c93a9c0f92011118bb581f7c2d.tar.bz2
Ishtar-ac839d9481b863c93a9c0f92011118bb581f7c2d.zip
UI bootstrap for stats
Diffstat (limited to 'ishtar_common')
-rw-r--r--ishtar_common/models_imports.py5
-rw-r--r--ishtar_common/templates/blocks/DataTables-stats.html70
2 files changed, 43 insertions, 32 deletions
diff --git a/ishtar_common/models_imports.py b/ishtar_common/models_imports.py
index b61d591b1..6358f070a 100644
--- a/ishtar_common/models_imports.py
+++ b/ishtar_common/models_imports.py
@@ -179,7 +179,10 @@ class ImporterType(models.Model):
)
is_template = models.BooleanField(_("Can be exported"), default=False)
unicity_keys = models.CharField(
- _('Unicity keys (separator ";")'), blank=True, null=True, max_length=500
+ _('Unicity keys (separator ";")'), blank=True, null=True, max_length=500,
+ help_text=_("Mandatory for update importer. Set to key that identify items "
+ "without ambiguity. Warning: __ is not supported, only use level "
+ "1 key.")
)
available = models.BooleanField(_("Available"), default=True)
objects = ImporterTypeManager()
diff --git a/ishtar_common/templates/blocks/DataTables-stats.html b/ishtar_common/templates/blocks/DataTables-stats.html
index aae2bb91f..d443a7721 100644
--- a/ishtar_common/templates/blocks/DataTables-stats.html
+++ b/ishtar_common/templates/blocks/DataTables-stats.html
@@ -3,37 +3,45 @@
</style>
<div>
<div id="stats-form-{{name}}">
- <p class="text-center">
- <label for="stats_modality_1-{{name}}">{% trans "Modality 1" %}</label>
- <select id="stats_modality_1-{{name}}" name="stats_modality_1">
- {% for modality, modality_lbl in current_model.STATISTIC_MODALITIES_OPTIONS.items %}
- <option value="{{modality}}"{% if forloop.first %} selected='selected'{% endif %}>{{modality_lbl}}</option>
- {% endfor %}
- </select>
- <label for="stats_modality_2-{{name}}">{% trans "Modality 2" %}</label>
- <select id="stats_modality_2-{{name}}" name="stats_modality_2">
- <option value="" selected='selected'>--</option>
- {% for modality, modality_lbl in current_model.STATISTIC_MODALITIES_OPTIONS.items %}
- <option value="{{modality}}">{{modality_lbl}}</option>
- {% endfor %}
- </select>
- </p>
- <p class="text-center">
- <label for="stats_renderer-{{name}}">{% trans "Type" %}</label>
- <select id="stats_renderer-{{name}}" name="stats_renderer">
- <option value="bar" selected='selected'>{% trans "Bar" %}</option>
- <option value="line">{% trans "Line" %}</option>
- <option value="pie">{% trans "Pie" %}</option>
- <option value="table">{% trans "Table" %}</option>
- </select>
- <label for="stats_sum-{{name}}">{% trans "Sum" %}</label>
- <select id="stats_sum-{{name}}" name="stats_sum">
- {% for sum_var, sum_var_lbl in current_model.STATISTIC_SUM_VARIABLE.items %}
- <option value="{{sum_var}}"{% if forloop.first %}
- selected='selected'{% endif %}>{{sum_var_lbl.0}}</option>
- {% endfor %}
- </select>
- </p>
+ <div class="form-row">
+ <div class="col-6 col-lg-3 offset-lg-3">
+ <label for="stats_modality_1-{{name}}">{% trans "Modality 1" %}</label>
+ <select class="form-control" id="stats_modality_1-{{name}}" name="stats_modality_1">
+ {% for modality, modality_lbl in current_model.STATISTIC_MODALITIES_OPTIONS.items %}
+ <option value="{{modality}}"{% if forloop.first %} selected='selected'{% endif %}>{{modality_lbl}}</option>
+ {% endfor %}
+ </select>
+ </div>
+ <div class="col-6 col-lg-3">
+ <label for="stats_modality_2-{{name}}">{% trans "Modality 2" %}</label>
+ <select class="form-control" id="stats_modality_2-{{name}}" name="stats_modality_2">
+ <option value="" selected='selected'>--</option>
+ {% for modality, modality_lbl in current_model.STATISTIC_MODALITIES_OPTIONS.items %}
+ <option value="{{modality}}">{{modality_lbl}}</option>
+ {% endfor %}
+ </select>
+ </div>
+ </div>
+ <div class="form-row">
+ <div class="col-6 col-lg-3 offset-lg-3">
+ <label for="stats_renderer-{{name}}">{% trans "Type" %}</label>
+ <select class="form-control" id="stats_renderer-{{name}}" name="stats_renderer">
+ <option value="bar" selected='selected'>{% trans "Bar" %}</option>
+ <option value="line">{% trans "Line" %}</option>
+ <option value="pie">{% trans "Pie" %}</option>
+ <option value="table">{% trans "Table" %}</option>
+ </select>
+ </div>
+ <div class="col-6 col-lg-3">
+ <label for="stats_sum-{{name}}">{% trans "Sum" %}</label>
+ <select class="form-control" id="stats_sum-{{name}}" name="stats_sum">
+ {% for sum_var, sum_var_lbl in current_model.STATISTIC_SUM_VARIABLE.items %}
+ <option value="{{sum_var}}"{% if forloop.first %}
+ selected='selected'{% endif %}>{{sum_var_lbl.0}}</option>
+ {% endfor %}
+ </select>
+ </div>
+ </div>
</div>
<hr/>