From 4ccbb4bef309571159c9558cca5da04987a68646 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Mon, 22 Oct 2012 00:08:24 +0200 Subject: Djangoization - Major refactoring (step 15) * works on dashboards --- ishtar_common/templates/dashboard_file.html | 215 --------- ishtar_common/templates/dashboard_main.html | 82 ---- ishtar_common/templates/dashboard_operation.html | 510 --------------------- .../ishtar/dashboards/dashboard_main.html | 82 ++++ 4 files changed, 82 insertions(+), 807 deletions(-) delete mode 100644 ishtar_common/templates/dashboard_file.html delete mode 100644 ishtar_common/templates/dashboard_main.html delete mode 100644 ishtar_common/templates/dashboard_operation.html create mode 100644 ishtar_common/templates/ishtar/dashboards/dashboard_main.html (limited to 'ishtar_common/templates') diff --git a/ishtar_common/templates/dashboard_file.html b/ishtar_common/templates/dashboard_file.html deleted file mode 100644 index cebd147f4..000000000 --- a/ishtar_common/templates/dashboard_file.html +++ /dev/null @@ -1,215 +0,0 @@ -{% extends "base.html" %} -{% load i18n %} -{% load range %} -{% block extra_head %} -{{form.media}} -{% endblock %} -{% block content %} -
-

{% trans "Archaeological files" %}

-
-

{% trans "Global informations" %}

- -

{% trans "Total:" %} {{dashboard.total_number}}

- {% for type in dashboard.types %} -

{{type.file_type__label}}{% trans ":"%} {{type.number}}

- {% endfor %} -
- - - - {% for year in dashboard.by_year %}{% endfor %} - - - {% for year in dashboard.by_year %}{% endfor%} - -
{% trans "By year"%}
{{year.date.year}}
{{year.number}}
-
- -
- - - - {% for month in dashboard.by_month %}{% endfor %} - - - {% for month in dashboard.by_month %}{% endfor%} - -
{% trans "By month"%}
{{month.date|date:"F Y"|capfirst}}
{{month.number}}
-
- -
-
- -

{% trans "Research archaeology" %}

- -

{% trans "Total:" %} {{dashboard.research.total_number}}

-
- - - - {% for year in dashboard.research.by_year %}{% endfor %} - - - {% for year in dashboard.research.by_year %}{% endfor%} - -
{% trans "By year"%}
{{year.date.year}}
{{year.number}}
-
- -
- - - - {% for month in dashboard.research.by_month %}{% endfor %} - - - {% for month in dashboard.research.by_month %}{% endfor%} - -
{% trans "By month"%}
{{month.date|date:"F Y"|capfirst}}
{{month.number}}
-
- -
- - - - {% for dpt in dashboard.research.by_dpt %}{% endfor %} - - - {% for dpt in dashboard.research.by_dpt %}{% endfor%} - -
{% trans "By department"%}
{{dpt.department__label}}
{{dpt.number}}
-
- -
- - - - {% for town in dashboard.research.towns %}{% endfor %} - - - {% for town in dashboard.research.towns %}{% endfor%} - -
{% trans "Main towns"%}
{{town.town__name}}
{{town.number}}
-
- -
-
- -

{% trans "Rescue archaeology" %}

- -

{% trans "Total:" %} {{dashboard.rescue.total_number}}

- -
- - - - {% for saisine in dashboard.rescue.saisine %}{% endfor %} - - - {% for saisine in dashboard.rescue.saisine %}{% endfor%} - -
{% trans "By saisine type"%}
{{saisine.saisine_type__label}}
{{saisine.number}}
-
- -
- - - - {% for act in dashboard.rescue.administrative_act %}{% endfor %} - - - {% for act in dashboard.rescue.administrative_act %}{% endfor%} - -
{% trans "By administrative act"%}
{{act.act_type__label}}
{{act.number}}
-
- -
- - - - {% for year in dashboard.rescue.by_year %}{% endfor %} - - - {% for year in dashboard.rescue.by_year %}{% endfor%} - -
{% trans "By year"%}
{{year.date.year}}
{{year.number}}
-
- -
- - - - {% for month in dashboard.rescue.by_month %}{% endfor %} - - - {% for month in dashboard.rescue.by_month %}{% endfor%} - -
{% trans "By month"%}
{{month.date|date:"F Y"|capfirst}}
{{month.number}}
-
- -

