lato_view 1.1.4 → 1.1.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (123) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/images/lato_view/icons/_artist.svg +0 -0
  3. data/app/assets/images/lato_view/icons/_artwork.svg +0 -0
  4. data/app/assets/images/lato_view/icons/_calendar.svg +0 -0
  5. data/app/assets/images/lato_view/icons/_clients.svg +0 -0
  6. data/app/assets/images/lato_view/icons/_home.svg +0 -0
  7. data/app/assets/images/lato_view/icons/_list.svg +0 -0
  8. data/app/assets/images/lato_view/icons/_magni-glass.svg +0 -0
  9. data/app/assets/images/lato_view/icons/_percentage.svg +0 -0
  10. data/app/assets/images/lato_view/icons/_sweet.svg +0 -0
  11. data/app/assets/images/lato_view/icons/_users.svg +0 -0
  12. data/app/assets/javascripts/lato_view/application.js +8 -6
  13. data/app/assets/javascripts/lato_view/build/ActionBar.js +0 -0
  14. data/app/assets/javascripts/lato_view/build/ConfirmationPopup.js +52 -0
  15. data/app/assets/javascripts/lato_view/build/Dropdown.js +0 -0
  16. data/app/assets/javascripts/lato_view/build/FormManager.js +170 -50
  17. data/app/assets/javascripts/lato_view/build/Step.js +169 -0
  18. data/app/assets/javascripts/lato_view/build/Util.js +25 -9
  19. data/app/assets/javascripts/lato_view/build/Validator.js +70 -48
  20. data/app/assets/stylesheets/lato_view/config/_config.scss +4 -4
  21. data/app/assets/stylesheets/lato_view/config/templates/_base-template.scss +22 -0
  22. data/app/assets/stylesheets/lato_view/config/templates/_black-template.scss +26 -6
  23. data/app/assets/stylesheets/lato_view/config/templates/_feral-template.scss +190 -0
  24. data/app/assets/stylesheets/lato_view/config/templates/_mauve-template.scss +178 -0
  25. data/app/assets/stylesheets/lato_view/config/templates/_orange-template.scss +184 -0
  26. data/app/assets/stylesheets/lato_view/modules/_arranger.scss +0 -0
  27. data/app/assets/stylesheets/lato_view/modules/_button-group.scss +0 -0
  28. data/app/assets/stylesheets/lato_view/modules/_buttons.scss +13 -7
  29. data/app/assets/stylesheets/lato_view/modules/_confirmation-popup.scss +63 -0
  30. data/app/assets/stylesheets/lato_view/modules/_dropdown.scss +0 -0
  31. data/app/assets/stylesheets/lato_view/modules/_form-controls.scss +11 -2
  32. data/app/assets/stylesheets/lato_view/modules/_modules.scss +2 -0
  33. data/app/assets/stylesheets/lato_view/modules/_pagination.scss +0 -0
  34. data/app/assets/stylesheets/lato_view/modules/_sidebar.scss +2 -2
  35. data/app/assets/stylesheets/lato_view/modules/_status.scss +0 -0
  36. data/app/assets/stylesheets/lato_view/modules/_step.scss +53 -0
  37. data/app/assets/stylesheets/lato_view/modules/_wyswyg.scss +4 -0
  38. data/app/assets/stylesheets/lato_view/views/_admin.scss +4 -1
  39. data/app/assets/stylesheets/lato_view/views/_login.scss +5 -4
  40. data/app/cells/lato_view/cells_v1/buttongroup/cell.rb +0 -0
  41. data/app/cells/lato_view/cells_v1/buttongroup/views/show.html.erb +0 -0
  42. data/app/cells/lato_view/cells_v1/dropdown/cell.rb +0 -0
  43. data/app/cells/lato_view/cells_v1/dropdown/views/show.html.erb +0 -0
  44. data/app/cells/lato_view/cells_v1/input/cell.rb +21 -1
  45. data/app/cells/lato_view/cells_v1/input/views/date.html.erb +1 -1
  46. data/app/cells/lato_view/cells_v1/input/views/number.html.erb +8 -3
  47. data/app/cells/lato_view/cells_v1/input/views/select.html.erb +1 -1
  48. data/app/cells/lato_view/cells_v1/input/views/time.html.erb +0 -0
  49. data/app/cells/lato_view/component/button/cell.rb +4 -2
  50. data/app/cells/lato_view/component/button/views/show.html.erb +1 -1
  51. data/app/cells/lato_view/component/buttongroup/cell.rb +0 -0
  52. data/app/cells/lato_view/component/buttongroup/views/show.html.erb +0 -0
  53. data/app/cells/lato_view/component/buttonprompt/cell.rb +38 -0
  54. data/app/cells/lato_view/component/buttonprompt/views/show.html.erb +2 -0
  55. data/app/cells/lato_view/component/dropdown/cell.rb +0 -0
  56. data/app/cells/lato_view/component/dropdown/views/show.html.erb +0 -0
  57. data/app/cells/lato_view/component/form/cell.rb +0 -0
  58. data/app/cells/lato_view/component/form/views/open.html.erb +0 -0
  59. data/app/cells/lato_view/component/form/views/show.html.erb +0 -0
  60. data/app/cells/lato_view/component/searchbar/cell.rb +0 -0
  61. data/app/cells/lato_view/component/searchbar/views/show.html.erb +0 -0
  62. data/app/cells/lato_view/input/checkbox/cell.rb +7 -2
  63. data/app/cells/lato_view/input/checkbox/views/show.html.erb +2 -2
  64. data/app/cells/lato_view/input/date/cell.rb +4 -2
  65. data/app/cells/lato_view/input/date/views/show.html.erb +1 -1
  66. data/app/cells/lato_view/input/doubleselect/cell.rb +72 -0
  67. data/app/cells/lato_view/input/doubleselect/views/show.html.erb +90 -0
  68. data/app/cells/lato_view/input/editor/cell.rb +0 -0
  69. data/app/cells/lato_view/input/editor/views/show.html.erb +0 -0
  70. data/app/cells/lato_view/input/email/cell.rb +0 -0
  71. data/app/cells/lato_view/input/email/views/show.html.erb +0 -0
  72. data/app/cells/lato_view/input/file/cell.rb +0 -0
  73. data/app/cells/lato_view/input/file/views/show.html.erb +0 -0
  74. data/app/cells/lato_view/input/map/cell.rb +54 -0
  75. data/app/cells/lato_view/input/map/views/show.html.erb +103 -0
  76. data/app/cells/lato_view/input/nselect/cell.rb +47 -0
  77. data/app/cells/lato_view/input/nselect/views/show.html.erb +15 -0
  78. data/app/cells/lato_view/input/number/cell.rb +4 -2
  79. data/app/cells/lato_view/input/number/views/show.html.erb +6 -8
  80. data/app/cells/lato_view/input/password/cell.rb +0 -0
  81. data/app/cells/lato_view/input/password/views/show.html.erb +0 -0
  82. data/app/cells/lato_view/input/radio/cell.rb +0 -0
  83. data/app/cells/lato_view/input/radio/views/show.html.erb +0 -0
  84. data/app/cells/lato_view/input/select/cell.rb +3 -2
  85. data/app/cells/lato_view/input/select/views/show.html.erb +2 -2
  86. data/app/cells/lato_view/input/text/cell.rb +1 -1
  87. data/app/cells/lato_view/input/text/views/show.html.erb +3 -3
  88. data/app/cells/lato_view/input/textarea/cell.rb +0 -0
  89. data/app/cells/lato_view/input/textarea/views/show.html.erb +1 -4
  90. data/app/cells/lato_view/input/time/cell.rb +0 -0
  91. data/app/cells/lato_view/input/time/views/show.html.erb +0 -0
  92. data/app/cells/lato_view/layout/actionbar/cell.rb +0 -0
  93. data/app/cells/lato_view/layout/actionbar/views/show.html.erb +0 -0
  94. data/app/cells/lato_view/layout/block/cell.rb +0 -0
  95. data/app/cells/lato_view/layout/index/cell.rb +0 -0
  96. data/app/cells/lato_view/layout/index/views/head.html.erb +0 -0
  97. data/app/cells/lato_view/layout/index/views/rows.html.erb +29 -17
  98. data/app/cells/lato_view/layout/step/cell.rb +50 -0
  99. data/app/cells/lato_view/layout/tablerows/cell.rb +23 -0
  100. data/app/cells/lato_view/layout/tablerows/views/show.html.erb +13 -0
  101. data/app/controllers/lato_view/assets_controller.rb +0 -0
  102. data/app/views/lato_view/develop/home.html.erb +74 -0
  103. data/app/views/lato_view/icons/_artist.svg +0 -0
  104. data/app/views/lato_view/icons/_artwork.svg +0 -0
  105. data/app/views/lato_view/icons/_calendar.svg +0 -0
  106. data/app/views/lato_view/icons/_clients.svg +0 -0
  107. data/app/views/lato_view/icons/_home.svg +0 -0
  108. data/app/views/lato_view/icons/_list.svg +0 -0
  109. data/app/views/lato_view/icons/_magni-glass.svg +0 -0
  110. data/app/views/lato_view/icons/_percentage.svg +0 -0
  111. data/app/views/lato_view/icons/_sweet.svg +0 -0
  112. data/app/views/lato_view/icons/_users.svg +0 -0
  113. data/app/views/lato_view/layout/_prompt.html.erb +11 -0
  114. data/app/views/layouts/lato_layout.html.erb +12 -6
  115. data/config/example.yml +4 -0
  116. data/config/initializers/lists.rb +1 -1
  117. data/config/initializers/ram.rb +1 -0
  118. data/lang/default.yml +3 -0
  119. data/lang/en.yml +3 -0
  120. data/lib/lato_view/interface/assets.rb +16 -0
  121. data/lib/lato_view/interface/images.rb +0 -0
  122. data/lib/lato_view/interface/themes.rb +0 -0
  123. metadata +22 -3
