diff options
Diffstat (limited to 'ishtar_common/templates/ishtar/dashboards/dashboard_main_detail.html')
-rw-r--r-- | ishtar_common/templates/ishtar/dashboards/dashboard_main_detail.html | 159 |
1 files changed, 115 insertions, 44 deletions
diff --git a/ishtar_common/templates/ishtar/dashboards/dashboard_main_detail.html b/ishtar_common/templates/ishtar/dashboards/dashboard_main_detail.html index 5ebb05af4..ac779abe0 100644 --- a/ishtar_common/templates/ishtar/dashboards/dashboard_main_detail.html +++ b/ishtar_common/templates/ishtar/dashboards/dashboard_main_detail.html @@ -1,64 +1,134 @@ -{% load i18n date_formating humanize %} -<div class='dashboard' id="{{unique_id}}-tab"> - <div> +{% load i18n date_formating humanize table_form %} +<div id="{{unique_id}}-tab"> <h4>{% trans "Numbers" %}</h4> {% if form %} <div class='form'> <form method='post' action="{% url 'dashboard-main-detail' item_name %}" id='{{unique_id}}_form'> - <table>{% csrf_token %} - {{form}} - </table> - <button id="search_{{unique_id}}" class="submit">{% trans "Change" %}</button> + {% csrf_token %} + {% bs_form form %} + <div class="text-center"> + <button type='button' id="search_{{unique_id}}" + class="btn btn-primary"> + {% trans "Change" %}</button> + </div> </form> </div> {% endif %} <p><strong>{% trans "Total:" %}</strong> {{dashboard.total_number|intcomma}}</p> - <div class='table'> - <div id="chart_{{unique_id}}" style="height:400px; width:700px;"></div> - <p class='info-box'><i class="fa fa-info-circle" aria-hidden="true"></i> {% trans 'Draw rectangle on the graph to zoom. Double-click to reinitialize.' %}</p> - <div class='form chart-img-form'> - <button id="chart_img_display_{{unique_id}}" class='submit'>{% trans "Display as an image" %}</button> - <div id="chart_img_{{unique_id}}" class='chart-img'> - <div id="img_{{unique_id}}"></div> - <p class='info-box'><i class="fa fa-info-circle" aria-hidden="true"></i> {% trans 'Right-click on this image to save it.' %}</p> - </div> + <div> + <div id="chart_{{unique_id}}" + style="height:400px; width:700px; margin-right:auto; margin-left:auto"></div> + <p class='alert alert-info'> + {% trans 'Draw rectangle on the graph to zoom. Double-click to reinitialize.' %} + </p> + <div class='form chart-img-form'> + <div class="text-center"> + <button id="chart_img_display_{{unique_id}}" + type='button' class='btn btn-secondary'> + {% trans "Display as an image" %} + </button> + </div> + <div id="chart_img_{{unique_id}}" class='chart-img'> + <div class="card"> + <div id="img_{{unique_id}}" + class="card-img-top text-center"></div> + <div class="card-body"> + <div class='alert alert-info'> + {% trans 'Right-click on this image to save it.' %} + </div> + </div> + </div> + </div> + </div> </div> - </div> - <div class='clean-table'> - <div class='clean-table-wrap'> - <table> + <hr> + <table class="table table-striped"> {% for idx, lbl, values in dashboard.values %} - <tr class='idx {% if forloop.counter0|divisibleby:"2" %}even{%else%}odd{%endif%}'> + <tr> <th>{{lbl}}</th> {% for value in values reversed %}{% if forloop.parentloop.counter0 %}<td>{% else %}<th>{%endif%}{{value|date_formating }}{% if forloop.parentloop.counter0 %}</td>{% else %}</th>{%endif%}{% endfor%} </tr> {% endfor%} </table> - </div> - </div> + <hr> {% if dashboard.periods %} <h4>{% trans "By years" %}</h4> - <ul> - <li><strong>{% trans "Average:" %}</strong> {{dashboard.average}}</li> - <li><strong>{% trans "Variance:" %}</strong> {{dashboard.variance}}</li> - <li><strong>{% trans "Standard deviation:" %}</strong> {{dashboard.standard_deviation}}</li> - <li><strong>{% trans "Median:" %}</strong> {{dashboard.median}}</li> - <li><strong>{% trans "Mode:" %}</strong> {{dashboard.mode}}</li> - </ul> + <dl class="row"> + <dt class="col-sm-3"> + {% trans "Average:" %} + </dt> + <dd class="col-sm-9"> + {{dashboard.average}} + </dd> + + <dt class="col-sm-3"> + {% trans "Variance:" %} + </dt> + <dd class="col-sm-9"> + {{dashboard.variance}} + </dd> + + <dt class="col-sm-3"> + {% trans "Standard deviation:" %} + </dt> + <dd class="col-sm-9"> + {{dashboard.standard_deviation}} + </dd> + <dt class="col-sm-3"> + {% trans "Median:" %} + </dt> + <dd class="col-sm-9"> + {{dashboard.median}} + </dd> + <dt class="col-sm-3"> + {% trans "Mode:" %} + </dt> + <dd class="col-sm-9"> + {{dashboard.mode}} + </dd> + </dl> + <hr> {% endif %} {% if dashboard.operation_average %} <h4>{% trans "By operations" %}</h4> - <ul> - <li><strong>{% trans "Average:" %}</strong> {{dashboard.operation_average}}</li> - <li><strong>{% trans "Variance:" %}</strong> {{dashboard.operation_variance}}</li> - <li><strong>{% trans "Standard deviation:" %}</strong> {{dashboard.operation_standard_deviation}}</li> - <li><strong>{% trans "Median:" %}</strong> {{dashboard.operation_median}}</li> - <li><strong>{% trans "Mode:" %}</strong> {{dashboard.operation_mode}}</li> - </ul> + <dl class="row"> + <dt class="col-sm-3"> + {% trans "Average:" %} + </dt> + <dd class="col-sm-9"> + {{dashboard.operation_average}} + </dd> + + <dt class="col-sm-3"> + {% trans "Variance:" %} + </dt> + <dd class="col-sm-9"> + {{dashboard.operation_variance}} + </dd> + + <dt class="col-sm-3"> + {% trans "Standard deviation:" %} + </dt> + <dd class="col-sm-9"> + {{dashboard.operation_standard_deviation}} + </dd> + <dt class="col-sm-3"> + {% trans "Median:" %} + </dt> + <dd class="col-sm-9"> + {{dashboard.operation_median}} + </dd> + <dt class="col-sm-3"> + {% trans "Mode:" %} + </dt> + <dd class="col-sm-9"> + {{dashboard.operation_mode}} + </dd> + </dl> + <hr> {% endif %} - <div class='clean-table'> <h4>{% trans "Created last" %}</h4> - <table> + <table class="table table-striped"> <tr><th>{{lbl}}</th><th>{% trans "Created" %}</th><th></th></tr> {% for item in dashboard.lasts %}<tr> <td class='ref'>{{item}}</td> @@ -68,10 +138,9 @@ </a>{%endif%}</td> </tr>{% endfor %} </table> - </div> - <div class='clean-table'> + <hr> <h4>{% trans "Recent changes" %}</h4> - <table> + <table class="table table-striped"> <tr><th>{{lbl}}</th><th>{% trans "Modified" %}</th><th></th></tr> {% for item in dashboard.recents %}<tr> <td class='ref'>{{item}}</td> @@ -81,8 +150,7 @@ </a>{%endif%}</td> </tr>{% endfor %} </table> - </div> - </div> +</div> <script language="javascript" type="text/javascript"> $(document).ready(function(){ @@ -177,9 +245,12 @@ $('#search_{{unique_id}}').click(function (){ return false; }); +/* {% if item_name == 'files' or item_name == "operations" or item_name == "treatments" or item_name == "treatmentfiles" %} load_jquerydate_{{item_name}}_after(); load_jquerydate_{{item_name}}_before(); {% endif %} +*/ + }); </script> |