{% trans "Archaeological files linked to at least one operation:" %} {{dashboard.rescue.with_associated_operation}}

-

{% trans "Archaeological files linked to at least one operation (%):" %} {{dashboard.rescue.with_associated_operation_percent}}

- -
- - - - {% for year in dashboard.rescue.operational_by_year %}{% endfor %} - - - {% for year in dashboard.rescue.operational_by_year %}{% endfor%} - -
{% trans "Archaeological files linked to at least one operation (%)"%}
{{year.date.year}}
{{year.number}}
-
- -
- - - - {% for dpt in dashboard.rescue.by_dpt %}{% endfor %} - - - {% for dpt in dashboard.rescue.by_dpt %}{% endfor%} - -
{% trans "By department"%}
{{dpt.department__label}}
{{dpt.number}}
-
- -
- - - - {% for dpt in dashboard.rescue.surface_by_dpt %}{% endfor %} - - - {% for dpt in dashboard.rescue.surface_by_dpt %}{% endfor%} - -
{% trans "Surface by department (m²)"%}
{{dpt.department__label}}
{{dpt.number}}
-
- -
- - - - {% for town in dashboard.rescue.towns %}{% endfor %} - - - {% for town in dashboard.rescue.towns %}{% endfor%} - -
{% trans "Main towns by number"%}
{{town.town__name}}
{{town.number}}
-
- -
- - - - {% for town in dashboard.rescue.surface_by_town %}{% endfor %} - - - {% for town in dashboard.rescue.surface_by_town %}{% endfor%} - -
{% trans "Main towns by surface (m²)"%}
{{town.town__name}}
{{town.number}}
-
- -
-
-{% endblock %} diff --git a/ishtar_common/templates/dashboard_main.html b/ishtar_common/templates/dashboard_main.html deleted file mode 100644 index e710dbe16..000000000 --- a/ishtar_common/templates/dashboard_main.html +++ /dev/null @@ -1,82 +0,0 @@ -{% extends "base.html" %} -{% load i18n %} -{% load range %} -{% block extra_head %} -{{form.media}} -{% endblock %} -{% block content %} -
-{% for lbl, dashboard in items %} -
-

{{lbl}}

-

{% trans "Numbers" %}

-

{% trans "Total:" %} {{dashboard.total_number}}

-
- - {% for idx, lbl, values in dashboard.values %} - - - {% for value in values %}{% endfor%} - - {% endfor%} -
{{lbl}}{{value}}
-
- {% if dashboard.years %} -

{% trans "By years" %}

-
    -
  • {% trans "Average:" %} {{dashboard.average}}
  • -
  • {% trans "Variance:" %} {{dashboard.variance}}
  • -
  • {% trans "Standard deviation:" %} {{dashboard.standard_deviation}}
  • -
  • {% trans "Median:" %} {{dashboard.median}}
  • -
  • {% trans "Mode:" %} {{dashboard.mode}}
  • -
- {% endif %} - {% if dashboard.operation_average %} -

{% trans "By operations" %}

-
    -
  • {% trans "Average:" %} {{dashboard.operation_average}}
  • -
  • {% trans "Variance:" %} {{dashboard.operation_variance}}
  • -
  • {% trans "Standard deviation:" %} {{dashboard.operation_standard_deviation}}
  • -
  • {% trans "Median:" %} {{dashboard.operation_median}}
  • -
  • {% trans "Mode:" %} {{dashboard.operation_mode}}
  • -
- {% endif %} -

{% trans "Created last" %}

-
- - - {% for item in dashboard.lasts %} - - - - {% endfor %} -
{{lbl}}{% trans "Created" %}
{{item}}{{item.history_date}}{% if item.get_show_url %}{%trans "Show"%}{%endif%}
-
-

{% trans "Recent changes" %}

-
- - - {% for item in dashboard.recents %} - - - - {% endfor %} -
{{lbl}}{% trans "Modified" %}
{{item}}{{item.history_date}}{% if item.get_show_url %}{%trans "Show"%}{%endif%}
-
-
-{% endfor%} -
-