@@ -76,8 +76,17 @@
76
76
  &[data-input="radio"] {
77
77
  .form-block:hover {
78
78
  .label-control:before {
79
- border-color: darken($robin-blue, 5%);
79
+ border-color: $form-control-check-hover;
80
80
  }
81
81
  }
82
82
  }
83
- }
83
+
84
+ &[data-input="disabled"] {
85
+ .form-label {
86
+ color: mix($text-color, white, 50%);
87
+ &:before {
88
+ border-color: lighten($form-control-border-color, 10%);
89
+ }
90
+ }
91
+ }
92
+ }
@@ -11,9 +11,11 @@
11
11
  @import "dropdown";
12
12
  @import "form";
13
13
  @import "form-controls";
14
+ @import "confirmation-popup";
14
15
  @import "upload";
15
16
  @import "flash";
16
17
  @import "table";
17
18
  @import "action-bar";
18
19
  @import "search-bar";
20
+ @import "step";
19
21
  @import "pagination";
@@ -43,10 +43,10 @@
43
43
  .sidebar-list-item {
44
44
  position: relative;
45
45
  .sidebar-main-link {
46
- font-size: 16px;
46
+ font-size: 14px;
47
47
  color: $sidebar-inactive-color;
48
48
  display: block;
49
- padding: 14px 0 14px 25px;
49
+ padding: 10px 0 14px 25px;
50
50
  text-decoration: none;
51
51
  transition: background-color 0.25s ease-in-out, color 0.25s ease;
52
52
  .sidebar-item-icon {
@@ -0,0 +1,53 @@
1
+ .element-step, .step-scroller {
2
+ width: 100%;
3
+ overflow: hidden;
4
+ @include clearfix();
5
+ }
6
+
7
+ .step-scroller {
8
+ transition: all 0.45s;
9
+ }
10
+
11
+ .element-step {
12
+ padding: 10px 0;
13
+ }
14
+
15
+ .step {
16
+ float: left;
17
+ width: 100%;
18
+ }
19
+
20
+ .step-navigator {
21
+ text-align: center;
22
+ padding: 5px 0;
23
+ }
24
+
25
+ .step-paginate-container {
26
+ display: inline-block;
27
+ padding: 0 $step-paginate-spacing;
28
+ }
29
+
30
+ .step-paginate {
31
+ list-style: none;
32
+ margin: 0;
33
+ padding: 0;
34
+ }
35
+
36
+ .step-paginate-index {
37
+ display: inline-block;
38
+ @include size($step-index-base-size);
39
+ line-height: $step-index-base-size;
40
+ cursor: pointer;
41
+ margin-right: $step-index-base-spacing;
42
+ border-radius: 50%;
43
+ box-shadow: $step-index-shadow;
44
+ color: $step-index-base-color;
45
+ transition: all 0.3s;
46
+ &:last-child {
47
+ margin-right: 0;
48
+ }
49
+ &.active, &:hover {
50
+ color: $step-index-active-color;
51
+ box-shadow: $step-index-active-shadow;
52
+ }
53
+ }
@@ -753,3 +753,7 @@ $transition-duration: 150ms;
753
753
  min-height: 100px;
754
754
  max-height: 200px;
755
755
  }
756
+
757
+ .trumbowyg-fullscreen, .trumbowyg-editor {
758
+ max-height: none;
759
+ }
@@ -13,6 +13,9 @@
13
13
  padding: 0 15px 0 30px;
14
14
  @include clearfix();
15
15
  }
16
+ .is-confirmation-popup-open & {
17
+ overflow: hidden;
18
+ }
16
19
  }
