lato_core 2.1.2 → 2.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/lato_core/application.js +18 -9
- data/app/assets/javascripts/lato_core/modules/CoreButton.js +38 -0
- data/app/assets/javascripts/lato_core/{initializers/Charts.js → modules/CoreChart.js} +12 -12
- data/app/assets/javascripts/lato_core/modules/CoreDatepicker.js +42 -0
- data/app/assets/javascripts/lato_core/modules/CoreEditor.js +27 -0
- data/app/assets/javascripts/lato_core/modules/CoreFlash.js +27 -0
- data/app/assets/javascripts/lato_core/modules/CoreFormValidator.js +110 -0
- data/app/assets/javascripts/lato_core/{initializers/Layout.js → modules/CoreLayout.js} +6 -5
- data/app/assets/javascripts/lato_core/modules/CoreMediapicker.js +140 -0
- data/app/assets/javascripts/lato_core/{interfaces/Modal.js → modules/CoreModal.js} +27 -2
- data/app/assets/javascripts/lato_core/modules/CoreSelect.js +110 -0
- data/app/assets/javascripts/lato_core/{initializers/inputs/SortableManager.js → modules/CoreSortableManager.js} +7 -6
- data/app/assets/javascripts/lato_core/modules/CoreTable.js +28 -0
- data/app/assets/stylesheets/lato_core/cells/inputs/_inputs.scss +1 -0
- data/app/assets/stylesheets/lato_core/cells/inputs/_multipleselect.scss +6 -0
- data/app/assets/stylesheets/lato_core/cells/widgets/_index.scss +9 -0
- data/app/cells/lato_core/inputs/dropzone/views/show.html.erb +24 -20
- data/app/cells/lato_core/inputs/multipleselect/cell.rb +52 -0
- data/app/cells/lato_core/inputs/multipleselect/views/show.html.erb +16 -0
- data/app/cells/lato_core/inputs/select/cell.rb +19 -1
- data/app/cells/lato_core/inputs/select/views/show.html.erb +10 -2
- data/app/cells/lato_core/widgets/index/cell.rb +1 -0
- data/app/cells/lato_core/widgets/index/views/partials/counter.html.erb +3 -0
- data/app/cells/lato_core/widgets/index/views/show.html.erb +2 -0
- data/app/controllers/lato_core/back/superusers_controller.rb +9 -9
- data/app/controllers/lato_core/doc/cells_inputs_controller.rb +28 -0
- data/app/views/lato_core/doc/cells_elements/button.html.erb +0 -4
- data/app/views/lato_core/doc/cells_elements/modal.html.erb +4 -4
- data/app/views/lato_core/doc/cells_inputs/multipleselect.html.erb +110 -0
- data/app/views/lato_core/doc/cells_inputs/select.html.erb +48 -2
- data/app/views/lato_core/doc/doc/index.html.erb +1 -0
- data/app/views/lato_core/doc/general/generators.html.erb +40 -0
- data/app/views/layouts/lato_core/partials/_logo.html.erb +7 -5
- data/config/languages/default.yml +2 -1
- data/config/languages/it.yml +2 -1
- data/config/routes/doc.rb +5 -0
- data/lib/generators/lato_core/crud_controller_generator.rb +35 -0
- data/lib/generators/lato_core/crud_generator.rb +31 -12
- data/lib/generators/lato_core/crud_views_generator.rb +52 -0
- data/lib/generators/lato_core/initializer_generator.rb +38 -28
- data/lib/generators/lato_core/scaffold_generator.rb +30 -0
- data/lib/generators/lato_core/templates/crud_controller/app/controllers/lato/crud_controller.rb +94 -0
- data/lib/generators/lato_core/templates/crud_views/app/views/lato/crud/edit.html.erb +24 -0
- data/lib/generators/lato_core/templates/crud_views/app/views/lato/crud/index.html.erb +35 -0
- data/lib/generators/lato_core/templates/crud_views/app/views/lato/crud/new.html.erb +24 -0
- data/lib/generators/lato_core/templates/crud_views/app/views/lato/crud/shared/_form.html.erb +42 -0
- data/lib/generators/lato_core/templates/crud_views/app/views/lato/crud/show.html.erb +22 -0
- data/lib/generators/lato_core/templates/{assets → initializer/assets}/images/logo.svg +0 -0
- data/lib/generators/lato_core/templates/{assets → initializer/assets}/javascripts/application.js +0 -0
- data/lib/generators/lato_core/templates/{assets → initializer/assets}/stylesheets/application.scss +0 -0
- data/lib/generators/lato_core/templates/{assets → initializer/assets}/stylesheets/theme.scss.erb +0 -0
- data/lib/generators/lato_core/templates/initializer/controllers/application_controller.rb +25 -0
- data/lib/generators/lato_core/templates/initializer/views/application/index.html.erb +20 -0
- data/lib/lato_core/interfaces/token.rb +4 -3
- data/lib/lato_core/version.rb +1 -1
- metadata +33 -16
- data/app/assets/javascripts/lato_core/initializers/Elements.js +0 -67
- data/app/assets/javascripts/lato_core/initializers/Inputs.js +0 -249
- data/app/assets/javascripts/lato_core/initializers/inputs/MultipleSelect.js +0 -0
- data/lib/generators/lato_core/templates/controllers/application_controller.rb +0 -13
- data/lib/generators/lato_core/templates/views/application/index.html.erb +0 -16
@@ -41,7 +41,7 @@ module LatoCore
|
|
41
41
|
flash[:success] = LANGUAGES[:lato_core][:flashes][:superuser_create_success]
|
42
42
|
redirect_to lato_core.superuser_path(@superuser.id)
|
43
43
|
end
|
44
|
-
|
44
|
+
|
45
45
|
def edit
|
46
46
|
core__set_header_active_page_title(LANGUAGES[:lato_core][:pages][:superusers_edit])
|
47
47
|
@superuser = LatoCore::Superuser.find_by(id: params[:id])
|
@@ -60,7 +60,7 @@ module LatoCore
|
|
60
60
|
|
61
61
|
fetch_external_objects
|
62
62
|
end
|
63
|
-
|
63
|
+
|
64
64
|
def update
|
65
65
|
@superuser = LatoCore::Superuser.find_by(id: params[:id])
|
66
66
|
|
@@ -81,11 +81,11 @@ module LatoCore
|
|
81
81
|
redirect_to lato_core.edit_superuser_path(@superuser.id)
|
82
82
|
return
|
83
83
|
end
|
84
|
-
|
84
|
+
|
85
85
|
flash[:success] = LANGUAGES[:lato_core][:flashes][:superuser_update_success]
|
86
86
|
redirect_to lato_core.superuser_path(@superuser.id)
|
87
87
|
end
|
88
|
-
|
88
|
+
|
89
89
|
def destroy
|
90
90
|
@superuser = LatoCore::Superuser.find_by(id: params[:id])
|
91
91
|
|
@@ -119,13 +119,13 @@ module LatoCore
|
|
119
119
|
end
|
120
120
|
|
121
121
|
def fetch_external_objects
|
122
|
-
@permissions_list =
|
122
|
+
@permissions_list = permissions_list_for_current_superuser
|
123
123
|
end
|
124
124
|
|
125
|
-
def
|
126
|
-
|
127
|
-
|
128
|
-
|
125
|
+
def permissions_list_for_current_superuser
|
126
|
+
CONFIGS[:lato_core][:superusers_permissions].values.select do |x|
|
127
|
+
x[:value] <= @core__current_superuser.permission
|
128
|
+
end
|
129
129
|
end
|
130
130
|
|
131
131
|
def check_superuser_permissions
|
@@ -33,5 +33,33 @@ module LatoCore
|
|
33
33
|
|
34
34
|
def youtube; end
|
35
35
|
|
36
|
+
def multipleselect; end
|
37
|
+
|
38
|
+
def multipleselect_categories
|
39
|
+
render json: [
|
40
|
+
{label: 'Animals', value: 'cat1'},
|
41
|
+
{label: 'Colors', value: 'cat2'},
|
42
|
+
{label: 'Cities', value: 'cat3'}
|
43
|
+
]
|
44
|
+
end
|
45
|
+
|
46
|
+
def multipleselect_values
|
47
|
+
possibilities = {
|
48
|
+
cat1: [
|
49
|
+
{label: 'Cat', value: 1},
|
50
|
+
{label: 'Dog', value: 2}
|
51
|
+
],
|
52
|
+
cat2: [
|
53
|
+
{label: 'Yellow', value: 3},
|
54
|
+
{label: 'Blue', value: 4}
|
55
|
+
],
|
56
|
+
cat3: [
|
57
|
+
{label: 'Rome', value: 5},
|
58
|
+
{label: 'Venice', value: 6}
|
59
|
+
]
|
60
|
+
}
|
61
|
+
render json: possibilities[params[:value].to_sym]
|
62
|
+
end
|
63
|
+
|
36
64
|
end
|
37
65
|
end
|
@@ -246,10 +246,6 @@
|
|
246
246
|
|
247
247
|
<%=raw block.open %>
|
248
248
|
|
249
|
-
<%=raw cell(:elements, :title).new(label: 'Info', size: 6) %>
|
250
|
-
|
251
|
-
<p>Remember to use ' an not " inside the code of the onclick.</p>
|
252
|
-
|
253
249
|
<%=raw cell(:elements, :title).new(label: 'Code', size: 6) %>
|
254
250
|
|
255
251
|
<%=raw code.open %>
|
@@ -25,7 +25,7 @@
|
|
25
25
|
|
26
26
|
<%=raw block.open %>
|
27
27
|
|
28
|
-
<%=raw cell(:elements, :button).new(label: 'Open modal', style: 'info', onclick: "
|
28
|
+
<%=raw cell(:elements, :button).new(label: 'Open modal', style: 'info', onclick: "CoreModal.open('my-modal', event);") %>
|
29
29
|
|
30
30
|
<%=raw cell(:elements, :modal).new(id: 'my-modal', render: render('lato_core/doc/shared/modal_content')) %>
|
31
31
|
|
@@ -42,7 +42,7 @@
|
|
42
42
|
|
43
43
|
<%=raw code.open %>
|
44
44
|
|
45
|
-
<%= erb_open_tag %>=raw cell(:elements, :button).new(label: 'Open modal', style: 'info', onclick: "
|
45
|
+
<%= erb_open_tag %>=raw cell(:elements, :button).new(label: 'Open modal', style: 'info', onclick: "CoreModal.open('my-modal', event);") <%= erb_close_tag %>
|
46
46
|
|
47
47
|
<%= erb_open_tag %>=raw cell(:elements, :modal).new(id: 'my-modal', render: render('lato_core/doc/shared/modal_content')) <%= erb_close_tag %>
|
48
48
|
|
@@ -60,7 +60,7 @@
|
|
60
60
|
|
61
61
|
<%=raw block.open %>
|
62
62
|
|
63
|
-
<%=raw cell(:elements, :button).new(label: 'Open modal', style: 'info', onclick: "
|
63
|
+
<%=raw cell(:elements, :button).new(label: 'Open modal', style: 'info', onclick: "CoreModal.open('my-modal-2', event);") %>
|
64
64
|
|
65
65
|
<%=raw cell(:elements, :modal).new(id: 'my-modal-2', title: 'Modal with title', render: render('lato_core/doc/shared/modal_content')) %>
|
66
66
|
|
@@ -77,7 +77,7 @@
|
|
77
77
|
|
78
78
|
<%=raw code.open %>
|
79
79
|
|
80
|
-
<%= erb_open_tag %>=raw cell(:elements, :button).new(label: 'Open modal', style: 'info', onclick: "
|
80
|
+
<%= erb_open_tag %>=raw cell(:elements, :button).new(label: 'Open modal', style: 'info', onclick: "CoreModal.open('my-modal-2', event);") <%= erb_close_tag %>
|
81
81
|
|
82
82
|
<%= erb_open_tag %>=raw cell(:elements, :modal).new(id: 'my-modal-2', title: 'Modal with title', render: render('lato_core/doc/shared/modal_content')) <%= erb_close_tag %>
|
83
83
|
|
@@ -0,0 +1,110 @@
|
|
1
|
+
<%
|
2
|
+
row = cell(:elements, :row).new
|
3
|
+
block = cell(:elements, :block).new(class: 'xs-12 sm-12 md-12')
|
4
|
+
code = cell(:elements, :code).new
|
5
|
+
form = cell(:inputs, :form).new(url: '#', method: 'get')
|
6
|
+
%>
|
7
|
+
|
8
|
+
<!-- PRESENTATION -->
|
9
|
+
<%=raw row.open %>
|
10
|
+
|
11
|
+
<%=raw block.open %>
|
12
|
+
|
13
|
+
<%=raw cell(:elements, :title).new(label: 'Cells Inputs: Multipleselect') %>
|
14
|
+
|
15
|
+
<p>A group of select used in a realtime way.</p>
|
16
|
+
|
17
|
+
<%=raw block.close %>
|
18
|
+
|
19
|
+
<%=raw row.close %>
|
20
|
+
<!-- / PRESENTATION -->
|
21
|
+
|
22
|
+
<hr>
|
23
|
+
<%=raw cell(:elements, :title).new(label: 'Normal Multipleselect input', size: 3) %>
|
24
|
+
|
25
|
+
<%=raw row.open %>
|
26
|
+
|
27
|
+
<%=raw block.open %>
|
28
|
+
|
29
|
+
<%=raw form.open %>
|
30
|
+
|
31
|
+
<%=raw row.open %>
|
32
|
+
|
33
|
+
<%=raw cell(:inputs, :multipleselect).new(name: 'sample', label: 'Select an item', selects: [
|
34
|
+
{name: 'category', label: 'Category', api: lato_core.doc_cells_inputs_multipleselect_categories_path, value: '', class: 'xs-12 sm-12 md-6 lg-6'},
|
35
|
+
{name: 'element', label: 'Element', api: lato_core.doc_cells_inputs_multipleselect_values_path, value: '', class: 'xs-12 sm-12 md-6 lg-6'}
|
36
|
+
]) %>
|
37
|
+
|
38
|
+
<%=raw row.close %>
|
39
|
+
|
40
|
+
<%=raw form.close %>
|
41
|
+
|
42
|
+
<%=raw block.close %>
|
43
|
+
|
44
|
+
<%=raw row.close %>
|
45
|
+
|
46
|
+
<!-- CODE SECTION -->
|
47
|
+
<%=raw row.open %>
|
48
|
+
|
49
|
+
<%=raw block.open %>
|
50
|
+
|
51
|
+
<%=raw cell(:elements, :title).new(label: 'Code', size: 6) %>
|
52
|
+
|
53
|
+
<%=raw code.open %>
|
54
|
+
|
55
|
+
<%= erb_open_tag %>=raw cell(:inputs, :multipleselect).new(name: 'sample', label: 'Select an item', selects: [
|
56
|
+
{name: 'category', label: 'Category', api: lato_core.doc_cells_inputs_multipleselect_categories_path, value: '', class: 'xs-12 sm-12 md-6 lg-6'},
|
57
|
+
{name: 'element', label: 'Element', api: lato_core.doc_cells_inputs_multipleselect_values_path, value: '', class: 'xs-12 sm-12 md-6 lg-6'}
|
58
|
+
])<%= erb_close_tag %>
|
59
|
+
|
60
|
+
<%=raw code.close %>
|
61
|
+
|
62
|
+
<%=raw block.close %>
|
63
|
+
|
64
|
+
<%=raw row.close %>
|
65
|
+
<!-- / CODE SECTION -->
|
66
|
+
|
67
|
+
<hr>
|
68
|
+
<%=raw cell(:elements, :title).new(label: 'Multipleselect input with selected values', size: 3) %>
|
69
|
+
|
70
|
+
<%=raw row.open %>
|
71
|
+
|
72
|
+
<%=raw block.open %>
|
73
|
+
|
74
|
+
<%=raw form.open %>
|
75
|
+
|
76
|
+
<%=raw row.open %>
|
77
|
+
|
78
|
+
<%=raw cell(:inputs, :multipleselect).new(name: 'sample', label: 'Select an item', selects: [
|
79
|
+
{name: 'category', label: 'Category', api: lato_core.doc_cells_inputs_multipleselect_categories_path, value: 'cat2'},
|
80
|
+
{name: 'element', label: 'Element', api: lato_core.doc_cells_inputs_multipleselect_values_path, value: 3}
|
81
|
+
]) %>
|
82
|
+
|
83
|
+
<%=raw row.close %>
|
84
|
+
|
85
|
+
<%=raw form.close %>
|
86
|
+
|
87
|
+
<%=raw block.close %>
|
88
|
+
|
89
|
+
<%=raw row.close %>
|
90
|
+
|
91
|
+
<!-- CODE SECTION -->
|
92
|
+
<%=raw row.open %>
|
93
|
+
|
94
|
+
<%=raw block.open %>
|
95
|
+
|
96
|
+
<%=raw cell(:elements, :title).new(label: 'Code', size: 6) %>
|
97
|
+
|
98
|
+
<%=raw code.open %>
|
99
|
+
|
100
|
+
<%= erb_open_tag %>=raw cell(:inputs, :multipleselect).new(name: 'sample', label: 'Select an item', selects: [
|
101
|
+
{name: 'category', label: 'Category', api: lato_core.doc_cells_inputs_multipleselect_categories_path, value: 'cat2'},
|
102
|
+
{name: 'element', label: 'Element', api: lato_core.doc_cells_inputs_multipleselect_values_path, value: 3}
|
103
|
+
])<%= erb_close_tag %>
|
104
|
+
|
105
|
+
<%=raw code.close %>
|
106
|
+
|
107
|
+
<%=raw block.close %>
|
108
|
+
|
109
|
+
<%=raw row.close %>
|
110
|
+
<!-- / CODE SECTION -->
|
@@ -155,7 +155,8 @@
|
|
155
155
|
|
156
156
|
<%=raw row.open %>
|
157
157
|
|
158
|
-
<%=raw cell(:inputs, :select).new(name: 'sample', label: 'Select multiple items',
|
158
|
+
<%=raw cell(:inputs, :select).new(name: 'sample', label: 'Select multiple items',
|
159
|
+
options: ['Pippo', 'Luigi', 'Gino'], multiple: true, value: ['Pippo', 'Luigi']) %>
|
159
160
|
|
160
161
|
<%=raw row.close %>
|
161
162
|
|
@@ -174,7 +175,52 @@
|
|
174
175
|
|
175
176
|
<%=raw code.open %>
|
176
177
|
|
177
|
-
<%= erb_open_tag %>=raw cell(:inputs, :select).new(name: 'sample', label: 'Select multiple items', options: ['Pippo', 'Luigi', 'Gino'], multiple: true)<%= erb_close_tag %>
|
178
|
+
<%= erb_open_tag %>=raw cell(:inputs, :select).new(name: 'sample', label: 'Select multiple items', options: ['Pippo', 'Luigi', 'Gino'], multiple: true, value: ['Pippo', 'Luigi'])<%= erb_close_tag %>
|
179
|
+
|
180
|
+
<%=raw code.close %>
|
181
|
+
|
182
|
+
<%=raw block.close %>
|
183
|
+
|
184
|
+
<%=raw row.close %>
|
185
|
+
<!-- / CODE SECTION -->
|
186
|
+
|
187
|
+
<hr>
|
188
|
+
<%=raw cell(:elements, :title).new(label: 'Select input with custom data attributes', size: 3) %>
|
189
|
+
|
190
|
+
<%=raw row.open %>
|
191
|
+
|
192
|
+
<%=raw block.open %>
|
193
|
+
|
194
|
+
<%=raw form.open %>
|
195
|
+
|
196
|
+
<%=raw row.open %>
|
197
|
+
|
198
|
+
<%=raw cell(:inputs, :select).new(name: 'sample', label: 'Select an item',
|
199
|
+
options: ['Pippo', 'Luigi', 'Gino'], attributes: {
|
200
|
+
foo: 'bar'
|
201
|
+
}) %>
|
202
|
+
|
203
|
+
<%=raw row.close %>
|
204
|
+
|
205
|
+
<%=raw form.close %>
|
206
|
+
|
207
|
+
<%=raw block.close %>
|
208
|
+
|
209
|
+
<%=raw row.close %>
|
210
|
+
|
211
|
+
<!-- CODE SECTION -->
|
212
|
+
<%=raw row.open %>
|
213
|
+
|
214
|
+
<%=raw block.open %>
|
215
|
+
|
216
|
+
<%=raw cell(:elements, :title).new(label: 'Code', size: 6) %>
|
217
|
+
|
218
|
+
<%=raw code.open %>
|
219
|
+
|
220
|
+
<%= erb_open_tag %>=raw cell(:inputs, :select).new(name: 'sample', label: 'Select an item',
|
221
|
+
options: ['Pippo', 'Luigi', 'Gino'], attributes: {
|
222
|
+
foo: 'bar'
|
223
|
+
})<%= erb_close_tag %>
|
178
224
|
|
179
225
|
<%=raw code.close %>
|
180
226
|
|
@@ -78,6 +78,7 @@
|
|
78
78
|
<%=raw cell(:elements, :button).new(label: 'Geolocalization', url: lato_core.doc_cells_inputs_geolocalization_path) %>
|
79
79
|
<%=raw cell(:elements, :button).new(label: 'Sortable Block', url: lato_core.doc_cells_inputs_sortableblock_path) %>
|
80
80
|
<%=raw cell(:elements, :button).new(label: 'Youtube', url: lato_core.doc_cells_inputs_youtube_path) %>
|
81
|
+
<%=raw cell(:elements, :button).new(label: 'Multipleselect', url: lato_core.doc_cells_inputs_multipleselect_path) %>
|
81
82
|
|
82
83
|
<br><br>
|
83
84
|
|
@@ -13,6 +13,9 @@
|
|
13
13
|
|
14
14
|
<p>Generators are used to speed up your development with lato.</p>
|
15
15
|
|
16
|
+
<br>
|
17
|
+
<%=raw cell(:elements, :title).new(label: 'Initialize project', size: 2) %>
|
18
|
+
|
16
19
|
<p>To initialize your project with lato you can run:</p>
|
17
20
|
|
18
21
|
<%=raw code.open %>
|
@@ -32,6 +35,43 @@ $> rails generate lato_core:initializer
|
|
32
35
|
</ul>
|
33
36
|
</p>
|
34
37
|
|
38
|
+
<br>
|
39
|
+
<%=raw cell(:elements, :title).new(label: 'Create a scaffold', size: 2) %>
|
40
|
+
|
41
|
+
<%=raw code.open %>
|
42
|
+
|
43
|
+
$> rails generate lato_core:scaffold ModelName
|
44
|
+
|
45
|
+
<%=raw code.close %>
|
46
|
+
|
47
|
+
<br>
|
48
|
+
<%=raw cell(:elements, :title).new(label: 'Create a crud', size: 2) %>
|
49
|
+
|
50
|
+
<%=raw code.open %>
|
51
|
+
|
52
|
+
$> rails generate lato_core:crud ModelName
|
53
|
+
|
54
|
+
<%=raw code.close %>
|
55
|
+
|
56
|
+
<br>
|
57
|
+
<%=raw cell(:elements, :title).new(label: 'Create only crud controller', size: 2) %>
|
58
|
+
|
59
|
+
<%=raw code.open %>
|
60
|
+
|
61
|
+
$> rails generate lato_core:crud_controller ModelName
|
62
|
+
|
63
|
+
<%=raw code.close %>
|
64
|
+
|
65
|
+
<br>
|
66
|
+
<%=raw cell(:elements, :title).new(label: 'Create only crud views', size: 2) %>
|
67
|
+
|
68
|
+
<%=raw code.open %>
|
69
|
+
|
70
|
+
$> rails generate lato_core:crud_views ModelName
|
71
|
+
|
72
|
+
<%=raw code.close %>
|
73
|
+
|
74
|
+
<br>
|
35
75
|
<%=raw block.close %>
|
36
76
|
|
37
77
|
<%=raw row.close %>
|
@@ -1,9 +1,11 @@
|
|
1
1
|
<div class="layout-admin__logo-container">
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
3
|
+
<a href="<%= lato_core.root_path %>">
|
4
|
+
<% if LAYOUT[:logo] %>
|
5
|
+
<%= image_tag(LAYOUT[:logo_sidebar], alt: CONFIGS[:lato_core][:application_name]) %>
|
6
|
+
<% else %>
|
7
|
+
<%= image_tag('lato_core/logo-negative.svg', alt: CONFIGS[:lato_core][:application_name]) %>
|
8
|
+
<% end %>
|
9
|
+
</a>
|
8
10
|
|
9
11
|
</div>
|
data/config/languages/it.yml
CHANGED
data/config/routes/doc.rb
CHANGED
@@ -40,6 +40,11 @@ namespace :doc do
|
|
40
40
|
get 'cells_inputs_geolocalization', to: 'cells_inputs#geolocalization', as: 'cells_inputs_geolocalization'
|
41
41
|
get 'cells_inputs_sortableblock', to: 'cells_inputs#sortableblock', as: 'cells_inputs_sortableblock'
|
42
42
|
get 'cells_inputs_youtube', to: 'cells_inputs#youtube', as: 'cells_inputs_youtube'
|
43
|
+
get 'cells_inputs_multipleselect', to: 'cells_inputs#multipleselect', as: 'cells_inputs_multipleselect'
|
44
|
+
|
45
|
+
# multipleselect helpers
|
46
|
+
get 'cells_inputs_multipleselect_categories', to: 'cells_inputs#multipleselect_categories', as: 'cells_inputs_multipleselect_categories'
|
47
|
+
get 'cells_inputs_multipleselect_values', to: 'cells_inputs#multipleselect_values', as: 'cells_inputs_multipleselect_values'
|
43
48
|
|
44
49
|
# cells charts
|
45
50
|
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'rails/generators/base'
|
4
|
+
|
5
|
+
module LatoCore
|
6
|
+
# CrudControllerGenerator.
|
7
|
+
class CrudControllerGenerator < Rails::Generators::Base
|
8
|
+
|
9
|
+
source_root File.expand_path('../templates/crud_controller', __FILE__)
|
10
|
+
|
11
|
+
argument :model_name, type: :string, default: 'Crud'
|
12
|
+
|
13
|
+
desc 'This function create a complete crud controller with Lato.'
|
14
|
+
def create_crud
|
15
|
+
set_utils_names
|
16
|
+
|
17
|
+
manage_controller
|
18
|
+
end
|
19
|
+
|
20
|
+
private
|
21
|
+
|
22
|
+
def set_utils_names
|
23
|
+
@model_name = model_name
|
24
|
+
@singular_name = @model_name.underscore
|
25
|
+
@plural_name = @singular_name.pluralize
|
26
|
+
@controller_name = @plural_name.camelize
|
27
|
+
end
|
28
|
+
|
29
|
+
def manage_controller
|
30
|
+
template('app/controllers/lato/crud_controller.rb',
|
31
|
+
"app/controllers/lato/#{@plural_name}_controller.rb")
|
32
|
+
end
|
33
|
+
|
34
|
+
end
|
35
|
+
end
|