binda 0.0.2
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 +7 -0
- data/MIT-LICENSE +20 -0
- data/README.md +63 -0
- data/Rakefile +37 -0
- data/app/assets/config/binda_manifest.js +2 -0
- data/app/assets/javascripts/binda/application.js +18 -0
- data/app/assets/javascripts/binda/components/form_item.js +54 -0
- data/app/assets/javascripts/binda/components/form_item_asset.js +24 -0
- data/app/assets/javascripts/binda/components/form_item_repeater.js +66 -0
- data/app/assets/javascripts/binda/components/sortable.js +44 -0
- data/app/assets/javascripts/binda/dist/binda.bundle.js +336 -0
- data/app/assets/javascripts/binda/index.js +16 -0
- data/app/assets/stylesheets/binda/application.css +6 -0
- data/app/assets/stylesheets/binda/components/assets_manager.scss +46 -0
- data/app/assets/stylesheets/binda/components/button.scss +7 -0
- data/app/assets/stylesheets/binda/components/form_body.scss +2 -0
- data/app/assets/stylesheets/binda/components/form_item.scss +169 -0
- data/app/assets/stylesheets/binda/components/form_item_asset.scss +20 -0
- data/app/assets/stylesheets/binda/components/form_section.scss +40 -0
- data/app/assets/stylesheets/binda/components/login.scss +6 -0
- data/app/assets/stylesheets/binda/components/main_container.scss +0 -0
- data/app/assets/stylesheets/binda/components/main_content.scss +5 -0
- data/app/assets/stylesheets/binda/components/main_header.scss +25 -0
- data/app/assets/stylesheets/binda/components/main_table.scss +28 -0
- data/app/assets/stylesheets/binda/components/sidebar.scss +131 -0
- data/app/assets/stylesheets/binda/components/sortable.scss +98 -0
- data/app/assets/stylesheets/binda/index.scss +24 -0
- data/app/assets/stylesheets/binda/layout/components_index.scss +9 -0
- data/app/assets/stylesheets/binda/layout/dashboard.scss +7 -0
- data/app/assets/stylesheets/binda/layout/users_sign_in.scss +29 -0
- data/app/assets/stylesheets/binda/settings/common.scss +93 -0
- data/app/assets/stylesheets/binda/settings/fonts.scss +90 -0
- data/app/assets/stylesheets/binda/settings/variables.scss +83 -0
- data/app/assets/stylesheets/scaffolds.scss +89 -0
- data/app/controllers/binda/application_controller.rb +29 -0
- data/app/controllers/binda/assets_controller.rb +62 -0
- data/app/controllers/binda/bindings_controller.rb +62 -0
- data/app/controllers/binda/categories_controller.rb +60 -0
- data/app/controllers/binda/components_controller.rb +223 -0
- data/app/controllers/binda/dates_controller.rb +62 -0
- data/app/controllers/binda/field_groups_controller.rb +114 -0
- data/app/controllers/binda/field_settings_controller.rb +66 -0
- data/app/controllers/binda/galleries_controller.rb +62 -0
- data/app/controllers/binda/manage/users_controller.rb +97 -0
- data/app/controllers/binda/repeaters_controller.rb +67 -0
- data/app/controllers/binda/settings_controller.rb +75 -0
- data/app/controllers/binda/structures_controller.rb +89 -0
- data/app/controllers/binda/texts_controller.rb +62 -0
- data/app/controllers/binda/users/confirmations_controller.rb +33 -0
- data/app/controllers/binda/users/omniauth_callbacks_controller.rb +33 -0
- data/app/controllers/binda/users/passwords_controller.rb +37 -0
- data/app/controllers/binda/users/registrations_controller.rb +89 -0
- data/app/controllers/binda/users/sessions_controller.rb +30 -0
- data/app/controllers/binda/users/unlocks_controller.rb +33 -0
- data/app/helpers/binda/application_helper.rb +25 -0
- data/app/helpers/binda/assets_helper.rb +4 -0
- data/app/helpers/binda/bindings_helper.rb +4 -0
- data/app/helpers/binda/categories_helper.rb +10 -0
- data/app/helpers/binda/components_helper.rb +10 -0
- data/app/helpers/binda/dates_helper.rb +4 -0
- data/app/helpers/binda/field_groups_helper.rb +10 -0
- data/app/helpers/binda/field_settings_helper.rb +14 -0
- data/app/helpers/binda/galleries_helper.rb +4 -0
- data/app/helpers/binda/repeaters_helper.rb +4 -0
- data/app/helpers/binda/settings_helper.rb +13 -0
- data/app/helpers/binda/structures_helper.rb +4 -0
- data/app/helpers/binda/texts_helper.rb +4 -0
- data/app/jobs/binda/application_job.rb +4 -0
- data/app/mailers/binda/application_mailer.rb +6 -0
- data/app/models/binda/application_record.rb +5 -0
- data/app/models/binda/asset.rb +21 -0
- data/app/models/binda/binding.rb +24 -0
- data/app/models/binda/category.rb +31 -0
- data/app/models/binda/component.rb +186 -0
- data/app/models/binda/date.rb +9 -0
- data/app/models/binda/field_group.rb +40 -0
- data/app/models/binda/field_setting.rb +95 -0
- data/app/models/binda/gallery.rb +18 -0
- data/app/models/binda/repeater.rb +108 -0
- data/app/models/binda/setting.rb +42 -0
- data/app/models/binda/structure.rb +31 -0
- data/app/models/binda/text.rb +9 -0
- data/app/models/binda/user.rb +8 -0
- data/app/uploaders/binda/asset/image_uploader.rb +76 -0
- data/app/views/binda/assets/_form.html.erb +22 -0
- data/app/views/binda/assets/edit.html.erb +6 -0
- data/app/views/binda/assets/index.html.erb +29 -0
- data/app/views/binda/assets/new.html.erb +5 -0
- data/app/views/binda/assets/show.html.erb +19 -0
- data/app/views/binda/bindings/_form.html.erb +32 -0
- data/app/views/binda/bindings/edit.html.erb +6 -0
- data/app/views/binda/bindings/index.html.erb +31 -0
- data/app/views/binda/bindings/new.html.erb +5 -0
- data/app/views/binda/bindings/show.html.erb +19 -0
- data/app/views/binda/categories/_form.html.erb +58 -0
- data/app/views/binda/categories/edit.html.erb +8 -0
- data/app/views/binda/categories/index.html.erb +34 -0
- data/app/views/binda/categories/new.html.erb +8 -0
- data/app/views/binda/components/_form_body.html.erb +86 -0
- data/app/views/binda/components/_form_item_asset.html.erb +20 -0
- data/app/views/binda/components/_form_item_date.html.erb +16 -0
- data/app/views/binda/components/_form_item_gallery.html.erb +0 -0
- data/app/views/binda/components/_form_item_new_repeater.html.erb +33 -0
- data/app/views/binda/components/_form_item_repeater.html.erb +81 -0
- data/app/views/binda/components/_form_item_text.html.erb +28 -0
- data/app/views/binda/components/_form_section.html.erb +37 -0
- data/app/views/binda/components/_form_section_repeater.html.erb +31 -0
- data/app/views/binda/components/_form_sidebar.html.erb +34 -0
- data/app/views/binda/components/edit.html.erb +8 -0
- data/app/views/binda/components/index.html.erb +43 -0
- data/app/views/binda/components/new.html.erb +8 -0
- data/app/views/binda/dates/_form.html.erb +22 -0
- data/app/views/binda/dates/edit.html.erb +6 -0
- data/app/views/binda/dates/index.html.erb +27 -0
- data/app/views/binda/dates/new.html.erb +5 -0
- data/app/views/binda/dates/show.html.erb +9 -0
- data/app/views/binda/field_groups/_form_body.html.erb +71 -0
- data/app/views/binda/field_groups/_form_item.html.erb +62 -0
- data/app/views/binda/field_groups/_form_section.html.erb +37 -0
- data/app/views/binda/field_groups/_form_section_repeater.html.erb +25 -0
- data/app/views/binda/field_groups/edit.html.erb +8 -0
- data/app/views/binda/field_groups/index.html.erb +34 -0
- data/app/views/binda/field_groups/new.html.erb +8 -0
- data/app/views/binda/field_settings/_form_body.html.erb +60 -0
- data/app/views/binda/field_settings/edit.html.erb +8 -0
- data/app/views/binda/field_settings/index.html.erb +31 -0
- data/app/views/binda/field_settings/new.html.erb +8 -0
- data/app/views/binda/galleries/_form.html.erb +27 -0
- data/app/views/binda/galleries/edit.html.erb +6 -0
- data/app/views/binda/galleries/index.html.erb +29 -0
- data/app/views/binda/galleries/new.html.erb +5 -0
- data/app/views/binda/galleries/show.html.erb +14 -0
- data/app/views/binda/manage/users/_admin_manage_user.json.jbuilder +2 -0
- data/app/views/binda/manage/users/_form_body.html.erb +58 -0
- data/app/views/binda/manage/users/edit.html.erb +8 -0
- data/app/views/binda/manage/users/index.html.erb +38 -0
- data/app/views/binda/manage/users/index.json.jbuilder +1 -0
- data/app/views/binda/manage/users/new.html.erb +8 -0
- data/app/views/binda/manage/users/show.json.jbuilder +1 -0
- data/app/views/binda/repeaters/_form.html.erb +27 -0
- data/app/views/binda/repeaters/edit.html.erb +6 -0
- data/app/views/binda/repeaters/index.html.erb +29 -0
- data/app/views/binda/repeaters/new.html.erb +5 -0
- data/app/views/binda/repeaters/show.html.erb +14 -0
- data/app/views/binda/settings/_dashboard_form.html.erb +51 -0
- data/app/views/binda/settings/_form.html.erb +52 -0
- data/app/views/binda/settings/dashboard.html.erb +9 -0
- data/app/views/binda/settings/edit.html.erb +8 -0
- data/app/views/binda/settings/index.html.erb +34 -0
- data/app/views/binda/settings/new.html.erb +8 -0
- data/app/views/binda/structures/_form_body.html.erb +56 -0
- data/app/views/binda/structures/_form_section.html.erb +64 -0
- data/app/views/binda/structures/add_child.html.erb +0 -0
- data/app/views/binda/structures/edit.html.erb +8 -0
- data/app/views/binda/structures/index.html.erb +34 -0
- data/app/views/binda/structures/new.html.erb +8 -0
- data/app/views/binda/texts/_form.html.erb +22 -0
- data/app/views/binda/texts/edit.html.erb +6 -0
- data/app/views/binda/texts/index.html.erb +27 -0
- data/app/views/binda/texts/new.html.erb +5 -0
- data/app/views/binda/texts/show.html.erb +9 -0
- data/app/views/layouts/binda/_flash.html.erb +26 -0
- data/app/views/layouts/binda/_header.html.erb +9 -0
- data/app/views/layouts/binda/_sidebar.html.erb +50 -0
- data/app/views/layouts/binda/application.html.erb +29 -0
- data/app/views/users/confirmations/new.html.erb +16 -0
- data/app/views/users/mailer/confirmation_instructions.html.erb +5 -0
- data/app/views/users/mailer/password_change.html.erb +3 -0
- data/app/views/users/mailer/reset_password_instructions.html.erb +8 -0
- data/app/views/users/mailer/unlock_instructions.html.erb +7 -0
- data/app/views/users/passwords/edit.html.erb +31 -0
- data/app/views/users/passwords/new.html.erb +28 -0
- data/app/views/users/registrations/edit.html.erb +27 -0
- data/app/views/users/registrations/new.html.erb +17 -0
- data/app/views/users/sessions/new.html.erb +27 -0
- data/app/views/users/shared/_links.html.erb +25 -0
- data/app/views/users/unlocks/new.html.erb +16 -0
- data/config/initializers/assets.rb +3 -0
- data/config/initializers/devise.rb +278 -0
- data/config/initializers/devise_patch.rb +50 -0
- data/config/initializers/friendly_id.rb +88 -0
- data/config/initializers/simple_form.rb +165 -0
- data/config/initializers/simple_form_bootstrap.rb +149 -0
- data/config/locales/devise.en.yml +62 -0
- data/config/locales/en.yml +37 -0
- data/config/locales/simple_form.en.yml +31 -0
- data/config/routes.rb +67 -0
- data/config/tinymce.yml +15 -0
- data/db/migrate/1_create_binda_tables.rb +172 -0
- data/lib/binda.rb +5 -0
- data/lib/binda/engine.rb +30 -0
- data/lib/binda/version.rb +3 -0
- data/lib/generators/binda/install/USAGE +9 -0
- data/lib/generators/binda/install/install_generator.rb +107 -0
- data/lib/generators/binda/install/templates/config/initializers/carrierwave.rb +32 -0
- data/lib/generators/binda/install/templates/config/initializers/devise.rb +280 -0
- data/lib/generators/binda/setup/USAGE +8 -0
- data/lib/generators/binda/setup/setup_generator.rb +43 -0
- data/lib/tasks/binda.rake +25 -0
- data/lib/templates/erb/scaffold/_form.html.erb +13 -0
- metadata +637 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<p id="notice"><%= notice %></p>
|
|
2
|
+
|
|
3
|
+
<p>
|
|
4
|
+
<strong>Name:</strong>
|
|
5
|
+
<%= @asset.name %>
|
|
6
|
+
</p>
|
|
7
|
+
|
|
8
|
+
<p>
|
|
9
|
+
<strong>Image:</strong>
|
|
10
|
+
<%= @asset.image %>
|
|
11
|
+
</p>
|
|
12
|
+
|
|
13
|
+
<p>
|
|
14
|
+
<strong>Slug:</strong>
|
|
15
|
+
<%= @asset.slug %>
|
|
16
|
+
</p>
|
|
17
|
+
|
|
18
|
+
<%= link_to 'Edit', edit_asset_path(@asset) %> |
|
|
19
|
+
<%= link_to 'Back', assets_path %>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<%= form_for(binding) do |f| %>
|
|
2
|
+
<% if binding.errors.any? %>
|
|
3
|
+
<div id="error_explanation">
|
|
4
|
+
<h2><%= pluralize(binding.errors.count, "error") %> prohibited this binding from being saved:</h2>
|
|
5
|
+
|
|
6
|
+
<ul>
|
|
7
|
+
<% binding.errors.full_messages.each do |message| %>
|
|
8
|
+
<li><%= message %></li>
|
|
9
|
+
<% end %>
|
|
10
|
+
</ul>
|
|
11
|
+
</div>
|
|
12
|
+
<% end %>
|
|
13
|
+
|
|
14
|
+
<div class="field">
|
|
15
|
+
<%= f.label :position %>
|
|
16
|
+
<%= f.number_field :position %>
|
|
17
|
+
</div>
|
|
18
|
+
|
|
19
|
+
<div class="field">
|
|
20
|
+
<%= f.label :description %>
|
|
21
|
+
<%= f.text_area :description %>
|
|
22
|
+
</div>
|
|
23
|
+
|
|
24
|
+
<div class="field">
|
|
25
|
+
<%= f.label :title %>
|
|
26
|
+
<%= f.text_field :title %>
|
|
27
|
+
</div>
|
|
28
|
+
|
|
29
|
+
<div class="actions">
|
|
30
|
+
<%= f.submit %>
|
|
31
|
+
</div>
|
|
32
|
+
<% end %>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<p id="notice"><%= notice %></p>
|
|
2
|
+
|
|
3
|
+
<h1>Bindings</h1>
|
|
4
|
+
|
|
5
|
+
<table>
|
|
6
|
+
<thead>
|
|
7
|
+
<tr>
|
|
8
|
+
<th>Position</th>
|
|
9
|
+
<th>Description</th>
|
|
10
|
+
<th>Title</th>
|
|
11
|
+
<th colspan="3"></th>
|
|
12
|
+
</tr>
|
|
13
|
+
</thead>
|
|
14
|
+
|
|
15
|
+
<tbody>
|
|
16
|
+
<% @bindings.each do |binding| %>
|
|
17
|
+
<tr>
|
|
18
|
+
<td><%= binding.position %></td>
|
|
19
|
+
<td><%= binding.description %></td>
|
|
20
|
+
<td><%= binding.title %></td>
|
|
21
|
+
<td><%= link_to 'Show', binding %></td>
|
|
22
|
+
<td><%= link_to 'Edit', edit_binding_path(binding) %></td>
|
|
23
|
+
<td><%= link_to 'Destroy', binding, method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
|
24
|
+
</tr>
|
|
25
|
+
<% end %>
|
|
26
|
+
</tbody>
|
|
27
|
+
</table>
|
|
28
|
+
|
|
29
|
+
<br>
|
|
30
|
+
|
|
31
|
+
<%= link_to 'New Binding', new_binding_path %>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<p id="notice"><%= notice %></p>
|
|
2
|
+
|
|
3
|
+
<p>
|
|
4
|
+
<strong>Position:</strong>
|
|
5
|
+
<%= @binding.position %>
|
|
6
|
+
</p>
|
|
7
|
+
|
|
8
|
+
<p>
|
|
9
|
+
<strong>Description:</strong>
|
|
10
|
+
<%= @binding.description %>
|
|
11
|
+
</p>
|
|
12
|
+
|
|
13
|
+
<p>
|
|
14
|
+
<strong>Title:</strong>
|
|
15
|
+
<%= @binding.title %>
|
|
16
|
+
</p>
|
|
17
|
+
|
|
18
|
+
<%= link_to 'Edit', edit_binding_path(@binding) %> |
|
|
19
|
+
<%= link_to 'Back', bindings_path %>
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
<div class="row">
|
|
2
|
+
<div class="form-body--container col-sm-12">
|
|
3
|
+
|
|
4
|
+
<%= simple_form_for category, url: get_form_category_url, defaults: { label: false } do |f| %>
|
|
5
|
+
<% if category.errors.any? %>
|
|
6
|
+
<div id="error_explanation">
|
|
7
|
+
<h2><%= pluralize( category.errors.count, "error") %> prohibited this category from being saved:</h2>
|
|
8
|
+
|
|
9
|
+
<ul>
|
|
10
|
+
<% category.errors.full_messages.each do |message| %>
|
|
11
|
+
<li><%= message %></li>
|
|
12
|
+
<% end %>
|
|
13
|
+
</ul>
|
|
14
|
+
</div>
|
|
15
|
+
<% end %>
|
|
16
|
+
|
|
17
|
+
<div class="row">
|
|
18
|
+
<div class="col-sm-8">
|
|
19
|
+
|
|
20
|
+
<div class="form-section--wide-container row">
|
|
21
|
+
<div class="col-sm-12">
|
|
22
|
+
|
|
23
|
+
<h4><%= "#{ t :details }".capitalize %></h4>
|
|
24
|
+
|
|
25
|
+
<h5><%= t(:name).capitalize %></h5>
|
|
26
|
+
<%= f.input :name %>
|
|
27
|
+
|
|
28
|
+
<% if category.slug.nil? %>
|
|
29
|
+
<%= f.input :slug, as: :hidden %>
|
|
30
|
+
<% else %>
|
|
31
|
+
<h5><%= "#{ t :slug }".capitalize %></h5>
|
|
32
|
+
<%= f.input :slug, disabled: true, hint: "#{ t :slug_disable_hint }" %>
|
|
33
|
+
<% end %>
|
|
34
|
+
|
|
35
|
+
<h5><%= t(:description).capitalize %></h5>
|
|
36
|
+
<%= f.input :description %>
|
|
37
|
+
|
|
38
|
+
<h5><%= t(:position).capitalize %></h5>
|
|
39
|
+
<%= f.input :position %>
|
|
40
|
+
|
|
41
|
+
</div>
|
|
42
|
+
</div>
|
|
43
|
+
|
|
44
|
+
</div>
|
|
45
|
+
<div class="col-sm-4">
|
|
46
|
+
<div class="form-section--narrow-container row">
|
|
47
|
+
<div class="col-sm-12">
|
|
48
|
+
<div class="form-actions">
|
|
49
|
+
<h4><%= t(:setting).capitalize.pluralize %></h4>
|
|
50
|
+
<%= f.button :submit, 'Save changes', class: 'btn btn-primary' %>
|
|
51
|
+
</div>
|
|
52
|
+
</div>
|
|
53
|
+
</div>
|
|
54
|
+
</div>
|
|
55
|
+
<% end %>
|
|
56
|
+
|
|
57
|
+
</div>
|
|
58
|
+
</div>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<% content_for :header do %>
|
|
2
|
+
<h3><%= "#{ t(:edit).capitalize } #{ @structure.name.humanize } #{ t(:category).capitalize }" %></h3>
|
|
3
|
+
<a href="<%= structure_categories_path %>" class="main-header--back"><span class="glyphicon glyphicon-list"></span> <%= t(:back_to_index).capitalize %></a>
|
|
4
|
+
<% end %>
|
|
5
|
+
|
|
6
|
+
<% content_for :content do %>
|
|
7
|
+
<%= render 'form', category: @category, structure: @structure %>
|
|
8
|
+
<% end %>
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
<% content_for :header do %>
|
|
2
|
+
<div class="main-header--buttons">
|
|
3
|
+
<%= link_to "#{ t(:new).capitalize } #{ t(:category).capitalize }", new_structure_category_path, class: 'main-header--link btn btn-primary' %>
|
|
4
|
+
</div>
|
|
5
|
+
<h3><%= @structure.name.capitalize %> <%= t(:category).capitalize.pluralize %></h3>
|
|
6
|
+
<% end %>
|
|
7
|
+
|
|
8
|
+
<% content_for :content do %>
|
|
9
|
+
<div class="main-table--row row">
|
|
10
|
+
<div class="col-sm-12">
|
|
11
|
+
|
|
12
|
+
<table class="table table-striped">
|
|
13
|
+
<thead>
|
|
14
|
+
<tr>
|
|
15
|
+
<th colspan="3"><%= t(:category).capitalize.pluralize %></th>
|
|
16
|
+
<th></th>
|
|
17
|
+
</tr>
|
|
18
|
+
</thead>
|
|
19
|
+
|
|
20
|
+
<tbody>
|
|
21
|
+
<% @categories.order( :position, :name ).each do |category| %>
|
|
22
|
+
<tr id="category_<%= category.id %>">
|
|
23
|
+
<td colspan="3"><%= category.name %></td>
|
|
24
|
+
<td><span class="glyphicon glyphicon-pencil" aria-hidden="true"></span> <%= link_to 'Edit', edit_structure_category_path( @structure.slug, category) %> <span class="glyphicon glyphicon-trash" aria-hidden="true"></span> <%= link_to 'Destroy', structure_category_path( @structure.slug, category ), method: :delete, data: { confirm: 'Are you sure?' }, class: 'text-danger' %></td>
|
|
25
|
+
</tr>
|
|
26
|
+
<% end %>
|
|
27
|
+
<tbody>
|
|
28
|
+
</table>
|
|
29
|
+
|
|
30
|
+
<%= link_to "New #{ t(:category).capitalize }", new_structure_category_path, class: 'main-header--link btn btn-default' %>
|
|
31
|
+
|
|
32
|
+
</div>
|
|
33
|
+
</div>
|
|
34
|
+
<% end %>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<% content_for :header do %>
|
|
2
|
+
<h3><%= "#{ t(:new).capitalize } #{ @structure.name.humanize } #{ t(:category).capitalize }" %></h3>
|
|
3
|
+
<a href="<%= structure_categories_path %>" class="main-header--back"><span class="glyphicon glyphicon-list"></span> <%= t(:back_to_index).capitalize %></a>
|
|
4
|
+
<% end %>
|
|
5
|
+
|
|
6
|
+
<% content_for :content do %>
|
|
7
|
+
<%= render 'form', category: @category, structure: @structure %>
|
|
8
|
+
<% end %>
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
<div class="row">
|
|
2
|
+
<div class="form-body--container col-sm-12">
|
|
3
|
+
|
|
4
|
+
<%= simple_form_for @component, url: get_form_component_url, defaults: { label: false }, html: { class: 'form-body' } do |f| %>
|
|
5
|
+
<%= f.error_notification %>
|
|
6
|
+
|
|
7
|
+
<%# - - - - - - - - - - - - %>
|
|
8
|
+
<%# SET POSITION %>
|
|
9
|
+
<%# - - - - - - - - - - - - %>
|
|
10
|
+
<% unless @component.new_record? %>
|
|
11
|
+
<%= f.input :position, as: :hidden %>
|
|
12
|
+
<% end %>
|
|
13
|
+
|
|
14
|
+
<div class="row">
|
|
15
|
+
<div class="col-sm-8">
|
|
16
|
+
|
|
17
|
+
<%# - - - - - - - - - - - - %>
|
|
18
|
+
<%# NOTICE / ERRORS %>
|
|
19
|
+
<%# - - - - - - - - - - - - %>
|
|
20
|
+
<div class="form-section--wide-container row">
|
|
21
|
+
<div class="col-sm-12">
|
|
22
|
+
|
|
23
|
+
<h4><%= "#{ t :details }".capitalize %></h4>
|
|
24
|
+
|
|
25
|
+
<h5><%= "#{ t :title }".capitalize %></h5>
|
|
26
|
+
<%= f.input :name %>
|
|
27
|
+
|
|
28
|
+
<% if @component.slug.nil? %>
|
|
29
|
+
<%= f.input :slug, as: :hidden %>
|
|
30
|
+
<% else %>
|
|
31
|
+
<h5><%= "#{ t :slug }".capitalize %></h5>
|
|
32
|
+
<%= f.input :slug, disabled: true, hint: "#{ t :slug_disable_hint }" %>
|
|
33
|
+
<% end %>
|
|
34
|
+
|
|
35
|
+
<%= f.input :structure_id, as: :hidden, input_html: { value: @structure.id } %>
|
|
36
|
+
|
|
37
|
+
</div>
|
|
38
|
+
</div>
|
|
39
|
+
|
|
40
|
+
<%# - - - - - - - - - - - - %>
|
|
41
|
+
<%# FIELD GROUP LOOP %>
|
|
42
|
+
<%# - - - - - - - - - - - - %>
|
|
43
|
+
<% @structure.field_groups.order( :position ).each_with_index do |field_group, index| %>
|
|
44
|
+
<div class="form-section--wide-container row">
|
|
45
|
+
<div class="col-sm-12">
|
|
46
|
+
|
|
47
|
+
<h4><%= field_group.name.capitalize %></h4>
|
|
48
|
+
|
|
49
|
+
<% if @component.new_record? %>
|
|
50
|
+
|
|
51
|
+
<h5><%= t( :hint_create_parent_before_child, arg1: "#{ t :component }", arg2: "#{ t :detail }" ).capitalize %></h5>
|
|
52
|
+
|
|
53
|
+
<% else %>
|
|
54
|
+
|
|
55
|
+
<% field_group.field_settings.order( :position ).each do |field_setting| %>
|
|
56
|
+
<% next unless field_setting.is_root? %>
|
|
57
|
+
<%= render "form_section", f: f, field_setting: field_setting %>
|
|
58
|
+
<% end %>
|
|
59
|
+
|
|
60
|
+
<% end %>
|
|
61
|
+
|
|
62
|
+
</div>
|
|
63
|
+
</div>
|
|
64
|
+
<% end %>
|
|
65
|
+
|
|
66
|
+
</div>
|
|
67
|
+
<div class="col-sm-4">
|
|
68
|
+
|
|
69
|
+
<%# - - - - - - - - - - - - %>
|
|
70
|
+
<%# SIDEBAR %>
|
|
71
|
+
<%# - - - - - - - - - - - - %>
|
|
72
|
+
<div class="form-section--narrow-container row">
|
|
73
|
+
<div class="col-sm-12">
|
|
74
|
+
|
|
75
|
+
<%= render "form_sidebar", f: f %>
|
|
76
|
+
|
|
77
|
+
</div>
|
|
78
|
+
</div>
|
|
79
|
+
|
|
80
|
+
</div>
|
|
81
|
+
</div>
|
|
82
|
+
|
|
83
|
+
<% end %>
|
|
84
|
+
|
|
85
|
+
</div>
|
|
86
|
+
</div>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<%# HEADING %>
|
|
2
|
+
<h5><%= field_setting.name.capitalize %></h5>
|
|
3
|
+
|
|
4
|
+
<%= ff.input :image, input_html: { class: 'form-item--asset--uploader'} %>
|
|
5
|
+
|
|
6
|
+
<% if ff.object.image.present? %>
|
|
7
|
+
<%= image_tag ff.object.image.thumb.url, class: 'form-item--asset--image' %>
|
|
8
|
+
<% end %>
|
|
9
|
+
|
|
10
|
+
<% unless field_setting.description.blank? %>
|
|
11
|
+
<small class="text-muted"><%= field_setting.description %></small>
|
|
12
|
+
<% end %>
|
|
13
|
+
|
|
14
|
+
<%= ff.input :image_cache, as: :hidden %>
|
|
15
|
+
<%= ff.input :field_setting_id, as: :hidden, input_html: { value: field_setting.id } %>
|
|
16
|
+
<%= ff.input :id, as: :hidden, input_html: { value: ff.object.id } %>
|
|
17
|
+
<%= ff.input :fieldable_id, as: :hidden %>
|
|
18
|
+
<%= ff.input :fieldable_type, as: :hidden %>
|
|
19
|
+
|
|
20
|
+
<div class="form-item--asset--clearfix"></div>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<%# HEADING %>
|
|
2
|
+
|
|
3
|
+
<h5><%= field_setting.name.capitalize %></h5>
|
|
4
|
+
|
|
5
|
+
<% unless field_setting.description.blank? %>
|
|
6
|
+
<small class="text-muted"><%= field_setting.description %></small>
|
|
7
|
+
<% end %>
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
<%# INPUT %>
|
|
11
|
+
|
|
12
|
+
<%= ff.input :date, start_year: Date.today.year - 200, end_year: Date.today.year + 200 %>
|
|
13
|
+
<%= ff.input :field_setting_id, as: :hidden, input_html: { value: field_setting.id } %>
|
|
14
|
+
<%= ff.input :id, as: :hidden, input_html: { value: ff.object.id } %>
|
|
15
|
+
<%= ff.input :fieldable_id, as: :hidden %>
|
|
16
|
+
<%= ff.input :fieldable_type, as: :hidden %>
|
|
File without changes
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<%# - - - - - - - - - - - - - - %>
|
|
2
|
+
<%# REPEATER NEW FIELDS %>
|
|
3
|
+
<%# - - - - - - - - - - - - - - %>
|
|
4
|
+
<%= simple_form_for @component, url: structure_component_path( structure_id: @component.structure.id, id: @component.id ), defaults: { label: false } do |f| %>
|
|
5
|
+
<!-- SPLIT -->
|
|
6
|
+
<% repeater = @component.repeaters.create( field_setting: @repeater_setting ) %>
|
|
7
|
+
|
|
8
|
+
<li id="repeater_<%= repeater.id %>">
|
|
9
|
+
|
|
10
|
+
<%# - - - - - - - - - - - - %>
|
|
11
|
+
<%# REMOVE BUTTON %>
|
|
12
|
+
<%# - - - - - - - - - - - - %>
|
|
13
|
+
<a class="form-item--delete-repeater-item" href="<%= repeater_path( id: repeater.id ) %>" data-id="<%= repeater.id %>""><span class="glyphicon glyphicon-trash" aria-hidden="true"></span></a>
|
|
14
|
+
|
|
15
|
+
<%# - - - - - - - - - - - - - - %>
|
|
16
|
+
<%# FIRST REPEATER %>
|
|
17
|
+
<%# - - - - - - - - - - - - - - %>
|
|
18
|
+
<div class="form-item--repeater-fields">
|
|
19
|
+
<%= f.simple_fields_for "repeaters_attributes[]", repeater do |ff| %>
|
|
20
|
+
<%= ff.input :fieldable_id, as: :hidden %>
|
|
21
|
+
<%= ff.input :fieldable_type, as: :hidden %>
|
|
22
|
+
<%= ff.input :field_setting_id, as: :hidden, input_html: { value: @repeater_setting.id } %>
|
|
23
|
+
<%= ff.input :id, as: :hidden, input_html: { value: ff.object.id } %>
|
|
24
|
+
<% @repeater_setting.children.order( :position ).each do |repeater_setting_child| %>
|
|
25
|
+
<%= render "form_section_repeater", f: ff, repeater_setting_child: repeater_setting_child, repeater: repeater %>
|
|
26
|
+
<% end %>
|
|
27
|
+
<% end %>
|
|
28
|
+
</div>
|
|
29
|
+
|
|
30
|
+
</li>
|
|
31
|
+
|
|
32
|
+
<!-- SPLIT -->
|
|
33
|
+
<% end %>
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
<div class="form-item--label-on-left form-item--repeater-section">
|
|
2
|
+
<h5 class="form-item--repeater-title">
|
|
3
|
+
<a class="sortable--toggle" href="#" data-repeater-id="form-item--repeater-setting-<%= repeater_setting.id %>">
|
|
4
|
+
<span class="sortable--toggle-text">Done</span>
|
|
5
|
+
<span class="sortable--toggle-text">Sort items</span>
|
|
6
|
+
<span class="glyphicon glyphicon-sort"></span>
|
|
7
|
+
</a>
|
|
8
|
+
<%= repeater_setting.name %>
|
|
9
|
+
</h5>
|
|
10
|
+
|
|
11
|
+
<ul id="form-item--repeater-setting-<%= repeater_setting.id %>" class="sortable sortable--disabled" data-update-url="<%= structure_component_sort_repeaters_path( structure_id: @structure.slug, component_id: @component ) %>">
|
|
12
|
+
|
|
13
|
+
<% if repeaters.size == 0 %>
|
|
14
|
+
|
|
15
|
+
<% repeater = @component.find_or_create_a_field_by( repeater_setting.id, 'repeater' ) %>
|
|
16
|
+
|
|
17
|
+
<li id="repeater_<%= repeater.id %>">
|
|
18
|
+
|
|
19
|
+
<%# - - - - - - - - - - - - %>
|
|
20
|
+
<%# REMOVE BUTTON %>
|
|
21
|
+
<%# - - - - - - - - - - - - %>
|
|
22
|
+
<a href="<%= repeater_path( id: repeater.id ) %>" data-method="delete" data-confirm="This operation will delete this group of fields. Are you ok with that?"><span class="glyphicon glyphicon-trash" aria-hidden="true"></span></a>
|
|
23
|
+
|
|
24
|
+
<%# - - - - - - - - - - - - - - %>
|
|
25
|
+
<%# FIRST REPEATER %>
|
|
26
|
+
<%# - - - - - - - - - - - - - - %>
|
|
27
|
+
<div class="form-item--repeater-fields">
|
|
28
|
+
<%= f.simple_fields_for "repeaters_attributes[]", repeater do |ff| %>
|
|
29
|
+
<%= ff.input :fieldable_id, as: :hidden %>
|
|
30
|
+
<%= ff.input :fieldable_type, as: :hidden %>
|
|
31
|
+
<%= ff.input :field_setting_id, as: :hidden, input_html: { value: repeater_setting.id } %>
|
|
32
|
+
<%= ff.input :id, as: :hidden, input_html: { value: ff.object.id } %>
|
|
33
|
+
<% repeater_setting.children.order( :position ).each do |repeater_setting_child| %>
|
|
34
|
+
<%= render "form_section_repeater", f: ff, repeater_setting_child: repeater_setting_child, repeater: repeater %>
|
|
35
|
+
<% end %>
|
|
36
|
+
<% end %>
|
|
37
|
+
</div>
|
|
38
|
+
</li>
|
|
39
|
+
|
|
40
|
+
<% else %>
|
|
41
|
+
|
|
42
|
+
<% repeaters.each do |repeater| %>
|
|
43
|
+
<li id="repeater_<%= repeater.id %>">
|
|
44
|
+
|
|
45
|
+
<%# - - - - - - - - - - - - %>
|
|
46
|
+
<%# REMOVE BUTTON %>
|
|
47
|
+
<%# - - - - - - - - - - - - %>
|
|
48
|
+
<a class="form-item--delete-repeater-item" href="<%= repeater_path( id: repeater.id ) %>" data-id="<%= repeater.id %>""><span class="glyphicon glyphicon-trash" aria-hidden="true"></span></a>
|
|
49
|
+
|
|
50
|
+
<%# - - - - - - - - - - - - - - %>
|
|
51
|
+
<%# EACH REPEATER %>
|
|
52
|
+
<%# - - - - - - - - - - - - - - %>
|
|
53
|
+
<div class="form-item--repeater-fields">
|
|
54
|
+
<%= f.simple_fields_for "repeaters_attributes[]", repeater do |ff| %>
|
|
55
|
+
<%= ff.input :field_setting_id, as: :hidden, input_html: { value: repeater_setting.id } %>
|
|
56
|
+
<%= ff.input :id, as: :hidden, input_html: { value: ff.object.id } %>
|
|
57
|
+
<%= ff.input :fieldable_id, as: :hidden %>
|
|
58
|
+
<%= ff.input :fieldable_type, as: :hidden %>
|
|
59
|
+
<% repeater_setting.children.order( :position ).each do |repeater_setting_child| %>
|
|
60
|
+
<%= render "form_section_repeater", f: ff, repeater_setting_child: repeater_setting_child, repeater: repeater %>
|
|
61
|
+
<% end %>
|
|
62
|
+
<% end %>
|
|
63
|
+
</div>
|
|
64
|
+
|
|
65
|
+
</li>
|
|
66
|
+
<% end %>
|
|
67
|
+
|
|
68
|
+
<% end %>
|
|
69
|
+
</ul>
|
|
70
|
+
|
|
71
|
+
</div>
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
<%# - - - - - - - - - - - - - - %>
|
|
75
|
+
<%# ADD NEW REPEATER FIELDS %>
|
|
76
|
+
<%# - - - - - - - - - - - - - - %>
|
|
77
|
+
<a class="form-item--repeater-section--add-new main-header--link btn btn-default" href="#" data-url="<%= structure_component_new_repeater_path( structure_id: @structure.id, component_id: @component.id ) %>" data-id="<%= repeater_setting.id %>">
|
|
78
|
+
<%= t(:new_item_in_repeater, arg1: repeater_setting.name.capitalize ) %>
|
|
79
|
+
</a>
|
|
80
|
+
|
|
81
|
+
<hr>
|