hot-glue 0.4.1 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +4 -4
- data/Gemfile.lock +17 -17
- data/README.md +30 -0
- data/config/database.yml +83 -8
- data/config/hot_glue.yml +3 -0
- data/db/schema.rb +3 -3
- data/lib/generators/hot_glue/install_generator.rb +2 -2
- data/lib/generators/hot_glue/layout/builder.rb +115 -0
- data/lib/generators/hot_glue/markup_templates/erb.rb +159 -178
- data/lib/generators/hot_glue/markup_templates/haml.rb +7 -2
- data/lib/generators/hot_glue/scaffold_generator.rb +98 -81
- data/lib/generators/hot_glue/templates/controller.rb.erb +1 -1
- data/lib/generators/hot_glue/templates/erb/_form.erb +1 -1
- data/lib/generators/hot_glue/templates/erb/_list.erb +9 -12
- data/lib/generators/hot_glue/templates/erb/_show.erb +7 -7
- data/lib/generators/hot_glue/templates/system_spec.rb.erb +37 -26
- data/lib/hotglue/version.rb +1 -1
- metadata +6 -24
- data/db/migrate/20210306212711_create_abcs.rb +0 -11
- data/db/migrate/20210306223300_create_defs.rb +0 -9
- data/db/migrate/20210306223305_create_ghis.rb +0 -9
- data/db/migrate/20210306223309_create_jkls.rb +0 -9
- data/db/migrate/20210306223701_devise_create_users.rb +0 -44
- data/db/migrate/20210306225506_create_xyzs.rb +0 -9
@@ -5,10 +5,8 @@ module HotGlue
|
|
5
5
|
attr_accessor :singular
|
6
6
|
|
7
7
|
def field_output(col, type = nil, width, col_identifier )
|
8
|
-
"<div class='#{col_identifier} form-group <%='alert-danger' if @#{singular}.errors.details.keys.include?(:#{col.to_s})%>' > \n" +
|
9
8
|
" <%= f.text_field :#{col.to_s}, value: @#{@singular}.#{col.to_s}, autocomplete: 'off', size: #{width}, class: 'form-control', type: '#{type}' %>\n "+
|
10
|
-
" <label class='form-text' >#{col.to_s.humanize}</label>\n"
|
11
|
-
"</div>"
|
9
|
+
" <label class='form-text' >#{col.to_s.humanize}</label>\n"
|
12
10
|
end
|
13
11
|
|
14
12
|
|
@@ -32,28 +30,31 @@ module HotGlue
|
|
32
30
|
lines = 5
|
33
31
|
end
|
34
32
|
|
35
|
-
"<div class=\"#{col_identifier} form-group \#{'alert-danger' if #{singular}.errors.details.keys.include?(:#{col.to_s})}\">" +
|
36
33
|
"<%= f.text_area :#{col.to_s}, class: 'form-control', autocomplete: 'off', cols: 40, rows: '#{lines}' %>" +
|
37
|
-
"<label class='form-text'>#{col.to_s.humanize}</label>"
|
38
|
-
"</div>"
|
39
|
-
|
34
|
+
"<label class='form-text'>#{col.to_s.humanize}</label>"
|
40
35
|
end
|
41
36
|
|
42
37
|
def list_column_headings(*args)
|
43
|
-
|
38
|
+
layout_columns = args[0][:columns]
|
44
39
|
column_width = args[0][:column_width]
|
45
40
|
col_identifier = args[0][:col_identifier]
|
46
|
-
|
41
|
+
layout = args[0][:layout]
|
42
|
+
|
43
|
+
if layout == "hotglue"
|
47
44
|
col_style = " style='flex-basis: #{column_width}%'"
|
48
45
|
else
|
49
46
|
col_style = ""
|
50
47
|
end
|
51
|
-
|
48
|
+
|
49
|
+
result = layout_columns.map{ |column|
|
50
|
+
"<div class='#{col_identifier}'" + col_style + ">" + column.map(&:to_s).map{|col_name| "#{col_name.humanize}"}.join("<br />") + "</div>"
|
51
|
+
}.join("\n")
|
52
|
+
return result
|
52
53
|
end
|
53
54
|
|
54
55
|
|
55
56
|
def all_form_fields(*args)
|
56
|
-
|
57
|
+
layout_columns = args[0][:columns]
|
57
58
|
show_only = args[0][:show_only]
|
58
59
|
singular_class = args[0][:singular_class]
|
59
60
|
col_identifier = args[0][:col_identifier]
|
@@ -63,99 +64,89 @@ module HotGlue
|
|
63
64
|
@singular = args[0][:singular]
|
64
65
|
singular = @singular
|
65
66
|
|
66
|
-
|
67
|
-
|
68
67
|
col_spaces_prepend = " "
|
69
68
|
|
70
|
-
res = columns.map { |col|
|
71
|
-
|
72
|
-
if show_only.include?(col)
|
73
69
|
|
74
|
-
|
75
|
-
|
76
|
-
"<label class='form-text'>#{col.to_s.humanize}</label>" +
|
77
|
-
"</div>"
|
70
|
+
result = layout_columns.map{ |column|
|
71
|
+
"<div class='#{col_identifier}' >" +
|
78
72
|
|
79
|
-
|
73
|
+
column.map { |col|
|
80
74
|
|
75
|
+
field_result = if show_only.include?(col)
|
76
|
+
"<%= @#{singular}.#{col.to_s} %>" +
|
77
|
+
"<label class='form-text'>#{col.to_s.humanize}</label>"
|
78
|
+
else
|
79
|
+
type = eval("#{singular_class}.columns_hash['#{col}']").type
|
80
|
+
limit = eval("#{singular_class}.columns_hash['#{col}']").limit
|
81
|
+
sql_type = eval("#{singular_class}.columns_hash['#{col}']").sql_type
|
82
|
+
|
83
|
+
case type
|
84
|
+
when :integer
|
85
|
+
# look for a belongs_to on this object
|
86
|
+
if col.to_s.ends_with?("_id")
|
87
|
+
assoc_name = col.to_s.gsub("_id","")
|
88
|
+
assoc = eval("#{singular_class}.reflect_on_association(:#{assoc_name})")
|
89
|
+
if assoc.nil?
|
90
|
+
exit_message= "*** Oops. on the #{singular_class} object, there doesn't seem to be an association called '#{assoc_name}'"
|
91
|
+
exit
|
92
|
+
end
|
93
|
+
display_column = HotGlue.derrive_reference_name(assoc.class_name)
|
94
|
+
"<%= f.collection_select(:#{col.to_s}, #{assoc.class_name}.all, :id, :#{display_column}, {prompt: true, selected: @#{singular}.#{col.to_s} }, class: 'form-control') %>
|
95
|
+
<label class='small form-text text-muted'>#{col.to_s.humanize}</label>"
|
96
|
+
|
97
|
+
else
|
98
|
+
"<%= f.text_field :#{col.to_s}, value: #{singular}.#{col.to_s}, class: 'form-control', size: 4, type: 'number' %>
|
99
|
+
<label class='small form-text text-muted'>#{col.to_s.humanize}</label>"
|
100
|
+
|
101
|
+
end
|
102
|
+
when :string
|
103
|
+
if sql_type == "varchar" || sql_type == "character varying"
|
104
|
+
field_output(col, nil, limit || 40, col_identifier)
|
105
|
+
else
|
106
|
+
text_area_output(col, 65536, col_identifier)
|
107
|
+
end
|
108
|
+
|
109
|
+
when :text
|
110
|
+
if sql_type == "varchar"
|
111
|
+
field_output(col, nil, limit, col_identifier)
|
112
|
+
else
|
113
|
+
text_area_output(col, 65536, col_identifier)
|
114
|
+
end
|
115
|
+
when :float
|
116
|
+
field_output(col, nil, 5, col_identifier)
|
117
|
+
when :datetime
|
118
|
+
"<%= datetime_field_localized(f, :#{col.to_s}, #{singular}.#{col.to_s}, '#{ col.to_s.humanize }', #{@auth ? @auth+'.timezone' : 'nil'}) %>"
|
119
|
+
when :date
|
120
|
+
"<%= date_field_localized(f, :#{col.to_s}, #{singular}.#{col.to_s}, '#{ col.to_s.humanize }', #{@auth ? @auth+'.timezone' : 'nil'}) %>"
|
121
|
+
when :time
|
122
|
+
"<%= time_field_localized(f, :#{col.to_s}, #{singular}.#{col.to_s}, '#{ col.to_s.humanize }', #{@auth ? @auth+'.timezone' : 'nil'}) %>"
|
123
|
+
when :boolean
|
124
|
+
" " +
|
125
|
+
" <span>#{col.to_s.humanize}</span>" +
|
126
|
+
" <%= f.radio_button(:#{col.to_s}, '0', checked: #{singular}.#{col.to_s} ? '' : 'checked') %>\n" +
|
127
|
+
" <%= f.label(:#{col.to_s}, value: 'No', for: '#{singular}_#{col.to_s}_0') %>\n" +
|
128
|
+
" <%= f.radio_button(:#{col.to_s}, '1', checked: #{singular}.#{col.to_s} ? 'checked' : '') %>\n" +
|
129
|
+
" <%= f.label(:#{col.to_s}, value: 'Yes', for: '#{singular}_#{col.to_s}_1') %>\n" +
|
130
|
+
""
|
131
|
+
when :enum
|
132
|
+
enum_name = "enum_name"
|
133
|
+
|
134
|
+
enum_type = eval("#{singular_class}.columns.select{|x| x.name == '#{col.to_s}'}[0].sql_type")
|
135
|
+
"<%= f.collection_select(:#{col.to_s}, enum_to_collection_select( #{singular_class}.defined_enums['#{enum_type}']), :key, :value, {prompt: true, selected: @#{singular}.#{col.to_s} }, class: 'form-control') %>
|
136
|
+
<label class='small form-text text-muted'>#{col.to_s.humanize}</label>"
|
81
137
|
|
82
|
-
type = eval("#{singular_class}.columns_hash['#{col}']").type
|
83
|
-
limit = eval("#{singular_class}.columns_hash['#{col}']").limit
|
84
|
-
sql_type = eval("#{singular_class}.columns_hash['#{col}']").sql_type
|
85
|
-
|
86
|
-
case type
|
87
|
-
when :integer
|
88
|
-
# look for a belongs_to on this object
|
89
|
-
if col.to_s.ends_with?("_id")
|
90
|
-
assoc_name = col.to_s.gsub("_id","")
|
91
|
-
assoc = eval("#{singular_class}.reflect_on_association(:#{assoc_name})")
|
92
|
-
if assoc.nil?
|
93
|
-
exit_message= "*** Oops. on the #{singular_class} object, there doesn't seem to be an association called '#{assoc_name}'"
|
94
|
-
exit
|
95
138
|
end
|
96
|
-
|
97
|
-
|
98
|
-
"<div class='#{col_identifier} form-group <%= 'alert-danger' if #{singular}.errors.details.keys.include?(:#{assoc_name.to_s}) %>' >
|
99
|
-
<%= f.collection_select(:#{col.to_s}, #{assoc.class_name}.all, :id, :#{display_column}, {prompt: true, selected: @#{singular}.#{col.to_s} }, class: 'form-control') %>
|
100
|
-
<label class='small form-text text-muted'>#{col.to_s.humanize}</label></div>"
|
101
|
-
|
102
|
-
else
|
103
|
-
"<div class=\"#{col_identifier} form-group <%= 'alert-danger' if #{singular}.errors.details.keys.include?(:#{col}) %> \" >
|
104
|
-
<%= f.text_field :#{col.to_s}, value: #{singular}.#{col.to_s}, class: 'form-control', size: 4, type: 'number' %>
|
105
|
-
<label class='small form-text text-muted'>#{col.to_s.humanize}</label></div>"
|
106
|
-
|
107
|
-
end
|
108
|
-
when :string
|
109
|
-
if sql_type == "varchar" || sql_type == "character varying"
|
110
|
-
field_output(col, nil, limit || 40, col_identifier)
|
111
|
-
else
|
112
|
-
text_area_output(col, 65536, col_identifier)
|
113
|
-
end
|
114
|
-
|
115
|
-
when :text
|
116
|
-
if sql_type == "varchar"
|
117
|
-
field_output(col, nil, limit, col_identifier)
|
118
|
-
else
|
119
|
-
text_area_output(col, 65536, col_identifier)
|
120
|
-
end
|
121
|
-
when :float
|
122
|
-
field_output(col, nil, 5, col_identifier)
|
123
|
-
when :datetime
|
124
|
-
|
125
|
-
|
126
|
-
"<div class='col form-group <%='alert-danger' if @#{singular}.errors.details.keys.include?(:#{col.to_s})%>' > \n" +
|
127
|
-
"<%= datetime_field_localized(f, :#{col.to_s}, #{singular}.#{col.to_s}, '#{ col.to_s.humanize }', #{@auth ? @auth+'.timezone' : 'nil'}) %>" +
|
128
|
-
"</div>"
|
129
|
-
when :date
|
130
|
-
"<div class='col form-group <%='alert-danger' if @#{singular}.errors.details.keys.include?(:#{col.to_s})%>' > \n" +
|
131
|
-
"<%= date_field_localized(f, :#{col.to_s}, #{singular}.#{col.to_s}, '#{ col.to_s.humanize }', #{@auth ? @auth+'.timezone' : 'nil'}) %>" +
|
132
|
-
"</div>"
|
133
|
-
when :time
|
134
|
-
"<div class='col form-group <%='alert-danger' if @#{singular}.errors.details.keys.include?(:#{col.to_s})%>' > \n" +
|
135
|
-
"<%= time_field_localized(f, :#{col.to_s}, #{singular}.#{col.to_s}, '#{ col.to_s.humanize }', #{@auth ? @auth+'.timezone' : 'nil'}) %>" +
|
136
|
-
"</div>"
|
137
|
-
|
138
|
-
when :boolean
|
139
|
-
"<div class='col form-group <%='alert-danger' if @#{singular}.errors.details.keys.include?(:#{col.to_s})%>' > \n" +
|
140
|
-
" <span>#{col.to_s.humanize}</span>" +
|
141
|
-
" <%= f.radio_button(:#{col.to_s}, '0', checked: #{singular}.#{col.to_s} ? '' : 'checked') %>\n" +
|
142
|
-
" <%= f.label(:#{col.to_s}, value: 'No', for: '#{singular}_#{col.to_s}_0') %>\n" +
|
143
|
-
" <%= f.radio_button(:#{col.to_s}, '1', checked: #{singular}.#{col.to_s} ? 'checked' : '') %>\n" +
|
144
|
-
" <%= f.label(:#{col.to_s}, value: 'Yes', for: '#{singular}_#{col.to_s}_1') %>\n" +
|
145
|
-
"</div>"
|
146
|
-
when :enum
|
147
|
-
enum_name = "enum_name"
|
148
|
-
# byebug
|
149
|
-
enum_type = eval("#{singular_class}.columns.select{|x| x.name == '#{col.to_s}'}[0].sql_type")
|
150
|
-
"<div class='#{col_identifier} form-group <%= 'alert-danger' if #{singular}.errors.details.keys.include?(:#{col.to_s}) %>' >
|
151
|
-
<%= f.collection_select(:#{col.to_s}, enum_to_collection_select( #{singular_class}.defined_enums['#{enum_type}']), :key, :value, {prompt: true, selected: @#{singular}.#{col.to_s} }, class: 'form-control') %>
|
152
|
-
<label class='small form-text text-muted'>#{col.to_s.humanize}</label></div>"
|
139
|
+
end
|
153
140
|
|
141
|
+
if (type == :integer) && col.to_s.ends_with?("_id")
|
142
|
+
field_error_name = col.to_s.gsub("_id","")
|
143
|
+
else
|
144
|
+
field_error_name = col.to_s
|
154
145
|
end
|
155
|
-
|
156
|
-
|
146
|
+
"<span class='<%= \"alert-danger\" if #{singular}.errors.details.keys.include?(:#{field_error_name}) %>' #{ 'style="display: inherit;"'} >" + field_result + "</span>"
|
147
|
+
}.join("<br />\n") + "</div>"
|
157
148
|
}.join("\n")
|
158
|
-
return
|
149
|
+
return result
|
159
150
|
end
|
160
151
|
|
161
152
|
|
@@ -167,116 +158,106 @@ module HotGlue
|
|
167
158
|
end
|
168
159
|
|
169
160
|
def all_line_fields(*args)
|
170
|
-
|
161
|
+
layout_columns = args[0][:columns]
|
171
162
|
show_only = args[0][:show_only]
|
172
163
|
singular_class = args[0][:singular_class]
|
173
164
|
singular = args[0][:singular]
|
174
165
|
perc_width = args[0][:perc_width]
|
175
166
|
layout = args[0][:layout]
|
176
167
|
|
177
|
-
columns_count =
|
168
|
+
columns_count = layout_columns.count + 1
|
178
169
|
perc_width = (perc_width).floor
|
179
170
|
|
180
171
|
if layout == "bootstrap"
|
181
|
-
col_identifer = "col"
|
172
|
+
col_identifer = "col-md-2"
|
182
173
|
style_with_flex_basis = ""
|
183
174
|
else
|
184
175
|
style_with_flex_basis = " style='flex-basis: #{perc_width}%'"
|
185
176
|
col_identifer = "scaffold-cell"
|
186
177
|
end
|
187
178
|
|
179
|
+
result = layout_columns.map{ |column|
|
180
|
+
"<div class='#{col_identifer}'#{style_with_flex_basis}>" +
|
181
|
+
|
188
182
|
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
183
|
+
column.map { |col|
|
184
|
+
type = eval("#{singular_class}.columns_hash['#{col}']").type
|
185
|
+
limit = eval("#{singular_class}.columns_hash['#{col}']").limit
|
186
|
+
sql_type = eval("#{singular_class}.columns_hash['#{col}']").sql_type
|
193
187
|
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
188
|
+
case type
|
189
|
+
when :integer
|
190
|
+
# look for a belongs_to on this object
|
191
|
+
if col.to_s.ends_with?("_id")
|
198
192
|
|
199
|
-
|
193
|
+
assoc_name = col.to_s.gsub("_id","")
|
200
194
|
|
201
195
|
|
202
|
-
|
196
|
+
assoc = eval("#{singular_class}.reflect_on_association(:#{assoc_name})")
|
203
197
|
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
198
|
+
if assoc.nil?
|
199
|
+
exit_message = "*** Oops. on the #{singular_class} object, there doesn't seem to be an association called '#{assoc_name}'"
|
200
|
+
puts exit_message
|
201
|
+
exit
|
202
|
+
# raise(HotGlue::Error,exit_message)
|
203
|
+
end
|
210
204
|
|
211
|
-
|
205
|
+
display_column = HotGlue.derrive_reference_name(assoc.class_name)
|
212
206
|
|
213
|
-
|
214
|
-
<%= #{singular}.#{assoc.name.to_s}.try(:#{display_column}) || '<span class=\"content alert-danger\">MISSING</span>'.html_safe %>
|
215
|
-
</div>"
|
207
|
+
"<%= #{singular}.#{assoc.name.to_s}.try(:#{display_column}) || '<span class=\"content alert-danger\">MISSING</span>'.html_safe %>"
|
216
208
|
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
"<div class='#{col_identifer}'#{style_with_flex_basis}>
|
232
|
-
<%= #{singular}.#{col} %>
|
233
|
-
</div>"
|
234
|
-
when :datetime
|
235
|
-
|
236
|
-
"<div class='#{col_identifer}' #{style_with_flex_basis} >
|
237
|
-
<% unless #{singular}.#{col}.nil? %>
|
238
|
-
<%= #{singular}.#{col}.in_time_zone(current_timezone).strftime('%m/%d/%Y @ %l:%M %p ') + timezonize(current_timezone) %>
|
239
|
-
<% else %>
|
240
|
-
<span class='alert-danger'>MISSING</span>
|
241
|
-
<% end %>
|
242
|
-
</div>"
|
243
|
-
when :date
|
244
|
-
"<div class='#{col_identifer}' #{style_with_flex_basis} >
|
245
|
-
<% unless #{singular}.#{col}.nil? %>
|
246
|
-
<%= #{singular}.#{col} %>
|
209
|
+
else
|
210
|
+
"<%= #{singular}.#{col}%>"
|
211
|
+
end
|
212
|
+
when :float
|
213
|
+
width = (limit && limit < 40) ? limit : (40)
|
214
|
+
"<%= #{singular}.#{col}%>"
|
215
|
+
when :string
|
216
|
+
width = (limit && limit < 40) ? limit : (40)
|
217
|
+
"<%= #{singular}.#{col} %>"
|
218
|
+
when :text
|
219
|
+
"<%= #{singular}.#{col} %>"
|
220
|
+
when :datetime
|
221
|
+
"<% unless #{singular}.#{col}.nil? %>
|
222
|
+
<%= #{singular}.#{col}.in_time_zone(current_timezone).strftime('%m/%d/%Y @ %l:%M %p ') + timezonize(current_timezone) %>
|
247
223
|
<% else %>
|
248
224
|
<span class='alert-danger'>MISSING</span>
|
249
|
-
<% end %>
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
</
|
278
|
-
|
279
|
-
|
225
|
+
<% end %>"
|
226
|
+
when :date
|
227
|
+
"<% unless #{singular}.#{col}.nil? %>
|
228
|
+
<%= #{singular}.#{col} %>
|
229
|
+
<% else %>
|
230
|
+
<span class='alert-danger'>MISSING</span>
|
231
|
+
<% end %>"
|
232
|
+
when :time
|
233
|
+
"<% unless #{singular}.#{col}.nil? %>
|
234
|
+
<%= #{singular}.#{col}.in_time_zone(current_timezone).strftime('%l:%M %p ') + timezonize(current_timezone) %>
|
235
|
+
<% else %>
|
236
|
+
<span class='alert-danger'>MISSING</span>
|
237
|
+
<% end %>"
|
238
|
+
when :boolean
|
239
|
+
"
|
240
|
+
<% if #{singular}.#{col}.nil? %>
|
241
|
+
<span class='alert-danger'>MISSING</span>
|
242
|
+
<% elsif #{singular}.#{col} %>
|
243
|
+
YES
|
244
|
+
<% else %>
|
245
|
+
NO
|
246
|
+
<% end %>
|
247
|
+
|
248
|
+
" when :enum
|
249
|
+
enum_type = eval("#{singular_class}.columns.select{|x| x.name == '#{col.to_s}'}[0].sql_type")
|
250
|
+
|
251
|
+
"
|
252
|
+
<% if #{singular}.#{col}.nil? %>
|
253
|
+
<span class='alert-danger'>MISSING</span>
|
254
|
+
<% else %>
|
255
|
+
<%= #{singular_class}.defined_enums['#{enum_type}'][#{singular}.#{col}] %>
|
256
|
+
<% end %>
|
257
|
+
|
258
|
+
"
|
259
|
+
end #end of switch
|
260
|
+
}.join("<br />") + "</div>"
|
280
261
|
}.join("\n")
|
281
262
|
end
|
282
263
|
end
|
@@ -31,6 +31,7 @@ module HotGlue
|
|
31
31
|
show_only = args[0][:show_only]
|
32
32
|
singular_class = args[0][:singular_class]
|
33
33
|
|
34
|
+
|
34
35
|
# TODO: CLEAN ME
|
35
36
|
@singular = args[0][:singular]
|
36
37
|
singular = @singular
|
@@ -137,11 +138,15 @@ module HotGlue
|
|
137
138
|
show_only = args[0][:show_only]
|
138
139
|
singular_class = args[0][:singular_class]
|
139
140
|
singular = args[0][:singular]
|
141
|
+
layout = args[0][:layout]
|
140
142
|
|
141
143
|
columns_count = columns.count + 1
|
142
144
|
perc_width = (100/columns_count).floor
|
143
|
-
|
144
|
-
|
145
|
+
if @layout == 'bootstrap'
|
146
|
+
col_identifer = ".col-md-2"
|
147
|
+
else
|
148
|
+
col_identifer = ".col"
|
149
|
+
end
|
145
150
|
columns.map { |col|
|
146
151
|
type = eval("#{singular_class}.columns_hash['#{col}']").type
|
147
152
|
limit = eval("#{singular_class}.columns_hash['#{col}']").limit
|