17
20
 
18
21
  .admin-section-title {
@@ -27,4 +30,4 @@
27
30
  padding: 0 20px;
28
31
  }
29
32
  }
30
- }
33
+ }
@@ -7,10 +7,10 @@
7
7
  &.login {
8
8
  position: relative;
9
9
  overflow: hidden;
10
- background: #50a3a2;
11
- background: -webkit-linear-gradient(top left, $catskill-white 0%, lighten($ship-cove, 22%) 100%);
12
- background: linear-gradient(to bottom right, $catskill-white 0%, lighten($ship-cove, 22%) 100%);
13
- .flashes-container{
10
+ background: $login-view-base-bg;
11
+ background: -webkit-linear-gradient(top left, $login-view-first-gradient-bg 0%, $login-view-second-gradient-bg 100%);
12
+ background: linear-gradient(to bottom right, $login-view-first-gradient-bg 0%, $login-view-second-gradient-bg 100%);
13
+ .flashes-container {
14
14
  top: 0;
15
15
  }
16
16
  .link-back-login {
@@ -149,4 +149,5 @@
149
149
  text-align: center;
150
150
  max-width: 190px;
151
151
  margin: auto;
152
+ margin-bottom: 25px;
152
153
  }
@@ -40,6 +40,10 @@ module LatoView
40
40
  # * *default*: false
41
41
  attr_accessor :required
42
42
 
43
+ # Valore booleano usato per indicare se il datepicker è un birthdatepicker
44
+ # * *default*: false
45
+ attr_accessor :birthdate
46
+
43
47
  # Valore booleano che indica (nel caso di input password) se mostrare
44
48
  # il pulsante per vedere la password
45
49
  # * *default*: true
@@ -64,6 +68,18 @@ module LatoView
64
68
  # * *default*: false
65
69
  attr_accessor :disabled
66
70
 
71
+ # Valore che indica il minimo nel caso di input number
72
+ # * *default*: nil
73
+ attr_accessor :min
74
+
75
+ # Valore che indica il massimo nel caso di input number
76
+ # * *default*: nil
77
+ attr_accessor :max
78
+
79
+ # Valore che indica se il create è attivo nel caso di input select
80
+ # * *default*: nil
81
+ attr_accessor :create
82
+
67
83
  # Valore che indica (nel caso di input file) se accettare piu' file o
68
84
  # uno singolarmente
69
85
  # * *default*: false
@@ -73,7 +89,7 @@ module LatoView
73
89
  value: '', label: '', width: 'large', required: false,
74
90
  password_visible: true, custom_class: '', options: [],
75
91
  option_blank: false, disabled: false,
76
- multiple_files: false)
92
+ multiple_files: false, birthdate: false, min: nil, max: nil, create: nil)
77
93
  # eseguo brevi controlli sull'input
