binda 0.0.7 → 0.1.0
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 +850 -18
- data/Rakefile +1 -13
- data/app/assets/javascripts/binda/application.js +23 -0
- data/app/assets/javascripts/binda/components/bootstrap.js +9 -0
- data/app/assets/javascripts/binda/components/field_group_editor.js +18 -0
- data/app/assets/javascripts/binda/components/fileupload.js +182 -0
- data/app/assets/javascripts/binda/components/form_item.js +91 -23
- data/app/assets/javascripts/binda/components/form_item_choice.js +15 -8
- data/app/assets/javascripts/binda/components/form_item_editor.js +6 -6
- data/app/assets/javascripts/binda/components/form_item_image.js +23 -0
- data/app/assets/javascripts/binda/components/form_item_repeater.js +70 -23
- data/app/assets/javascripts/binda/components/login-shader.js +193 -0
- data/app/assets/javascripts/binda/components/login_form.js +116 -0
- data/app/assets/javascripts/binda/components/radio-toggle.js +18 -0
- data/app/assets/javascripts/binda/components/select2.js +22 -0
- data/app/assets/javascripts/binda/components/sortable.js +53 -8
- data/app/assets/javascripts/binda/dist/binda.bundle.js +914 -107
- data/app/assets/javascripts/binda/index.js +26 -3
- data/app/assets/stylesheets/binda/application.scss +6 -0
- data/app/assets/stylesheets/binda/components/assets_manager.scss +46 -36
- data/app/assets/stylesheets/binda/components/b-btn.scss +114 -0
- data/app/assets/stylesheets/binda/components/button.scss +4 -1
- data/app/assets/stylesheets/binda/components/fileupload.scss +134 -0
- data/app/assets/stylesheets/binda/components/form_item.scss +233 -168
- data/app/assets/stylesheets/binda/components/form_item_image.scss +0 -0
- data/app/assets/stylesheets/binda/components/form_item_video.scss +25 -0
- data/app/assets/stylesheets/binda/components/main_container.scss +3 -0
- data/app/assets/stylesheets/binda/components/main_content.scss +1 -2
- data/app/assets/stylesheets/binda/components/main_header.scss +21 -20
- data/app/assets/stylesheets/binda/components/main_sidebar.scss +121 -0
- data/app/assets/stylesheets/binda/components/main_table.scss +84 -28
- data/app/assets/stylesheets/binda/components/popup_warning.scss +71 -0
- data/app/assets/stylesheets/binda/components/select2.scss +126 -0
- data/app/assets/stylesheets/binda/components/sortable.scss +83 -56
- data/app/assets/stylesheets/binda/components/standard-form.scss +228 -0
- data/app/assets/stylesheets/binda/components/texts.scss +6 -0
- data/app/assets/stylesheets/binda/controllers/components_index.scss +3 -0
- data/app/assets/stylesheets/binda/controllers/users_sessions_new.scss +309 -0
- data/app/assets/stylesheets/binda/index.scss +16 -8
- data/app/assets/stylesheets/binda/settings/bootstrap_overrides.scss +0 -0
- data/app/assets/stylesheets/binda/settings/buttons.scss +36 -0
- data/app/assets/stylesheets/binda/settings/common.scss +36 -79
- data/app/assets/stylesheets/binda/settings/fonts.scss +88 -31
- data/app/assets/stylesheets/binda/settings/tiny_mce_overrides.scss +82 -0
- data/app/assets/stylesheets/binda/settings/variables.scss +36 -31
- data/app/controllers/binda/application_controller.rb +0 -2
- data/app/controllers/binda/assets_controller.rb +1 -1
- data/app/controllers/binda/boards_controller.rb +15 -4
- data/app/controllers/binda/components_controller.rb +30 -15
- data/app/controllers/binda/field_groups_controller.rb +19 -4
- data/app/controllers/binda/images_controller.rb +68 -0
- data/app/controllers/binda/repeaters_controller.rb +3 -12
- data/app/controllers/binda/structures_controller.rb +8 -1
- data/app/controllers/binda/videos_controller.rb +68 -0
- data/app/controllers/concerns/binda/fieldable_helpers.rb +113 -28
- data/app/controllers/concerns/binda/maintenance_helpers.rb +34 -0
- data/app/helpers/binda/components_helper.rb +26 -2
- data/app/helpers/binda/field_groups_helper.rb +16 -0
- data/app/helpers/binda/structures_helper.rb +6 -0
- data/app/models/binda/asset.rb +0 -4
- data/app/models/binda/b.rb +5 -0
- data/app/models/binda/board.rb +1 -18
- data/app/models/binda/choice.rb +48 -12
- data/app/models/binda/component.rb +20 -0
- data/app/models/binda/field_group.rb +2 -2
- data/app/models/binda/field_setting.rb +61 -28
- data/app/models/binda/gallery.rb +0 -2
- data/app/models/binda/image.rb +7 -0
- data/app/models/binda/relation.rb +79 -0
- data/app/models/binda/relation_link.rb +11 -0
- data/app/models/binda/repeater.rb +1 -1
- data/app/models/binda/selection.rb +0 -9
- data/app/models/binda/structure.rb +41 -39
- data/app/models/binda/video.rb +7 -0
- data/app/models/concerns/binda/default_helpers.rb +186 -0
- data/app/models/concerns/binda/fieldable_associations.rb +276 -30
- data/app/uploaders/binda/{asset → image}/image_uploader.rb +27 -9
- data/app/uploaders/binda/video/video_uploader.rb +51 -0
- data/app/views/binda/boards/edit.html.erb +6 -1
- data/app/views/binda/categories/_form.html.erb +41 -40
- data/app/views/binda/categories/edit.html.erb +1 -1
- data/app/views/binda/categories/index.html.erb +16 -13
- data/app/views/binda/components/edit.html.erb +6 -3
- data/app/views/binda/components/index.html.erb +69 -28
- data/app/views/binda/components/new.html.erb +1 -1
- data/app/views/binda/components/sort_index.html.erb +46 -0
- data/app/views/binda/field_groups/_form_body.html.erb +65 -44
- data/app/views/binda/field_groups/_form_item.html.erb +66 -23
- data/app/views/binda/field_groups/_form_item_choice.erb +34 -15
- data/app/views/binda/field_groups/_form_section.html.erb +6 -10
- data/app/views/binda/field_groups/_form_section_repeater.html.erb +3 -3
- data/app/views/binda/field_groups/edit.html.erb +1 -1
- data/app/views/binda/field_settings/_form_body.html.erb +5 -5
- data/app/views/binda/field_settings/edit.html.erb +1 -1
- data/app/views/binda/fieldable/_form_body.html.erb +93 -79
- data/app/views/binda/fieldable/_form_item_date.html.erb +14 -14
- data/app/views/binda/fieldable/_form_item_image.html.erb +35 -0
- data/app/views/binda/fieldable/_form_item_new_repeater.html.erb +12 -5
- data/app/views/binda/fieldable/_form_item_relation.html.erb +44 -0
- data/app/views/binda/fieldable/_form_item_repeater.html.erb +80 -58
- data/app/views/binda/fieldable/_form_item_selections.html.erb +109 -87
- data/app/views/binda/fieldable/_form_item_string.html.erb +19 -17
- data/app/views/binda/fieldable/_form_item_text.html.erb +19 -16
- data/app/views/binda/fieldable/_form_item_video.html.erb +32 -0
- data/app/views/binda/fieldable/_form_section.html.erb +27 -5
- data/app/views/binda/fieldable/_form_section_repeater.html.erb +30 -10
- data/app/views/binda/fieldable/_form_sidebar.html.erb +44 -20
- data/app/views/binda/manage/users/_form_body.html.erb +42 -37
- data/app/views/binda/manage/users/edit.html.erb +1 -1
- data/app/views/binda/manage/users/index.html.erb +21 -21
- data/app/views/binda/structures/_form_body.html.erb +54 -60
- data/app/views/binda/structures/_form_section.html.erb +32 -18
- data/app/views/binda/structures/_form_sidebar.html.erb +35 -0
- data/app/views/binda/structures/edit.html.erb +2 -2
- data/app/views/binda/structures/index.html.erb +21 -16
- data/app/views/binda/structures/sort_index.html.erb +36 -0
- data/app/views/{users → binda/users}/confirmations/new.html.erb +1 -1
- data/app/views/{users → binda/users}/mailer/confirmation_instructions.html.erb +0 -0
- data/app/views/{users → binda/users}/mailer/password_change.html.erb +0 -0
- data/app/views/{users → binda/users}/mailer/reset_password_instructions.html.erb +0 -0
- data/app/views/{users → binda/users}/mailer/unlock_instructions.html.erb +0 -0
- data/app/views/{users → binda/users}/passwords/edit.html.erb +1 -1
- data/app/views/{users → binda/users}/passwords/new.html.erb +1 -1
- data/app/views/{users → binda/users}/registrations/edit.html.erb +0 -0
- data/app/views/{users → binda/users}/registrations/new.html.erb +1 -1
- data/app/views/binda/users/sessions/_background.html.erb +139 -0
- data/app/views/binda/users/sessions/new.html.erb +62 -0
- data/app/views/{users → binda/users}/shared/_links.html.erb +3 -3
- data/app/views/{users → binda/users}/unlocks/new.html.erb +1 -1
- data/app/views/kaminari/_first_page.html.erb +11 -0
- data/app/views/kaminari/_gap.html.erb +8 -0
- data/app/views/kaminari/_last_page.html.erb +11 -0
- data/app/views/kaminari/_next_page.html.erb +11 -0
- data/app/views/kaminari/_page.html.erb +12 -0
- data/app/views/kaminari/_paginator.html.erb +19 -0
- data/app/views/kaminari/_prev_page.html.erb +11 -0
- data/app/views/layouts/binda/_flash.html.erb +1 -1
- data/app/views/layouts/binda/_header.html.erb +2 -6
- data/app/views/layouts/binda/_sidebar.html.erb +11 -4
- data/app/views/layouts/binda/application.html.erb +15 -7
- data/config/autoprefixer.yml +5 -0
- data/config/database.yml.travis +3 -0
- data/config/initializers/assets.rb +1 -0
- data/config/initializers/autoprefixer.yml +5 -0
- data/config/initializers/carrierwave.rb +32 -0
- data/config/initializers/devise.rb +14 -10
- data/config/initializers/devise_patch.rb +8 -8
- data/config/initializers/simple_form.rb +4 -0
- data/config/initializers/simple_form__fileupload.rb +121 -0
- data/config/initializers/{simple_form_bootstrap.rb → simple_form_custom.rb} +79 -50
- data/config/locales/en.yml +61 -3
- data/config/locales/it.yml +51 -0
- data/config/locales/simple_form.en.yml +3 -3
- data/config/routes.rb +41 -24
- data/db/migrate/1_create_binda_tables.rb +18 -7
- data/db/migrate/20171214140451_add_preview_mode.rb +5 -0
- data/lib/binda.rb +1 -1
- data/lib/binda/engine.rb +19 -23
- data/lib/binda/version.rb +2 -2
- data/lib/generators/binda/install/install_generator.rb +59 -54
- data/lib/generators/binda/install/templates/config/initializers/carrierwave.rb +11 -2
- data/lib/generators/binda/maintenance/USAGE +8 -0
- data/lib/generators/binda/maintenance/maintenance_generator.rb +50 -0
- data/lib/generators/binda/maintenance/templates/app/assets/javascripts/maintenance.js +0 -0
- data/lib/generators/binda/maintenance/templates/app/assets/stylesheets/maintenance.scss +0 -0
- data/lib/generators/binda/maintenance/templates/app/views/layouts/maintenance.html.erb +16 -0
- data/lib/generators/binda/maintenance/templates/config/initializers/maintenance.rb +1 -0
- data/lib/generators/binda/setup/setup_generator.rb +41 -30
- data/lib/tasks/add_default_helpers_class_task.rake +11 -0
- data/lib/tasks/add_video_feature_task.rake +15 -0
- data/lib/tasks/remove_orphan_fields_task.rake +16 -0
- data/lib/tasks/set_repeater_position_task.rake +13 -0
- data/lib/tasks/upgrade_to_v007_task.rake +72 -0
- data/lib/tasks/user_tasks.rake +14 -0
- data/vendor/assets/fonts/font-awesome/fa-brands-400.eot +0 -0
- data/vendor/assets/fonts/font-awesome/fa-brands-400.svg +978 -0
- data/vendor/assets/fonts/font-awesome/fa-brands-400.ttf +0 -0
- data/vendor/assets/fonts/font-awesome/fa-brands-400.woff +0 -0
- data/vendor/assets/fonts/font-awesome/fa-brands-400.woff2 +0 -0
- data/vendor/assets/fonts/font-awesome/fa-regular-400.eot +0 -0
- data/vendor/assets/fonts/font-awesome/fa-regular-400.svg +363 -0
- data/vendor/assets/fonts/font-awesome/fa-regular-400.ttf +0 -0
- data/vendor/assets/fonts/font-awesome/fa-regular-400.woff +0 -0
- data/vendor/assets/fonts/font-awesome/fa-regular-400.woff2 +0 -0
- data/vendor/assets/fonts/font-awesome/fa-solid-900.eot +0 -0
- data/vendor/assets/fonts/font-awesome/fa-solid-900.svg +1410 -0
- data/vendor/assets/fonts/font-awesome/fa-solid-900.ttf +0 -0
- data/vendor/assets/fonts/font-awesome/fa-solid-900.woff +0 -0
- data/vendor/assets/fonts/font-awesome/fa-solid-900.woff2 +0 -0
- data/vendor/assets/javascripts/GSAP/CSSPlugin.min.js +13 -0
- data/vendor/assets/javascripts/GSAP/EasePack.min.js +12 -0
- data/vendor/assets/javascripts/GSAP/ScrollToPlugin.min.js +12 -0
- data/vendor/assets/javascripts/GSAP/TweenLite.min.js +12 -0
- data/vendor/assets/javascripts/select2/i18n/af.js +3 -0
- data/vendor/assets/javascripts/select2/i18n/ar.js +3 -0
- data/vendor/assets/javascripts/select2/i18n/az.js +3 -0
- data/vendor/assets/javascripts/select2/i18n/bg.js +3 -0
- data/vendor/assets/javascripts/select2/i18n/bs.js +3 -0
- data/vendor/assets/javascripts/select2/i18n/ca.js +3 -0
- data/vendor/assets/javascripts/select2/i18n/cs.js +3 -0
- data/vendor/assets/javascripts/select2/i18n/da.js +3 -0
- data/vendor/assets/javascripts/select2/i18n/de.js +3 -0
- data/vendor/assets/javascripts/select2/i18n/dsb.js +3 -0
- data/vendor/assets/javascripts/select2/i18n/el.js +3 -0
- data/vendor/assets/javascripts/select2/i18n/en.js +3 -0
- data/vendor/assets/javascripts/select2/i18n/es.js +3 -0
- data/vendor/assets/javascripts/select2/i18n/et.js +3 -0
- data/vendor/assets/javascripts/select2/i18n/eu.js +3 -0
- data/vendor/assets/javascripts/select2/i18n/fa.js +3 -0
- data/vendor/assets/javascripts/select2/i18n/fi.js +3 -0
- data/vendor/assets/javascripts/select2/i18n/fr.js +3 -0
- data/vendor/assets/javascripts/select2/i18n/gl.js +3 -0
- data/vendor/assets/javascripts/select2/i18n/he.js +3 -0
- data/vendor/assets/javascripts/select2/i18n/hi.js +3 -0
- data/vendor/assets/javascripts/select2/i18n/hr.js +3 -0
- data/vendor/assets/javascripts/select2/i18n/hsb.js +3 -0
- data/vendor/assets/javascripts/select2/i18n/hu.js +3 -0
- data/vendor/assets/javascripts/select2/i18n/hy.js +3 -0
- data/vendor/assets/javascripts/select2/i18n/id.js +3 -0
- data/vendor/assets/javascripts/select2/i18n/is.js +3 -0
- data/vendor/assets/javascripts/select2/i18n/it.js +3 -0
- data/vendor/assets/javascripts/select2/i18n/ja.js +3 -0
- data/vendor/assets/javascripts/select2/i18n/km.js +3 -0
- data/vendor/assets/javascripts/select2/i18n/ko.js +3 -0
- data/vendor/assets/javascripts/select2/i18n/lt.js +3 -0
- data/vendor/assets/javascripts/select2/i18n/lv.js +3 -0
- data/vendor/assets/javascripts/select2/i18n/mk.js +3 -0
- data/vendor/assets/javascripts/select2/i18n/ms.js +3 -0
- data/vendor/assets/javascripts/select2/i18n/nb.js +3 -0
- data/vendor/assets/javascripts/select2/i18n/nl.js +3 -0
- data/vendor/assets/javascripts/select2/i18n/pl.js +3 -0
- data/vendor/assets/javascripts/select2/i18n/ps.js +3 -0
- data/vendor/assets/javascripts/select2/i18n/pt-BR.js +3 -0
- data/vendor/assets/javascripts/select2/i18n/pt.js +3 -0
- data/vendor/assets/javascripts/select2/i18n/ro.js +3 -0
- data/vendor/assets/javascripts/select2/i18n/ru.js +3 -0
- data/vendor/assets/javascripts/select2/i18n/sk.js +3 -0
- data/vendor/assets/javascripts/select2/i18n/sl.js +3 -0
- data/vendor/assets/javascripts/select2/i18n/sr-Cyrl.js +3 -0
- data/vendor/assets/javascripts/select2/i18n/sr.js +3 -0
- data/vendor/assets/javascripts/select2/i18n/sv.js +3 -0
- data/vendor/assets/javascripts/select2/i18n/th.js +3 -0
- data/vendor/assets/javascripts/select2/i18n/tr.js +3 -0
- data/vendor/assets/javascripts/select2/i18n/uk.js +3 -0
- data/vendor/assets/javascripts/select2/i18n/vi.js +3 -0
- data/vendor/assets/javascripts/select2/i18n/zh-CN.js +3 -0
- data/vendor/assets/javascripts/select2/i18n/zh-TW.js +3 -0
- data/vendor/assets/javascripts/select2/select2.full.min.js +1 -0
- data/vendor/assets/javascripts/select2/select2.min.js +1 -0
- data/vendor/assets/javascripts/tether.min.js +1 -0
- data/vendor/assets/stylesheets/{bootstrap-select.css → bootstrap/bootstrap-select.css} +0 -0
- data/vendor/assets/stylesheets/font-awesome/_animated.scss +6 -20
- data/vendor/assets/stylesheets/font-awesome/_bordered-pulled.scss +6 -11
- data/vendor/assets/stylesheets/font-awesome/_core.scss +11 -7
- data/vendor/assets/stylesheets/font-awesome/_fixed-width.scss +1 -1
- data/vendor/assets/stylesheets/font-awesome/_icons.scss +785 -787
- data/vendor/assets/stylesheets/font-awesome/_larger.scss +16 -6
- data/vendor/assets/stylesheets/font-awesome/_list.scss +7 -8
- data/vendor/assets/stylesheets/font-awesome/_mixins.scss +17 -20
- data/vendor/assets/stylesheets/font-awesome/_rotated-flipped.scss +9 -6
- data/vendor/assets/stylesheets/font-awesome/_screen-reader.scss +2 -2
- data/vendor/assets/stylesheets/font-awesome/_stacked.scss +19 -8
- data/vendor/assets/stylesheets/font-awesome/_variables.scss +795 -795
- data/vendor/assets/stylesheets/font-awesome/fa-brands.scss +21 -0
- data/vendor/assets/stylesheets/font-awesome/fa-regular.scss +22 -0
- data/vendor/assets/stylesheets/font-awesome/fa-solid.scss +23 -0
- data/vendor/assets/stylesheets/font-awesome/fontawesome.scss +20 -0
- data/vendor/assets/stylesheets/select2/select2.min.css +1 -0
- metadata +278 -125
- data/app/assets/javascripts/binda/components/form_item_asset.js +0 -25
- data/app/assets/stylesheets/binda/application.css +0 -6
- data/app/assets/stylesheets/binda/components/form_body.scss +0 -2
- data/app/assets/stylesheets/binda/components/form_item_asset.scss +0 -20
- data/app/assets/stylesheets/binda/components/form_section.scss +0 -40
- data/app/assets/stylesheets/binda/components/sidebar.scss +0 -131
- data/app/assets/stylesheets/binda/layout/components_index.scss +0 -9
- data/app/assets/stylesheets/binda/layout/dashboard.scss +0 -7
- data/app/assets/stylesheets/binda/layout/users_sign_in.scss +0 -29
- data/app/controllers/binda/bindings_controller.rb +0 -62
- data/app/controllers/concerns/binda/default_helpers.rb +0 -226
- data/app/helpers/binda/bindings_helper.rb +0 -4
- data/app/models/binda/binda.rb +0 -7
- data/app/models/binda/binding.rb +0 -24
- data/app/views/binda/bindings/_form.html.erb +0 -32
- data/app/views/binda/bindings/edit.html.erb +0 -6
- data/app/views/binda/bindings/index.html.erb +0 -31
- data/app/views/binda/bindings/new.html.erb +0 -5
- data/app/views/binda/bindings/show.html.erb +0 -19
- data/app/views/binda/field_groups/index.html.erb +0 -34
- data/app/views/binda/fieldable/_form_item_asset.html.erb +0 -20
- data/app/views/users/sessions/new.html.erb +0 -27
- data/lib/tasks/binda.rake +0 -79
- data/vendor/assets/fonts/font-awesome/FontAwesome.otf +0 -0
- data/vendor/assets/fonts/font-awesome/fontawesome-webfont.eot +0 -0
- data/vendor/assets/fonts/font-awesome/fontawesome-webfont.svg +0 -2671
- data/vendor/assets/fonts/font-awesome/fontawesome-webfont.ttf +0 -0
- data/vendor/assets/fonts/font-awesome/fontawesome-webfont.woff +0 -0
- data/vendor/assets/fonts/font-awesome/fontawesome-webfont.woff2 +0 -0
- data/vendor/assets/stylesheets/font-awesome/_path.scss +0 -15
- data/vendor/assets/stylesheets/font-awesome/font-awesome.scss +0 -18
data/config/locales/en.yml
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
en:
|
2
|
+
accepted_structures: Accepted Structures
|
2
3
|
detail: detail
|
3
4
|
details: details
|
4
5
|
slug: slug
|
@@ -17,7 +18,7 @@ en:
|
|
17
18
|
board: board
|
18
19
|
back_to_index: back to list
|
19
20
|
back_to: back to
|
20
|
-
slug_disable_hint:
|
21
|
+
slug_disable_hint: Editing slug is not possible. If you want a specific slug create a new item and a slug will be extracted from the title.
|
21
22
|
field_type: field type
|
22
23
|
field_group_title: field group title
|
23
24
|
select_field_type: select a field type
|
@@ -25,7 +26,6 @@ en:
|
|
25
26
|
field_group: field group
|
26
27
|
field_setting: field setting
|
27
28
|
repeater: repeater
|
28
|
-
new_item_in_repeater: New %{arg1} item
|
29
29
|
structure: structure
|
30
30
|
hint_create_parent_before_child: you need to create the %{arg1} before being able to add any %{arg2}
|
31
31
|
dashboard_title: website settings
|
@@ -45,4 +45,62 @@ en:
|
|
45
45
|
allow_null: allow null?
|
46
46
|
instance: instance
|
47
47
|
structure_instance_type: 'This structure is for:'
|
48
|
-
|
48
|
+
|
49
|
+
binda:
|
50
|
+
title: title
|
51
|
+
view_website: View website
|
52
|
+
error_related_to_itself: Sorry, this record cannot relate to itself
|
53
|
+
confirm_delete: Do you really want to remove it?
|
54
|
+
upload_button: Upload
|
55
|
+
upload_loading_message: Uploading file...
|
56
|
+
choose_file_button: Choose a file
|
57
|
+
preview: Preview
|
58
|
+
no_preview: No file selected
|
59
|
+
filename: Name
|
60
|
+
filesize: Size
|
61
|
+
filedimension: Dimension
|
62
|
+
select_placeholder: Select a option
|
63
|
+
new_item_in_repeater: New %{arg1} item
|
64
|
+
null_is_not_allowed: You need to select at least one choice
|
65
|
+
delete: delete
|
66
|
+
edit: edit
|
67
|
+
sort: sort
|
68
|
+
structure: Structure
|
69
|
+
structures: Structures
|
70
|
+
field_group: Field group
|
71
|
+
field_groups: Field groups
|
72
|
+
field_setting: Field setting
|
73
|
+
field_settings: Field settings
|
74
|
+
repeater_field_settings: Fields settings of the %{arg1} repeater
|
75
|
+
component: Component
|
76
|
+
components: Component
|
77
|
+
new: new
|
78
|
+
new_structure: New %{arg1} structure
|
79
|
+
new_field_group: New %{arg1} field group
|
80
|
+
new_component: New %{arg1}
|
81
|
+
new_user: New User
|
82
|
+
new_category: New %{arg1} category
|
83
|
+
edit_structure: Edit %{arg1} structure
|
84
|
+
edit_field_group: Edit %{arg1} field group
|
85
|
+
edit_component: Edit %{arg1}
|
86
|
+
edit_user: Edit User
|
87
|
+
edit_category: Edit %{arg1} category
|
88
|
+
has_categories: Enable categories
|
89
|
+
has_preview: Enable preview
|
90
|
+
has_categories_hint: Enable a taxonomy specific to this structure
|
91
|
+
preview_path_warning: Make preview available. Once enabled, remember to create a route in you application for
|
92
|
+
relation_warning: This relation isn't set properly. Ensure the setup of this relation refers to at least one structure.
|
93
|
+
standard_form_error_heading: The form contains
|
94
|
+
standard_form_error: error
|
95
|
+
done: Done
|
96
|
+
sort_items: Sort Items
|
97
|
+
sort_items_loader: Updating %{arg1} position...
|
98
|
+
sort_index_hint: Drag & drop to sort your %{arg1}. Changes are automatically saved.
|
99
|
+
collapse: Collapse
|
100
|
+
expand: Expand
|
101
|
+
item: item
|
102
|
+
default_choice_id_validation: must be selected. Please make sure you select one default or allow null as choice (not possible on radio buttons).
|
103
|
+
login_email: Enter your email
|
104
|
+
login_password: Enter your password
|
105
|
+
login_welcome: Welcome to %{arg1} admin panel
|
106
|
+
login_credit: Built with Binda CMS - Version %{arg1}
|
@@ -0,0 +1,51 @@
|
|
1
|
+
it:
|
2
|
+
detail: detail
|
3
|
+
details: details
|
4
|
+
slug: slug
|
5
|
+
title: title
|
6
|
+
title_hint: Title should be singular.
|
7
|
+
name: name
|
8
|
+
description: description
|
9
|
+
position: position
|
10
|
+
publish: publish
|
11
|
+
publish_settings: publication setting
|
12
|
+
new: new
|
13
|
+
edit: edit
|
14
|
+
create: create
|
15
|
+
delete: delete
|
16
|
+
setting: setting
|
17
|
+
board: board
|
18
|
+
back_to_index: back to list
|
19
|
+
back_to: back to
|
20
|
+
slug_disable_hint: 'Editing slug is not possible. If you want a specific slug create a new item and a slug will be extracted from the title.'
|
21
|
+
field_type: field type
|
22
|
+
field_group_title: field group title
|
23
|
+
select_field_type: select a field type
|
24
|
+
go_to: go to
|
25
|
+
field_group: field group
|
26
|
+
field_setting: field setting
|
27
|
+
repeater: repeater
|
28
|
+
new_item_in_repeater: New %{arg1} item
|
29
|
+
structure: structure
|
30
|
+
hint_create_parent_before_child: you need to create the %{arg1} before being able to add any %{arg2}
|
31
|
+
dashboard_title: website settings
|
32
|
+
dashboard: dashboard
|
33
|
+
component: component
|
34
|
+
category: category
|
35
|
+
select_category: select one category
|
36
|
+
create_category: create a new category
|
37
|
+
structure_has_categories: Enable categories
|
38
|
+
asset: asset
|
39
|
+
choices: choices
|
40
|
+
choice_label: label
|
41
|
+
choice_value: value
|
42
|
+
add_choice: Add choice
|
43
|
+
default_choice: default choice
|
44
|
+
default_choice_description: if you have added/removed any choice you need to click save to update the list of choices
|
45
|
+
allow_null: allow null?
|
46
|
+
instance: instance
|
47
|
+
structure_instance_type: 'This structure is for:'
|
48
|
+
null_is_not_allowed: You need to select at least one choice
|
49
|
+
|
50
|
+
binda:
|
51
|
+
title: titolo
|
@@ -3,11 +3,11 @@ en:
|
|
3
3
|
"yes": 'Yes'
|
4
4
|
"no": 'No'
|
5
5
|
required:
|
6
|
-
text: 'required'
|
7
|
-
mark: '*'
|
6
|
+
# text: 'required'
|
7
|
+
# mark: '*'
|
8
8
|
# You can uncomment the line below if you need to overwrite the whole required html.
|
9
9
|
# When using html, text and mark won't be used.
|
10
|
-
|
10
|
+
html: '<span class="control-label-required" title="required" data-toggle="tooltip" data-placement="top">*</span>'
|
11
11
|
error_notification:
|
12
12
|
default_message: "Please review the problems below:"
|
13
13
|
# Examples
|
data/config/routes.rb
CHANGED
@@ -3,27 +3,29 @@ Binda::Engine.routes.draw do
|
|
3
3
|
# ROOT
|
4
4
|
# ----
|
5
5
|
# https://github.com/plataformatec/devise/wiki/How-To:-Require-authentication-for-all-components
|
6
|
-
#
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
6
|
+
# https://stackoverflow.com/a/24135199/1498118
|
7
|
+
authenticated :user, class_name: "Binda::User", module: 'binda/users' do
|
8
|
+
root to: "boards#dashboard"
|
9
|
+
end
|
10
|
+
unauthenticated :user do
|
11
|
+
devise_scope :user do
|
12
|
+
get "/", to: "users/sessions#new"
|
13
|
+
end
|
14
|
+
end
|
11
15
|
|
12
16
|
# DEVISE
|
13
17
|
# ------
|
14
|
-
#
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
}
|
26
|
-
# end
|
18
|
+
# https://github.com/plataformatec/devise/blob/88724e10adaf9ffd1d8dbfbaadda2b9d40de756a/lib/devise/rails/routes.rb#L143
|
19
|
+
devise_for :users, class_name: "Binda::User", module: 'binda/users',
|
20
|
+
path_names: {
|
21
|
+
sign_in: 'login',
|
22
|
+
sign_out: 'logout',
|
23
|
+
password: 'secret',
|
24
|
+
confirmation: 'verification',
|
25
|
+
unlock: 'unblock',
|
26
|
+
registration: 'register',
|
27
|
+
sign_up: 'signup'
|
28
|
+
}
|
27
29
|
|
28
30
|
namespace :manage do
|
29
31
|
resources :users
|
@@ -34,6 +36,7 @@ Binda::Engine.routes.draw do
|
|
34
36
|
get 'dashboard', to: 'boards#dashboard', as: :dashboard
|
35
37
|
|
36
38
|
post 'structures/sort'
|
39
|
+
get 'structures/sort_index'
|
37
40
|
resources :structures do
|
38
41
|
post 'field_groups/sort'
|
39
42
|
post 'field_groups/add_child'
|
@@ -45,21 +48,35 @@ Binda::Engine.routes.draw do
|
|
45
48
|
resources :boards do
|
46
49
|
post 'sort_repeaters'
|
47
50
|
post 'new_repeater'
|
51
|
+
member do
|
52
|
+
patch 'upload'
|
53
|
+
end
|
48
54
|
end
|
49
55
|
post 'components/sort'
|
56
|
+
get 'components/sort_index'
|
50
57
|
resources :components do
|
51
58
|
post 'sort_repeaters'
|
52
59
|
post 'new_repeater'
|
60
|
+
member do
|
61
|
+
patch 'upload'
|
62
|
+
end
|
53
63
|
end
|
54
64
|
resources :categories
|
55
65
|
end
|
56
66
|
|
57
67
|
resources :choices, only: [:destroy]
|
58
68
|
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
69
|
+
resources :videos do
|
70
|
+
member do
|
71
|
+
delete 'remove_video'
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
resources :images do
|
76
|
+
member do
|
77
|
+
delete 'remove_image'
|
78
|
+
end
|
79
|
+
end
|
80
|
+
resources :repeaters
|
81
|
+
|
65
82
|
end
|
@@ -57,6 +57,11 @@ class CreateBindaTables < ActiveRecord::Migration[5.0]
|
|
57
57
|
t.timestamps
|
58
58
|
end
|
59
59
|
|
60
|
+
create_table :binda_field_settings_structures do |t|
|
61
|
+
t.belongs_to :field_setting
|
62
|
+
t.belongs_to :structure
|
63
|
+
end
|
64
|
+
|
60
65
|
create_table :binda_repeaters do |t|
|
61
66
|
t.integer :position
|
62
67
|
t.belongs_to :field_setting
|
@@ -81,6 +86,8 @@ class CreateBindaTables < ActiveRecord::Migration[5.0]
|
|
81
86
|
end
|
82
87
|
|
83
88
|
create_table :binda_assets do |t|
|
89
|
+
t.string :type
|
90
|
+
t.string :video
|
84
91
|
t.string :image
|
85
92
|
t.belongs_to :field_setting
|
86
93
|
t.references :fieldable, polymorphic: true, index: true
|
@@ -114,13 +121,6 @@ class CreateBindaTables < ActiveRecord::Migration[5.0]
|
|
114
121
|
t.timestamps
|
115
122
|
end
|
116
123
|
|
117
|
-
create_table :binda_bindings do |t|
|
118
|
-
t.string :title
|
119
|
-
t.text :description
|
120
|
-
t.integer :position
|
121
|
-
t.timestamps
|
122
|
-
end
|
123
|
-
|
124
124
|
create_table :binda_categories do |t|
|
125
125
|
t.string :name, null: false
|
126
126
|
t.string :slug
|
@@ -136,6 +136,17 @@ class CreateBindaTables < ActiveRecord::Migration[5.0]
|
|
136
136
|
t.belongs_to :component, index: true
|
137
137
|
end
|
138
138
|
|
139
|
+
create_table :binda_relations do |t|
|
140
|
+
t.integer :field_setting_id
|
141
|
+
t.references :fieldable, polymorphic: true, index: true
|
142
|
+
end
|
143
|
+
|
144
|
+
create_table :binda_relation_links do |t|
|
145
|
+
t.references :owner, polymorphic: true, index: true
|
146
|
+
t.references :dependent, polymorphic: true, index: true
|
147
|
+
t.timestamps
|
148
|
+
end
|
149
|
+
|
139
150
|
create_table :friendly_id_slugs do |t|
|
140
151
|
t.string :slug, :null => false
|
141
152
|
t.integer :sluggable_id, :null => false
|
data/lib/binda.rb
CHANGED
data/lib/binda/engine.rb
CHANGED
@@ -2,8 +2,6 @@ require 'devise'
|
|
2
2
|
require 'jquery-rails'
|
3
3
|
require 'jquery-ui-rails'
|
4
4
|
require 'sass-rails'
|
5
|
-
require 'coffee-rails'
|
6
|
-
require 'colorize'
|
7
5
|
require 'friendly_id'
|
8
6
|
require 'aasm'
|
9
7
|
require 'simple_form'
|
@@ -12,29 +10,27 @@ require 'carrierwave'
|
|
12
10
|
require 'mini_magick'
|
13
11
|
require 'ancestry'
|
14
12
|
require 'kaminari'
|
15
|
-
|
16
|
-
# require 'rails-perftest'
|
17
|
-
# require 'ruby-prof'
|
18
|
-
# require 'test-unit'
|
13
|
+
require 'bourbon'
|
19
14
|
|
15
|
+
# **Binda** is a CMS with an intuitive out-of-the-box interface to manage and customize page components.
|
16
|
+
#
|
17
|
+
# For more information check [Binda's guidelines](/docs/file/README.md)
|
20
18
|
module Binda
|
21
|
-
|
22
|
-
|
19
|
+
class Engine < ::Rails::Engine
|
20
|
+
isolate_namespace Binda
|
23
21
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
22
|
+
# Add vendor files to pipeline
|
23
|
+
config.assets.paths << config.root.join("vendor", "assets" )
|
24
|
+
# config.assets.paths << config.root.join("vendor", "assets", "fonts")
|
25
|
+
config.assets.precompile << /\.(?:svg|eot|woff|ttf)\z/
|
28
26
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
# https://stackoverflow.com/a/17718926/1498118
|
33
|
-
config.generators do |g|
|
34
|
-
g.integration_tool :rspec
|
35
|
-
g.test_framework :rspec
|
36
|
-
end
|
37
|
-
|
38
|
-
end
|
39
|
-
end
|
27
|
+
# Setup tinymce configuration file
|
28
|
+
config.tinymce.config_path = self.root.join("config/tinymce.yml")
|
40
29
|
|
30
|
+
# https://stackoverflow.com/a/17718926/1498118
|
31
|
+
config.generators do |g|
|
32
|
+
g.integration_tool :rspec
|
33
|
+
g.test_framework :rspec
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
data/lib/binda/version.rb
CHANGED
@@ -1,3 +1,3 @@
|
|
1
1
|
module Binda
|
2
|
-
VERSION = '0.0.
|
3
|
-
end
|
2
|
+
VERSION = '0.1.0'.freeze
|
3
|
+
end
|
@@ -1,37 +1,32 @@
|
|
1
|
-
require 'colorize'
|
2
1
|
require 'securerandom'
|
3
2
|
|
4
3
|
module Binda
|
5
4
|
class InstallGenerator < Rails::Generators::Base
|
6
5
|
source_root File.expand_path('../templates', __FILE__)
|
7
|
-
|
8
|
-
def
|
9
|
-
|
10
|
-
|
11
|
-
puts "Binda has already been installed on this database.".colorize(:red)
|
12
|
-
puts "Please ensure Binda is completely removed from the database before trying to install it again.".colorize(:red)
|
6
|
+
|
7
|
+
def check_if_production
|
8
|
+
if Rails.env.production?
|
9
|
+
puts "Sorry Binda can only be installed in development mode"
|
13
10
|
exit
|
14
11
|
end
|
15
12
|
end
|
16
13
|
|
17
|
-
def
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
def add_helpers
|
24
|
-
ac_path = Rails.root.join('app', 'controllers', 'application_controller.rb' )
|
25
|
-
unless File.readlines(ac_path).grep(/::Binda::DefaultHelpers/).size > 0
|
26
|
-
inject_into_file ac_path, after: "ActionController::Base" do
|
27
|
-
"\n include ::Binda::DefaultHelpers"
|
28
|
-
end
|
14
|
+
def check_previous_install
|
15
|
+
# Ensure Binda is not installed
|
16
|
+
if ActiveRecord::Base.connection.data_source_exists? 'binda_components'
|
17
|
+
puts "Binda has already been installed on this database."
|
18
|
+
puts "Please ensure Binda is completely removed from the database before trying to install it again."
|
19
|
+
exit
|
29
20
|
end
|
30
21
|
end
|
31
|
-
|
32
|
-
def
|
33
|
-
|
34
|
-
|
22
|
+
|
23
|
+
def run_migrations
|
24
|
+
puts ""
|
25
|
+
puts "==============================================================================="
|
26
|
+
puts " BINDA INSTALLATION"
|
27
|
+
puts "==============================================================================="
|
28
|
+
puts ""
|
29
|
+
puts "1) Install migrations"
|
35
30
|
# Check if there is any previous Binda migration
|
36
31
|
previous_binda_migrations = Dir.glob( Rails.root.join('db', 'migrate', '*.binda.rb' ))
|
37
32
|
previous_migrations = Dir.glob( Rails.root.join('db', 'migrate', '*.rb' ))
|
@@ -42,8 +37,8 @@ module Binda
|
|
42
37
|
else
|
43
38
|
# If there is any previous Binda migration
|
44
39
|
if previous_migrations.size != previous_binda_migrations.size
|
45
|
-
puts "You have several migrations, please manually delete Binda's ones then run 'rails g binda:install' again."
|
46
|
-
puts "Keep in mind that Binda will place the new migration after the existing ones."
|
40
|
+
puts "You have several migrations, please manually delete Binda's ones then run 'rails g binda:install' again."
|
41
|
+
puts "Keep in mind that Binda will place the new migration after the existing ones."
|
47
42
|
exit
|
48
43
|
else
|
49
44
|
# Remove previous Binda migrations
|
@@ -52,20 +47,46 @@ module Binda
|
|
52
47
|
rake 'binda:install:migrations'
|
53
48
|
end
|
54
49
|
end
|
55
|
-
end
|
56
|
-
|
57
|
-
def run_migrations
|
58
50
|
rake 'db:migrate'
|
51
|
+
|
52
|
+
end
|
53
|
+
|
54
|
+
def add_route
|
55
|
+
return if Rails.application.routes.routes.detect { |route| route.app.app == Binda::Engine }
|
56
|
+
puts "2) Add Binda routes"
|
57
|
+
route "mount Binda::Engine => '/admin_panel'"
|
59
58
|
end
|
60
59
|
|
61
|
-
def setup_devise
|
62
|
-
return if Rails.env.production?
|
63
60
|
|
61
|
+
# Setup Devise initializer
|
62
|
+
#
|
63
|
+
# It append the snippet below to `config/initializers/devise.rb` of your application:
|
64
|
+
#
|
65
|
+
# ```ruby
|
66
|
+
# # PLEASE UPDATE THIS WITH THE FINAL URL OF YOUR DOMAIN
|
67
|
+
# # for setup see https://rubyonrailshelp.wordpress.com/2014/01/02/setting-up-mailer-using-devise-for-forgot-password/
|
68
|
+
# config.action_mailer.default_url_options = { host: 'yourdomain.com' }
|
69
|
+
# config.action_mailer.delivery_method = :smtp
|
70
|
+
# config.action_mailer.perform_deliveries = true
|
71
|
+
# config.action_mailer.raise_delivery_errors = false
|
72
|
+
# config.action_mailer.default :charset => 'utf-8'
|
73
|
+
# config.action_mailer.smtp_settings = {
|
74
|
+
# address: 'smtp.gmail.com',
|
75
|
+
# port: 587,
|
76
|
+
# domain: ENV['MAIL_DOMAIN'],
|
77
|
+
# authentication: 'plain',
|
78
|
+
# enable_starttls_auto: true,
|
79
|
+
# user_name: ENV['MAIL_USERNAME'],
|
80
|
+
# password: ENV['MAIL_PASSWORD']
|
81
|
+
# }
|
82
|
+
# ```
|
83
|
+
def setup_devise
|
84
|
+
puts "4) Setup Devise"
|
64
85
|
# Check if devise is already setup and if so, create a backup before overwrite it
|
65
86
|
initializers_path = Rails.root.join('config', 'initializers' )
|
66
87
|
if File.exist?( "#{ initializers_path }/devise.rb" )
|
67
|
-
puts "
|
68
|
-
puts "In order to avoid any conflict that file has been renamed"
|
88
|
+
puts "Binda has detected a configuration file for Devise: config/initializers/devise.rb"
|
89
|
+
puts "In order to avoid any conflict that file has been renamed"
|
69
90
|
File.rename( "#{ initializers_path }/devise.rb" , "#{ initializers_path }/devise_backup_#{ Time.now.strftime('%Y%m%d-%H%M%S-%3N') }.rb" )
|
70
91
|
end
|
71
92
|
|
@@ -86,37 +107,21 @@ module Binda
|
|
86
107
|
end
|
87
108
|
application( nil, env: "production" ) do
|
88
109
|
"\n # PLEASE UPDATE THIS WITH THE FINAL URL OF YOUR DOMAIN\n # config.action_mailer.default_url_options = { host: 'yourdomain.com' }\n # config.action_mailer.delivery_method = :smtp\n # config.action_mailer.perform_deliveries = true\n # config.action_mailer.raise_delivery_errors = false\n # config.action_mailer.default :charset => 'utf-8'\n # config.action_mailer.smtp_settings = {\n # address: 'smtp.gmail.com',\n # port: 587,\n # domain: ENV['MAIL_DOMAIN'],\n # authentication: 'plain',\n # enable_starttls_auto: true,\n # user_name: ENV['MAIL_USERNAME'],\n # password: ENV['MAIL_PASSWORD']\n # }"
|
89
|
-
|
90
|
-
# which returns the snippet below:
|
91
|
-
#
|
92
|
-
# # PLEASE UPDATE THIS WITH THE FINAL URL OF YOUR DOMAIN
|
93
|
-
# # for setup see https://rubyonrailshelp.wordpress.com/2014/01/02/setting-up-mailer-using-devise-for-forgot-password/
|
94
|
-
# config.action_mailer.default_url_options = { host: 'yourdomain.com' }
|
95
|
-
# config.action_mailer.delivery_method = :smtp
|
96
|
-
# config.action_mailer.perform_deliveries = true
|
97
|
-
# config.action_mailer.raise_delivery_errors = false
|
98
|
-
# config.action_mailer.default :charset => 'utf-8'
|
99
|
-
# config.action_mailer.smtp_settings = {
|
100
|
-
# address: 'smtp.gmail.com',
|
101
|
-
# port: 587,
|
102
|
-
# domain: ENV['MAIL_DOMAIN'],
|
103
|
-
# authentication: 'plain',
|
104
|
-
# enable_starttls_auto: true,
|
105
|
-
# user_name: ENV['MAIL_USERNAME'],
|
106
|
-
# password: ENV['MAIL_PASSWORD']
|
107
|
-
# }
|
108
110
|
end
|
109
111
|
end
|
110
112
|
|
113
|
+
# Setup Carrierwave
|
114
|
+
#
|
115
|
+
# It generates this {file:lib/generators/binda/install/templates/confic/initializers/carrierwave.rb}
|
111
116
|
def setup_carrierwave
|
112
|
-
return if Rails.env.production?
|
113
117
|
return if File.exist?( Rails.root.join('config', 'initializers', 'carrierwave.rb' ))
|
114
|
-
|
118
|
+
puts "4) Setup Carrierwave"
|
115
119
|
template 'config/initializers/carrierwave.rb'
|
120
|
+
puts "==============================================================================="
|
116
121
|
end
|
117
122
|
|
118
123
|
def setup_settings
|
119
|
-
exec 'rails
|
124
|
+
exec 'rails generate binda:maintenance && rails generate binda:setup'
|
120
125
|
end
|
121
126
|
|
122
127
|
end
|