From 959ec49df2cb3190abfda2652f5f6be46eab706f Mon Sep 17 00:00:00 2001 From: Felipe Bormann Date: Mon, 29 May 2017 11:46:13 -0300 Subject: [PATCH] modified organization of HTML inside dashboards as well as finished log load methods --- dashboards/static/dashboards/.sass-cache/d1f4112ca6d0e14bdf64d22b0b14a2322f24cc83/general.sassc | Bin 35579 -> 0 bytes dashboards/static/dashboards/css/general.css | 36 +++++++++++++++++++++--------------- dashboards/static/dashboards/css/general.css.map | 2 +- dashboards/static/dashboards/css/general.sass | 39 +++++++++++++++++++++++---------------- dashboards/static/dashboards/js/logbehavior.js | 35 +++++++++++++++++++++++++++++++++++ dashboards/templates/dashboards/category.html | 11 +---------- dashboards/templates/dashboards/general.html | 93 ++++----------------------------------------------------------------------------------------- dashboards/templates/dashboards/general_body.html | 78 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ dashboards/templates/dashboards/log.html | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ dashboards/templates/dashboards/tags_body.html | 12 ++++++++++++ dashboards/urls.py | 2 ++ dashboards/views.py | 50 ++++++++++++++++++++++++++++++++++++++++++++++++-- 12 files changed, 277 insertions(+), 133 deletions(-) create mode 100644 dashboards/static/dashboards/js/logbehavior.js create mode 100644 dashboards/templates/dashboards/general_body.html create mode 100644 dashboards/templates/dashboards/log.html create mode 100644 dashboards/templates/dashboards/tags_body.html diff --git a/dashboards/static/dashboards/.sass-cache/d1f4112ca6d0e14bdf64d22b0b14a2322f24cc83/general.sassc b/dashboards/static/dashboards/.sass-cache/d1f4112ca6d0e14bdf64d22b0b14a2322f24cc83/general.sassc index 32e7521..6458c0f 100644 Binary files a/dashboards/static/dashboards/.sass-cache/d1f4112ca6d0e14bdf64d22b0b14a2322f24cc83/general.sassc and b/dashboards/static/dashboards/.sass-cache/d1f4112ca6d0e14bdf64d22b0b14a2322f24cc83/general.sassc differ diff --git a/dashboards/static/dashboards/css/general.css b/dashboards/static/dashboards/css/general.css index 1d16a9f..0a71e88 100644 --- a/dashboards/static/dashboards/css/general.css +++ b/dashboards/static/dashboards/css/general.css @@ -16,21 +16,24 @@ display: inline-flex; width: 50%; margin-bottom: 0px; } - #general-report-header ul li { - margin-right: 2%; - width: 50%; - color: white; - font-size: 20px; - background-color: #0f8a9a; - width: 100%; - text-align: center; - border-radius: 20px; - height: 30px; } - #general-report-header ul li.selected { - background-color: #4dcfbd; - width: 100%; - text-align: center; - border-radius: 20px; } + #general-report-header ul a { + width: 100%; } + +li.tab-option { + margin-right: 2%; + color: white; + font-size: 20px; + background-color: #0f8a9a; + width: 100%; + text-align: center; + border-radius: 20px; + height: 30px; } + +li.selected { + background-color: #4dcfbd; + width: 100%; + text-align: center; + border-radius: 20px; } #most-used-tags-header { background: linear-gradient(to right, #0e8999, #6bf0ce); @@ -131,4 +134,7 @@ color: white; text-align: center; } +#period-selector { + display: flex; } + /*# sourceMappingURL=general.css.map */ diff --git a/dashboards/static/dashboards/css/general.css.map b/dashboards/static/dashboards/css/general.css.map index c82fbd3..fd848b0 100644 --- a/dashboards/static/dashboards/css/general.css.map +++ b/dashboards/static/dashboards/css/general.css.map @@ -1,6 +1,6 @@ { "version": 3, -"mappings": "AAEA,YAAY;EACR,MAAM,EAAE,iBAAiB;EACzB,aAAa,EAAE,IAAI;EACnB,OAAO,EAAE,IAAI;EACb,QAAQ,EAAE,IAAI;EACd,KAAK,EAAE,IAAI;EACX,gBAAgB,EAAE,OAAO;;AAE7B,sBAAsB;EAClB,MAAM,EAAE,GAAG;EACX,OAAO,EAAE,KAAK;EACd,yBAAE;IACE,KAAK,EAdC,OAAO;EAgBjB,yBAAE;IACE,KAAK,EAAE,KAAK;IACZ,OAAO,EAAE,WAAW;IACpB,KAAK,EAAE,GAAG;IACV,aAAa,EAAE,GAAG;IAElB,4BAAE;MACE,YAAY,EAAE,EAAE;MAChB,KAAK,EAAE,GAAG;MACV,KAAK,EAAE,KAAK;MACZ,SAAS,EAAE,IAAI;MACf,gBAAgB,EAAE,OAAO;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ACT,UAAU,EAAE,iCAAkC;EAC9C,KAAK,EAAE,KAAK;EACZ,aAAa,EAAE,IAAI;EACnB,OAAO,EAAE,GAAG;;AAEhB,mBAAmB;EACf,gBAAgB,EAAE,OAAO;EACzB,KAAK,EAAE,GAAG;EACV,WAAW,EAAE,EAAE;EACf,UAAU,EAAE,EAAE;EACd,QAAQ,EAAE,QAAQ;EAClB,YAAY,EAAE,CAAC;EACf,KAAK,EAAE,KAAK;EACZ,MAAM,EAAE,iBAAiB;EACzB,UAAU,EAAE,sDAAsD;EAElE,sBAAE;IACE,YAAY,EAAE,EAAE;;AAExB,qDAAqD;EACjD,MAAM,EAAE,IAAI;EACZ,IAAI,EAAE,GAAG;EACT,MAAM,EAAE,iBAAiB;EACzB,OAAO,EAAE,GAAG;EACZ,MAAM,EAAE,CAAC;EACT,KAAK,EAAE,CAAC;EACR,QAAQ,EAAE,QAAQ;EAClB,cAAc,EAAE,IAAI;;AAGxB,0BAA0B;EACtB,YAAY,EAAE,IAAI;EAClB,WAAW,EAAE,IAAI;EACjB,YAAY,EAAE,sBAAsB;EACpC,mBAAmB,EAAE,OAAO;;AAEhC,yBAAyB;EACrB,gBAAgB,EAAE,OAAO;;AAG7B,mBAAmB;EACf,UAAU,EAAE,MAAM;EAClB,KAAK,EAAE,OAAO;;AAElB,aAAa;EACT,KAAK,EAAE,IAAI;EACX,MAAM,EAAE,IAAI;EACZ,UAAU,EAAE,OAAO;EACnB,KAAK,EAAE,KAAK;EACZ,UAAU,EAAE,MAAM;;AAKtB,gBAAgB;EACZ,OAAO,EAAE,IAAI", "sources": ["general.sass"], "names": [], "file": "general.css" diff --git a/dashboards/static/dashboards/css/general.sass b/dashboards/static/dashboards/css/general.sass index 507cffa..7e5a4d1 100644 --- a/dashboards/static/dashboards/css/general.sass +++ b/dashboards/static/dashboards/css/general.sass @@ -20,25 +20,26 @@ $title-color: #009688 width: 50% margin-bottom: 0px - li - margin-right: 2% - width: 50% - color: white - font-size: 20px - background-color: #0f8a9a + a width: 100% - text-align: center - border-radius: 20px - height: 30px + +li.tab-option + margin-right: 2% + color: white + font-size: 20px + background-color: #0f8a9a + width: 100% + text-align: center + border-radius: 20px + height: 30px - li.selected - background-color: #4dcfbd - width: 100% - text-align: center - border-radius: 20px - +li.selected + background-color: #4dcfbd + width: 100% + text-align: center + border-radius: 20px @@ -150,4 +151,10 @@ $title-color: #009688 height: 20px background: #52b7bd color: white - text-align: center \ No newline at end of file + text-align: center + + +//LOG CLASSES AND ID's + +#period-selector + display: flex \ No newline at end of file diff --git a/dashboards/static/dashboards/js/logbehavior.js b/dashboards/static/dashboards/js/logbehavior.js new file mode 100644 index 0000000..4bae214 --- /dev/null +++ b/dashboards/static/dashboards/js/logbehavior.js @@ -0,0 +1,35 @@ +$(document).ready(function(){ + $('#init_date').datetimepicker(); + $('#end_date').datetimepicker({ + useCurrent: false //Important! See issue #1075 + }); + $("#init_date").on("dp.change", function (e) { + $('#end_date').data("DateTimePicker").minDate(e.date); + }); + $("#end_date").on("dp.change", function (e) { + $('#init_date').data("DateTimePicker").maxDate(e.date); + init_date = $("#init_date").data("DateTimePicker").date(); + log.refresh_log_data(init_date, e.date); + }); + + +}); + + + + +var log = { + + refresh_log_data: function(init_date, end_date){ + $.get("/dashboards/get_log_data", {init_date: init_date.format("YYYY-MM-DD HH:mm"), end_date: end_date.format("YYYY-MM-DD HH:mm")}).done(function(data){ + log.render_table("log_body", data); + }) + }, + render_table: function(target_id, data){ + table_body = $('#' + target_id); + + data.forEach(function(datum){ + console.log(datum); + }); + }, +} diff --git a/dashboards/templates/dashboards/category.html b/dashboards/templates/dashboards/category.html index bf40ac8..9e2be5f 100644 --- a/dashboards/templates/dashboards/category.html +++ b/dashboards/templates/dashboards/category.html @@ -63,16 +63,7 @@
-
-
-