78
94
  raise 'Input Concept: type has not a correct value' unless @@types.include? type
79
95
  raise 'Input Concept: width has not a correct value' unless @@widths.include? width
@@ -89,9 +105,13 @@ module LatoView
89
105
  @password_visible = password_visible
90
106
  @options = options
91
107
  @custom_class = custom_class
108
+ @select_class = create == true ? 'select-create' : 'select'
92
109
  @option_blank = option_blank
93
110
  @disabled = disabled
94
111
  @multiple_files = multiple_files
112
+ @min = min
113
+ @max = max
114
+ @datepicker_class = birthdate ? 'birthdate-picker' : 'date-picker'
95
115
  end
96
116
 
97
117
  def show
@@ -1,5 +1,5 @@
1
1
  <div class="form-control <%= @width %>" <%= required_data_input %>>
2
2
  <label class="form-label"><%= @label %></label>
3
- <input type="text" class="input date-picker <%= @custom_class %>" name="<%= @name %>" placeholder="<%= @placeholder %>" <%= disabled_data_input %> value="<%= @value %>">
3
+ <input type="text" class="input <%= @datepicker_class %> <%= @custom_class %>" name="<%= @name %>" placeholder="<%= @placeholder %>" <%= disabled_data_input %> value="<%= @value %>">
4
4
  <div class="input-error-message"></div>
