common_core_js 0.3.3 → 0.3.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/helpers/common_core_js/application_helper.rb +1 -1
- data/lib/common_core_js/version.rb +1 -1
- data/lib/generators/common_core/scaffold_generator.rb +9 -7
- data/lib/generators/common_core/templates/_line.haml +3 -1
- data/lib/generators/common_core/templates/all.haml +2 -1
- data/lib/generators/common_core/templates/common_core.js +3 -3
- data/lib/generators/common_core/templates/common_core.scss +5 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9ed403954e1619e60aed2c0c239679b882ded20fab6876557bc370682866e4e9
|
4
|
+
data.tar.gz: 82d2eff05dcd520bc721087573fcc01a928651415a66e3b9437e8641082df995
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0d962aeeb62c3a241cb00e774e207f20d6f7d5e0ce73ad18f3d77ee23806531278fcb897172125baf64c234f559b981b40a4e5fbb05e6f96b21c6684eba94e3a
|
7
|
+
data.tar.gz: fa77bc758647627c1995163e803646dfd144543881fe623c50ba9b5a9f6689337ba054e928623edf37e933e00bd01dd7c5ea16affdd499cd45a570c8edb5f3c1
|
@@ -13,7 +13,7 @@ module CommonCore
|
|
13
13
|
end
|
14
14
|
|
15
15
|
".row
|
16
|
-
|
16
|
+
%div{class: \"form-group col-md-4 \#{'alert-danger' if #{singular}.errors.details.keys.include?(:#{col.to_s})}\"}
|
17
17
|
= f.text_area :#{col.to_s}, class: 'form-control', cols: 40, rows: '#{lines}'
|
18
18
|
%label.form-text
|
19
19
|
#{col.to_s.humanize}\n"
|
@@ -23,7 +23,7 @@ module CommonCore
|
|
23
23
|
|
24
24
|
def field_output(col, type = nil, width)
|
25
25
|
".row
|
26
|
-
|
26
|
+
%div{class: \"form-group col-md-4 \#{'alert-danger' if #{singular}.errors.details.keys.include?(:#{col.to_s})}\"}
|
27
27
|
= f.text_field :#{col.to_s}, value: @#{singular}.#{col.to_s}, size: #{width}, class: 'form-control', type: '#{type}'
|
28
28
|
%label.form-text
|
29
29
|
#{col.to_s.humanize}\n"
|
@@ -397,14 +397,14 @@ module CommonCore
|
|
397
397
|
end
|
398
398
|
|
399
399
|
".row
|
400
|
-
|
400
|
+
%div{class: \"form-group col-md-4 \#{'alert-danger' if #{singular}.errors.details.keys.include?(:#{assoc_name.to_s})}\"}
|
401
401
|
= f.collection_select(:#{col.to_s}, #{assoc_name.titleize}.all, :id, :#{display_column}, {prompt: true, selected: @#{singular}.#{col.to_s} }, class: 'form-control')
|
402
402
|
%label.small.form-text.text-muted
|
403
403
|
#{col.to_s.humanize}"
|
404
404
|
|
405
405
|
else
|
406
406
|
".row
|
407
|
-
|
407
|
+
%div{class: \"form-group col-md-4 \#{'alert-danger' if #{singular}.errors.details.keys.include?(:#{col.to_s})}\"}
|
408
408
|
= f.text_field :#{col.to_s}, value: @#{singular}.#{col.to_s}, class: 'form-control', size: 4, type: 'number'
|
409
409
|
%label.form-text
|
410
410
|
#{col.to_s.humanize}\n"
|
@@ -427,15 +427,15 @@ module CommonCore
|
|
427
427
|
|
428
428
|
when :datetime
|
429
429
|
".row
|
430
|
-
|
430
|
+
%div{class: \"form-group col-md-4 \#{'alert-danger' if #{singular}.errors.details.keys.include?(:#{col.to_s})}\"}
|
431
431
|
= datetime_field_localized(f, :#{col.to_s}, @#{singular}.#{col.to_s}, '#{col.to_s.humanize}', #{@auth}.timezone)"
|
432
432
|
when :date
|
433
433
|
".row
|
434
|
-
|
434
|
+
%div{class: \"form-group col-md-4 \#{'alert-danger' if #{singular}.errors.details.keys.include?(:#{col.to_s})}\"}
|
435
435
|
= date_field_localized(f, :#{col.to_s}, @#{singular}.#{col.to_s}, '#{col.to_s.humanize}', #{@auth}.timezone)"
|
436
436
|
when :time
|
437
437
|
".row
|
438
|
-
|
438
|
+
%div{class: \"form-group col-md-4 \#{'alert-danger' if #{singular}.errors.details.keys.include?(:#{col.to_s})}\"}
|
439
439
|
= time_field_localized(f, :#{col.to_s}, @#{singular}.#{col.to_s}, '#{col.to_s.humanize}', #{@auth}.timezone)"
|
440
440
|
|
441
441
|
end
|
@@ -510,6 +510,7 @@ module CommonCore
|
|
510
510
|
= #{singular}.#{col}
|
511
511
|
- else
|
512
512
|
%span.alert-danger
|
513
|
+
MISSING
|
513
514
|
"
|
514
515
|
when :time
|
515
516
|
" %td
|
@@ -517,6 +518,7 @@ module CommonCore
|
|
517
518
|
= #{singular}.#{col}.in_time_zone(current_timezone).strftime('%l:%M %p ') + human_timezone(Time.now, current_timezone)
|
518
519
|
- else
|
519
520
|
%span.alert-danger
|
521
|
+
MISSING
|
520
522
|
"
|
521
523
|
|
522
524
|
end
|
@@ -1,3 +1,5 @@
|
|
1
1
|
<%= all_line_fields %>
|
2
2
|
%td
|
3
|
-
= link_to "
|
3
|
+
= link_to "Delete <i class='fa fa-1x fa-remove'></i>".html_safe, <%= path_helper_singular %>(<%= singular %>), remote: true ,method: :delete, disable_with: "Loading...", class: "delete-<%= singular %>-button btn btn-primary "
|
4
|
+
|
5
|
+
= link_to "Edit <i class='fa fa-1x fa-list-alt'></i>".html_safe, edit_<%= path_helper_singular %>(<%= singular %>), remote: true , disable_with: "Loading...", class: "edit-<%= singular %>-button btn btn-primary "
|
@@ -1,4 +1,5 @@
|
|
1
1
|
.container-fluid
|
2
2
|
.row
|
3
3
|
.col-md-12
|
4
|
-
|
4
|
+
.<%= singular %>-list
|
5
|
+
= render partial: "<%= namespace_with_trailing_dash %><%= plural %>/list", locals: {<%= plural %>: <%= all_objects_root %>.order("created_at DESC").page(1)}
|
@@ -1,9 +1,9 @@
|
|
1
1
|
|
2
2
|
require("jquery")
|
3
|
-
console.log("loading common core...")
|
3
|
+
// console.log("loading common core...")
|
4
4
|
|
5
|
-
require("jstimezonedetect/dist/jstz.min")
|
6
|
-
var JSTZ = require('jstimezonedetect');
|
5
|
+
// require("jstimezonedetect/dist/jstz.min")
|
6
|
+
// var JSTZ = require('jstimezonedetect');
|
7
7
|
|
8
8
|
|
9
9
|
|