- {% trans "most used tags" %} -

-
-
- -
-
+ {% include "dashboards/tags_body.html" %}
{% endblock content %} \ No newline at end of file diff --git a/dashboards/templates/dashboards/general.html b/dashboards/templates/dashboards/general.html index 599ebfe..f83be78 100644 --- a/dashboards/templates/dashboards/general.html +++ b/dashboards/templates/dashboards/general.html @@ -7,9 +7,9 @@ {% endblock style %} {% block javascript %} - - - + {% for file in javascript_files %} + + {% endfor %} {% endblock javascript %} {% block breadcrumbs %} @@ -41,92 +41,7 @@
-
-

{% trans "Amadeus Report" %}

- -
    -
  • - {% trans "Focus" %} -
  • -
  • - {% trans "Log" %} -
  • -
-
- -
- -
-
-

- {% trans "most used tags" %} -

-
-
- -
-
-
-
- -

{% trans "Most accessed " %}

-
- - -
-

{% trans "Categories" %}

- -
- -
-

{% trans "Subjects" %}

- -
- -
-

{% trans "Resource" %}

- -
- -
- -
-
-
-

{% trans "Most active users" %}

-
- -
-
-
-

{% trans "Amount of access in: " %} - -

-
- -
- -
- -
- - - - - -
-
- -
-
-
- -
+ {% include child_template %}