5
5
  </div>
@@ -1,5 +1,10 @@
1
- <div class="form-control <%= @width %>" data-control="number" <%= required_data_input %>>
1
+ <div class="form-control <%= @width %>" data-control="number"<%= required_data_input %>>
2
2
  <label class="form-label"><%= @label %></label>
3
- <input type="text" class="input input-number <%= @custom_class %>" <%= disabled_data_input %> name="<%= @name %>" placeholder="<%= @placeholder %>" value="<%= @value %>">
3
+ <input type="number" class="input input-number <%= @custom_class %>"
4
+ name="<%= @name %>" placeholder="<%= @placeholder %>" value="<%= @value %>"
5
+ step="any"
6
+ <% if !@min.nil? %> min="<%=@min%>" <% end %>
7
+ <% if !@max.nil? %> max="<%=@max%>" <% end %>
8
+ <%= disabled_data_input %>>
4
9
  <div class="input-error-message"></div>
5
- </div>
10
+ </div>
@@ -1,6 +1,6 @@
1
1
  <div class="form-control <%= @width %>" <%= required_data_input %>>
2
2
  <label class="form-label"><%= @label %></label>
3
- <select class="select <%= @custom_class %>" name="<%= @name %>" placeholder="<%= @placeholder %>">
3
+ <select class="<%= @select_class %> <%= @custom_class %>" name="<%= @name %>" placeholder="<%= @placeholder %>">
4
4
  <% if(@option_blank) %>
5
5
  <option></option>
6
6
  <% end %>
@@ -4,14 +4,16 @@ module LatoView
4
4
  @@colors = %w(normal yellow green red)
5
5
  @@sizes = %w(normal small)
6
6
 
7
- attr_accessor :title, :url, :color, :size
7
+ attr_accessor :title, :url, :color, :size, :custom_class, :method
8
8
 
9
- def initialize(title: '', url: '', color: 'normal', size: 'normal')
9
+ def initialize(title: '', url: '', color: 'normal', size: 'normal', custom_class: '', method: 'get')
10
10
  # save params
11
11
  @title = title
12
12
  @url = url
13
13
  @color = color
14
14
  @size = size
15
+ @method = method
16
+ @custom_class = custom_class
15
17
  # check params
16
18
  check_params
17
19
  end
