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.
Files changed (201) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.md +63 -0
  4. data/Rakefile +37 -0
  5. data/app/assets/config/binda_manifest.js +2 -0
  6. data/app/assets/javascripts/binda/application.js +18 -0
  7. data/app/assets/javascripts/binda/components/form_item.js +54 -0
  8. data/app/assets/javascripts/binda/components/form_item_asset.js +24 -0
  9. data/app/assets/javascripts/binda/components/form_item_repeater.js +66 -0
  10. data/app/assets/javascripts/binda/components/sortable.js +44 -0
  11. data/app/assets/javascripts/binda/dist/binda.bundle.js +336 -0
  12. data/app/assets/javascripts/binda/index.js +16 -0
  13. data/app/assets/stylesheets/binda/application.css +6 -0
  14. data/app/assets/stylesheets/binda/components/assets_manager.scss +46 -0
  15. data/app/assets/stylesheets/binda/components/button.scss +7 -0
  16. data/app/assets/stylesheets/binda/components/form_body.scss +2 -0
  17. data/app/assets/stylesheets/binda/components/form_item.scss +169 -0
  18. data/app/assets/stylesheets/binda/components/form_item_asset.scss +20 -0
  19. data/app/assets/stylesheets/binda/components/form_section.scss +40 -0
  20. data/app/assets/stylesheets/binda/components/login.scss +6 -0
  21. data/app/assets/stylesheets/binda/components/main_container.scss +0 -0
  22. data/app/assets/stylesheets/binda/components/main_content.scss +5 -0
  23. data/app/assets/stylesheets/binda/components/main_header.scss +25 -0
  24. data/app/assets/stylesheets/binda/components/main_table.scss +28 -0
  25. data/app/assets/stylesheets/binda/components/sidebar.scss +131 -0
  26. data/app/assets/stylesheets/binda/components/sortable.scss +98 -0
  27. data/app/assets/stylesheets/binda/index.scss +24 -0
  28. data/app/assets/stylesheets/binda/layout/components_index.scss +9 -0
  29. data/app/assets/stylesheets/binda/layout/dashboard.scss +7 -0
  30. data/app/assets/stylesheets/binda/layout/users_sign_in.scss +29 -0
  31. data/app/assets/stylesheets/binda/settings/common.scss +93 -0
  32. data/app/assets/stylesheets/binda/settings/fonts.scss +90 -0
  33. data/app/assets/stylesheets/binda/settings/variables.scss +83 -0
  34. data/app/assets/stylesheets/scaffolds.scss +89 -0
  35. data/app/controllers/binda/application_controller.rb +29 -0
  36. data/app/controllers/binda/assets_controller.rb +62 -0
  37. data/app/controllers/binda/bindings_controller.rb +62 -0
  38. data/app/controllers/binda/categories_controller.rb +60 -0
  39. data/app/controllers/binda/components_controller.rb +223 -0
  40. data/app/controllers/binda/dates_controller.rb +62 -0
  41. data/app/controllers/binda/field_groups_controller.rb +114 -0
  42. data/app/controllers/binda/field_settings_controller.rb +66 -0
  43. data/app/controllers/binda/galleries_controller.rb +62 -0
  44. data/app/controllers/binda/manage/users_controller.rb +97 -0
  45. data/app/controllers/binda/repeaters_controller.rb +67 -0
  46. data/app/controllers/binda/settings_controller.rb +75 -0
  47. data/app/controllers/binda/structures_controller.rb +89 -0
  48. data/app/controllers/binda/texts_controller.rb +62 -0
  49. data/app/controllers/binda/users/confirmations_controller.rb +33 -0
  50. data/app/controllers/binda/users/omniauth_callbacks_controller.rb +33 -0
  51. data/app/controllers/binda/users/passwords_controller.rb +37 -0
  52. data/app/controllers/binda/users/registrations_controller.rb +89 -0
  53. data/app/controllers/binda/users/sessions_controller.rb +30 -0
  54. data/app/controllers/binda/users/unlocks_controller.rb +33 -0
  55. data/app/helpers/binda/application_helper.rb +25 -0
  56. data/app/helpers/binda/assets_helper.rb +4 -0
  57. data/app/helpers/binda/bindings_helper.rb +4 -0
  58. data/app/helpers/binda/categories_helper.rb +10 -0
  59. data/app/helpers/binda/components_helper.rb +10 -0
  60. data/app/helpers/binda/dates_helper.rb +4 -0
  61. data/app/helpers/binda/field_groups_helper.rb +10 -0
  62. data/app/helpers/binda/field_settings_helper.rb +14 -0
  63. data/app/helpers/binda/galleries_helper.rb +4 -0
  64. data/app/helpers/binda/repeaters_helper.rb +4 -0
  65. data/app/helpers/binda/settings_helper.rb +13 -0
  66. data/app/helpers/binda/structures_helper.rb +4 -0
  67. data/app/helpers/binda/texts_helper.rb +4 -0
  68. data/app/jobs/binda/application_job.rb +4 -0
  69. data/app/mailers/binda/application_mailer.rb +6 -0
  70. data/app/models/binda/application_record.rb +5 -0
  71. data/app/models/binda/asset.rb +21 -0
  72. data/app/models/binda/binding.rb +24 -0
  73. data/app/models/binda/category.rb +31 -0
  74. data/app/models/binda/component.rb +186 -0
  75. data/app/models/binda/date.rb +9 -0
  76. data/app/models/binda/field_group.rb +40 -0
  77. data/app/models/binda/field_setting.rb +95 -0
  78. data/app/models/binda/gallery.rb +18 -0
  79. data/app/models/binda/repeater.rb +108 -0
  80. data/app/models/binda/setting.rb +42 -0
  81. data/app/models/binda/structure.rb +31 -0
  82. data/app/models/binda/text.rb +9 -0
  83. data/app/models/binda/user.rb +8 -0
  84. data/app/uploaders/binda/asset/image_uploader.rb +76 -0
  85. data/app/views/binda/assets/_form.html.erb +22 -0
  86. data/app/views/binda/assets/edit.html.erb +6 -0
  87. data/app/views/binda/assets/index.html.erb +29 -0
  88. data/app/views/binda/assets/new.html.erb +5 -0
  89. data/app/views/binda/assets/show.html.erb +19 -0
  90. data/app/views/binda/bindings/_form.html.erb +32 -0
  91. data/app/views/binda/bindings/edit.html.erb +6 -0
  92. data/app/views/binda/bindings/index.html.erb +31 -0
  93. data/app/views/binda/bindings/new.html.erb +5 -0
  94. data/app/views/binda/bindings/show.html.erb +19 -0
  95. data/app/views/binda/categories/_form.html.erb +58 -0
  96. data/app/views/binda/categories/edit.html.erb +8 -0
  97. data/app/views/binda/categories/index.html.erb +34 -0
  98. data/app/views/binda/categories/new.html.erb +8 -0
  99. data/app/views/binda/components/_form_body.html.erb +86 -0
  100. data/app/views/binda/components/_form_item_asset.html.erb +20 -0
  101. data/app/views/binda/components/_form_item_date.html.erb +16 -0
  102. data/app/views/binda/components/_form_item_gallery.html.erb +0 -0
  103. data/app/views/binda/components/_form_item_new_repeater.html.erb +33 -0
  104. data/app/views/binda/components/_form_item_repeater.html.erb +81 -0
  105. data/app/views/binda/components/_form_item_text.html.erb +28 -0
  106. data/app/views/binda/components/_form_section.html.erb +37 -0
  107. data/app/views/binda/components/_form_section_repeater.html.erb +31 -0
  108. data/app/views/binda/components/_form_sidebar.html.erb +34 -0
  109. data/app/views/binda/components/edit.html.erb +8 -0
  110. data/app/views/binda/components/index.html.erb +43 -0
  111. data/app/views/binda/components/new.html.erb +8 -0
  112. data/app/views/binda/dates/_form.html.erb +22 -0
  113. data/app/views/binda/dates/edit.html.erb +6 -0
  114. data/app/views/binda/dates/index.html.erb +27 -0
  115. data/app/views/binda/dates/new.html.erb +5 -0
  116. data/app/views/binda/dates/show.html.erb +9 -0
  117. data/app/views/binda/field_groups/_form_body.html.erb +71 -0
  118. data/app/views/binda/field_groups/_form_item.html.erb +62 -0
  119. data/app/views/binda/field_groups/_form_section.html.erb +37 -0
  120. data/app/views/binda/field_groups/_form_section_repeater.html.erb +25 -0
  121. data/app/views/binda/field_groups/edit.html.erb +8 -0
  122. data/app/views/binda/field_groups/index.html.erb +34 -0
  123. data/app/views/binda/field_groups/new.html.erb +8 -0
  124. data/app/views/binda/field_settings/_form_body.html.erb +60 -0
  125. data/app/views/binda/field_settings/edit.html.erb +8 -0
  126. data/app/views/binda/field_settings/index.html.erb +31 -0
  127. data/app/views/binda/field_settings/new.html.erb +8 -0
  128. data/app/views/binda/galleries/_form.html.erb +27 -0
  129. data/app/views/binda/galleries/edit.html.erb +6 -0
  130. data/app/views/binda/galleries/index.html.erb +29 -0
  131. data/app/views/binda/galleries/new.html.erb +5 -0
  132. data/app/views/binda/galleries/show.html.erb +14 -0
  133. data/app/views/binda/manage/users/_admin_manage_user.json.jbuilder +2 -0
  134. data/app/views/binda/manage/users/_form_body.html.erb +58 -0
  135. data/app/views/binda/manage/users/edit.html.erb +8 -0
  136. data/app/views/binda/manage/users/index.html.erb +38 -0
  137. data/app/views/binda/manage/users/index.json.jbuilder +1 -0
  138. data/app/views/binda/manage/users/new.html.erb +8 -0
  139. data/app/views/binda/manage/users/show.json.jbuilder +1 -0
  140. data/app/views/binda/repeaters/_form.html.erb +27 -0
  141. data/app/views/binda/repeaters/edit.html.erb +6 -0
  142. data/app/views/binda/repeaters/index.html.erb +29 -0
  143. data/app/views/binda/repeaters/new.html.erb +5 -0
  144. data/app/views/binda/repeaters/show.html.erb +14 -0
  145. data/app/views/binda/settings/_dashboard_form.html.erb +51 -0
  146. data/app/views/binda/settings/_form.html.erb +52 -0
  147. data/app/views/binda/settings/dashboard.html.erb +9 -0
  148. data/app/views/binda/settings/edit.html.erb +8 -0
  149. data/app/views/binda/settings/index.html.erb +34 -0
  150. data/app/views/binda/settings/new.html.erb +8 -0
  151. data/app/views/binda/structures/_form_body.html.erb +56 -0
  152. data/app/views/binda/structures/_form_section.html.erb +64 -0
  153. data/app/views/binda/structures/add_child.html.erb +0 -0
  154. data/app/views/binda/structures/edit.html.erb +8 -0
  155. data/app/views/binda/structures/index.html.erb +34 -0
  156. data/app/views/binda/structures/new.html.erb +8 -0
  157. data/app/views/binda/texts/_form.html.erb +22 -0
  158. data/app/views/binda/texts/edit.html.erb +6 -0
  159. data/app/views/binda/texts/index.html.erb +27 -0
  160. data/app/views/binda/texts/new.html.erb +5 -0
  161. data/app/views/binda/texts/show.html.erb +9 -0
  162. data/app/views/layouts/binda/_flash.html.erb +26 -0
  163. data/app/views/layouts/binda/_header.html.erb +9 -0
  164. data/app/views/layouts/binda/_sidebar.html.erb +50 -0
  165. data/app/views/layouts/binda/application.html.erb +29 -0
  166. data/app/views/users/confirmations/new.html.erb +16 -0
  167. data/app/views/users/mailer/confirmation_instructions.html.erb +5 -0
  168. data/app/views/users/mailer/password_change.html.erb +3 -0
  169. data/app/views/users/mailer/reset_password_instructions.html.erb +8 -0
  170. data/app/views/users/mailer/unlock_instructions.html.erb +7 -0
  171. data/app/views/users/passwords/edit.html.erb +31 -0
  172. data/app/views/users/passwords/new.html.erb +28 -0
  173. data/app/views/users/registrations/edit.html.erb +27 -0
  174. data/app/views/users/registrations/new.html.erb +17 -0
  175. data/app/views/users/sessions/new.html.erb +27 -0
  176. data/app/views/users/shared/_links.html.erb +25 -0
  177. data/app/views/users/unlocks/new.html.erb +16 -0
  178. data/config/initializers/assets.rb +3 -0
  179. data/config/initializers/devise.rb +278 -0
  180. data/config/initializers/devise_patch.rb +50 -0
  181. data/config/initializers/friendly_id.rb +88 -0
  182. data/config/initializers/simple_form.rb +165 -0
  183. data/config/initializers/simple_form_bootstrap.rb +149 -0
  184. data/config/locales/devise.en.yml +62 -0
  185. data/config/locales/en.yml +37 -0
  186. data/config/locales/simple_form.en.yml +31 -0
  187. data/config/routes.rb +67 -0
  188. data/config/tinymce.yml +15 -0
  189. data/db/migrate/1_create_binda_tables.rb +172 -0
  190. data/lib/binda.rb +5 -0
  191. data/lib/binda/engine.rb +30 -0
  192. data/lib/binda/version.rb +3 -0
  193. data/lib/generators/binda/install/USAGE +9 -0
  194. data/lib/generators/binda/install/install_generator.rb +107 -0
  195. data/lib/generators/binda/install/templates/config/initializers/carrierwave.rb +32 -0
  196. data/lib/generators/binda/install/templates/config/initializers/devise.rb +280 -0
  197. data/lib/generators/binda/setup/USAGE +8 -0
  198. data/lib/generators/binda/setup/setup_generator.rb +43 -0
  199. data/lib/tasks/binda.rake +25 -0
  200. data/lib/templates/erb/scaffold/_form.html.erb +13 -0
  201. metadata +637 -0