{% trans "Users" %}

-
- - - {% for user_type in ishtar_users.types %} - - - - - {% endfor%} -
{% trans "User type" %}{% trans "Number" %}
{{user_type.person__person_type__label}}{{user_type.number}}
-
-
-{% endblock %} diff --git a/ishtar_common/templates/dashboard_operation.html b/ishtar_common/templates/dashboard_operation.html deleted file mode 100644 index 28f1dd9c6..000000000 --- a/ishtar_common/templates/dashboard_operation.html +++ /dev/null @@ -1,510 +0,0 @@ -{% extends "base.html" %} -{% load i18n %} -{% load range %} -{% block extra_head %} -{{form.media}} -{% endblock %} -{% block content %} -
-

{% trans "Operations" %}

-
-

{% trans "Global informations" %}

- -
- - - - - - {% for lbl, nb in dashboard.total %} - - - - {% endfor %} -
{% trans "Total" %}
{% trans "Status" %}{% trans "Number" %}
{{lbl}}{{nb}}
- -
- - - - - - {% for surface in dashboard.surface_by_type %} - - - - {% endfor %} -
{% trans "Area by type of operation" %}
{% trans "Status" %}{% trans "Area (m²)" %}
{{surface.operation_type__label}}{{surface.number}}
- -
- - - - {%for typ in dashboard.types %}{% endfor %} - - {% for lbl, types in dashboard.by_type %} - - {%for nb in types %}{% endfor %} - - {% endfor %} -
{% trans "By types" %}
{% trans "State" %}{{typ.label}}
{{lbl}}{{nb}}
- -
- - - - {%for yr in dashboard.years %}{% endfor %} - - {% for lbl, years in dashboard.by_year %} - - {%for nb in years %}{% endfor %} - - {% endfor %} -
{% trans "By year" %}
{% trans "State" %}{{yr}}
{{lbl}}{{nb}}
- -
- - - - {%for yr in dashboard.realisation_years %}{% endfor %} - - {% for lbl, years in dashboard.by_realisation_year %} - - {%for nb in years %}{% endfor %} - - {% endfor %} -
{% trans "By realisation year" %}
{% trans "State" %}{{yr.year}}
{{lbl}}{{nb}}
- -
- - - - {%for yr in dashboard.years %}{% endfor %} - - {% for lbl, years in dashboard.effective %} - - {%for nb in years %}{% endfor %} - - {% endfor %} -
{% trans "Effective operation by type and year" %}
{% trans "Type" %}{{yr}}
{{lbl}}{{nb}}
- -
- - - - {%for mt in dashboard.last_months %}{% endfor %} - - {% for lbl, months in dashboard.by_realisation_month %} - - {%for nb in months %}{% endfor %} - - {% endfor %} -
{% trans "By realisation month" %}
{% trans "State" %}{{mt.date|date:"F Y"|capfirst}}
{{lbl}}{{nb}}
- -
-
- -

{% trans "Survey informations" %}

- -
- - - - - - {% for lbl, nb in dashboard.survey.total %} - - - - {% endfor %} -
{% trans "Total" %}
{% trans "Status" %}{% trans "Number" %}
{{lbl}}{{nb}}
- -
- - - - {%for yr in dashboard.years %}{% endfor %} - - {% for lbl, years in dashboard.survey.by_year %} - - {%for nb in years %}{% endfor %} - - {% endfor %} -
{% trans "By year" %}
{% trans "State" %}{{yr}}
{{lbl}}{{nb}}
- -
- - - - {%for yr in dashboard.realisation_years %}{% endfor %} - - {% for lbl, years in dashboard.survey.by_realisation_year %} - - {%for nb in years %}{% endfor %} - - {% endfor %} -
{% trans "By realisation year" %}
{% trans "State" %}{{yr.year}}
{{lbl}}{{nb}}
- -
- - - - {% for lbl in dashboard.filters_label %}{%endfor%} - - - {% for nb in dashboard.survey.area %}{%endfor%} - - - {% for nb in dashboard.survey.manday %}{%endfor%} - - - {% for nb in dashboard.survey.mandayhect %}{%endfor%} - -
{% trans "Current year" %}
{% trans "Status" %}{{lbl}}
{% trans "Area"%}{{nb}}
{% trans "Man-day"%}{{nb}}
{% trans "Man-day/hectare"%}{{nb}}
- -

