blazer 1.0.4 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of blazer might be problematic. Click here for more details.

@@ -263,8 +263,8 @@ th {
263
263
  @font-face {
264
264
  font-family: 'Glyphicons Halflings';
265
265
 
266
- src: url('../fonts/glyphicons-halflings-regular.eot');
267
- src: url('../fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'), url('../fonts/glyphicons-halflings-regular.woff') format('woff'), url('../fonts/glyphicons-halflings-regular.ttf') format('truetype'), url('../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular') format('svg');
266
+ src: url('<%= font_path("blazer/glyphicons-halflings-regular.eot") %>');
267
+ src: url('<%= font_path("blazer/glyphicons-halflings-regular.eot?#iefix") %>') format('embedded-opentype'), url('<%= font_path("blazer/glyphicons-halflings-regular.woff") %>') format('woff'), url('<%= font_path("blazer/glyphicons-halflings-regular.ttf") %>') format('truetype'), url('<%= font_path("blazer/glyphicons-halflings-regular.svg#glyphicons_halflingsregular") %>') format('svg');
268
268
  }
269
269
  .glyphicon {
270
270
  position: relative;
@@ -1,134 +1,12 @@
1
- /*!
2
- * Stylesheet for the Date Range Picker, for use with Bootstrap 3.x
3
- *
4
- * Copyright 2013-2015 Dan Grossman ( http://www.dangrossman.info )
5
- * Licensed under the MIT license. See http://www.opensource.org/licenses/mit-license.php
6
- *
7
- * Built for http://www.improvely.com
8
- */
9
-
10
- .daterangepicker.dropdown-menu {
11
- max-width: none;
12
- z-index: 3000;
13
- }
14
-
15
- .daterangepicker.opensleft .ranges, .daterangepicker.opensleft .calendar {
16
- float: left;
17
- margin: 4px;
18
- }
19
-
20
- .daterangepicker.opensright .ranges, .daterangepicker.opensright .calendar,
21
- .daterangepicker.openscenter .ranges, .daterangepicker.openscenter .calendar {
22
- float: right;
23
- margin: 4px;
24
- }
25
-
26
- .daterangepicker.single .ranges, .daterangepicker.single .calendar {
27
- float: none;
28
- }
29
-
30
- .daterangepicker .ranges {
31
- width: 160px;
32
- text-align: left;
33
- }
34
-
35
- .daterangepicker .ranges .range_inputs>div {
36
- float: left;
37
- }
38
-
39
- .daterangepicker .ranges .range_inputs>div:nth-child(2) {
40
- padding-left: 11px;
41
- }
42
-
43
- .daterangepicker .calendar {
44
- display: none;
45
- max-width: 270px;
46
- }
47
-
48
- .daterangepicker.show-calendar .calendar {
49
- display: block;
50
- }
51
-
52
- .daterangepicker .calendar.single .calendar-date {
53
- border: none;
54
- }
55
-
56
- .daterangepicker .calendar th, .daterangepicker .calendar td {
57
- font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
58
- white-space: nowrap;
59
- text-align: center;
60
- min-width: 32px;
61
- }
62
-
63
- .daterangepicker .daterangepicker_start_input label,
64
- .daterangepicker .daterangepicker_end_input label {
65
- color: #333;
66
- display: block;
67
- font-size: 11px;
68
- font-weight: normal;
69
- height: 20px;
70
- line-height: 20px;
71
- margin-bottom: 2px;
72
- text-shadow: #fff 1px 1px 0px;
73
- text-transform: uppercase;
74
- width: 74px;
75
- }
1
+ /**
2
+ * A stylesheet for use with Bootstrap 3.x
3
+ * @author: Dan Grossman http://www.dangrossman.info/
4
+ * @copyright: Copyright (c) 2012-2015 Dan Grossman. All rights reserved.
5
+ * @license: Licensed under the MIT license. See http://www.opensource.org/licenses/mit-license.php
6
+ * @website: https://www.improvely.com/
7
+ */
76
8
 
77
- .daterangepicker .ranges input {
78
- font-size: 11px;
79
- }
80
-
81
- .daterangepicker .ranges .input-mini {
82
- border: 1px solid #ccc;
83
- border-radius: 4px;
84
- color: #555;
85
- display: block;
86
- font-size: 11px;
87
- height: 30px;
88
- line-height: 30px;
89
- vertical-align: middle;
90
- margin: 0 0 10px 0;
91
- padding: 0 6px;
92
- width: 74px;
93
- }
94
-
95
- .daterangepicker .ranges ul {
96
- list-style: none;
97
- margin: 0;
98
- padding: 0;
99
- }
100
-
101
- .daterangepicker .ranges li {
102
- font-size: 13px;
103
- background: #f5f5f5;
104
- border: 1px solid #f5f5f5;
105
- color: #08c;
106
- padding: 3px 12px;
107
- margin-bottom: 8px;
108
- -webkit-border-radius: 5px;
109
- -moz-border-radius: 5px;
110
- border-radius: 5px;
111
- cursor: pointer;
112
- }
113
-
114
- .daterangepicker .ranges li.active, .daterangepicker .ranges li:hover {
115
- background: #08c;
116
- border: 1px solid #08c;
117
- color: #fff;
118
- }
119
-
120
- .daterangepicker .calendar-date {
121
- border: 1px solid #ddd;
122
- padding: 4px;
123
- border-radius: 4px;
124
- background: #fff;
125
- }
126
-
127
- .daterangepicker .calendar-time {
128
- text-align: center;
129
- margin: 8px auto 0 auto;
130
- line-height: 30px;
131
- }
9
+ /* Container Appearance */
132
10
 
133
11
  .daterangepicker {
134
12
  position: absolute;
@@ -137,9 +15,8 @@
137
15
  left: 20px;
138
16
  padding: 4px;
139
17
  margin-top: 1px;
140
- -webkit-border-radius: 4px;
141
- -moz-border-radius: 4px;
142
18
  border-radius: 4px;
19
+ width:278px;
143
20
  }
144
21
 
145
22
  .daterangepicker.opensleft:before {
@@ -219,6 +96,60 @@
219
96
  content: '';
220
97
  }
221
98
 
99
+ .daterangepicker.dropup{
100
+ margin-top: -5px;
101
+ }
102
+ .daterangepicker.dropup:before{
103
+ top: initial;
104
+ bottom:-7px;
105
+ border-bottom: initial;
106
+ border-top: 7px solid #ccc;
107
+ }
108
+ .daterangepicker.dropup:after{
109
+ top: initial;
110
+ bottom:-6px;
111
+ border-bottom: initial;
112
+ border-top: 6px solid #fff;
113
+ }
114
+
115
+ .daterangepicker.dropdown-menu {
116
+ max-width: none;
117
+ z-index: 3000;
118
+ }
119
+
120
+ .daterangepicker.single .ranges, .daterangepicker.single .calendar {
121
+ float: none;
122
+ }
123
+
124
+ .daterangepicker .calendar {
125
+ display: none;
126
+ max-width: 270px;
127
+ margin: 4px;
128
+ }
129
+
130
+ .daterangepicker.show-calendar .calendar {
131
+ display: block;
132
+ }
133
+
134
+ .daterangepicker .calendar.single .calendar-table {
135
+ border: none;
136
+ }
137
+
138
+ /* Calendars */
139
+
140
+ .daterangepicker .calendar th, .daterangepicker .calendar td {
141
+ white-space: nowrap;
142
+ text-align: center;
143
+ min-width: 32px;
144
+ }
145
+
146
+ .daterangepicker .calendar-table {
147
+ border: 1px solid #ddd;
148
+ padding: 4px;
149
+ border-radius: 4px;
150
+ background: #fff;
151
+ }
152
+
222
153
  .daterangepicker table {
223
154
  width: 100%;
224
155
  margin: 0;
@@ -228,19 +159,20 @@
228
159
  text-align: center;
229
160
  width: 20px;
230
161
  height: 20px;
231
- -webkit-border-radius: 4px;
232
- -moz-border-radius: 4px;
233
162
  border-radius: 4px;
234
- cursor: pointer;
235
163
  white-space: nowrap;
164
+ cursor: pointer;
236
165
  }
237
166
 
238
- .daterangepicker td.off {
167
+ .daterangepicker td.off, .daterangepicker td.off.in-range, .daterangepicker td.off.start-date, .daterangepicker td.off.end-date {
239
168
  color: #999;
169
+ background: #fff;
240
170
  }
241
171
 
242
172
  .daterangepicker td.disabled, .daterangepicker option.disabled {
243
173
  color: #999;
174
+ cursor: not-allowed;
175
+ text-decoration: line-through;
244
176
  }
245
177
 
246
178
  .daterangepicker td.available:hover, .daterangepicker th.available:hover {
@@ -249,26 +181,18 @@
249
181
 
250
182
  .daterangepicker td.in-range {
251
183
  background: #ebf4f8;
252
- -webkit-border-radius: 0;
253
- -moz-border-radius: 0;
254
184
  border-radius: 0;
255
185
  }
256
186
 
257
187
  .daterangepicker td.start-date {
258
- -webkit-border-radius: 4px 0 0 4px;
259
- -moz-border-radius: 4px 0 0 4px;
260
188
  border-radius: 4px 0 0 4px;
261
189
  }
262
190
 
263
191
  .daterangepicker td.end-date {
264
- -webkit-border-radius: 0 4px 4px 0;
265
- -moz-border-radius: 0 4px 4px 0;
266
192
  border-radius: 0 4px 4px 0;
267
193
  }
268
194
 
269
195
  .daterangepicker td.start-date.end-date {
270
- -webkit-border-radius: 4px;
271
- -moz-border-radius: 4px;
272
196
  border-radius: 4px;
273
197
  }
274
198
 
@@ -305,15 +229,147 @@
305
229
  margin-bottom: 0;
306
230
  }
307
231
 
308
- .daterangepicker_start_input {
309
- float: left;
232
+ .daterangepicker th.month {
233
+ width: auto;
310
234
  }
311
235
 
312
- .daterangepicker_end_input {
313
- float: left;
314
- padding-left: 11px
236
+ /* Text Input Above Each Calendar */
237
+
238
+ .daterangepicker .input-mini {
239
+ border: 1px solid #ccc;
240
+ border-radius: 4px;
241
+ color: #555;
242
+ display: block;
243
+ height: 30px;
244
+ line-height: 30px;
245
+ vertical-align: middle;
246
+ margin: 0 0 5px 0;
247
+ padding: 0 6px 0 28px;
248
+ width: 100%;
315
249
  }
316
250
 
317
- .daterangepicker th.month {
318
- width: auto;
251
+ .daterangepicker .input-mini.active {
252
+ border: 1px solid #357ebd;
253
+ }
254
+
255
+ .daterangepicker .daterangepicker_input i {
256
+ position: absolute;
257
+ left: 8px;
258
+ top: 8px;
259
+ }
260
+
261
+ .daterangepicker .daterangepicker_input {
262
+ position: relative;
263
+ }
264
+
265
+ /* Time Picker */
266
+
267
+ .daterangepicker .calendar-time {
268
+ text-align: center;
269
+ margin: 5px auto;
270
+ line-height: 30px;
271
+ position: relative;
272
+ padding-left: 28px;
273
+ }
274
+
275
+ .daterangepicker .calendar-time select.disabled {
276
+ color: #ccc;
277
+ cursor: not-allowed;
278
+ }
279
+
280
+ /* Predefined Ranges */
281
+
282
+ .daterangepicker .ranges {
283
+ font-size: 11px;
284
+ float: none;
285
+ margin: 4px;
286
+ text-align: left;
287
+ }
288
+
289
+ .daterangepicker .ranges ul {
290
+ list-style: none;
291
+ margin: 0 auto;
292
+ padding: 0;
293
+ width: 100%;
294
+ }
295
+
296
+ .daterangepicker .ranges li {
297
+ font-size: 13px;
298
+ background: #f5f5f5;
299
+ border: 1px solid #f5f5f5;
300
+ color: #08c;
301
+ padding: 3px 12px;
302
+ margin-bottom: 8px;
303
+ border-radius: 5px;
304
+ cursor: pointer;
305
+ }
306
+
307
+ .daterangepicker .ranges li.active, .daterangepicker .ranges li:hover {
308
+ background: #08c;
309
+ border: 1px solid #08c;
310
+ color: #fff;
311
+ }
312
+
313
+ /* Larger Screen Styling */
314
+ @media (min-width: 564px) {
315
+ .daterangepicker{
316
+ width: auto;
317
+ }
318
+
319
+ .daterangepicker .ranges ul {
320
+ width: 160px;
321
+ }
322
+ .daterangepicker.single .ranges ul {
323
+ width: 100%;
324
+ }
325
+ .daterangepicker .calendar.left .calendar-table {
326
+ border-right: none;
327
+ border-top-right-radius: 0;
328
+ border-bottom-right-radius: 0;
329
+ }
330
+
331
+ .daterangepicker .calendar.right .calendar-table {
332
+ border-left: none;
333
+ border-top-left-radius: 0;
334
+ border-bottom-left-radius: 0;
335
+ }
336
+
337
+ .daterangepicker .calendar.left {
338
+ clear: left;
339
+ margin-right: 0;
340
+ }
341
+ .daterangepicker.single .calendar.left {
342
+ clear: none;
343
+ }
344
+ .daterangepicker.single .ranges,
345
+ .daterangepicker.single .calendar{
346
+ float:left;
347
+ }
348
+
349
+ .daterangepicker .calendar.right {
350
+ margin-left: 0;
351
+ }
352
+
353
+ .daterangepicker .left .daterangepicker_input {
354
+ padding-right: 12px;
355
+ }
356
+
357
+ .daterangepicker .calendar.left .calendar-table {
358
+ padding-right: 12px;
359
+ }
360
+
361
+ .daterangepicker .ranges,
362
+ .daterangepicker .calendar {
363
+ float: left;
364
+ }
365
+ }
366
+
367
+ @media (min-width: 730px) {
368
+ .daterangepicker .ranges {
369
+ width: auto;
370
+ float: left;
371
+ }
372
+ .daterangepicker .calendar.left {
373
+ clear: none;
374
+ }
319
375
  }
@@ -42,7 +42,7 @@ module Blazer
42
42
  helper_method :extract_vars
43
43
 
44
44
  def variable_params
45
- params.except(:controller, :action, :id, :host, :query, :query_id, :table_names, :authenticity_token, :utf8, :_method, :commit, :statement, :data_source, :name)
45
+ params.except(:controller, :action, :id, :host, :query, :dashboard, :query_id, :query_ids, :table_names, :authenticity_token, :utf8, :_method, :commit, :statement, :data_source, :name)
46
46
  end
47
47
  helper_method :variable_params
48
48
 
@@ -1,6 +1,6 @@
1
1
  module Blazer
2
2
  class DashboardsController < BaseController
3
- before_action :set_dashboard, only: [:show, :edit, :update, :destroy]
3
+ before_action :set_dashboard, only: [:show, :edit, :update, :destroy, :refresh]
4
4
 
5
5
  def index
6
6
  @dashboards = Blazer::Dashboard.order(:name)
@@ -29,9 +29,9 @@ module Blazer
29
29
 
30
30
  @smart_vars = {}
31
31
  @sql_errors = []
32
- data_sources = @queries.map { |q| Blazer.data_sources[q.data_source] }.uniq
32
+ @data_sources = @queries.map { |q| Blazer.data_sources[q.data_source] }.uniq
33
33
  @bind_vars.each do |var|
34
- data_sources.each do |data_source|
34
+ @data_sources.each do |data_source|
35
35
  query = data_source.smart_variables[var]
36
36
  if query
37
37
  rows, error, cached_at = data_source.run_statement(query)
@@ -47,7 +47,7 @@ module Blazer
47
47
 
48
48
  def update
49
49
  if update_dashboard(@dashboard)
50
- redirect_to dashboard_path(@dashboard)
50
+ redirect_to dashboard_path(@dashboard, variable_params)
51
51
  else
52
52
  render :edit
53
53
  end
@@ -58,6 +58,17 @@ module Blazer
58
58
  redirect_to dashboards_path
59
59
  end
60
60
 
61
+ def refresh
62
+ @dashboard.queries.each do |query|
63
+ data_source = Blazer.data_sources[query.data_source]
64
+ statement = query.statement.dup
65
+ process_vars(statement)
66
+ Blazer.transform_statement.call(data_source, statement) if Blazer.transform_statement
67
+ data_source.clear_cache(statement)
68
+ end
69
+ redirect_to dashboard_path(@dashboard, variable_params)
70
+ end
71
+
61
72
  protected
62
73
 
63
74
  def dashboard_params