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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: df6a0ef3c8ba7cdd6d652d08a0c930519dca2aec379bd3275d24fb99f839129e
4
- data.tar.gz: c47bab0989ad1a159a308cdc3c229c121293e6d483b14dce97efe0ced18474aa
3
+ metadata.gz: 600547c558970ce888f15fb4aa5822676f4099cbac81da59884aa166fc2d0ef1
4
+ data.tar.gz: 9cac99f04d6b474da4e6a0f40352342350a68f7d6ef2e05a8fac48480e66fd44
5
5
  SHA512:
6
- metadata.gz: fafe733141d4516b0f0b360097ad195b638fced57dce48fd5fefe1fd0b968ef54afeae4720744827e60ae3742d8ed1870063eb30e9c71c9ee4072ffd9f246353
7
- data.tar.gz: d19d3fb7fdc997ad5a4fddefcb1680e4b07e9bc7270b1373617b6688a8ca45ebffd68e706f78bd96ba2acaeff1def4e3488466da11bd53c55dd4b8d0ca3458a1
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? && authenticated(User).recruiter.nil?
12
+ error(403) if authenticated(User).permissions.empty?
11
13
  end
12
14
 
13
15
  get '/constants' do
@@ -1,38 +1,41 @@
1
- .ct-chart.pie id="#{id}"
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
- table.table.table-striped
5
- tbody
6
- tr
7
- -for label in labels
8
- th #{label}
9
- tr
10
- -for element in serie
11
- td #{element}
12
- tr
13
- -total = [1,serie.reduce(:+)].max
14
- -for element in serie
15
- td #{(element.to_f*100/total).round(0)}%
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
- var labels = #{{labels}};
19
- var serie = #{{serie}};
20
+ javascript:
21
+ var labels = #{{labels}};
22
+ var serie = #{{serie}};
20
23
 
21
- new Chartist.Pie("##{id}", {
22
- labels: labels,
23
- series: serie
24
- }, {
25
- fullWidth: true,
26
- showLabel: false,
27
- height: '300px',
28
- plugins: [
29
- Chartist.plugins.legend()
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
- .pie .ct-legend.ct-legend-inside {
36
- position: absolute;
37
- top: 60px;
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sinatra-hexacta
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marco Zanger