{% trans "Man-day/hectare for effective operations (current year):" %} {{dashboard.survey.mandayhect_effective}}

- -
- - - - - - {% for org in dashboard.survey.org %} - - - - {% endfor %} -
{% trans "Organizations (current year)" %}
 {% trans "Area" %}{% trans "Man-day" %}{% trans "Man-day/hectare" %}
{{org.in_charge__attached_to__name}}{{org.area}}{{org.manday}}{{org.mandayhect}}
- -
- - - - {% for lbl in dashboard.filters_label %}{%endfor%} - - - {% for nb in dashboard.survey.area_realised %}{%endfor%} - - - {% for nb in dashboard.survey.manday_realised %}{%endfor%} - - - {% for nb in dashboard.survey.mandayhect_realised %}{%endfor%} - -
{% trans "Current realisation year" %}
{% trans "Status" %}{{lbl}}
{% trans "Area"%}{{nb}}
{% trans "Man-day"%}{{nb}}
{% trans "Man-day/hectare"%}{{nb}}
- -

{% trans "Man-day/hectare for effective operations (current realisation year):" %} {{dashboard.survey.mandayhect_real_effective}}

- -
- - - - - - {% for org in dashboard.survey.org_realised %} - - - - {% endfor %} -
{% trans "Organizations (current realisation year)" %}
 {% trans "Area" %}{% trans "Man-day" %}{% trans "Man-day/hectare" %}
{{org.in_charge__attached_to__name}}{{org.area}}{{org.manday}}{{org.mandayhect}}
- -
- - - - {% for yr in dashboard.years%}{% endfor %} - - {% for org, vals in dashboard.survey.org_by_year %} - - {% for area, cost in vals %}{% endfor %} - - {% endfor %} - - {% for area in dashboard.survey.org_by_year_area_mean %}{% endfor %} - -
{% trans "Area by organization by year" %}
{% trans "Organization" %}{{yr}}
{{org}}{{area}}
{% trans "Mean" %}{{area}}
- -
- - - - {% for yr in dashboard.years%}{% endfor %} - - - {% for nb, mean in dashboard.survey.effective %}{% endfor %} - - - {% for nb, avg in dashboard.survey.effective %}{% endfor %} - -
{% trans "Effective operations areas (m²)" %}
 {{yr}}
{% trans "Sum" %}{{nb}}
{% trans "Average" %}{{avg}}
- -
- - - - {% for yr in dashboard.years%}{% endfor %} - - - {% for nb, mean in dashboard.survey.mandayshect %}{% endfor %} - - - {% for nb, avg in dashboard.survey.mandayshect %}{% endfor %} - -
{% trans "Man-Days/hectare by Year" %}
 {{yr}}
{% trans "Man-Days/hectare" %}{{nb}}
{% trans "Average" %}{{avg}}
- -
- - - - {%for mt in dashboard.last_months %}{% endfor %} - - {% for lbl, months in dashboard.survey.by_month %} - - {%for nb in months %}{% endfor %} - - {% endfor %} -
{% trans "By month" %}
{% trans "State" %}{{mt.date|date:"F Y"|capfirst}}
{{lbl}}{{nb}}
- -
- - - - {%for yr in dashboard.years %}{% endfor %} - - {% for lbl, years in dashboard.survey.by_dpt %} - - {%for nb in years %}{{nb}}{% endfor %} - - {% endfor %} -
{% trans "By department" %}
{% trans "Department" %}{{yr}}{% trans "Sum" %}
{{lbl}}
- -
- - - - {%for yr in dashboard.years %}{% endfor %} - - - {%for yr in dashboard.years %}{% endfor %} - - {% for lbl, years in dashboard.survey.effective_by_dpt %} - - {%for nb, area, cost, fnap in years %}{{nb}}{{area}}{% endfor %} - - {% endfor %} -
{% trans "Effective operation by department" %}
{% trans "Department" %}{{yr}}{% trans "Sum" %}
{%trans "Nb."%}{%trans "Area"%}{%trans "Nb."%}{%trans "Area"%}
{{lbl}}
- -
- - - - - - {% for lbl, nb in dashboard.survey.towns %} - - - - {% endfor %} -
{% trans "Main towns by number" %}
{% trans "Town" %}{% trans "Number" %}
{{lbl}}{{nb}}
- -
- - - - - - {% for lbl, nb in dashboard.survey.towns_surface %} - - - - {% endfor %} -
{% trans "Main towns by surface" %}
{% trans "Town" %}{% trans "Total surface (m²)" %}
{{lbl}}{{nb}}
- - -
-
- -