@@ -0,0 +1,62 @@
1
+ # Additional translations at https://github.com/plataformatec/devise/wiki/I18n
2
+
3
+ en:
4
+ devise:
5
+ confirmations:
6
+ confirmed: "Your email address has been successfully confirmed."
7
+ send_instructions: "You will receive an email with instructions for how to confirm your email address in a few minutes."
8
+ send_paranoid_instructions: "If your email address exists in our database, you will receive an email with instructions for how to confirm your email address in a few minutes."
9
+ failure:
10
+ already_authenticated: "You are already signed in."
11
+ inactive: "Your account is not activated yet."
12
+ invalid: "Invalid %{authentication_keys} or password."
13
+ locked: "Your account is locked."
14
+ last_attempt: "You have one more attempt before your account is locked."
15
+ not_found_in_database: "Invalid %{authentication_keys} or password."
16
+ timeout: "Your session expired. Please sign in again to continue."
17
+ unauthenticated: "You need to sign in or sign up before continuing."
18
+ unconfirmed: "You have to confirm your email address before continuing."
19
+ mailer:
20
+ confirmation_instructions:
21
+ subject: "Confirmation instructions"
22
+ reset_password_instructions:
23
+ subject: "Reset password instructions"
24
+ unlock_instructions:
25
+ subject: "Unlock instructions"
26
+ password_change:
27
+ subject: "Password Changed"
28
+ omniauth_callbacks:
29
+ failure: "Could not authenticate you from %{kind} because \"%{reason}\"."
30
+ success: "Successfully authenticated from %{kind} account."
31
+ passwords:
32
+ no_token: "You can't access this page without coming from a password reset email. If you do come from a password reset email, please make sure you used the full URL provided."
33
+ send_instructions: "You will receive an email with instructions on how to reset your password in a few minutes."
34
+ send_paranoid_instructions: "If your email address exists in our database, you will receive a password recovery link at your email address in a few minutes."
35
+ updated: "Your password has been changed successfully. You are now signed in."
36
+ updated_not_active: "Your password has been changed successfully."
37
+ registrations:
38
+ destroyed: "Bye! Your account has been successfully cancelled. We hope to see you again soon."
39
+ signed_up: "Welcome! You have signed up successfully."
40
+ signed_up_but_inactive: "You have signed up successfully. However, we could not sign you in because your account is not yet activated."
41
+ signed_up_but_locked: "You have signed up successfully. However, we could not sign you in because your account is locked."
42
+ signed_up_but_unconfirmed: "A message with a confirmation link has been sent to your email address. Please follow the link to activate your account."
43
+ update_needs_confirmation: "You updated your account successfully, but we need to verify your new email address. Please check your email and follow the confirm link to confirm your new email address."
44
+ updated: "Your account has been updated successfully."
45
+ sessions:
46
+ signed_in: "Signed in successfully."
47
+ signed_out: "Signed out successfully."
48
+ already_signed_out: "Signed out successfully."
49
+ unlocks:
50
+ send_instructions: "You will receive an email with instructions for how to unlock your account in a few minutes."
51
+ send_paranoid_instructions: "If your account exists, you will receive an email with instructions for how to unlock it in a few minutes."
52
+ unlocked: "Your account has been unlocked successfully. Please sign in to continue."
53
+ errors:
54
+ messages:
55
+ already_confirmed: "was already confirmed, please try signing in"
56
+ confirmation_period_expired: "needs to be confirmed within %{period}, please request a new one"
57
+ expired: "has expired, please request a new one"
58
+ not_found: "not found"
59
+ not_locked: "was not locked"
60
+ not_saved:
61
+ one: "1 error prohibited this %{resource} from being saved:"
62
+ other: "%{count} errors prohibited this %{resource} from being saved:"
@@ -0,0 +1,37 @@
1
+ en:
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
+ back_to_index: back to list
18
+ back_to: back to
19
+ 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.'
20
+ field_type: field type
21
+ field_group_title: field group title
22
+ select_field_type: select a field type
23
+ go_to: go to
24
+ field_group: field group
25
+ field_setting: field setting
26
+ repeater: repeater
27
+ new_item_in_repeater: New %{arg1} item
28
+ structure: structure
29
+ hint_create_parent_before_child: you need to create the %{arg1} before being able to add any %{arg2}
30
+ dashboard_title: website settings
31
+ dashboard: dashboard
32
+ component: component
33
+ category: category
34
+ select_category: select one category
35
+ create_category: create a new category
36
+ structure_has_categories: Enable categories
37
+ asset: asset
@@ -0,0 +1,31 @@
1
+ en:
2
+ simple_form:
3
+ "yes": 'Yes'
4
+ "no": 'No'
5
+ required:
6
+ text: 'required'
7
+ mark: '*'
8
+ # You can uncomment the line below if you need to overwrite the whole required html.
9
+ # When using html, text and mark won't be used.
10
+ # html: '<abbr title="required">*</abbr>'
11
+ error_notification:
12
+ default_message: "Please review the problems below:"
13
+ # Examples
14
+ # labels:
15
+ # defaults:
16
+ # password: 'Password'
17
+ # user:
18
+ # new:
19
+ # email: 'E-mail to sign in.'
20
+ # edit:
21
+ # email: 'E-mail.'
22
+ # hints:
23
+ # defaults:
24
+ # username: 'User name to sign in.'
25
+ # password: 'No special characters, please.'
26
+ # include_blanks:
27
+ # defaults:
28
+ # age: 'Rather not say'
29
+ # prompts:
30
+ # defaults:
31
+ # age: 'Select your age'
data/config/routes.rb ADDED
@@ -0,0 +1,67 @@
1
+ Binda::Engine.routes.draw do
2
+
3
+ # ROOT
4
+ # ----
5
+ # https://github.com/plataformatec/devise/wiki/How-To:-Require-authentication-for-all-components
6
+ # authenticated :user, class_name: "Binda::User", module: :devise do
7
+ # root to: 'settings#dashboard', as: :authenticated_root
8
+ # end
9
+ # root to: 'users/sessions#new'
10
+ root to: 'settings#dashboard'
11
+
12
+ # DEVISE
13
+ # ------
14
+ # scope "admindd_ddpanel" do
15
+ # https://github.com/plataformatec/devise/blob/88724e10adaf9ffd1d8dbfbaadda2b9d40de756a/lib/devise/rails/routes.rb#L143
16
+ devise_for :users, class_name: "Binda::User", module: 'binda/users',
17
+ path_names: {
18
+ sign_in: 'login',
19
+ sign_out: 'logout',
20
+ password: 'secret',
21
+ confirmation: 'verification',
22
+ unlock: 'unblock',
23
+ registration: 'register',
24
+ sign_up: 'signup'
25
+ }
26
+ # end
27
+
28
+ namespace :manage do
29
+ resources :users
30
+ end
31
+
32
+ # ADMINISTRATION PANEL
33
+ # --------------------
34
+ get 'dashboard', to: 'settings#dashboard', as: :dashboard
35
+ post 'dashboard', to: 'settings#update_dashboard'
36
+ resources :settings
37
+
38
+ post 'structures/sort'
39
+ resources :structures do
40
+
41
+ resources :categories
42
+
43
+ post 'components/sort'
44
+ resources :components do
45
+ post 'sort_repeaters'
46
+ post 'new_repeater'
47
+ end
48
+
49
+ post 'field_groups/sort'
50
+ post 'field_groups/add_child'
51
+ resources :field_groups do
52
+
53
+ post 'field_settings/add_child'
54
+ post 'field_settings/sort'
55
+ resources :field_settings
56
+
57
+ end
58
+ end
59
+
60
+ resources :texts
61
+ resources :bindings
62
+ resources :galleries
63
+ resources :assets
64
+ resources :repeaters
65
+ resources :dates
66
+
67
+ end
@@ -0,0 +1,15 @@
1
+ toolbar:
2
+ - styleselect | bold italic | undo redo | link image
3
+ plugins:
4
+ - link
5
+ - paste
6
+ - nonbreaking
7
+ - autolink
8
+ - code
9
+ # - image
10
+
11
+ forced_root_block: false
12
+ paste_text_sticky_default: true
13
+ paste_text_sticky: true
14
+ menubar: edit format tools
15
+ selector: '.tinymce'
@@ -0,0 +1,172 @@
1
+ class CreateBindaTables < ActiveRecord::Migration[5.0]
2
+ def change
3
+
4
+ create_table :binda_settings do |t|
5
+ t.string :name, null: false
6
+ t.string :slug
7
+ t.index :slug, unique: true
8
+ t.text :content
9
+ t.integer :position
10
+ t.boolean :is_true, default: false
11
+ end
12
+
13
+ create_table :binda_components do |t|
14
+ t.string :name, null: false
15
+ t.string :slug
16
+ t.index :slug, unique: true
17
+ t.string :publish_state
18
+ t.integer :position
19
+ t.belongs_to :structure
20
+ t.timestamps
21
+ end
22
+
23
+ create_table :binda_structures do |t|
24
+ t.string :name, null: false
25
+ t.string :slug
26
+ t.integer :position
27
+ t.boolean :has_categories, default: true
28
+ t.index :slug, unique: true
29
+ t.timestamps
30
+ end
31
+
32
+ create_table :binda_field_groups do |t|
33
+ t.string :name, null: false
34
+ t.string :slug
35
+ t.index :slug, unique: true
36
+ t.text :description
37
+ t.integer :position
38
+ t.string :layout
39
+ t.belongs_to :structure
40
+ t.timestamps
41
+ end
42
+
43
+ create_table :binda_field_settings do |t|
44
+ t.string :name, null: false
45
+ t.string :slug
46
+ t.index :slug, unique: true
47
+ t.text :description
48
+ t.integer :position
49
+ t.boolean :required
50
+ t.text :default_text
51
+ t.string :field_type
52
+ t.belongs_to :field_group
53
+ t.string :ancestry
54
+ t.index :ancestry
55
+ t.timestamps
56
+ end
57
+
58
+ create_table :binda_repeaters do |t|
59
+ t.integer :position
60
+ t.belongs_to :field_setting
61
+ t.references :fieldable, polymorphic: true, index: true
62
+ t.timestamps
63
+ end
64
+
65
+ create_table :binda_texts do |t|
66
+ t.text :content
67
+ t.integer :position
68
+ t.belongs_to :field_setting
69
+ t.references :fieldable, polymorphic: true, index: true
70
+ t.timestamps
71
+ end
72
+
73
+ create_table :binda_galleries do |t|
74
+ t.integer :position
75
+ t.belongs_to :field_setting
76
+ t.references :fieldable, polymorphic: true, index: true
77
+ t.timestamps
78
+ end
79
+
80
+ create_table :binda_assets do |t|
81
+ t.string :image
82
+ t.belongs_to :field_setting
83
+ t.references :fieldable, polymorphic: true, index: true
84
+ t.timestamps
85
+ end
86
+
87
+ create_table :binda_dates do |t|
88
+ t.datetime :date
89
+ t.belongs_to :field_setting
90
+ t.references :fieldable, polymorphic: true, index: true
91
+ t.timestamps
92
+ end
93
+
94
+ create_table :binda_bindings do |t|
95
+ t.string :title
96
+ t.text :description
97
+ t.integer :position
98
+ t.timestamps
99
+ end
100
+
101
+ create_table :binda_categories do |t|
102
+ t.string :name, null: false
103
+ t.string :slug
104
+ t.index :slug, unique: true
105
+ t.belongs_to :structure
106
+ t.integer :position
107
+ t.text :description
108
+ t.timestamps
109
+ end
110
+
111
+ create_table :binda_categories_components, id: false do |t|
112
+ t.belongs_to :category, index: true
113
+ t.belongs_to :component, index: true
114
+ end
115
+
116
+ create_table :friendly_id_slugs do |t|
117
+ t.string :slug, :null => false
118
+ t.integer :sluggable_id, :null => false
119
+ t.string :sluggable_type, :limit => 50
120
+ t.string :scope
121
+ t.datetime :created_at
122
+ end
123
+
124
+ add_index :friendly_id_slugs, :sluggable_id
125
+ add_index :friendly_id_slugs, [:slug, :sluggable_type]
126
+ add_index :friendly_id_slugs, [:slug, :sluggable_type, :scope], :unique => true
127
+ add_index :friendly_id_slugs, :sluggable_type
128
+
129
+ # DEVISE
130
+ create_table :binda_users do |t|
131
+ ## Database authenticatable
132
+ t.string :email, null: false, default: ""
133
+ t.string :encrypted_password, null: false, default: ""
134
+
135
+ ## Recoverable
136
+ t.string :reset_password_token
137
+ t.datetime :reset_password_sent_at
138
+
139
+ ## Rememberable
140
+ t.datetime :remember_created_at
141
+
142
+ ## Trackable
143
+ t.integer :sign_in_count, default: 0, null: false
144
+ t.datetime :current_sign_in_at
145
+ t.datetime :last_sign_in_at
146
+ t.string :current_sign_in_ip
147
+ t.string :last_sign_in_ip
148
+
149
+ ## Confirmable
150
+ t.string :confirmation_token
151
+ t.datetime :confirmed_at
152
+ t.datetime :confirmation_sent_at
153
+ t.string :unconfirmed_email # Only if using reconfirmable
154
+
155
+ ## Lockable
156
+ t.integer :failed_attempts, default: 0, null: false # Only if lock strategy is :failed_attempts
157
+ t.string :unlock_token # Only if unlock strategy is :email or :both
158
+ t.datetime :locked_at
159
+
160
+ ## Custom Binda setup
161
+ t.boolean :is_superadmin, default: false
162
+
163
+ t.timestamps null: false
164
+ end
165
+
166
+ add_index :binda_users, :email, unique: true
167
+ add_index :binda_users, :reset_password_token, unique: true
168
+ add_index :binda_users, :confirmation_token, unique: true
169
+ add_index :binda_users, :unlock_token, unique: true
170
+
171
+ end
172
+ end
data/lib/binda.rb ADDED
@@ -0,0 +1,5 @@
1
+ require "binda/engine"
2
+
3
+ module Binda
4
+ # Your code goes here...
5
+ end
@@ -0,0 +1,30 @@
1
+ require 'devise'
2
+ require 'jquery-rails'
3
+ require 'jquery-ui-rails'
4
+ require 'sass-rails'
5
+ require 'coffee-rails'
6
+ require 'colorize'
7
+ require 'friendly_id'
8
+ require 'aasm'
9
+ require 'ffaker'
10
+ require 'simple_form'
11
+ require 'tinymce-rails'
12
+ require 'carrierwave'
13
+ require 'mini_magick'
14
+ require 'ancestry'
15
+
16
+ module Binda
17
+ class Engine < ::Rails::Engine
18
+ isolate_namespace Binda
19
+
20
+ # Add vendor files to pipeline
21
+ config.assets.paths << config.root.join("vendor", "assets" )
22
+ # config.assets.paths << config.root.join("vendor", "assets", "fonts")
23
+ config.assets.precompile << /\.(?:svg|eot|woff|ttf)\z/
24
+
25
+ # Setup tinymce configuration file
26
+ config.tinymce.config_path = ::Binda::Engine.root.join("config/tinymce.yml")
27
+
28
+ end
29
+ end
30
+
@@ -0,0 +1,3 @@
1
+ module Binda
2
+ VERSION = '0.0.2'
3
+ end
@@ -0,0 +1,9 @@
1
+ Description:
2
+ Binda install generator will setup the CMS
3
+
4
+ Example:
5
+ rails generate binda:install
6
+
7
+ This will:
8
+ - setup and run Binda migrations
9
+ - create default settings