Commit caa3f758359209819f0e66f2dc1b306cbc63eefb
1 parent
657f96a1
Exists in
master
and in
2 other branches
styled weekly selector properly
Showing
7 changed files
with
42 additions
and
20 deletions
Show diff stats
analytics/static/.sass-cache/01cecb7b42e56765f6ed49ed3c70281ebdc742c7/general.sassc
No preview for this file type
analytics/static/analytics/general.css
@@ -57,7 +57,8 @@ | @@ -57,7 +57,8 @@ | ||
57 | 57 | ||
58 | .chart { | 58 | .chart { |
59 | width: 30%; | 59 | width: 30%; |
60 | - float: left; } | 60 | + float: left; |
61 | + text-align: center; } | ||
61 | .chart h4 { | 62 | .chart h4 { |
62 | color: #009688; } | 63 | color: #009688; } |
63 | 64 | ||
@@ -114,4 +115,8 @@ | @@ -114,4 +115,8 @@ | ||
114 | .most-accessed-item:hover { | 115 | .most-accessed-item:hover { |
115 | background-color: #3aa7ad; } | 116 | background-color: #3aa7ad; } |
116 | 117 | ||
118 | +#month_selector_div { | ||
119 | + text-align: center; | ||
120 | + color: #009688; } | ||
121 | + | ||
117 | /*# sourceMappingURL=general.css.map */ | 122 | /*# sourceMappingURL=general.css.map */ |
analytics/static/analytics/general.css.map
1 | { | 1 | { |
2 | "version": 3, | 2 | "version": 3, |
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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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", |
4 | "sources": ["general.sass"], | 4 | "sources": ["general.sass"], |
5 | "names": [], | 5 | "names": [], |
6 | "file": "general.css" | 6 | "file": "general.css" |
analytics/static/analytics/general.sass
@@ -74,6 +74,7 @@ $title-color: #009688 | @@ -74,6 +74,7 @@ $title-color: #009688 | ||
74 | .chart | 74 | .chart |
75 | width: 30% | 75 | width: 30% |
76 | float: left | 76 | float: left |
77 | + text-align: center | ||
77 | h4 | 78 | h4 |
78 | color: $title-color | 79 | color: $title-color |
79 | 80 | ||
@@ -132,4 +133,9 @@ $title-color: #009688 | @@ -132,4 +133,9 @@ $title-color: #009688 | ||
132 | border-bottom-color: #52b7bd | 133 | border-bottom-color: #52b7bd |
133 | 134 | ||
134 | .most-accessed-item:hover | 135 | .most-accessed-item:hover |
135 | - background-color: #3aa7ad | ||
136 | \ No newline at end of file | 136 | \ No newline at end of file |
137 | + background-color: #3aa7ad | ||
138 | + | ||
139 | + | ||
140 | +#month_selector_div | ||
141 | + text-align: center | ||
142 | + color: #009688 | ||
137 | \ No newline at end of file | 143 | \ No newline at end of file |
analytics/static/analytics/js/behavior.js
@@ -12,9 +12,14 @@ $(document).ready(function(){ | @@ -12,9 +12,14 @@ $(document).ready(function(){ | ||
12 | 12 | ||
13 | }); | 13 | }); |
14 | }); | 14 | }); |
15 | + //week date selector at the right-chart field | ||
16 | + $('input.datepicker').datetimepicker({ | ||
17 | + format: 'L', | ||
18 | + defaultDate: new Date(), | ||
19 | + }).on('dp.change', function(ev){ | ||
20 | + console.log(ev.date._i); | ||
21 | + }); | ||
15 | 22 | ||
16 | - | ||
17 | - $('#datetimepicker1').datetimepicker(); | ||
18 | 23 | ||
19 | 24 | ||
20 | }); | 25 | }); |
analytics/templates/analytics/general.html
@@ -7,7 +7,7 @@ | @@ -7,7 +7,7 @@ | ||
7 | {% endblock style %} | 7 | {% endblock style %} |
8 | 8 | ||
9 | {% block javascript %} | 9 | {% block javascript %} |
10 | - | 10 | + |
11 | <script type="text/javascript" src="{% static "analytics/js/charts.js" %}"></script> | 11 | <script type="text/javascript" src="{% static "analytics/js/charts.js" %}"></script> |
12 | <script type="text/javascript" src=" {% static "analytics/js/behavior.js" %} "></script> | 12 | <script type="text/javascript" src=" {% static "analytics/js/behavior.js" %} "></script> |
13 | {% endblock javascript %} | 13 | {% endblock javascript %} |
@@ -69,19 +69,20 @@ | @@ -69,19 +69,20 @@ | ||
69 | <section class="bottom-section"> | 69 | <section class="bottom-section"> |
70 | <div class="chart left-chart"> | 70 | <div class="chart left-chart"> |
71 | 71 | ||
72 | - | 72 | + <h4>{% trans "Most accessed " %}</h4> |
73 | <div id="left-data-selector"> | 73 | <div id="left-data-selector"> |
74 | + | ||
74 | 75 | ||
75 | <div class="selector" data-url="categories"> | 76 | <div class="selector" data-url="categories"> |
76 | - <p> {% trans "most accessed categories" %} </p> | 77 | + <p> {% trans "Most accessed categories" %} </p> |
77 | </div> | 78 | </div> |
78 | 79 | ||
79 | <div class="selector" data-url="subjects"> | 80 | <div class="selector" data-url="subjects"> |
80 | - <p> {% trans "most accessed subjects" %} </p> | 81 | + <p> {% trans "Most accessed subjects" %} </p> |
81 | </div> | 82 | </div> |
82 | 83 | ||
83 | <div class="selector" data-url="resources"> | 84 | <div class="selector" data-url="resources"> |
84 | - <p> {% trans "most accessed resource" %} </p> | 85 | + <p> {% trans "Most accessed resource" %} </p> |
85 | </div> | 86 | </div> |
86 | 87 | ||
87 | </div> | 88 | </div> |
@@ -89,33 +90,34 @@ | @@ -89,33 +90,34 @@ | ||
89 | </div> | 90 | </div> |
90 | <div class="chart middle-chart"> | 91 | <div class="chart middle-chart"> |
91 | <article> | 92 | <article> |
92 | - <h4>{% trans "most active users" %}</h4> | 93 | + <h4>{% trans "Most active users" %}</h4> |
93 | </article> | 94 | </article> |
94 | 95 | ||
95 | </div> | 96 | </div> |
96 | <div class="chart right-chart"> | 97 | <div class="chart right-chart"> |
97 | - <div> | ||
98 | - <p>{% trans "amount of access in: " %}</p> | 98 | + <div id="month_selector_div"> |
99 | + <h4>{% trans "Amount of access in: " %} | ||
99 | <select id="month_selector"> | 100 | <select id="month_selector"> |
100 | {% for month in months %} | 101 | {% for month in months %} |
101 | <option>{{month}}</option> | 102 | <option>{{month}}</option> |
102 | {% endfor %} | 103 | {% endfor %} |
103 | 104 | ||
104 | </select> | 105 | </select> |
106 | + </h4> | ||
105 | </div> | 107 | </div> |
106 | 108 | ||
107 | <div id="right-chart-body"> | 109 | <div id="right-chart-body"> |
108 | 110 | ||
109 | </div> | 111 | </div> |
110 | 112 | ||
111 | - <div class="form-group"> | ||
112 | - <div class='input-group date' id='datetimepicker1'> | ||
113 | - <input type='text' class="form-control" /> | ||
114 | - <span class="input-group-addon"> | ||
115 | - <span class="glyphicon glyphicon-calendar"></span> | ||
116 | - </span> | ||
117 | - </div> | 113 | + <div class='input-group date'> |
114 | + <label>{% trans "Select the begin of the week: " %}</label> | ||
115 | + <input type='text' class="datepicker form-control" /> | ||
116 | + <span class="input-group-addon"> | ||
117 | + <span class="glyphicon glyphicon-calendar"></span> | ||
118 | + </span> | ||
118 | </div> | 119 | </div> |
120 | + | ||
119 | </div> | 121 | </div> |
120 | </section> | 122 | </section> |
121 | 123 |
analytics/views.py
@@ -176,3 +176,7 @@ def get_days_of_the_month(month): | @@ -176,3 +176,7 @@ def get_days_of_the_month(month): | ||
176 | return days_set | 176 | return days_set |
177 | 177 | ||
178 | 178 | ||
179 | +def get_days_of_the_week(date): | ||
180 | + | ||
181 | + days_set = set() | ||
182 | + return days_set | ||
179 | \ No newline at end of file | 183 | \ No newline at end of file |