sinatra-hexacta 1.1.0 → 1.1.5
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.
- checksums.yaml +4 -4
- data/lib/sinatra/handlers/constants.rb +3 -1
- data/lib/sinatra/views/charts/pie.slim +37 -34
- data/lib/sinatra/views/constants/group.slim +1 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 600547c558970ce888f15fb4aa5822676f4099cbac81da59884aa166fc2d0ef1
|
4
|
+
data.tar.gz: 9cac99f04d6b474da4e6a0f40352342350a68f7d6ef2e05a8fac48480e66fd44
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 90ecdf14c00ffd178ffeff95ea3ac28eb499df35fea02267a5656e1c520c247c65000fa130e1de6a0758c6daf84a3b05c7d1ddc10494ae1ab4f71eeb08e4b9a2
|
7
|
+
data.tar.gz: 9b3bebb7422bb09f16f45cdd54a87a82c20a46a7e73ff9225b55536c32e17015529f46c5c906bdbf3bb778012b02598c2f94c3da0cb28d732943633642c8501e
|
@@ -5,9 +5,11 @@ module Sinatra
|
|
5
5
|
|
6
6
|
def enable_constants
|
7
7
|
p "Enabling constants..."
|
8
|
+
ConstantHandler.setup_dir("/app/views/#{Hexacta::GEM_FILE_DIR}/constants")
|
9
|
+
ConstantHandler.copy_all_files("/lib/sinatra/views/constants","/app/views/#{Hexacta::GEM_FILE_DIR}/constants")
|
8
10
|
|
9
11
|
before '/constant*' do
|
10
|
-
error(403) if authenticated(User).permissions.empty?
|
12
|
+
error(403) if authenticated(User).permissions.empty?
|
11
13
|
end
|
12
14
|
|
13
15
|
get '/constants' do
|
@@ -1,38 +1,41 @@
|
|
1
|
-
|
1
|
+
-if serie.empty?
|
2
|
+
== empty_alert({ :title => "Sin datos suficientes", :message => "No hay suficientes datos para mostrar esta información."})
|
3
|
+
-else
|
4
|
+
.ct-chart.pie id="#{id}"
|
2
5
|
|
3
|
-
.table-responsive.chart-table
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
6
|
+
.table-responsive.chart-table
|
7
|
+
table.table.table-striped
|
8
|
+
tbody
|
9
|
+
tr
|
10
|
+
-for label in labels
|
11
|
+
th #{label}
|
12
|
+
tr
|
13
|
+
-for element in serie
|
14
|
+
td #{element}
|
15
|
+
tr
|
16
|
+
-total = [1,serie.reduce(:+)].max
|
17
|
+
-for element in serie
|
18
|
+
td #{(element.to_f*100/total).round(0)}%
|
16
19
|
|
17
|
-
javascript:
|
18
|
-
|
19
|
-
|
20
|
+
javascript:
|
21
|
+
var labels = #{{labels}};
|
22
|
+
var serie = #{{serie}};
|
20
23
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
24
|
+
new Chartist.Pie("##{id}", {
|
25
|
+
labels: labels,
|
26
|
+
series: serie
|
27
|
+
}, {
|
28
|
+
fullWidth: true,
|
29
|
+
showLabel: false,
|
30
|
+
height: '300px',
|
31
|
+
plugins: [
|
32
|
+
Chartist.plugins.legend()
|
33
|
+
]
|
34
|
+
}
|
35
|
+
);
|
33
36
|
|
34
|
-
css:
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
37
|
+
css:
|
38
|
+
.pie .ct-legend.ct-legend-inside {
|
39
|
+
position: absolute;
|
40
|
+
top: 60px;
|
41
|
+
}
|
@@ -30,14 +30,12 @@ a.btn.btn-float.bgm-blue.m-btn.waves-effect.waves-circle.waves-float data-toggle
|
|
30
30
|
|
31
31
|
.modal.fade id="edit-constant" tabindex="-1" role="dialog" aria-labelledby="editConstant"
|
32
32
|
.modal-dialog
|
33
|
-
form.modal-content method="POST" data-toggle="validator"
|
33
|
+
form.modal-content.action method="POST" data-toggle="validator"
|
34
34
|
.modal-content
|
35
35
|
.modal-header
|
36
36
|
h4.modal-title Editar constante
|
37
37
|
.modal-body
|
38
38
|
.row
|
39
|
-
.col-sm-12
|
40
|
-
== select_input({ :id => 'edit_kind', :name => "kind", :elements => [{ :value => nil, :text => 'Elige tipo de constante' }] + (Constant.descendants).collect { |constant_class| { :value => constant_class, :text => constant_class.new.name } }.uniq, :placeholder => "Tipo de constante", :chosen => nil, :required => true })
|
41
39
|
.col-sm-12
|
42
40
|
== input({ :id => 'edit_value', :name => "value", :title => "Valor", :type => 'text', :value => nil, :required => true })
|
43
41
|
.modal-footer
|