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,27 @@
1
+ <p id="notice"><%= notice %></p>
2
+
3
+ <h1>Texts</h1>
4
+
5
+ <table>
6
+ <thead>
7
+ <tr>
8
+ <th>Content</th>
9
+ <th colspan="3"></th>
10
+ </tr>
11
+ </thead>
12
+
13
+ <tbody>
14
+ <% @texts.each do |text| %>
15
+ <tr>
16
+ <td><%= text.content %></td>
17
+ <td><%= link_to 'Show', text %></td>
18
+ <td><%= link_to 'Edit', edit_text_path(text) %></td>
19
+ <td><%= link_to 'Destroy', text, method: :delete, data: { confirm: 'Are you sure?' } %></td>
20
+ </tr>
21
+ <% end %>
22
+ </tbody>
23
+ </table>
24
+
25
+ <br>
26
+
27
+ <%= link_to 'New Text', new_text_path %>
@@ -0,0 +1,5 @@
1
+ <h1>New Text</h1>
2
+
3
+ <%= render 'form', text: @text %>
4
+
5
+ <%= link_to 'Back', texts_path %>
@@ -0,0 +1,9 @@
1
+ <p id="notice"><%= notice %></p>
2
+
3
+ <p>
4
+ <strong>Content:</strong>
5
+ <%= @text.content %>
6
+ </p>
7
+
8
+ <%= link_to 'Edit', edit_text_path(@text) %> |
9
+ <%= link_to 'Back', texts_path %>
@@ -0,0 +1,26 @@
1
+ <% unless notice.blank? %>
2
+ <div class="form-section--transparent-container row">
3
+ <div class="alert alert-success col-sm-12">
4
+ <%= notice if notice.is_a? String %>
5
+ <% if notice.is_a? Hash %>
6
+ <% notice.each do |key, message| %>
7
+ <p><%= key.humanize.capitalize %> <%= message.to_sentence %></p>
8
+ <% end %>
9
+ <% end %>
10
+ </div>
11
+ </div>
12
+ <% end %>
13
+
14
+ <% unless alert.blank? %>
15
+ <div class="form-section--transparent-container row">
16
+ <div class="alert alert-danger col-sm-12">
17
+ <%= alert if alert.is_a? String %>
18
+ <% if alert.is_a? Hash %>
19
+ <% alert.each do |key, message| %>
20
+ <p><%= key.humanize.capitalize %> <%= message.to_sentence %></p>
21
+ <% end %>
22
+ <% end %>
23
+ </div>
24
+ </div>
25
+ <% end %>
26
+
@@ -0,0 +1,9 @@
1
+ <% unless controller_name == 'sessions' && action_name == 'new' %>
2
+ <div id="main-header" class="container">
3
+ <div class="row">
4
+ <div class="col-sm-12">
5
+ <%= yield :header %>
6
+ </div>
7
+ </div>
8
+ </div>
9
+ <% end %>
@@ -0,0 +1,50 @@
1
+ <%
2
+ # If this partial is run from Devise
3
+ # keep in mind to add "binda." to path helpers
4
+ #
5
+ # https://github.com/plataformatec/devise/wiki/How-To:-Use-devise-inside-a-mountable-engine#path-helpers
6
+ %>
7
+
8
+ <% unless is_devise_controller %>
9
+ <div id="main-sidebar">
10
+ <ul class="main-sidebar--nav">
11
+ <li class = "main-sidebar--brand">
12
+ <h3><%= link_to get_website_name, '/' %></h3>
13
+ </li>
14
+ <li>
15
+ <a href="<%= dashboard_path %>">
16
+ <span class="glyphicon glyphicon-home" aria-hidden="true"></span> Dashboard
17
+ </a>
18
+ </li>
19
+ <% Binda::Structure.all.order(:position).each_with_index do |structure, index| %>
20
+ <li class="main-sidebar--structure <%= 'main-sidebar--first-structure' if index == 0 %>">
21
+ <a href="<%= structure_components_path( structure.slug ) %>">
22
+ <span class="glyphicon glyphicon-th-list" aria-hidden="true"></span> <%= structure.name.humanize.pluralize %>
23
+ </a>
24
+ <% if structure.has_categories %>
25
+ <a class="main-sidebar--sub-link" href="<%= structure_categories_path( structure.slug ) %>">
26
+ <span class="glyphicon glyphicon-tags" aria-hidden="true"></span> <%= structure.name.humanize %> <%= t(:category).capitalize.pluralize %>
27
+ </a>
28
+ <% end %>
29
+ </li>
30
+ <% end %>
31
+ <% if current_user.is_superadmin %>
32
+ <li>
33
+ <a href="<%= structures_path %>">
34
+ <span class="glyphicon glyphicon-edit" aria-hidden="true"></span> Structures
35
+ </a>
36
+ </li>
37
+ <% end %>
38
+ <li>
39
+ <a href="<%= manage_users_path %>">
40
+ <span class="glyphicon glyphicon-user" aria-hidden="true"></span> Users
41
+ </a>
42
+ </li>
43
+ <li>
44
+ <a href="<%= destroy_user_session_path %>" data-method="delete">
45
+ <span class="glyphicon glyphicon-log-out" aria-hidden="true"></span> Log out
46
+ </a>
47
+ </li>
48
+ </ul>
49
+ </div>
50
+ <% end %>
@@ -0,0 +1,29 @@
1
+ <!DOCTYPE html>
2
+ <html lang="<%= I18n.locale %>">
3
+ <head>
4
+ <title>Binda CMS -- <%= controller_name.capitalize %> <%= action_name.capitalize %></title>
5
+ <%= csrf_meta_tags %>
6
+ <%= tinymce %>
7
+ <%= stylesheet_link_tag "binda/application", media: "all" %>
8
+ <%= javascript_include_tag "binda/application" %>
9
+ </head>
10
+
11
+ <body class="<%= action_name %> <%= "#{controller_name}-#{action_name}" %> <%= 'devise-view' if is_devise_controller %>">
12
+
13
+ <div id="main-container">
14
+
15
+ <%= render partial: 'layouts/binda/sidebar' %>
16
+ <%= render partial: 'layouts/binda/header' %>
17
+
18
+ <div id="main-content" class="container">
19
+
20
+ <%= render partial: 'layouts/binda/flash' %>
21
+
22
+ <%= yield :content %>
23
+ <%= yield %>
24
+
25
+ </div>
26
+ </div>
27
+
28
+ </body>
29
+ </html>
@@ -0,0 +1,16 @@
1
+ <h2>Resend confirmation instructions</h2>
2
+
3
+ <%= simple_form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post }) do |f| %>
4
+ <%= f.error_notification %>
5
+ <%= f.full_error :confirmation_token %>
6
+
7
+ <div class="form-inputs">
8
+ <%= f.input :email, required: true, autofocus: true %>
9
+ </div>
10
+
11
+ <div class="form-actions">
12
+ <%= f.button :submit, "Resend confirmation instructions" %>
13
+ </div>
14
+ <% end %>
15
+
16
+ <%= render "users/shared/links" %>
@@ -0,0 +1,5 @@
1
+ <p>Welcome <%= @email %>!</p>
2
+
3
+ <p>You can confirm your account email through the link below:</p>
4
+
5
+ <p><%= link_to 'Confirm my account', confirmation_url(@resource, confirmation_token: @token) %></p>
@@ -0,0 +1,3 @@
1
+ <p>Hello <%= @resource.email %>!</p>
2
+
3
+ <p>We're contacting you to notify you that your password has been changed.</p>
@@ -0,0 +1,8 @@
1
+ <p>Hello <%= @resource.email %>!</p>
2
+
3
+ <p>Someone has requested a link to change your password. You can do this through the link below.</p>
4
+
5
+ <p><%= link_to 'Change my password', edit_password_url(@resource, reset_password_token: @token) %></p>
6
+
7
+ <p>If you didn't request this, please ignore this email.</p>
8
+ <p>Your password won't change until you access the link above and create a new one.</p>
@@ -0,0 +1,7 @@
1
+ <p>Hello <%= @resource.email %>!</p>
2
+
3
+ <p>Your account has been locked due to an excessive number of unsuccessful sign in attempts.</p>
4
+
5
+ <p>Click the link below to unlock your account:</p>
6
+
7
+ <p><%= link_to 'Unlock my account', unlock_url(@resource, unlock_token: @token) %></p>
@@ -0,0 +1,31 @@
1
+ <div class="row">
2
+ <div class="login">
3
+
4
+
5
+ <%= simple_form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f| %>
6
+
7
+ <div class="col-sm-12">
8
+
9
+ <%= f.error_notification %>
10
+ <h2>Change your password</h2>
11
+
12
+ <%= f.input :reset_password_token, as: :hidden %>
13
+ <%= f.full_error :reset_password_token %>
14
+
15
+ <div class="form-inputs">
16
+ <%= f.input :password, label: "New password", required: true, autofocus: true, hint: ("#{@minimum_password_length} characters minimum" if @minimum_password_length) %>
17
+ <%= f.input :password_confirmation, label: "Confirm your new password", required: true %>
18
+ </div>
19
+
20
+ <div class="update-form--button form-actions">
21
+ <%= f.button :submit, "Change my password" %>
22
+ </div>
23
+ </div>
24
+ <% end %>
25
+
26
+ <div class="col-sm-12">
27
+ <%= render "users/shared/links" %>
28
+ </div>
29
+
30
+ </div>
31
+ </div>
@@ -0,0 +1,28 @@
1
+ <div class="row">
2
+ <div class="login">
3
+
4
+ <%= simple_form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f| %>
5
+
6
+ <div class="col-sm-12">
7
+
8
+ <h2>Forgot your password?</h2>
9
+
10
+ <%= f.error_notification %>
11
+
12
+ <div class="form-inputs">
13
+ <%= f.input :email, required: true, autofocus: true %>
14
+ </div>
15
+
16
+ <div class="update-form--button form-actions">
17
+ <%= f.button :submit, "Send me reset password instructions" %>
18
+ </div>
19
+ </div>
20
+
21
+ <% end %>
22
+
23
+ <div class="col-sm-12">
24
+ <%= render "users/shared/links" %>
25
+ </div>
26
+
27
+ </div>
28
+ </div>
@@ -0,0 +1,27 @@
1
+ <h2>Edit <%= resource_name.to_s.humanize %></h2>
2
+
3
+ <%= simple_form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f| %>
4
+ <%= f.error_notification %>
5
+
6
+ <div class="form-inputs">
7
+ <%= f.input :email, required: true, autofocus: true %>
8
+
9
+ <% if devise_mapping.confirmable? && resource.pending_reconfirmation? %>
10
+ <p>Currently waiting confirmation for: <%= resource.unconfirmed_email %></p>
11
+ <% end %>
12
+
13
+ <%= f.input :password, autocomplete: "off", hint: "leave it blank if you don't want to change it", required: false %>
14
+ <%= f.input :password_confirmation, required: false %>
15
+ <%= f.input :current_password, hint: "we need your current password to confirm your changes", required: true %>
16
+ </div>
17
+
18
+ <div class="form-actions">
19
+ <%= f.button :submit, "Update" %>
20
+ </div>
21
+ <% end %>
22
+
23
+ <h3>Cancel my account</h3>
24
+
25
+ <p>Unhappy? <%= link_to "Cancel my account", registration_path(resource_name), data: { confirm: "Are you sure?" }, method: :delete %></p>
26
+
27
+ <%= link_to "Back", :back %>
@@ -0,0 +1,17 @@
1
+ <h2>Sign up</h2>
2
+
3
+ <%= simple_form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %>
4
+ <%= f.error_notification %>
5
+
6
+ <div class="form-inputs">
7
+ <%= f.input :email, required: true, autofocus: true %>
8
+ <%= f.input :password, required: true, hint: ("#{@minimum_password_length} characters minimum" if @minimum_password_length) %>
9
+ <%= f.input :password_confirmation, required: true %>
10
+ </div>
11
+
12
+ <div class="form-actions">
13
+ <%= f.button :submit, "Sign up" %>
14
+ </div>
15
+ <% end %>
16
+
17
+ <%= render "users/shared/links" %>
@@ -0,0 +1,27 @@
1
+ <div class="row">
2
+ <div class="login">
3
+
4
+ <%= simple_form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %>
5
+
6
+ <div class="col-sm-12">
7
+ <h2>Log in</h2>
8
+
9
+ <div class="form-inputs">
10
+ <%= f.input :email, required: false, autofocus: true %>
11
+ <%= f.input :password, required: false %>
12
+ <%= f.input :remember_me, as: :boolean if devise_mapping.rememberable? %>
13
+ </div>
14
+
15
+ <div class="update-form--button form-actions">
16
+ <%= f.button :submit, "Log in" %>
17
+ </div>
18
+ <% end %>
19
+
20
+ </div>
21
+
22
+ <div class="col-sm-12">
23
+ <%= render "users/shared/links" %>
24
+ </div>
25
+
26
+ </div>
27
+ </div>
@@ -0,0 +1,25 @@
1
+ <%- if controller_name != 'sessions' %>
2
+ <%= link_to "Log in", new_session_path(resource_name) %><br />
3
+ <% end -%>
4
+
5
+ <%# if devise_mapping.registerable? && controller_name != 'registrations' %>
6
+ <%# link_to "Signasdfasdfsadfsdf up", new_registration_path(resource_name) %><!-- <br /> -->
7
+ <%# end -%>
8
+
9
+ <%- if devise_mapping.recoverable? && controller_name != 'passwords' && controller_name != 'registrations' %>
10
+ <%= link_to "Forgot your password?", new_password_path(resource_name) %><br />
11
+ <% end -%>
12
+
13
+ <%- if devise_mapping.confirmable? && controller_name != 'confirmations' %>
14
+ <%= link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name) %><br />
15
+ <% end -%>
16
+
17
+ <%- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' %>
18
+ <%= link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name) %><br />
19
+ <% end -%>
20
+
21
+ <%- if devise_mapping.omniauthable? %>
22
+ <%- resource_class.omniauth_providers.each do |provider| %>
23
+ <%= link_to "Sign in with #{OmniAuth::Utils.camelize(provider)}", omniauth_authorize_path(resource_name, provider) %><br />
24
+ <% end -%>
25
+ <% end -%>
@@ -0,0 +1,16 @@
1
+ <h2>Resend unlock instructions</h2>
2
+
3
+ <%= simple_form_for(resource, as: resource_name, url: unlock_path(resource_name), html: { method: :post }) do |f| %>
4
+ <%= f.error_notification %>
5
+ <%= f.full_error :unlock_token %>
6
+
7
+ <div class="form-inputs">
8
+ <%= f.input :email, required: true, autofocus: true %>
9
+ </div>
10
+
11
+ <div class="form-actions">
12
+ <%= f.button :submit, "Resend unlock instructions" %>
13
+ </div>
14
+ <% end %>
15
+
16
+ <%= render "users/shared/links" %>
@@ -0,0 +1,3 @@
1
+ # Make fonts available to pipeline
2
+ Rails.application.config.assets.paths << Rails.root.join("vendor", "assets", "fonts")
3
+ Rails.application.config.assets.precompile << /\.(?:svg|eot|woff|ttf)\z/
@@ -0,0 +1,278 @@
1
+ # Use this hook to configure devise mailer, warden hooks and so forth.
2
+ # Many of these configuration options can be set straight in your model.
3
+ Devise.setup do |config|
4
+
5
+ # https://github.com/plataformatec/devise/wiki/How-To:-Use-devise-inside-a-mountable-engine
6
+ # You probably want Devise's controllers to inherit from
7
+ # your engine's controller and not the main controller.
8
+ # Set this in config/initializers/devise.rb:
9
+ config.parent_controller = 'Binda::ApplicationController'
10
+
11
+
12
+ # The secret key used by Devise. Devise uses this key to generate
13
+ # random tokens. Changing this key will render invalid all existing
14
+ # confirmation, reset password and unlock tokens in the database.
15
+ # Devise will use the `secret_key_base` as its `secret_key`
16
+ # by default. You can change it below and use your own secret key.
17
+ # config.secret_key = '477d441c458294ec4cef0652a0e96f1c5587593a3897c5459a43ccf8c7cc0f0e44003d17f7e5019ffa651806d22c24fb568096b56824f07df1dcad0ecd81bc2b'
18
+
19
+ # ==> Mailer Configuration
20
+ # Configure the e-mail address which will be shown in Devise::Mailer,
21
+ # note that it will be overwritten if you use your own mailer class
22
+ # with default "from" parameter.
23
+ # config.mailer_sender = 'please-change-me-at-config-initializers-devise@example.com'
24
+
25
+ # Configure the class responsible to send e-mails.
26
+ # config.mailer = 'Devise::Mailer'
27
+
28
+ # Configure the parent class responsible to send e-mails.
29
+ # config.parent_mailer = 'ActionMailer::Base'
30
+
31
+ # ==> ORM configuration
32
+ # Load and configure the ORM. Supports :active_record (default) and
33
+ # :mongoid (bson_ext recommended) by default. Other ORMs may be
34
+ # available as additional gems.
35
+ require 'devise/orm/active_record'
36
+
37
+ # ==> Configuration for any authentication mechanism
38
+ # Configure which keys are used when authenticating a user. The default is
39
+ # just :email. You can configure it to use [:username, :subdomain], so for
40
+ # authenticating a user, both parameters are required. Remember that those
41
+ # parameters are used only when authenticating and not when retrieving from
42
+ # session. If you need permissions, you should implement that in a before filter.
43
+ # You can also supply a hash where the value is a boolean determining whether
44
+ # or not authentication should be aborted when the value is not present.
45
+ # config.authentication_keys = [:email]
46
+
47
+ # Configure parameters from the request object used for authentication. Each entry
48
+ # given should be a request method and it will automatically be passed to the
49
+ # find_for_authentication method and considered in your model lookup. For instance,
50
+ # if you set :request_keys to [:subdomain], :subdomain will be used on authentication.
51
+ # The same considerations mentioned for authentication_keys also apply to request_keys.
52
+ # config.request_keys = []
53
+
54
+ # Configure which authentication keys should be case-insensitive.
55
+ # These keys will be downcased upon creating or modifying a user and when used
56
+ # to authenticate or find a user. Default is :email.
57
+ config.case_insensitive_keys = [:email]
58
+
59
+ # Configure which authentication keys should have whitespace stripped.
60
+ # These keys will have whitespace before and after removed upon creating or
61
+ # modifying a user and when used to authenticate or find a user. Default is :email.
62
+ config.strip_whitespace_keys = [:email]
63
+
64
+ # Tell if authentication through request.params is enabled. True by default.
65
+ # It can be set to an array that will enable params authentication only for the
66
+ # given strategies, for example, `config.params_authenticatable = [:database]` will
67
+ # enable it only for database (email + password) authentication.
68
+ # config.params_authenticatable = true
69
+
70
+ # Tell if authentication through HTTP Auth is enabled. False by default.
71
+ # It can be set to an array that will enable http authentication only for the
72
+ # given strategies, for example, `config.http_authenticatable = [:database]` will
73
+ # enable it only for database authentication. The supported strategies are:
74
+ # :database = Support basic authentication with authentication key + password
75
+ # config.http_authenticatable = false
76
+
77
+ # If 401 status code should be returned for AJAX requests. True by default.
78
+ # config.http_authenticatable_on_xhr = true
79
+
80
+ # The realm used in Http Basic Authentication. 'Application' by default.
81
+ # config.http_authentication_realm = 'Application'
82
+
83
+ # It will change confirmation, password recovery and other workflows
84
+ # to behave the same regardless if the e-mail provided was right or wrong.
85
+ # Does not affect registerable.
86
+ # config.paranoid = true
87
+
88
+ # By default Devise will store the user in session. You can skip storage for
89
+ # particular strategies by setting this option.
90
+ # Notice that if you are skipping storage for all authentication paths, you
91
+ # may want to disable generating routes to Devise's sessions controller by
92
+ # passing skip: :sessions to `devise_for` in your config/routes.rb
93
+ config.skip_session_storage = [:http_auth]
94
+
95
+ # By default, Devise cleans up the CSRF token on authentication to
96
+ # avoid CSRF token fixation attacks. This means that, when using AJAX
97
+ # requests for sign in and sign up, you need to get a new CSRF token
98
+ # from the server. You can disable this option at your own risk.
99
+ # config.clean_up_csrf_token_on_authentication = true
100
+
101
+ # ==> Configuration for :database_authenticatable
102
+ # For bcrypt, this is the cost for hashing the password and defaults to 11. If
103
+ # using other algorithms, it sets how many times you want the password to be hashed.
104
+ #
105
+ # Limiting the stretches to just one in testing will increase the performance of
106
+ # your test suite dramatically. However, it is STRONGLY RECOMMENDED to not use
107
+ # a value less than 10 in other environments. Note that, for bcrypt (the default
108
+ # algorithm), the cost increases exponentially with the number of stretches (e.g.
109
+ # a value of 20 is already extremely slow: approx. 60 seconds for 1 calculation).
110
+ config.stretches = Rails.env.test? ? 1 : 11
111
+
112
+ # Set up a pepper to generate the hashed password.
113
+ # config.pepper = '3ae686c27e0413bd5b0a863730f082714caff4c040d987fd64367f0041e7e99f221a583cd3b0eaeb85408ce97d56ea59c00907a61b69988148f83d30f7ff92c3'
114
+
115
+ # Send a notification email when the user's password is changed
116
+ # config.send_password_change_notification = false
117
+
118
+ # ==> Configuration for :confirmable
119
+ # A period that the user is allowed to access the website even without
120
+ # confirming their account. For instance, if set to 2.days, the user will be
121
+ # able to access the website for two days without confirming their account,
122
+ # access will be blocked just in the third day. Default is 0.days, meaning
123
+ # the user cannot access the website without confirming their account.
124
+ # config.allow_unconfirmed_access_for = 2.days
125
+
126
+ # A period that the user is allowed to confirm their account before their
127
+ # token becomes invalid. For example, if set to 3.days, the user can confirm
128
+ # their account within 3 days after the mail was sent, but on the fourth day
129
+ # their account can't be confirmed with the token any more.
130
+ # Default is nil, meaning there is no restriction on how long a user can take
131
+ # before confirming their account.
132
+ # config.confirm_within = 3.days
133
+
134
+ # If true, requires any email changes to be confirmed (exactly the same way as
135
+ # initial account confirmation) to be applied. Requires additional unconfirmed_email
136
+ # db field (see migrations). Until confirmed, new email is stored in
137
+ # unconfirmed_email column, and copied to email column on successful confirmation.
138
+ config.reconfirmable = true
139
+
140
+ # Defines which key will be used when confirming an account
141
+ # config.confirmation_keys = [:email]
142
+
143
+ # ==> Configuration for :rememberable
144
+ # The time the user will be remembered without asking for credentials again.
145
+ # config.remember_for = 2.weeks
146
+
147
+ # Invalidates all the remember me tokens when the user signs out.
148
+ config.expire_all_remember_me_on_sign_out = true
149
+
150
+ # If true, extends the user's remember period when remembered via cookie.
151
+ # config.extend_remember_period = false
152
+
153
+ # Options to be passed to the created cookie. For instance, you can set
154
+ # secure: true in order to force SSL only cookies.
155
+ # config.rememberable_options = {}
156
+
157
+ # ==> Configuration for :validatable
158
+ # Range for password length.
159
+ config.password_length = 6..128
160
+
161
+ # Email regex used to validate email formats. It simply asserts that
162
+ # one (and only one) @ exists in the given string. This is mainly
163
+ # to give user feedback and not to assert the e-mail validity.
164
+ config.email_regexp = /\A[^@\s]+@[^@\s]+\z/
165
+
166
+ # ==> Configuration for :timeoutable
167
+ # The time you want to timeout the user session without activity. After this
168
+ # time the user will be asked for credentials again. Default is 30 minutes.
169
+ # config.timeout_in = 30.minutes
170
+
171
+ # ==> Configuration for :lockable
172
+ # Defines which strategy will be used to lock an account.
173
+ # :failed_attempts = Locks an account after a number of failed attempts to sign in.
174
+ # :none = No lock strategy. You should handle locking by yourself.
175
+ # config.lock_strategy = :failed_attempts
176
+
177
+ # Defines which key will be used when locking and unlocking an account
178
+ # config.unlock_keys = [:email]
179
+
180
+ # Defines which strategy will be used to unlock an account.
181
+ # :email = Sends an unlock link to the user email
182
+ # :time = Re-enables login after a certain amount of time (see :unlock_in below)
183
+ # :both = Enables both strategies
184
+ # :none = No unlock strategy. You should handle unlocking by yourself.
185
+ # config.unlock_strategy = :both
186
+
187
+ # Number of authentication tries before locking an account if lock_strategy
188
+ # is failed attempts.
189
+ # config.maximum_attempts = 20
190
+
191
+ # Time interval to unlock the account if :time is enabled as unlock_strategy.
192
+ # config.unlock_in = 1.hour
193
+
194
+ # Warn on the last attempt before the account is locked.
195
+ # config.last_attempt_warning = true
196
+
197
+ # ==> Configuration for :recoverable
198
+ #
199
+ # Defines which key will be used when recovering the password for an account
200
+ # config.reset_password_keys = [:email]
201
+
202
+ # Time interval you can reset your password with a reset password key.
203
+ # Don't put a too small interval or your users won't have the time to
204
+ # change their passwords.
205
+ config.reset_password_within = 6.hours
206
+
207
+ # When set to false, does not sign a user in automatically after their password is
208
+ # reset. Defaults to true, so a user is signed in automatically after a reset.
209
+ # config.sign_in_after_reset_password = true
210
+
211
+ # ==> Configuration for :encryptable
212
+ # Allow you to use another hashing or encryption algorithm besides bcrypt (default).
213
+ # You can use :sha1, :sha512 or algorithms from others authentication tools as
214
+ # :clearance_sha1, :authlogic_sha512 (then you should set stretches above to 20
215
+ # for default behavior) and :restful_authentication_sha1 (then you should set
216
+ # stretches to 10, and copy REST_AUTH_SITE_KEY to pepper).
217
+ #
218
+ # Require the `devise-encryptable` gem when using anything other than bcrypt
219
+ # config.encryptor = :sha512
220
+
221
+ # ==> Scopes configuration
222
+ # Turn scoped views on. Before rendering "sessions/new", it will first check for
223
+ # "users/sessions/new". It's turned off by default because it's slower if you
224
+ # are using only default views.
225
+ # ============== DON'T CHANGE IT ===============
226
+ config.scoped_views = true
227
+ # ============== =============== ===============
228
+
229
+ # Configure the default scope given to Warden. By default it's the first
230
+ # devise role declared in your routes (usually :user).
231
+ # config.default_scope = :user
232
+
233
+ # Set this configuration to false if you want /users/sign_out to sign out
234
+ # only the current scope. By default, Devise signs out all scopes.
235
+ # config.sign_out_all_scopes = true
236
+
237
+ # ==> Navigation configuration
238
+ # Lists the formats that should be treated as navigational. Formats like
239
+ # :html, should redirect to the sign in page when the user does not have
240
+ # access, but formats like :xml or :json, should return 401.
241
+ #
242
+ # If you have any extra navigational formats, like :iphone or :mobile, you
243
+ # should add them to the navigational formats lists.
244
+ #
245
+ # The "*/*" below is required to match Internet Explorer requests.
246
+ # config.navigational_formats = ['*/*', :html]
247
+
248
+ # The default HTTP method used to sign out a resource. Default is :delete.
249
+ config.sign_out_via = :delete
250
+
251
+ # ==> OmniAuth
252
+ # Add a new OmniAuth provider. Check the wiki for more information on setting
253
+ # up on your models and hooks.
254
+ # config.omniauth :github, 'APP_ID', 'APP_SECRET', scope: 'user,public_repo'
255
+
256
+ # ==> Warden configuration
257
+ # If you want to use other strategies, that are not supported by Devise, or
258
+ # change the failure app, you can configure them inside the config.warden block.
259
+ #
260
+ # config.warden do |manager|
261
+ # manager.intercept_401 = false
262
+ # manager.default_strategies(scope: :user).unshift :some_external_strategy
263
+ # end
264
+
265
+ # ==> Mountable engine configurations
266
+ # When using Devise inside an engine, let's call it `MyEngine`, and this engine
267
+ # is mountable, there are some extra configurations to be taken into account.
268
+ # The following options are available, assuming the engine is mounted as:
269
+ #
270
+ # mount MyEngine, at: '/binda'
271
+ #
272
+ # The router that invoked `devise_for`, in the example above, would be:
273
+ config.router_name = :binda
274
+ #
275
+ # When using OmniAuth, Devise cannot automatically set OmniAuth path,
276
+ # so you need to do it manually. For the users scope, it would be:
277
+ # config.omniauth_path_prefix = '/my_engine/users/auth'
278
+ end