@@ -1 +1 @@
1
- <%= link_to @title, @url, class: "lato-button button-#{@color} button-#{@size}" %>
1
+ <%= link_to @title, @url, method: @method, class: "lato-button button-#{@color} button-#{@size} #{@custom_class}" %>
@@ -0,0 +1,38 @@
1
+ module LatoView
2
+ class Component::Buttonprompt::Cell < Cell
3
+
4
+ @@colors = %w(normal yellow green red)
5
+ @@sizes = %w(normal small xsmall)
6
+
7
+ attr_accessor :title, :url, :color, :size, :custom_class, :data_popup_text, :data_popup_no, :data_popup_ok, :custom_method
8
+
9
+ def initialize(title: '', url: '', color: 'normal', size: 'normal',
10
+ custom_class: '', data_popup_text: '',
11
+ data_popup_no: '', data_popup_ok: '', custom_method: 'get')
12
+
13
+ # save params
14
+ @title = title
15
+ @url = url
16
+ @color = color
17
+ @size = size
18
+ @custom_class = custom_class
19
+ @data_popup_text = data_popup_text
20
+ @data_popup_no = data_popup_no
21
+ @data_popup_ok = data_popup_ok
22
+ @custom_method = custom_method
23
+ # check params
24
+ check_params
25
+ end
26
+
27
+ def show
28
+ render 'show.html'
29
+ end
30
+
31
+ # check params
32
+ private def check_params
33
+ raise 'Button Cell: color value in not correct' unless @@colors.include? @color.to_s
34
+ raise 'Button Cell: size value in not correct' unless @@sizes.include? @size.to_s
35
+ end
36
+
37
+ end
38
+ end
@@ -0,0 +1,2 @@
1
+ <%= link_to @title, @url, class: "lato-button js-confirmation-popup-trigger button-#{@color} button-#{@size} #{@custom_class}",
2
+ "data-popup-ok" => "#{@data_popup_ok}", "data-popup-no" => "#{@data_popup_no}", "data-popup-text" => "#{@data_popup_text}", "data-fake-method" => "#{@custom_method}"%>
@@ -4,10 +4,13 @@ module LatoView
4
4
  @@widths = VIEW_INPUTWIDTH
5
5
 
6
6
  attr_accessor :name, :placeholder, :value, :label, :width, :required,
7
- :disabled, :custom_class
7
+ :disabled, :unique_id
8
+
9
+ # NB: The unique_id is used to use more checkbox with same name on same page.
8
10
 
9
11
  def initialize(name: 'input', placeholder: '', value: '', label: '',
10
- width: 'large', required: false, disabled: false)
12
+ width: 'large', required: false, disabled: false, custom_class: '' ,
13
+ unique_id: '')
11
14
  # save params
12
15
  @name = name
13
16
  @placeholder = placeholder
@@ -16,6 +19,8 @@ module LatoView
16
19
  @width = width
17
20
  @required = required
18
21
  @disabled = disabled
22
+ @custom_class = custom_class
23
+ @unique_id = unique_id
19
24
  # check params
20
25
  check_params
21
26
  end
@@ -5,10 +5,10 @@
5
5
  <input type="hidden" name="<%= @name %>" value="0">
6
6
 
7
7
  <input type="checkbox" class="check <%= @custom_class %>" name="<%= @name %>"
8
- id="<%= @name %>" value="1" <%= checked_data_input %>
8
+ id="<%= @name %><%= @unique_id %>" value="1" <%= checked_data_input %>
9
9
  <%= disabled_data_input %>>
10
10
 
11
- <label class="label-control" for="<%= @name %>"><%= @label%></label>
11
+ <label class="label-control" for="<%= @name %><%= @unique_id %>"><%= @label%></label>
12
12
 
13
13
  </div>
14
14
 
@@ -4,11 +4,12 @@ module LatoView
4
4
  @@widths = VIEW_INPUTWIDTH
5
5
 
6
6
  attr_accessor :name, :placeholder, :value, :label, :width, :required,
7
- :disabled, :custom_class
7
+ :disabled, :custom_class, :birthdate
8
8
 
