From bd7639f6ee2da2a3417b64e70fdbf1decbf831ed Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Thu, 25 Aug 2016 22:36:05 +0200 Subject: UI: better layer layout for simple tables. Rewrite of all dashboard (refs #1616) --- ishtar_common/static/media/style.css | 74 ++++++++++++++++++++-- .../ishtar/blocks/window_tables/documents.html | 8 ++- .../blocks/window_tables/static_documents.html | 7 +- .../ishtar/dashboards/dashboard_main_detail.html | 26 +++++--- ishtar_common/templatetags/date_formating.py | 4 +- 5 files changed, 95 insertions(+), 24 deletions(-) (limited to 'ishtar_common') diff --git a/ishtar_common/static/media/style.css b/ishtar_common/static/media/style.css index 69f86784b..8973876c6 100644 --- a/ishtar_common/static/media/style.css +++ b/ishtar_common/static/media/style.css @@ -843,7 +843,7 @@ a.photo{ .dashboard > div{ background: #FFF; text-align:left; - padding-bottom:10px; + padding:10px; border:1px solid #CCC; border-top-left-radius: 0; border-top-right-radius: 0; @@ -854,16 +854,12 @@ a.photo{ width:762px; background-color:#922; color:#FFF; - padding:0; + padding:10px; border-bottom-left-radius: 0; border-bottom-right-radius: 0; } -.dashboard h4{ - font-weight:normal; - color:#D14; -} -.dashboard h4, .dashboard p{ +.dashboard p{ margin:0; padding:0 10px; } @@ -1037,17 +1033,24 @@ table td.item-list span{ border-top-right-radius: 8px; } +.dashboard label, #window label{ display:inline-table; font-weight:bold; width:245px; } +.dashboard span.value, #window span.value{ display:inline-table; width:465px; } +.dashboard span.value.numeric{ + text-align: right; + width:80px; +} + #window ul.form-flex span.value { display: inline-table; width: 230px; @@ -1255,3 +1258,60 @@ table.table-form td { table.table-form td input{ border-color:#922; } + +.clean-table { + margin: 10px 0 10px 0; + width: 100%; + box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); +} + +.clean-table h4{ + color: #922; + font-size: 1.2em; + padding:0.3em; + margin:0; + text-align: center; +} + +.clean-table-wrap{ + overflow: auto; +} + +.clean-table table{ + border-collapse: collapse; + margin-left: auto; + margin-right: auto; +} + +.clean-table tr { + padding: 8px 0; + background: #f6f6f6; +} + +.clean-table tr:nth-of-type(odd) { + background: #e9e9e9; +} + +.clean-table tr th { + font-weight: 900; + color: #ffffff; + background: #DA2D2D; + text-align: center; + padding: 0.2em 0.4em; +} + +.clean-table tr th.sub { + background: #E65C5C; +} + +.clean-table td{ + text-align: right; + padding: 6px 12px; +} + +.mini-table{ + height: 400px; + overflow: auto; + display: block; +} + diff --git a/ishtar_common/templates/ishtar/blocks/window_tables/documents.html b/ishtar_common/templates/ishtar/blocks/window_tables/documents.html index f1592cc42..8c584425a 100644 --- a/ishtar_common/templates/ishtar/blocks/window_tables/documents.html +++ b/ishtar_common/templates/ishtar/blocks/window_tables/documents.html @@ -1,6 +1,8 @@ {% load i18n %} - - +

{{h4}}

+
+
+
{{caption}}
@@ -18,4 +20,4 @@ {% endfor %}
{% trans "Title" %} {% trans "Type" %}
- + diff --git a/ishtar_common/templates/ishtar/blocks/window_tables/static_documents.html b/ishtar_common/templates/ishtar/blocks/window_tables/static_documents.html index d6686b553..e378bdf49 100644 --- a/ishtar_common/templates/ishtar/blocks/window_tables/static_documents.html +++ b/ishtar_common/templates/ishtar/blocks/window_tables/static_documents.html @@ -1,6 +1,8 @@ {% load i18n %} - - +

{{caption}}

+
+
+
{% for col in col_names %} {% endfor %} @@ -9,3 +11,4 @@ {%endfor%} {% endfor %}
{{caption}}
{% trans col %}{{value}}
+ diff --git a/ishtar_common/templates/ishtar/dashboards/dashboard_main_detail.html b/ishtar_common/templates/ishtar/dashboards/dashboard_main_detail.html index 7247a5cda..fd92578a2 100644 --- a/ishtar_common/templates/ishtar/dashboards/dashboard_main_detail.html +++ b/ishtar_common/templates/ishtar/dashboards/dashboard_main_detail.html @@ -1,4 +1,4 @@ -{% load i18n date_formating %} +{% load i18n date_formating humanize %} {% load url from future %}
@@ -13,7 +13,7 @@
{% endif %} -

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

+

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

{% trans 'Draw rectangle on the graph to zoom. Double-click to reinitialize.' %}

@@ -25,8 +25,9 @@
-
- +
+
+
{% for idx, lbl, values in dashboard.values %} @@ -35,6 +36,7 @@ {% endfor%}
{{lbl}}
+ {% if dashboard.periods %}

{% trans "By years" %}

{% 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%}{% if item.get_show_url %} + + {%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%}{% if item.get_show_url %} + + {%endif%}
diff --git a/ishtar_common/templatetags/date_formating.py b/ishtar_common/templatetags/date_formating.py index eb81cf52c..9d4cf74cc 100644 --- a/ishtar_common/templatetags/date_formating.py +++ b/ishtar_common/templatetags/date_formating.py @@ -8,12 +8,12 @@ from django.utils.translation import ugettext as _ register = Library() + @register.filter def date_formating(value): try: d = datetime.strptime(unicode(value), '%Y-%m-%d') - return _(d.strftime("%B")).capitalize() + u" %d" % d.year + return _(d.strftime("%b")).capitalize() + u" %d" % d.year except ValueError: # could be passed to non date value: on error return value return value - -- cgit v1.2.3