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.
- checksums.yaml +4 -4
- data/app/assets/images/lato_view/icons/_artist.svg +0 -0
- data/app/assets/images/lato_view/icons/_artwork.svg +0 -0
- data/app/assets/images/lato_view/icons/_calendar.svg +0 -0
- data/app/assets/images/lato_view/icons/_clients.svg +0 -0
- data/app/assets/images/lato_view/icons/_home.svg +0 -0
- data/app/assets/images/lato_view/icons/_list.svg +0 -0
- data/app/assets/images/lato_view/icons/_magni-glass.svg +0 -0
- data/app/assets/images/lato_view/icons/_percentage.svg +0 -0
- data/app/assets/images/lato_view/icons/_sweet.svg +0 -0
- data/app/assets/images/lato_view/icons/_users.svg +0 -0
- data/app/assets/javascripts/lato_view/application.js +8 -6
- data/app/assets/javascripts/lato_view/build/ActionBar.js +0 -0
- data/app/assets/javascripts/lato_view/build/ConfirmationPopup.js +52 -0
- data/app/assets/javascripts/lato_view/build/Dropdown.js +0 -0
- data/app/assets/javascripts/lato_view/build/FormManager.js +170 -50
- data/app/assets/javascripts/lato_view/build/Step.js +169 -0
- data/app/assets/javascripts/lato_view/build/Util.js +25 -9
- data/app/assets/javascripts/lato_view/build/Validator.js +70 -48
- data/app/assets/stylesheets/lato_view/config/_config.scss +4 -4
- data/app/assets/stylesheets/lato_view/config/templates/_base-template.scss +22 -0
- data/app/assets/stylesheets/lato_view/config/templates/_black-template.scss +26 -6
- data/app/assets/stylesheets/lato_view/config/templates/_feral-template.scss +190 -0
- data/app/assets/stylesheets/lato_view/config/templates/_mauve-template.scss +178 -0
- data/app/assets/stylesheets/lato_view/config/templates/_orange-template.scss +184 -0
- data/app/assets/stylesheets/lato_view/modules/_arranger.scss +0 -0
- data/app/assets/stylesheets/lato_view/modules/_button-group.scss +0 -0
- data/app/assets/stylesheets/lato_view/modules/_buttons.scss +13 -7
- data/app/assets/stylesheets/lato_view/modules/_confirmation-popup.scss +63 -0
- data/app/assets/stylesheets/lato_view/modules/_dropdown.scss +0 -0
- data/app/assets/stylesheets/lato_view/modules/_form-controls.scss +11 -2
- data/app/assets/stylesheets/lato_view/modules/_modules.scss +2 -0
- data/app/assets/stylesheets/lato_view/modules/_pagination.scss +0 -0
- data/app/assets/stylesheets/lato_view/modules/_sidebar.scss +2 -2
- data/app/assets/stylesheets/lato_view/modules/_status.scss +0 -0
- data/app/assets/stylesheets/lato_view/modules/_step.scss +53 -0
- data/app/assets/stylesheets/lato_view/modules/_wyswyg.scss +4 -0
- data/app/assets/stylesheets/lato_view/views/_admin.scss +4 -1
- data/app/assets/stylesheets/lato_view/views/_login.scss +5 -4
- data/app/cells/lato_view/cells_v1/buttongroup/cell.rb +0 -0
- data/app/cells/lato_view/cells_v1/buttongroup/views/show.html.erb +0 -0
- data/app/cells/lato_view/cells_v1/dropdown/cell.rb +0 -0
- data/app/cells/lato_view/cells_v1/dropdown/views/show.html.erb +0 -0
- data/app/cells/lato_view/cells_v1/input/cell.rb +21 -1
- data/app/cells/lato_view/cells_v1/input/views/date.html.erb +1 -1
- data/app/cells/lato_view/cells_v1/input/views/number.html.erb +8 -3
- data/app/cells/lato_view/cells_v1/input/views/select.html.erb +1 -1
- data/app/cells/lato_view/cells_v1/input/views/time.html.erb +0 -0
- data/app/cells/lato_view/component/button/cell.rb +4 -2
- data/app/cells/lato_view/component/button/views/show.html.erb +1 -1
- data/app/cells/lato_view/component/buttongroup/cell.rb +0 -0
- data/app/cells/lato_view/component/buttongroup/views/show.html.erb +0 -0
- data/app/cells/lato_view/component/buttonprompt/cell.rb +38 -0
- data/app/cells/lato_view/component/buttonprompt/views/show.html.erb +2 -0
- data/app/cells/lato_view/component/dropdown/cell.rb +0 -0
- data/app/cells/lato_view/component/dropdown/views/show.html.erb +0 -0
- data/app/cells/lato_view/component/form/cell.rb +0 -0
- data/app/cells/lato_view/component/form/views/open.html.erb +0 -0
- data/app/cells/lato_view/component/form/views/show.html.erb +0 -0
- data/app/cells/lato_view/component/searchbar/cell.rb +0 -0
- data/app/cells/lato_view/component/searchbar/views/show.html.erb +0 -0
- data/app/cells/lato_view/input/checkbox/cell.rb +7 -2
- data/app/cells/lato_view/input/checkbox/views/show.html.erb +2 -2
- data/app/cells/lato_view/input/date/cell.rb +4 -2
- data/app/cells/lato_view/input/date/views/show.html.erb +1 -1
- data/app/cells/lato_view/input/doubleselect/cell.rb +72 -0
- data/app/cells/lato_view/input/doubleselect/views/show.html.erb +90 -0
- data/app/cells/lato_view/input/editor/cell.rb +0 -0
- data/app/cells/lato_view/input/editor/views/show.html.erb +0 -0
- data/app/cells/lato_view/input/email/cell.rb +0 -0
- data/app/cells/lato_view/input/email/views/show.html.erb +0 -0
- data/app/cells/lato_view/input/file/cell.rb +0 -0
- data/app/cells/lato_view/input/file/views/show.html.erb +0 -0
- data/app/cells/lato_view/input/map/cell.rb +54 -0
- data/app/cells/lato_view/input/map/views/show.html.erb +103 -0
- data/app/cells/lato_view/input/nselect/cell.rb +47 -0
- data/app/cells/lato_view/input/nselect/views/show.html.erb +15 -0
- data/app/cells/lato_view/input/number/cell.rb +4 -2
- data/app/cells/lato_view/input/number/views/show.html.erb +6 -8
- data/app/cells/lato_view/input/password/cell.rb +0 -0
- data/app/cells/lato_view/input/password/views/show.html.erb +0 -0
- data/app/cells/lato_view/input/radio/cell.rb +0 -0
- data/app/cells/lato_view/input/radio/views/show.html.erb +0 -0
- data/app/cells/lato_view/input/select/cell.rb +3 -2
- data/app/cells/lato_view/input/select/views/show.html.erb +2 -2
- data/app/cells/lato_view/input/text/cell.rb +1 -1
- data/app/cells/lato_view/input/text/views/show.html.erb +3 -3
- data/app/cells/lato_view/input/textarea/cell.rb +0 -0
- data/app/cells/lato_view/input/textarea/views/show.html.erb +1 -4
- data/app/cells/lato_view/input/time/cell.rb +0 -0
- data/app/cells/lato_view/input/time/views/show.html.erb +0 -0
- data/app/cells/lato_view/layout/actionbar/cell.rb +0 -0
- data/app/cells/lato_view/layout/actionbar/views/show.html.erb +0 -0
- data/app/cells/lato_view/layout/block/cell.rb +0 -0
- data/app/cells/lato_view/layout/index/cell.rb +0 -0
- data/app/cells/lato_view/layout/index/views/head.html.erb +0 -0
- data/app/cells/lato_view/layout/index/views/rows.html.erb +29 -17
- data/app/cells/lato_view/layout/step/cell.rb +50 -0
- data/app/cells/lato_view/layout/tablerows/cell.rb +23 -0
- data/app/cells/lato_view/layout/tablerows/views/show.html.erb +13 -0
- data/app/controllers/lato_view/assets_controller.rb +0 -0
- data/app/views/lato_view/develop/home.html.erb +74 -0
- data/app/views/lato_view/icons/_artist.svg +0 -0
- data/app/views/lato_view/icons/_artwork.svg +0 -0
- data/app/views/lato_view/icons/_calendar.svg +0 -0
- data/app/views/lato_view/icons/_clients.svg +0 -0
- data/app/views/lato_view/icons/_home.svg +0 -0
- data/app/views/lato_view/icons/_list.svg +0 -0
- data/app/views/lato_view/icons/_magni-glass.svg +0 -0
- data/app/views/lato_view/icons/_percentage.svg +0 -0
- data/app/views/lato_view/icons/_sweet.svg +0 -0
- data/app/views/lato_view/icons/_users.svg +0 -0
- data/app/views/lato_view/layout/_prompt.html.erb +11 -0
- data/app/views/layouts/lato_layout.html.erb +12 -6
- data/config/example.yml +4 -0
- data/config/initializers/lists.rb +1 -1
- data/config/initializers/ram.rb +1 -0
- data/lang/default.yml +3 -0
- data/lang/en.yml +3 -0
- data/lib/lato_view/interface/assets.rb +16 -0
- data/lib/lato_view/interface/images.rb +0 -0
- data/lib/lato_view/interface/themes.rb +0 -0
- metadata +22 -3
File without changes
|
@@ -76,8 +76,17 @@
|
|
76
76
|
&[data-input="radio"] {
|
77
77
|
.form-block:hover {
|
78
78
|
.label-control:before {
|
79
|
-
border-color:
|
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";
|
File without changes
|
@@ -43,10 +43,10 @@
|
|
43
43
|
.sidebar-list-item {
|
44
44
|
position: relative;
|
45
45
|
.sidebar-main-link {
|
46
|
-
font-size:
|
46
|
+
font-size: 14px;
|
47
47
|
color: $sidebar-inactive-color;
|
48
48
|
display: block;
|
49
|
-
padding:
|
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 {
|
File without changes
|
@@ -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
|
+
}
|
@@ -7,10 +7,10 @@
|
|
7
7
|
&.login {
|
8
8
|
position: relative;
|
9
9
|
overflow: hidden;
|
10
|
-
background:
|
11
|
-
background: -webkit-linear-gradient(top left, $
|
12
|
-
background: linear-gradient(to bottom right, $
|
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
|
}
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -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
|
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"
|
1
|
+
<div class="form-control <%= @width %>" data-control="number"<%= required_data_input %>>
|
2
2
|
<label class="form-label"><%= @label %></label>
|
3
|
-
<input type="
|
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="
|
3
|
+
<select class="<%= @select_class %> <%= @custom_class %>" name="<%= @name %>" placeholder="<%= @placeholder %>">
|
4
4
|
<% if(@option_blank) %>
|
5
5
|
<option></option>
|
6
6
|
<% end %>
|
File without changes
|
@@ -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}" %>
|
File without changes
|
File without changes
|
@@ -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}"%>
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -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, :
|
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
|
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
|