{% trans "Excavation informations" %}

- -
- - - - - - {% for lbl, nb in dashboard.excavation.total %} - - - - {% endfor %} -
{% trans "Total" %}
{% trans "Status" %}{% trans "Number" %}
{{lbl}}{{nb}}
- -
- - - - {%for yr in dashboard.years %}{% endfor %} - - {% for lbl, years in dashboard.excavation.by_year %} - - {%for nb in years %}{% endfor %} - - {% endfor %} -
{% trans "By year" %}
{% trans "State" %}{{yr}}
{{lbl}}{{nb}}
- -
- - - - {%for yr in dashboard.realisation_years %}{% endfor %} - - {% for lbl, years in dashboard.excavation.by_realisation_year %} - - {%for nb in years %}{% endfor %} - - {% endfor %} -
{% trans "By realisation year" %}
{% trans "State" %}{{yr.year}}
{{lbl}}{{nb}}
- -
- - - - {% for lbl in dashboard.filters_label %}{%endfor%} - - - {% for nb in dashboard.excavation.area_realised %}{%endfor%} - - - {% for nb in dashboard.excavation.manday_realised %}{%endfor%} - - - {% for nb in dashboard.excavation.mandayhect_realised %}{%endfor%} - -
{% trans "Current realisation year" %}
{% trans "Status" %}{{lbl}}
{% trans "Area"%}{{nb}}
{% trans "Man-day"%}{{nb}}
{% trans "Man-day/hectare"%}{{nb}}
- -

{% trans "Man-day/hectare for effective operations (current realisation year):" %} {{dashboard.excavation.mandayhect_real_effective}}

- -
- - - - - - {% for org in dashboard.excavation.org_realised %} - - - - {% endfor %} -
{% trans "Organizations (current realisation year)" %}
 {% trans "Area" %}{% trans "Man-day" %}{% trans "Man-day/hectare" %}
{{org.in_charge__attached_to__name}}{{org.area}}{{org.manday}}{{org.mandayhect}}
- -
- - - - {% for yr in dashboard.years%}{% endfor %} - - {% for org, vals in dashboard.excavation.org_by_year %} - - {% for area, cost in vals %}{% endfor %} - - {% endfor %} - - {% for area in dashboard.excavation.org_by_year_area_sum %}{% endfor %} - - - {% for area in dashboard.excavation.org_by_year_area_mean %}{% endfor %} - -
{% trans "Area by organization by year" %}
{% trans "Organization" %}{{yr}}
{{org}}{{area}}
{% trans "Sum" %}{{area}}
{% trans "Mean" %}{{area}}
- -
- - - - {% for yr in dashboard.years%}{% endfor %} - - {% for org, vals in dashboard.excavation.org_by_year %} - - {% for area, cost in vals %}{% endfor %} - - {% endfor %} - - {% for area in dashboard.excavation.org_by_year_area_sum %}{% endfor %} - - - {% for area in dashboard.excavation.org_by_year_area_mean %}{% endfor %} - -
{% trans "Area by organization by realisation year" %}
{% trans "Organization" %}{{yr}}
{{org}}{{area}}
{% trans "Sum" %}{{area}}
{% trans "Mean" %}{{area}}
- -
- - - - {%for mt in dashboard.last_months %}{% endfor %} - - {% for lbl, months in dashboard.excavation.by_month %} - - {%for nb in months %}{% endfor %} - - {% endfor %} -
{% trans "By month" %}
{% trans "State" %}{{mt.date|date:"F Y"|capfirst}}
{{lbl}}{{nb}}
- -
- - - - {%for yr in dashboard.years %}{% endfor %} - - {% for lbl, years in dashboard.excavation.by_dpt %} - - {%for nb in years %}{{nb}}{% endfor %} - - {% endfor %} -
{% trans "By department" %}
{% trans "Department" %}{{yr}}{% trans "Sum" %}
{{lbl}}
- -
- - - - {%for yr in dashboard.years %}{% endfor %} - - - {%for yr in dashboard.years %}{% endfor %} - - {% for lbl, years in dashboard.excavation.effective_by_dpt %} - - {%for nb, area, cost, fnap in years %}{{nb}}{{cost}}{{fnap}}{% endfor %} - - {% endfor %} -
{% trans "Effective operation by department" %}
{% trans "Department" %}{{yr}}{% trans "Sum" %}
{%trans "Nb."%}{%trans "Cost"%}{%trans "FNAP cost"%}{%trans "Nb."%}{%trans "Cost"%}{%trans "FNAP cost"%}
{{lbl}}
- -
- - - - - - {% for lbl, nb in dashboard.excavation.towns %} - - - - {% endfor %} -
{% trans "Main towns by number" %}
{% trans "Town" %}{% trans "Number" %}
{{lbl}}{{nb}}
- -
- - - - - - {% for lbl, nb in dashboard.excavation.towns_cost %} - - - - {% endfor %} -
{% trans "Main towns by cost" %}
{% trans "Town" %}{% trans "Cost (€)" %}
{{lbl}}{{nb}}
- - -
-
-{% endblock %} diff --git a/ishtar_common/templates/ishtar/dashboards/dashboard_main.html b/ishtar_common/templates/ishtar/dashboards/dashboard_main.html new file mode 100644 index 000000000..e710dbe16 --- /dev/null +++ b/ishtar_common/templates/ishtar/dashboards/dashboard_main.html @@ -0,0 +1,82 @@ +{% extends "base.html" %} +{% load i18n %} +{% load range %} +{% block extra_head %} +{{form.media}} +{% endblock %} +{% block content %} +
+{% for lbl, dashboard in items %} +
+