9
9
  def initialize(name: 'input', placeholder: '', value: '', label: '',
10
10
  width: 'large', required: false, disabled: false,
11
- custom_class: '')
11
+ custom_class: '', birthdate: false)
12
+
12
13
  # save params
13
14
  @name = name
14
15
  @placeholder = placeholder
@@ -18,6 +19,7 @@ module LatoView
18
19
  @required = required
19
20
  @disabled = disabled
20
21
  @custom_class = custom_class
22
+ @datepicker_class = birthdate ? 'birthdate-picker' : 'date-picker'
21
23
  # check params
22
24
  check_params
23
25
  end
@@ -2,7 +2,7 @@
2
2
 
3
3
  <label class="form-label"><%= @label %></label>
4
4
 
5
- <input type="text" class="input date-picker <%= @custom_class %>"
5
+ <input type="text" class="input <%= @datepicker_class %> . <%= @custom_class %>"
6
6
  name="<%= @name %>" placeholder="<%= @placeholder %>"
7
7
  value="<%= @value %>" <%= disabled_data_input %>>
8
8
 
@@ -0,0 +1,72 @@
1
+ module LatoView
2
+ class Input::Doubleselect::Cell < Cell
3
+
4
+ @@widths = VIEW_INPUTWIDTH
5
+
6
+ attr_accessor :first_select_name, :first_select_label, :width, :required,
7
+ :disabled, :custom_class, :token, :second_select_label, :second_select_name,
8
+ :first_select_endpoint_url, :second_select_endpoint_url, :first_select_val,
9
+ :second_select_val, :second_select_value_field, :first_select_label_field,
10
+ :first_select_value_field, :second_select_label_field
11
+
12
+ def initialize(first_select_name: 'input',
13
+ second_select_name: '', first_select_label: '',
14
+ width: 'large', required: false, disabled: false,
15
+ custom_class: '', token:'', second_select_label: '',
16
+ first_select_endpoint_url: '', second_select_endpoint_url: '',
17
+ first_select_val: '', second_select_val: '',
18
+ first_select_label_field: 'name', second_select_label_field: 'name',
19
+ first_select_value_field: 'id', second_select_value_field: 'id'
20
+ )
21
+ # save params
22
+ @width = width
23
+ @required = required
24
+ @disabled = disabled
25
+ @custom_class = custom_class
26
+
27
+ @first_select_label = first_select_label
28
+ @second_select_label = second_select_label
29
+ @first_select_endpoint_url = first_select_endpoint_url
30
+ @second_select_endpoint_url = second_select_endpoint_url
31
+ @first_select_name = first_select_name
32
+ @second_select_name = second_select_name
33
+ @first_select_val = first_select_val
34
+ @second_select_val = second_select_val
35
+ @first_select_label_field = first_select_label_field
36
+ @second_select_label_field = second_select_label_field
37
+ @first_select_value_field = first_select_value_field
38
+ @second_select_value_field = second_select_value_field
39
+ @token = token
40
+
41
+ # advise to not use double select
42
+ puts "@" * 20
43
+ puts "DOUBLE SELECT IS DEPRECATED. USE NSELECT."
44
+ puts "@" * 20
45
+
46
+ # check params
47
+ check_params
48
+ end
49
+
50
+ def show
51
+ render "show.html"
52
+ end
53
+
54
+ # return required string to input
55
+ protected def required_data_input
56
+ return "data-input='required'" if @required
57
+ end
58
+
59
+ # return disabled string to input
60
+ protected def disabled_data_input
61
+ return "data-input='disabled'" if @disabled
62
+ end
63
+
64
+ # check params
65
+ private def check_params
66
+ raise 'Input Cells: width has not a correct value' unless @@widths.include? width
67
+ raise 'Input Cells: first_select_endpoint_url is missing ' if @first_select_endpoint_url.blank?
68
+ raise 'Input Cells: second_select_endpoint_url is missing ' if @second_select_endpoint_url.blank?
69
+ end
70
+
71
+ end
72
+ end