binda 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +3 -2
- data/app/assets/javascripts/binda/components/fileupload.js +11 -2
- data/app/assets/javascripts/binda/components/form_item.js +25 -45
- data/app/assets/javascripts/binda/components/form_item_choice.js +42 -32
- data/app/assets/javascripts/binda/components/form_item_repeater.js +29 -32
- data/app/assets/javascripts/binda/components/sortable.js +24 -19
- data/app/assets/javascripts/binda/dist/binda.bundle.js +133 -138
- data/app/assets/stylesheets/binda/components/b-alert.scss +24 -0
- data/app/assets/stylesheets/binda/components/form_item.scss +20 -17
- data/app/assets/stylesheets/binda/components/form_item_choice.scss +20 -0
- data/app/assets/stylesheets/binda/components/main_header.scss +1 -1
- data/app/assets/stylesheets/binda/components/main_sidebar.scss +33 -13
- data/app/assets/stylesheets/binda/components/main_table.scss +11 -3
- data/app/assets/stylesheets/binda/components/select2.scss +27 -18
- data/app/assets/stylesheets/binda/components/sortable.scss +1 -1
- data/app/assets/stylesheets/binda/components/standard-form.scss +41 -56
- data/app/assets/stylesheets/binda/index.scss +2 -0
- data/app/assets/stylesheets/binda/settings/common.scss +4 -3
- data/app/assets/stylesheets/binda/settings/tiny_mce_overrides.scss +21 -5
- data/app/assets/stylesheets/binda/settings/variables.scss +2 -2
- data/app/controllers/binda/components_controller.rb +3 -1
- data/app/controllers/binda/field_groups_controller.rb +9 -5
- data/app/controllers/binda/structures_controller.rb +1 -3
- data/app/models/binda/choice.rb +15 -9
- data/app/views/binda/categories/_form.html.erb +4 -6
- data/app/views/binda/categories/index.html.erb +3 -3
- data/app/views/binda/components/index.html.erb +6 -6
- data/app/views/binda/components/sort_index.html.erb +6 -6
- data/app/views/binda/field_groups/_form_body.html.erb +9 -9
- data/app/views/binda/field_groups/_form_item.html.erb +95 -104
- data/app/views/binda/field_groups/_form_item_choice.erb +5 -2
- data/app/views/binda/field_groups/_form_section.html.erb +5 -3
- data/app/views/binda/field_groups/_form_section_repeater.html.erb +6 -3
- data/app/views/binda/fieldable/_form_body.html.erb +5 -7
- data/app/views/binda/fieldable/_form_item_new_repeater.html.erb +1 -1
- data/app/views/binda/fieldable/_form_item_repeater.html.erb +2 -2
- data/app/views/binda/fieldable/_form_item_selections.html.erb +1 -1
- data/app/views/binda/fieldable/_form_sidebar.html.erb +4 -6
- data/app/views/binda/manage/users/_form_body.html.erb +4 -6
- data/app/views/binda/manage/users/index.html.erb +3 -3
- data/app/views/binda/structures/_form_body.html.erb +3 -5
- data/app/views/binda/structures/_form_section.html.erb +49 -25
- data/app/views/binda/structures/_form_sidebar.html.erb +1 -1
- data/app/views/binda/structures/index.html.erb +4 -4
- data/app/views/binda/structures/sort_index.html.erb +6 -6
- data/app/views/binda/users/sessions/new.html.erb +1 -1
- data/app/views/layouts/binda/_flash.html.erb +14 -16
- data/app/views/layouts/binda/_sidebar.html.erb +3 -0
- data/config/initializers/simple_form_custom.rb +1 -1
- data/config/locales/en.yml +1 -1
- data/config/routes.rb +1 -1
- data/db/migrate/1_create_binda_tables.rb +1 -0
- data/lib/binda.rb +1 -0
- data/lib/binda/version.rb +1 -1
- data/lib/generators/binda/setup/setup_generator.rb +3 -1
- metadata +26 -5
- data/db/migrate/20171214140451_add_preview_mode.rb +0 -5
@@ -104,8 +104,11 @@
|
|
104
104
|
<%# - - - - - - - - - - - - %>
|
105
105
|
<%# ALLOW NULL %>
|
106
106
|
<%# - - - - - - - - - - - - %>
|
107
|
-
<div class="form-item--
|
108
|
-
|
107
|
+
<div class="form-item--full-size form-group allow-null">
|
108
|
+
<div class="control-label">
|
109
|
+
<p><%= t(:allow_null).capitalize %></p>
|
110
|
+
</div>
|
111
|
+
|
109
112
|
<%= ff.input :allow_null,
|
110
113
|
as: :boolean,
|
111
114
|
boolean_style: :inline,
|
@@ -27,7 +27,9 @@
|
|
27
27
|
<%= t( :hint_create_parent_before_child, arg1: "#{ t :field_group }", arg2: "#{ t :field_setting }" ).capitalize %>
|
28
28
|
</p>
|
29
29
|
<% else %>
|
30
|
-
<
|
31
|
-
|
32
|
-
|
30
|
+
<div class="standard-form--main-actions">
|
31
|
+
<a id="form-item--field-group-<%= f.object.id %>--add-new" class="form-item--add-new main-header--link b-btn b-btn-primary b-btn-settings" href="<%= new_structure_field_group_field_setting_path( field_group_id: @field_group.slug ) %>" data-new-form-item-id="field-group-<%= f.object.id %>--new-form-item">
|
32
|
+
<%= "<i class=\"fa fa-plus\" aria-hidden=\"true\"></i> #{ t(:new).capitalize }".html_safe %> <%= t :field_setting %>
|
33
|
+
</a>
|
34
|
+
</div>
|
33
35
|
<% end %>
|
@@ -20,6 +20,9 @@
|
|
20
20
|
<%# - - - - - - - - - - - - - - %>
|
21
21
|
<%# ADD NEW FIELD TO REPEATER %>
|
22
22
|
<%# - - - - - - - - - - - - - - %>
|
23
|
-
<
|
24
|
-
|
25
|
-
|
23
|
+
<div class="standard-form--main-actions">
|
24
|
+
<a id="form-item--repeater-<%= repeater.id %>--add-new" class="form-item--add-new main-header--link b-btn b-btn-primary b-btn-settings" data-new-form-item-id="repeater-<%= repeater.id %>--new-form-item" href="#">
|
25
|
+
<%= "<i class=\"fa fa-plus\" aria-hidden=\"true\"></i> #{ t(:new_item_in_repeater, arg1: repeater.name.capitalize) }".html_safe %> <%= t :field_setting %>
|
26
|
+
<%= %>
|
27
|
+
</a>
|
28
|
+
</div>
|
@@ -13,10 +13,8 @@
|
|
13
13
|
<%= f.error_notification %>
|
14
14
|
|
15
15
|
<% if f.object.errors.any? %>
|
16
|
-
<div class="standard-form--error-explanation">
|
17
|
-
|
18
|
-
<%= t('binda.standard_form_error_heading') %> <%= pluralize(f.object.errors.count, t("binda.standard_form_error")) %>.
|
19
|
-
</div>
|
16
|
+
<div class="standard-form--error-explanation b-alert b-alert--error">
|
17
|
+
<%= t('binda.standard_form_error_heading') %> <%= pluralize(f.object.errors.count, t("binda.standard_form_error")) %>:
|
20
18
|
<ul>
|
21
19
|
<% f.object.errors.full_messages.each do |msg| %>
|
22
20
|
<li><%= msg %></li>
|
@@ -40,7 +38,7 @@
|
|
40
38
|
<div class="standard-form--container">
|
41
39
|
|
42
40
|
<div class="standard-form--header">
|
43
|
-
<
|
41
|
+
<small><%= "#{ t :details }".capitalize %></small>
|
44
42
|
</div>
|
45
43
|
|
46
44
|
<div class="standard-form--fields">
|
@@ -67,12 +65,12 @@
|
|
67
65
|
<div class="standard-form--container">
|
68
66
|
|
69
67
|
<div class="standard-form--header">
|
70
|
-
<
|
68
|
+
<small><%= field_group.name.capitalize %></small>
|
71
69
|
</div>
|
72
70
|
|
73
71
|
<% if f.object.new_record? %>
|
74
72
|
|
75
|
-
<p><%= t( :hint_create_parent_before_child, arg1: "#{@structure.name} #{@structure.instance_type}", arg2: "#{ t :detail }" ).capitalize %></p>
|
73
|
+
<p class="standard-form--hint-on-new-record"><%= t( :hint_create_parent_before_child, arg1: "#{@structure.name} #{@structure.instance_type}", arg2: "#{ t :detail }" ).capitalize %></p>
|
76
74
|
|
77
75
|
<% else %>
|
78
76
|
|
@@ -8,7 +8,7 @@
|
|
8
8
|
<%# - - - - - - - - - - - - %>
|
9
9
|
<%# REPEATER HEADER %>
|
10
10
|
<%# - - - - - - - - - - - - %>
|
11
|
-
<div class="form-item--
|
11
|
+
<div class="form-item--header">
|
12
12
|
<a class="form-item--collapse-btn" href="#">
|
13
13
|
<span><i class="fas fa-angle-up"></i> <%= t('binda.collapse') %></span>
|
14
14
|
<span><i class="fas fa-angle-down"></i> <%= t('binda.expand') %></span>
|
@@ -34,7 +34,7 @@
|
|
34
34
|
<%# - - - - - - - - - - - - %>
|
35
35
|
<%# REPEATER HEADER %>
|
36
36
|
<%# - - - - - - - - - - - - %>
|
37
|
-
<div class="form-item--
|
37
|
+
<div class="form-item--header">
|
38
38
|
<a class="form-item--collapse-btn" href="#">
|
39
39
|
<span><i class="fas fa-angle-up"></i> <%= t('binda.collapse') %></span>
|
40
40
|
<span><i class="fas fa-angle-down"></i> <%= t('binda.expand') %></span>
|
@@ -67,7 +67,7 @@
|
|
67
67
|
<%# - - - - - - - - - - - - %>
|
68
68
|
<%# REPEATER HEADER %>
|
69
69
|
<%# - - - - - - - - - - - - %>
|
70
|
-
<div class="form-item--
|
70
|
+
<div class="form-item--header">
|
71
71
|
<a class="form-item--collapse-btn" href="#">
|
72
72
|
<span><i class="fas fa-angle-up"></i> <%= t('binda.collapse') %></span>
|
73
73
|
<span><i class="fas fa-angle-down"></i> <%= t('binda.expand') %></span>
|
@@ -109,7 +109,7 @@
|
|
109
109
|
<% end %>
|
110
110
|
|
111
111
|
<% else %>
|
112
|
-
<p>Sorry, no choice is available.
|
112
|
+
<p class="form-group">Sorry, no choice is available.
|
113
113
|
<% if current_user.is_superadmin %>
|
114
114
|
Please ensure you setup at least two possible choices in the <a href="<%= edit_structure_field_group_path( structure_id: @structure.id, id: field_setting.field_group.id )%>">field group setup</a>.
|
115
115
|
<% else %>
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<div class="standard-form--header">
|
2
|
-
<
|
2
|
+
<small><%= "#{ t :setting }".pluralize.capitalize %></small>
|
3
3
|
</div>
|
4
4
|
|
5
5
|
<div class="standard-form--radio">
|
@@ -18,11 +18,9 @@
|
|
18
18
|
<% end %>
|
19
19
|
|
20
20
|
<% if @instance.slug.nil? %>
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
</h5>
|
25
|
-
|
21
|
+
<p class="standard-form--hint-on-new-record">
|
22
|
+
<%= t( :hint_create_parent_before_child, arg1: "#{ t :category }", arg2: "#{ t :instance }" ).capitalize %>
|
23
|
+
</p>
|
26
24
|
<% else %>
|
27
25
|
|
28
26
|
<div class="standard-form--secondary-actions">
|
@@ -5,10 +5,8 @@
|
|
5
5
|
<%= f.error_notification %>
|
6
6
|
|
7
7
|
<% if f.object.errors.any? %>
|
8
|
-
<div class="standard-form--error-explanation">
|
9
|
-
|
10
|
-
<%= t('binda.standard_form_error_heading') %> <%= pluralize(f.object.errors.count, t("binda.standard_form_error")) %>.
|
11
|
-
</div>
|
8
|
+
<div class="standard-form--error-explanation b-alert b-alert--error">
|
9
|
+
<%= t('binda.standard_form_error_heading') %> <%= pluralize(f.object.errors.count, t("binda.standard_form_error")) %>:
|
12
10
|
<ul>
|
13
11
|
<% f.object.errors.full_messages.each do |msg| %>
|
14
12
|
<li><%= msg %></li>
|
@@ -22,7 +20,7 @@
|
|
22
20
|
<div class="standard-form--container">
|
23
21
|
|
24
22
|
<div class="standard-form--header">
|
25
|
-
<
|
23
|
+
<small>Edit User Details</small>
|
26
24
|
</div>
|
27
25
|
|
28
26
|
<%= f.input :email, label: "Email" %>
|
@@ -44,7 +42,7 @@
|
|
44
42
|
<div class="standard-form--sidebar">
|
45
43
|
|
46
44
|
<div class="standard-form--header">
|
47
|
-
<
|
45
|
+
<small><%= "#{ t :setting }".pluralize.capitalize %></small>
|
48
46
|
</div>
|
49
47
|
|
50
48
|
<div class="standard-form--container">
|
@@ -9,10 +9,10 @@
|
|
9
9
|
<div class="main-table--container">
|
10
10
|
|
11
11
|
<table class="standard-form--container">
|
12
|
-
<thead>
|
12
|
+
<thead class="standard-form--header">
|
13
13
|
<tr>
|
14
|
-
<th style="width: 70%;"
|
15
|
-
<th style="width: 30%;"
|
14
|
+
<th style="width: 70%;">Email</th>
|
15
|
+
<th style="width: 30%;"></th>
|
16
16
|
</tr>
|
17
17
|
</thead>
|
18
18
|
<tbody>
|
@@ -4,10 +4,8 @@
|
|
4
4
|
<%= f.error_notification %>
|
5
5
|
|
6
6
|
<% if f.object.errors.any? %>
|
7
|
-
<div class="standard-form--error-explanation">
|
8
|
-
|
9
|
-
<%= t('binda.standard_form_error_heading') %> <%= pluralize(f.object.errors.count, t("binda.standard_form_error")) %>.
|
10
|
-
</div>
|
7
|
+
<div class="standard-form--error-explanation b-alert b-alert--error">
|
8
|
+
<%= t('binda.standard_form_error_heading') %> <%= pluralize(f.object.errors.count, t("binda.standard_form_error")) %>:
|
11
9
|
<ul>
|
12
10
|
<% f.object.errors.full_messages.each do |msg| %>
|
13
11
|
<li><%= msg %></li>
|
@@ -21,7 +19,7 @@
|
|
21
19
|
<div class="standard-form--container">
|
22
20
|
|
23
21
|
<div class="standard-form--header">
|
24
|
-
<
|
22
|
+
<small><%= "#{ t :details }".capitalize %></small>
|
25
23
|
</div>
|
26
24
|
|
27
25
|
<div class="standard-form--fields">
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<div class="standard-form--header">
|
2
|
-
<
|
2
|
+
<small><%= "#{ t :field_group }".pluralize %></small>
|
3
3
|
</div>
|
4
4
|
|
5
5
|
<%# - - - - - - - - - - - - %>
|
@@ -16,36 +16,41 @@
|
|
16
16
|
<%# - - - - - - - - - - - - %>
|
17
17
|
<%# EDIT/REMOVE BUTTONS %>
|
18
18
|
<%# - - - - - - - - - - - - %>
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
structure_field_group_path( @structure.slug, ff.object.slug )
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
19
|
+
<div class="standard-form--secondary-header form-item--header form-item--repeater-header">
|
20
|
+
<%# - - - - - - - - - - - - %>
|
21
|
+
<%# BUTTONS %>
|
22
|
+
<%# - - - - - - - - - - - - %>
|
23
|
+
<% if ff.object.slug.nil? %>
|
24
|
+
<a class="form-item--delete-repeater-item form-item--remove-item-with-js"
|
25
|
+
data-confirm="This operation will delete this setting and all related component content. Are you ok with that?">
|
26
|
+
<i class="far fa-trash-alt"></i> <%= t('binda.delete').capitalize %>
|
27
|
+
</a>
|
28
|
+
<p><%= t('binda.new_item_in_repeater', { arg1: '' })%></p>
|
29
|
+
<% else %>
|
30
|
+
<%= link_to "<i class=\"fas fa-pencil-alt\"></i> #{ t('binda.edit')}".html_safe,
|
31
|
+
structure_field_group_path( @structure.slug, ff.object.slug ),
|
32
|
+
class: 'form-item--edit-item' %>
|
33
|
+
|
34
|
+
<%= link_to "<i class=\"far fa-trash-alt\"></i> #{t('binda.delete').capitalize}".html_safe,
|
35
|
+
structure_field_group_path( @structure.slug, ff.object.slug ),
|
36
|
+
method: :delete,
|
37
|
+
data: { confirm: t('binda.confirm_delete') },
|
38
|
+
class: 'form-item--delete-repeater-item' %>
|
39
|
+
|
40
|
+
<p><%= ff.object.name %> (<%= ff.object.name.humanize.capitalize %>)</p>
|
41
|
+
<% end %>
|
42
|
+
</div>
|
36
43
|
|
37
44
|
<%# - - - - - - - - - - - - %>
|
38
45
|
<%# NAME %>
|
39
46
|
<%# - - - - - - - - - - - - %>
|
40
|
-
<%= ff.input :name, label: "#{ t :name }".capitalize %>
|
47
|
+
<%= ff.input :name, label: "#{ t :name }".capitalize, wrapper_html: { class: "form-item--half-size" } %>
|
41
48
|
|
42
49
|
|
43
50
|
<%# - - - - - - - - - - - - %>
|
44
51
|
<%# SLUG %>
|
45
52
|
<%# - - - - - - - - - - - - %>
|
46
|
-
|
47
|
-
<%= ff.input :slug, as: :string, input_html: { class: "form-item--input" } %>
|
48
|
-
<% end %>
|
53
|
+
<%= ff.input :slug, wrapper_html: { class: "form-item--half-size" } %>
|
49
54
|
|
50
55
|
</div>
|
51
56
|
|
@@ -57,11 +62,27 @@
|
|
57
62
|
<%# - - - - - - - - - - - - %>
|
58
63
|
<%= f.simple_fields_for 'new_field_groups[]', @structure.field_groups.build() do |ff| %>
|
59
64
|
<div id="field-group-<%= f.object.id %>--new-form-item" class="form-item form-item--new">
|
65
|
+
|
66
|
+
<%# - - - - - - - - - - - - %>
|
67
|
+
<%# EDIT/REMOVE BUTTONS %>
|
68
|
+
<%# - - - - - - - - - - - - %>
|
69
|
+
<div class="standard-form--secondary-header form-item--header form-item--repeater-header">
|
70
|
+
<%# - - - - - - - - - - - - %>
|
71
|
+
<%# BUTTONS %>
|
72
|
+
<%# - - - - - - - - - - - - %>
|
73
|
+
<a class="form-item--delete-repeater-item form-item--remove-item-with-js"
|
74
|
+
data-confirm="This operation will delete this setting and all related component content. Are you ok with that?">
|
75
|
+
<i class="far fa-trash-alt"></i> <%= t('binda.delete').capitalize %>
|
76
|
+
</a>
|
77
|
+
<p><%= t('binda.new_item_in_repeater', { arg1: '' })%></p>
|
78
|
+
</div>
|
60
79
|
<div class="form-item--editor">
|
61
80
|
<%= ff.input :structure_id, as: :hidden %>
|
62
81
|
<%= ff.input :id, as: :hidden %>
|
63
|
-
<%= ff.input :name, label: "#{ t :name }".capitalize %>
|
82
|
+
<%= ff.input :name, label: "#{ t :name }".capitalize, wrapper_html: { class: "form-item--half-size" } %>
|
83
|
+
<%= ff.input :slug, wrapper_html: { class: "form-item--half-size" } %>
|
64
84
|
</div>
|
85
|
+
|
65
86
|
</div>
|
66
87
|
<% end %>
|
67
88
|
|
@@ -72,7 +93,10 @@
|
|
72
93
|
<% if section.slug.nil? %>
|
73
94
|
<p class="standard-form--suggestion"><%= t( :hint_create_parent_before_child, arg1: "#{ t :structure }", arg2: "#{ t :field_group }" ).capitalize %></p>
|
74
95
|
<% else %>
|
75
|
-
|
96
|
+
<div class="standard-form--main-actions">
|
97
|
+
<a id="form-item--field-group-<%= f.object.id %>--add-new" class="form-item--add-new main-header--link b-btn b-btn-primary b-btn-settings" href="<%= new_structure_field_group_path( @structure.slug ) %>" data-new-form-item-id="field-group-<%= f.object.id %>--new-form-item">
|
76
98
|
<%= "<i class=\"fa fa-plus\" aria-hidden=\"true\"></i> #{ t(:new).capitalize }".html_safe %> <%= t :field_group %>
|
77
|
-
|
99
|
+
</a>
|
100
|
+
</div>
|
101
|
+
|
78
102
|
<% end %>
|
@@ -3,17 +3,17 @@
|
|
3
3
|
<%= link_to "<i class=\"fa fa-plus\" aria-hidden=\"true\"></i> New Structure".html_safe, new_structure_path, class: 'main-header--link b-btn b-btn-primary' %>
|
4
4
|
<%= get_structures_sort_index_link %>
|
5
5
|
</div>
|
6
|
-
<
|
6
|
+
<p>Structures</p>
|
7
7
|
<% end %>
|
8
8
|
|
9
9
|
<% content_for :content do %>
|
10
10
|
<div class="main-table--container">
|
11
11
|
|
12
12
|
<table class="standard-form--container">
|
13
|
-
<thead>
|
13
|
+
<thead class="standard-form--header">
|
14
14
|
<tr>
|
15
|
-
<th style="width: 70%"
|
16
|
-
<th style="width: 30%"
|
15
|
+
<th style="width: 70%">Structures</th>
|
16
|
+
<th style="width: 30%"></th>
|
17
17
|
</tr>
|
18
18
|
</thead>
|
19
19
|
|
@@ -2,7 +2,7 @@
|
|
2
2
|
<div class="main-header--buttons">
|
3
3
|
<%= link_to "<i class=\"fa fa-plus\" aria-hidden=\"true\"></i> New Structure".html_safe, new_structure_path, class: 'main-header--link b-btn b-btn-primary' %>
|
4
4
|
</div>
|
5
|
-
<
|
5
|
+
<p><%= t 'binda.structures' %></p>
|
6
6
|
<% end %>
|
7
7
|
|
8
8
|
<% content_for :content do %>
|
@@ -11,11 +11,11 @@
|
|
11
11
|
<h5 class="text-muted"><%= t('binda.sort_index_hint', { arg1: t('binda.structures').downcase }).html_safe %></h5>
|
12
12
|
|
13
13
|
<table class="standard-form--container table-sort">
|
14
|
-
<thead>
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
14
|
+
<thead class="standard-form--header">
|
15
|
+
<tr>
|
16
|
+
<th style="width: 70%">Structures</th>
|
17
|
+
<th style="width: 30%"></th>
|
18
|
+
</tr>
|
19
19
|
</thead>
|
20
20
|
|
21
21
|
<tbody class="sortable" data-update-url="<%= structures_sort_path() %>">
|
@@ -6,7 +6,7 @@
|
|
6
6
|
<p><%= t('binda.login_welcome', { arg1: get_website_name }) %></p>
|
7
7
|
</div>
|
8
8
|
<div class="login--footer">
|
9
|
-
<a href="https://github.com/lacolonia/binda" target="_blank"><%= t('binda.login_credit', { arg1: Binda::VERSION.
|
9
|
+
<a href="https://github.com/lacolonia/binda" target="_blank"><%= t('binda.login_credit', { arg1: Binda::VERSION.to_s }) %></a>
|
10
10
|
</div>
|
11
11
|
<% end %>
|
12
12
|
|
@@ -1,26 +1,24 @@
|
|
1
1
|
<% unless notice.blank? %>
|
2
|
-
<div class="
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
<% end %>
|
2
|
+
<div class="b-alert b-alert--success">
|
3
|
+
<% if notice.is_a? String %>
|
4
|
+
<p><%= notice %></p>
|
5
|
+
<% elsif notice.is_a? Hash %>
|
6
|
+
<% notice.each do |key, message| %>
|
7
|
+
<p><%= key.split('.').map{|k| k.humanize }.join(': ') %> <%= message.to_sentence %></p>
|
9
8
|
<% end %>
|
10
|
-
|
9
|
+
<% end %>
|
11
10
|
</div>
|
12
11
|
<% end %>
|
13
12
|
|
14
13
|
<% unless alert.blank? %>
|
15
|
-
<div class="
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
<% end %>
|
14
|
+
<div class="b-alert b-alert--danger">
|
15
|
+
<% if alert.is_a? String %>
|
16
|
+
<p><%= alert %></p>
|
17
|
+
<% elsif alert.is_a? Hash %>
|
18
|
+
<% alert.each do |key, message| %>
|
19
|
+
<p><%= key.split('.').map{|k| k.humanize.capitalize }.join(': ') %> <%= message.to_sentence %></p>
|
22
20
|
<% end %>
|
23
|
-
|
21
|
+
<% end %>
|
24
22
|
</div>
|
25
23
|
<% end %>
|
26
24
|
|
@@ -2,7 +2,7 @@
|
|
2
2
|
SimpleForm.setup do |config|
|
3
3
|
|
4
4
|
# Bootstrap Simple Form defaults
|
5
|
-
config.error_notification_class = 'alert alert
|
5
|
+
config.error_notification_class = 'b-alert b-alert--danger'
|
6
6
|
config.button_class = 'b-btn b-btn-default'
|
7
7
|
config.boolean_label_class = nil
|
8
8
|
|