{{lbl}}

+

{% trans "Numbers" %}

+

{% trans "Total:" %} {{dashboard.total_number}}

+
+ + {% for idx, lbl, values in dashboard.values %} + + + {% for value in values %}{% endfor%} + + {% endfor%} +
{{lbl}}{{value}}
+
+ {% if dashboard.years %} +

{% trans "By years" %}

+
    +
  • {% trans "Average:" %} {{dashboard.average}}
  • +
  • {% trans "Variance:" %} {{dashboard.variance}}
  • +
  • {% trans "Standard deviation:" %} {{dashboard.standard_deviation}}
  • +
  • {% trans "Median:" %} {{dashboard.median}}
  • +
  • {% trans "Mode:" %} {{dashboard.mode}}
  • +
+ {% endif %} + {% if dashboard.operation_average %} +

{% trans "By operations" %}

+
    +
  • {% trans "Average:" %} {{dashboard.operation_average}}
  • +
  • {% trans "Variance:" %} {{dashboard.operation_variance}}
  • +
  • {% trans "Standard deviation:" %} {{dashboard.operation_standard_deviation}}
  • +
  • {% trans "Median:" %} {{dashboard.operation_median}}
  • +
  • {% trans "Mode:" %} {{dashboard.operation_mode}}
  • +
+ {% endif %} +

{% trans "Created last" %}

+
+ + + {% for item in dashboard.lasts %} + + + + {% endfor %} +
{{lbl}}{% trans "Created" %}
{{item}}{{item.history_date}}{% if item.get_show_url %}{%trans "Show"%}{%endif%}
+
+

{% trans "Recent changes" %}

+
+ + + {% for item in dashboard.recents %} + + + + {% endfor %} +
{{lbl}}{% trans "Modified" %}
{{item}}{{item.history_date}}{% if item.get_show_url %}{%trans "Show"%}{%endif%}
+
+
+{% endfor%} +
+

{% trans "Users" %}

+
+ + + {% for user_type in ishtar_users.types %} + + + + + {% endfor%} +
{% trans "User type" %}{% trans "Number" %}
{{user_type.person__person_type__label}}{{user_type.number}}
+
+
+{% endblock %} -- cgit v1.2.3