quadro 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (249) hide show
  1. checksums.yaml +15 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.md +194 -0
  4. data/Rakefile +39 -0
  5. data/app/assets/images/quadro/close.png +0 -0
  6. data/app/assets/images/quadro/favicon.ico +0 -0
  7. data/app/assets/images/quadro/loading.gif +0 -0
  8. data/app/assets/images/quadro/missing/cover/large.png +0 -0
  9. data/app/assets/images/quadro/missing/cover/medium.png +0 -0
  10. data/app/assets/images/quadro/missing/cover/small.png +0 -0
  11. data/app/assets/images/quadro/missing/cover/thumb.png +0 -0
  12. data/app/assets/images/quadro/missing/image/large.png +0 -0
  13. data/app/assets/images/quadro/missing/image/medium.png +0 -0
  14. data/app/assets/images/quadro/missing/image/small.png +0 -0
  15. data/app/assets/images/quadro/missing/image/thumb.png +0 -0
  16. data/app/assets/images/quadro/missing/slide/large.png +0 -0
  17. data/app/assets/images/quadro/missing/slide/medium.png +0 -0
  18. data/app/assets/images/quadro/missing/slide/small.png +0 -0
  19. data/app/assets/images/quadro/missing/slide/thumb.png +0 -0
  20. data/app/assets/images/quadro/next.png +0 -0
  21. data/app/assets/images/quadro/prev.png +0 -0
  22. data/app/assets/images/quadro/quadro-logo-mini.png +0 -0
  23. data/app/assets/images/quadro/quadro-logo.png +0 -0
  24. data/app/assets/javascripts/quadro/application.js.coffee +27 -0
  25. data/app/assets/javascripts/quadro/message.js.coffee +6 -0
  26. data/app/assets/javascripts/quadro/plugins/gmaps.min.js +1 -0
  27. data/app/assets/javascripts/quadro/plugins/humane.min.js +11 -0
  28. data/app/assets/javascripts/quadro/plugins/jasny-bootstrap.min.js +6 -0
  29. data/app/assets/javascripts/quadro/plugins/jquery.fs.dropper.min.js +9 -0
  30. data/app/assets/javascripts/quadro/plugins/jquery.show_char_limit.min.js +1 -0
  31. data/app/assets/javascripts/quadro/plugins/jquery.smartmenus.bootstrap.min.js +3 -0
  32. data/app/assets/javascripts/quadro/plugins/jquery.smartmenus.min.js +3 -0
  33. data/app/assets/javascripts/quadro/plugins/lightbox.min.js +13 -0
  34. data/app/assets/javascripts/quadro/plugins/pace.min.js +2 -0
  35. data/app/assets/javascripts/quadro/quadro.js.coffee +43 -0
  36. data/app/assets/javascripts/quadro/site.js.coffee +0 -0
  37. data/app/assets/javascripts/quadro/uploader.js.coffee +17 -0
  38. data/app/assets/javascripts/quadro/widget.js.coffee +80 -0
  39. data/app/assets/stylesheets/bootstrap/_mixins.scss +40 -0
  40. data/app/assets/stylesheets/quadro/application.css.sass +19 -0
  41. data/app/assets/stylesheets/quadro/plugins/humane-libnotify.min.css +1 -0
  42. data/app/assets/stylesheets/quadro/plugins/jasny-bootstrap.min.css +7 -0
  43. data/app/assets/stylesheets/quadro/plugins/jquery.fs.dropper.min.css +9 -0
  44. data/app/assets/stylesheets/quadro/plugins/jquery.smartmenus.bootstrap.min.css +1 -0
  45. data/app/assets/stylesheets/quadro/plugins/lightbox.min.css +1 -0
  46. data/app/assets/stylesheets/quadro/plugins/pace.min.css +1 -0
  47. data/app/assets/stylesheets/quadro/quadro.css.sass +99 -0
  48. data/app/assets/stylesheets/quadro/site.css.sass +0 -0
  49. data/app/controllers/quadro/application_controller.rb +122 -0
  50. data/app/controllers/quadro/assets_controller.rb +21 -0
  51. data/app/controllers/quadro/feeds_controller.rb +6 -0
  52. data/app/controllers/quadro/pages_controller.rb +42 -0
  53. data/app/controllers/quadro/robots_controller.rb +6 -0
  54. data/app/controllers/quadro/users_controller.rb +15 -0
  55. data/app/controllers/quadro/widgets_controller.rb +14 -0
  56. data/app/helpers/quadro/application_helper.rb +4 -0
  57. data/app/helpers/quadro/asset_helper.rb +7 -0
  58. data/app/helpers/quadro/navigation_helper.rb +43 -0
  59. data/app/helpers/quadro/widget_helper.rb +54 -0
  60. data/app/models/quadro/asset.rb +11 -0
  61. data/app/models/quadro/asset/cover.rb +18 -0
  62. data/app/models/quadro/asset/image.rb +18 -0
  63. data/app/models/quadro/asset/slide.rb +18 -0
  64. data/app/models/quadro/interaction.rb +13 -0
  65. data/app/models/quadro/page.rb +88 -0
  66. data/app/models/quadro/user.rb +19 -0
  67. data/app/models/quadro/widget.rb +21 -0
  68. data/app/models/quadro/widget/form.rb +13 -0
  69. data/app/models/quadro/widget/gallery.rb +17 -0
  70. data/app/models/quadro/widget/html.rb +14 -0
  71. data/app/models/quadro/widget/map.rb +13 -0
  72. data/app/models/quadro/widget/slider.rb +17 -0
  73. data/app/views/layouts/quadro/application.html.haml +33 -0
  74. data/app/views/layouts/quadro/devise.html.haml +11 -0
  75. data/app/views/quadro/assets/create.js.erb +11 -0
  76. data/app/views/quadro/assets/destroy.js.erb +11 -0
  77. data/app/views/quadro/assets/edit.js.erb +9 -0
  78. data/app/views/quadro/assets/image/_form.html.haml +25 -0
  79. data/app/views/quadro/assets/image/_image.html.haml +10 -0
  80. data/app/views/quadro/assets/slide/_form.html.haml +26 -0
  81. data/app/views/quadro/assets/slide/_slide.html.haml +9 -0
  82. data/app/views/quadro/assets/update.js.erb +18 -0
  83. data/app/views/quadro/feeds/atom.xml.builder +27 -0
  84. data/app/views/quadro/feeds/rss.xml.builder +25 -0
  85. data/app/views/quadro/interactions/_interaction.html.haml +22 -0
  86. data/app/views/quadro/pages/_edit.html.haml +35 -0
  87. data/app/views/quadro/pages/_new.html.haml +11 -0
  88. data/app/views/quadro/pages/_page.html.haml +1 -0
  89. data/app/views/quadro/pages/create.js.erb +7 -0
  90. data/app/views/quadro/pages/destroy.js.erb +5 -0
  91. data/app/views/quadro/pages/edit.js.erb +4 -0
  92. data/app/views/quadro/pages/form.js.erb +6 -0
  93. data/app/views/quadro/pages/index.html.haml +1 -0
  94. data/app/views/quadro/pages/new.js.erb +2 -0
  95. data/app/views/quadro/pages/show.html.haml +1 -0
  96. data/app/views/quadro/pages/update.js.erb +7 -0
  97. data/app/views/quadro/robots/index.text.erb +4 -0
  98. data/app/views/quadro/shared/_modal.html.haml +3 -0
  99. data/app/views/quadro/shared/_navigation.html.haml +17 -0
  100. data/app/views/quadro/shared/_toolbar.html.haml +55 -0
  101. data/app/views/quadro/shared/templates/_blank.html.haml +11 -0
  102. data/app/views/quadro/shared/templates/_demo.html.haml +22 -0
  103. data/app/views/quadro/shared/templates/_jumbotron.html.haml +10 -0
  104. data/app/views/quadro/shared/templates/_sidebar.html.haml +15 -0
  105. data/app/views/quadro/shared/templates/page/_list.html.haml +9 -0
  106. data/app/views/quadro/shared/templates/page/_thumbnail.html.haml +9 -0
  107. data/app/views/quadro/users/_edit.html.haml +15 -0
  108. data/app/views/quadro/users/edit.js.erb +2 -0
  109. data/app/views/quadro/users/update.js.erb +7 -0
  110. data/app/views/quadro/widgets/edit.js.erb +0 -0
  111. data/app/views/quadro/widgets/form/_empty.html.haml +4 -0
  112. data/app/views/quadro/widgets/form/_fields.html.haml +1 -0
  113. data/app/views/quadro/widgets/form/_form.html.haml +0 -0
  114. data/app/views/quadro/widgets/form/_signed_off.html.haml +6 -0
  115. data/app/views/quadro/widgets/form/_signed_on.html.haml +14 -0
  116. data/app/views/quadro/widgets/form/_toolbar.html.haml +7 -0
  117. data/app/views/quadro/widgets/form/_widget.html.haml +1 -0
  118. data/app/views/quadro/widgets/gallery/_empty.html.haml +20 -0
  119. data/app/views/quadro/widgets/gallery/_form.html.haml +0 -0
  120. data/app/views/quadro/widgets/gallery/_signed_off.html.haml +6 -0
  121. data/app/views/quadro/widgets/gallery/_signed_on.html.haml +10 -0
  122. data/app/views/quadro/widgets/gallery/_toolbar.html.haml +7 -0
  123. data/app/views/quadro/widgets/gallery/_uploader.html.haml +5 -0
  124. data/app/views/quadro/widgets/gallery/_widget.html.haml +6 -0
  125. data/app/views/quadro/widgets/html/_empty.html.haml +2 -0
  126. data/app/views/quadro/widgets/html/_form.html.haml +0 -0
  127. data/app/views/quadro/widgets/html/_signed_off.html.haml +6 -0
  128. data/app/views/quadro/widgets/html/_signed_on.html.haml +9 -0
  129. data/app/views/quadro/widgets/html/_toolbar.html.haml +7 -0
  130. data/app/views/quadro/widgets/html/_widget.html.haml +1 -0
  131. data/app/views/quadro/widgets/map/_empty.html.haml +18 -0
  132. data/app/views/quadro/widgets/map/_form.html.haml +0 -0
  133. data/app/views/quadro/widgets/map/_signed_off.html.haml +4 -0
  134. data/app/views/quadro/widgets/map/_signed_on.html.haml +6 -0
  135. data/app/views/quadro/widgets/map/_toolbar.html.haml +7 -0
  136. data/app/views/quadro/widgets/map/_widget.html.haml +45 -0
  137. data/app/views/quadro/widgets/slider/_empty.html.haml +7 -0
  138. data/app/views/quadro/widgets/slider/_form.html.haml +0 -0
  139. data/app/views/quadro/widgets/slider/_signed_off.html.haml +6 -0
  140. data/app/views/quadro/widgets/slider/_signed_on.html.haml +10 -0
  141. data/app/views/quadro/widgets/slider/_toolbar.html.haml +7 -0
  142. data/app/views/quadro/widgets/slider/_uploader.html.haml +5 -0
  143. data/app/views/quadro/widgets/slider/_widget.html.haml +4 -0
  144. data/app/views/quadro/widgets/update.js.erb +0 -0
  145. data/app/views/users/mailer/reset_password_instructions.html.haml +6 -0
  146. data/app/views/users/mailer/unlock_instructions.html.haml +5 -0
  147. data/app/views/users/passwords/edit.html.haml +15 -0
  148. data/app/views/users/passwords/new.html.haml +13 -0
  149. data/app/views/users/sessions/new.html.haml +15 -0
  150. data/app/views/users/shared/_links.html.haml +19 -0
  151. data/app/views/users/unlocks/new.html.haml +13 -0
  152. data/config/initializers/crummy.rb +5 -0
  153. data/config/initializers/devise.rb +261 -0
  154. data/config/initializers/gravatar_image_tag.rb +7 -0
  155. data/config/initializers/kaminari_config.rb +10 -0
  156. data/config/initializers/simple_form.rb +142 -0
  157. data/config/initializers/simple_form_bootstrap.rb +79 -0
  158. data/config/initializers/sitemap.rb +9 -0
  159. data/config/locales/devise.en.yml +60 -0
  160. data/config/locales/kaminari.en.yml +17 -0
  161. data/config/locales/quadro.en.yml +5 -0
  162. data/config/locales/simple_form.en.yml +26 -0
  163. data/config/routes.rb +25 -0
  164. data/db/migrate/20141122163450_create_quadro_widgets.rb +19 -0
  165. data/db/migrate/20141129022344_create_quadro_pages.rb +20 -0
  166. data/db/migrate/20141206085127_create_quadro_assets.rb +16 -0
  167. data/db/migrate/20141207202401_devise_create_quadro_users.rb +28 -0
  168. data/db/migrate/20160606213156_create_quadro_interactions.rb +11 -0
  169. data/lib/generators/quadro/install/USAGE +8 -0
  170. data/lib/generators/quadro/install/install_generator.rb +35 -0
  171. data/lib/generators/quadro/install/templates/app/assets/images/quadro/favicon.ico +0 -0
  172. data/lib/generators/quadro/install/templates/app/assets/images/quadro/quadro-logo-mini.png +0 -0
  173. data/lib/generators/quadro/install/templates/app/assets/images/quadro/quadro-logo.png +0 -0
  174. data/lib/generators/quadro/install/templates/app/assets/javascripts/quadro/site.js.coffee +0 -0
  175. data/lib/generators/quadro/install/templates/app/assets/stylesheets/quadro/site.css.sass +0 -0
  176. data/lib/generators/quadro/install/templates/app/views/quadro/shared/_navigation.html.haml +17 -0
  177. data/lib/generators/quadro/install/templates/app/views/quadro/shared/templates/_blank.html.haml +11 -0
  178. data/lib/generators/quadro/install/templates/app/views/quadro/shared/templates/_demo.html.haml +22 -0
  179. data/lib/generators/quadro/install/templates/app/views/quadro/shared/templates/_jumbotron.html.haml +10 -0
  180. data/lib/generators/quadro/install/templates/app/views/quadro/shared/templates/_sidebar.html.haml +15 -0
  181. data/lib/generators/quadro/install/templates/app/views/quadro/shared/templates/page/_list.html.haml +9 -0
  182. data/lib/generators/quadro/install/templates/app/views/quadro/shared/templates/page/_thumbnail.html.haml +9 -0
  183. data/lib/generators/quadro/install/templates/config/initializers/quadro.rb +12 -0
  184. data/lib/generators/quadro/install/templates/db/GeoLite2-Country.mmdb +0 -0
  185. data/lib/generators/quadro/install/templates/public/404.html +37 -0
  186. data/lib/generators/quadro/install/templates/public/422.html +37 -0
  187. data/lib/generators/quadro/install/templates/public/500.html +37 -0
  188. data/lib/generators/quadro/install/templates/public/maintenance.html +37 -0
  189. data/lib/quadro.rb +16 -0
  190. data/lib/quadro/engine.rb +44 -0
  191. data/lib/quadro/loader.rb +30 -0
  192. data/lib/quadro/signature.rb +3 -0
  193. data/lib/quadro/version.rb +3 -0
  194. data/lib/tasks/quadro_tasks.rake +15 -0
  195. data/test/dummy/README.rdoc +261 -0
  196. data/test/dummy/Rakefile +7 -0
  197. data/test/dummy/app/assets/images/quadro/favicon.ico +0 -0
  198. data/test/dummy/app/assets/images/quadro/quadro-logo-mini.png +0 -0
  199. data/test/dummy/app/assets/images/quadro/quadro-logo.png +0 -0
  200. data/test/dummy/app/assets/javascripts/application.js +15 -0
  201. data/test/dummy/app/assets/javascripts/quadro/site.js.coffee +0 -0
  202. data/test/dummy/app/assets/stylesheets/application.css +13 -0
  203. data/test/dummy/app/assets/stylesheets/quadro/site.css.sass +0 -0
  204. data/test/dummy/app/controllers/application_controller.rb +3 -0
  205. data/test/dummy/app/helpers/application_helper.rb +2 -0
  206. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  207. data/test/dummy/app/views/quadro/shared/_navigation.html.haml +17 -0
  208. data/test/dummy/app/views/quadro/shared/templates/_blank.html.haml +11 -0
  209. data/test/dummy/app/views/quadro/shared/templates/_demo.html.haml +22 -0
  210. data/test/dummy/app/views/quadro/shared/templates/_jumbotron.html.haml +10 -0
  211. data/test/dummy/app/views/quadro/shared/templates/_sidebar.html.haml +15 -0
  212. data/test/dummy/app/views/quadro/shared/templates/page/_list.html.haml +9 -0
  213. data/test/dummy/app/views/quadro/shared/templates/page/_thumbnail.html.haml +9 -0
  214. data/test/dummy/config.ru +4 -0
  215. data/test/dummy/config/application.rb +59 -0
  216. data/test/dummy/config/boot.rb +10 -0
  217. data/test/dummy/config/database.yml +25 -0
  218. data/test/dummy/config/environment.rb +5 -0
  219. data/test/dummy/config/environments/development.rb +37 -0
  220. data/test/dummy/config/environments/production.rb +67 -0
  221. data/test/dummy/config/environments/test.rb +37 -0
  222. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  223. data/test/dummy/config/initializers/inflections.rb +15 -0
  224. data/test/dummy/config/initializers/mime_types.rb +5 -0
  225. data/test/dummy/config/initializers/quadro.rb +12 -0
  226. data/test/dummy/config/initializers/secret_token.rb +7 -0
  227. data/test/dummy/config/initializers/session_store.rb +8 -0
  228. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  229. data/test/dummy/config/locales/en.yml +5 -0
  230. data/test/dummy/config/routes.rb +3 -0
  231. data/test/dummy/db/GeoLite2-Country.mmdb +0 -0
  232. data/test/dummy/db/migrate/20160615055717_create_quadro_widgets.quadro.rb +20 -0
  233. data/test/dummy/db/migrate/20160615055718_create_quadro_pages.quadro.rb +21 -0
  234. data/test/dummy/db/migrate/20160615055719_create_quadro_assets.quadro.rb +17 -0
  235. data/test/dummy/db/migrate/20160615055720_devise_create_quadro_users.quadro.rb +29 -0
  236. data/test/dummy/db/migrate/20160615055721_create_quadro_interactions.quadro.rb +12 -0
  237. data/test/dummy/db/schema.rb +105 -0
  238. data/test/dummy/db/test.sqlite3 +0 -0
  239. data/test/dummy/log/development.log +0 -0
  240. data/test/dummy/log/test.log +3 -0
  241. data/test/dummy/public/404.html +37 -0
  242. data/test/dummy/public/422.html +37 -0
  243. data/test/dummy/public/500.html +37 -0
  244. data/test/dummy/public/maintenance.html +37 -0
  245. data/test/dummy/script/rails +6 -0
  246. data/test/integration/navigation_test.rb +10 -0
  247. data/test/quadro_test.rb +7 -0
  248. data/test/test_helper.rb +18 -0
  249. metadata +806 -0
@@ -0,0 +1,79 @@
1
+ # http://stackoverflow.com/questions/14972253/simpleform-default-input-class
2
+ # https://github.com/plataformatec/simple_form/issues/316
3
+
4
+ inputs = %w[
5
+ CollectionSelectInput
6
+ DateTimeInput
7
+ FileInput
8
+ GroupedCollectionSelectInput
9
+ NumericInput
10
+ PasswordInput
11
+ RangeInput
12
+ StringInput
13
+ TextInput
14
+ ]
15
+
16
+ inputs.each do |input_type|
17
+ superclass = "SimpleForm::Inputs::#{input_type}".constantize
18
+
19
+ new_class = Class.new(superclass) do
20
+ def input_html_classes
21
+ super.push('form-control')
22
+ end
23
+ end
24
+
25
+ Object.const_set(input_type, new_class)
26
+ end
27
+
28
+ # Use this setup block to configure all options available in SimpleForm.
29
+ SimpleForm.setup do |config|
30
+ config.boolean_style = :nested
31
+
32
+ config.wrappers :bootstrap, tag: 'div', class: 'form-group', error_class: 'has-error',
33
+ defaults: { input_html: { class: 'default_class' } } do |b|
34
+
35
+ b.use :html5
36
+ b.use :min_max
37
+ b.use :maxlength
38
+ b.use :placeholder
39
+
40
+ b.optional :pattern
41
+ b.optional :readonly
42
+
43
+ b.use :label_input
44
+ b.use :hint, wrap_with: { tag: 'span', class: 'help-block' }
45
+ b.use :error, wrap_with: { tag: 'span', class: 'help-block has-error' }
46
+ end
47
+
48
+ config.wrappers :prepend, tag: 'div', class: 'form-group', error_class: 'has-error' do |b|
49
+ b.use :html5
50
+ b.use :placeholder
51
+ b.use :label
52
+ b.wrapper tag: 'div', class: 'controls' do |input|
53
+ input.wrapper tag: 'div', class: 'input-prepend' do |prepend|
54
+ prepend.use :input
55
+ end
56
+ input.use :hint, wrap_with: { tag: 'span', class: 'help-block' }
57
+ input.use :error, wrap_with: { tag: 'span', class: 'help-block has-error' }
58
+ end
59
+ end
60
+
61
+ config.wrappers :append, tag: 'div', class: 'form-group', error_class: 'has-error' do |b|
62
+ b.use :html5
63
+ b.use :placeholder
64
+ b.use :label
65
+ b.wrapper tag: 'div', class: 'controls' do |input|
66
+ input.wrapper tag: 'div', class: 'input-append' do |append|
67
+ append.use :input
68
+ end
69
+ input.use :hint, wrap_with: { tag: 'span', class: 'help-block' }
70
+ input.use :error, wrap_with: { tag: 'span', class: 'help-block has-error' }
71
+ end
72
+ end
73
+
74
+ # Wrappers for forms and inputs using the Twitter Bootstrap toolkit.
75
+ # Check the Bootstrap docs (http://getbootstrap.com/)
76
+ # to learn about the different styles for forms and inputs,
77
+ # buttons and other elements.
78
+ config.default_wrapper = :bootstrap
79
+ end
@@ -0,0 +1,9 @@
1
+ DynamicSitemaps::Sitemap.draw do
2
+ root = Quadro::Page.roots.first
3
+
4
+ url Quadro.railtie_routes_url_helpers.root_url, last_mod: root.updated_at, change_freq: root.frequency, priority: root.priority
5
+
6
+ root.children.find_each do |page|
7
+ url Quadro.railtie_routes_url_helpers.page_url(page), last_mod: page.updated_at, change_freq: page.frequency, priority: page.priority
8
+ end
9
+ end
@@ -0,0 +1,60 @@
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
+ omniauth_callbacks:
27
+ failure: "Could not authenticate you from %{kind} because \"%{reason}\"."
28
+ success: "Successfully authenticated from %{kind} account."
29
+ passwords:
30
+ 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."
31
+ send_instructions: "You will receive an email with instructions on how to reset your password in a few minutes."
32
+ 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."
33
+ updated: "Your password has been changed successfully. You are now signed in."
34
+ updated_not_active: "Your password has been changed successfully."
35
+ registrations:
36
+ destroyed: "Bye! Your account has been successfully cancelled. We hope to see you again soon."
37
+ signed_up: "Welcome! You have signed up successfully."
38
+ signed_up_but_inactive: "You have signed up successfully. However, we could not sign you in because your account is not yet activated."
39
+ signed_up_but_locked: "You have signed up successfully. However, we could not sign you in because your account is locked."
40
+ 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."
41
+ 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."
42
+ updated: "Your account has been updated successfully."
43
+ sessions:
44
+ signed_in: "Signed in successfully."
45
+ signed_out: "Signed out successfully."
46
+ already_signed_out: "Signed out successfully."
47
+ unlocks:
48
+ send_instructions: "You will receive an email with instructions for how to unlock your account in a few minutes."
49
+ send_paranoid_instructions: "If your account exists, you will receive an email with instructions for how to unlock it in a few minutes."
50
+ unlocked: "Your account has been unlocked successfully. Please sign in to continue."
51
+ errors:
52
+ messages:
53
+ already_confirmed: "was already confirmed, please try signing in"
54
+ confirmation_period_expired: "needs to be confirmed within %{period}, please request a new one"
55
+ expired: "has expired, please request a new one"
56
+ not_found: "not found"
57
+ not_locked: "was not locked"
58
+ not_saved:
59
+ one: "1 error prohibited this %{resource} from being saved:"
60
+ other: "%{count} errors prohibited this %{resource} from being saved:"
@@ -0,0 +1,17 @@
1
+ en:
2
+ views:
3
+ pagination:
4
+ first: "« First"
5
+ last: "Last »"
6
+ previous: "‹ Prev"
7
+ next: "Next ›"
8
+ truncate: "…"
9
+ helpers:
10
+ page_entries_info:
11
+ one_page:
12
+ display_entries:
13
+ zero: "No %{entry_name} found"
14
+ one: "Displaying <b>1</b> %{entry_name}"
15
+ other: "Displaying <b>all %{count}</b> %{entry_name}"
16
+ more_pages:
17
+ display_entries: "Displaying %{entry_name} <b>%{first}&nbsp;-&nbsp;%{last}</b> of <b>%{total}</b> in total"
@@ -0,0 +1,5 @@
1
+ en:
2
+ time:
3
+ formats:
4
+ atom: "%FT%TZ"
5
+ rss: "%a, %d %b %Y %H:%M:%S %z"
@@ -0,0 +1,26 @@
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
+ # Labels and hints 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
+
data/config/routes.rb ADDED
@@ -0,0 +1,25 @@
1
+ Quadro::Engine.routes.draw do
2
+ default_url_options host: Quadro.config.host
3
+
4
+ devise_for :users, class_name: 'Quadro::User', module: :devise, path: 'auth'
5
+
6
+ resource :user, only: [:edit, :update]
7
+
8
+ match 'atom.xml', to: 'feeds#atom', as: 'atom', format: 'xml'
9
+ match 'rss.xml', to: 'feeds#rss', as: 'rss', format: 'xml'
10
+ match 'sitemap.xml', to: 'sitemaps#sitemap', as: 'sitemap', format: 'xml'
11
+ match 'robots.txt', to: 'robots#index', as: 'robots', format: 'txt'
12
+
13
+ resources :pages, path: '/' do
14
+ member do
15
+ post :form
16
+ end
17
+ get 'page/:page', action: :index, on: :collection
18
+ resources :widgets, only: [:edit, :update] do
19
+ resources :assets, only: [:create, :edit, :update, :destroy]
20
+ end
21
+ resources :assets, only: [:create, :edit, :update, :destroy]
22
+ end
23
+
24
+ root :to => 'pages#index'
25
+ end
@@ -0,0 +1,19 @@
1
+ class CreateQuadroWidgets < ActiveRecord::Migration
2
+ def change
3
+ create_table :quadro_widgets do |t|
4
+ t.references :page
5
+ t.string :type
6
+ t.string :name
7
+ t.text :content
8
+ t.text :settings
9
+ t.timestamp :deleted_at
10
+ t.timestamps
11
+ end
12
+
13
+ add_index :quadro_widgets, [:page_id, :name], unique: true
14
+ add_index :quadro_widgets, :name
15
+ add_index :quadro_widgets, :page_id
16
+ add_index :quadro_widgets, :type
17
+ add_index :quadro_widgets, :deleted_at
18
+ end
19
+ end
@@ -0,0 +1,20 @@
1
+ class CreateQuadroPages < ActiveRecord::Migration
2
+ def change
3
+ create_table :quadro_pages do |t|
4
+ t.references :author
5
+ t.string :title
6
+ t.string :slug
7
+ t.string :summary
8
+ t.string :ancestry
9
+ t.integer :ancestry_depth, default: 0
10
+ t.text :settings
11
+ t.timestamp :deleted_at
12
+ t.timestamps
13
+ end
14
+
15
+ add_index :quadro_pages, :slug, unique: true
16
+ add_index :quadro_pages, :ancestry
17
+ add_index :quadro_pages, :deleted_at
18
+ add_index :quadro_pages, :author_id
19
+ end
20
+ end
@@ -0,0 +1,16 @@
1
+ class CreateQuadroAssets < ActiveRecord::Migration
2
+ def change
3
+ create_table :quadro_assets do |t|
4
+ t.references :assetable, polymorphic: true
5
+ t.string :type
6
+ t.text :settings
7
+ t.attachment :attachment
8
+ t.timestamp :deleted_at
9
+ t.timestamps
10
+ end
11
+
12
+ add_index :quadro_assets, [:assetable_id, :assetable_type]
13
+ add_index :quadro_assets, :type
14
+ add_index :quadro_assets, :deleted_at
15
+ end
16
+ end
@@ -0,0 +1,28 @@
1
+ class DeviseCreateQuadroUsers < ActiveRecord::Migration
2
+ def change
3
+ create_table(:quadro_users) do |t|
4
+ t.string :email
5
+ t.string :name
6
+ t.string :slug
7
+ t.string :encrypted_password
8
+ t.string :reset_password_token
9
+ t.datetime :reset_password_sent_at
10
+ t.datetime :remember_created_at
11
+ t.integer :sign_in_count, default: 0
12
+ t.datetime :current_sign_in_at
13
+ t.datetime :last_sign_in_at
14
+ t.string :current_sign_in_ip
15
+ t.string :last_sign_in_ip
16
+ t.integer :failed_attempts, default: 0
17
+ t.string :unlock_token
18
+ t.datetime :locked_at
19
+ t.timestamp :deleted_at
20
+ t.timestamps
21
+ end
22
+
23
+ add_index :quadro_users, :email, unique: true
24
+ add_index :quadro_users, :reset_password_token, unique: true
25
+ add_index :quadro_users, :unlock_token, unique: true
26
+ add_index :quadro_users, :slug, unique: true
27
+ end
28
+ end
@@ -0,0 +1,11 @@
1
+ class CreateQuadroInteractions < ActiveRecord::Migration
2
+ def change
3
+ create_table :quadro_interactions do |t|
4
+ t.references :interactable, polymorphic: true
5
+ t.text :content
6
+ t.string :ip_address
7
+ t.string :user_agent
8
+ t.timestamps
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,8 @@
1
+ Description:
2
+ Explain the generator
3
+
4
+ Example:
5
+ rails generate install Thing
6
+
7
+ This will create:
8
+ what/will/it/create
@@ -0,0 +1,35 @@
1
+ class Quadro::InstallGenerator < Rails::Generators::Base
2
+ source_root File.expand_path('../templates', __FILE__)
3
+
4
+ def install
5
+ route "mount Quadro::Engine => '/'"
6
+
7
+ remove_file "public/index.html"
8
+ remove_file "public/favicon.ico"
9
+ remove_file "public/robots.txt"
10
+
11
+ copy_file "db/GeoLite2-Country.mmdb", "db/GeoLite2-Country.mmdb"
12
+ copy_file "config/initializers/quadro.rb", "config/initializers/quadro.rb"
13
+ copy_file "app/views/quadro/shared/templates/page/_list.html.haml", "app/views/quadro/shared/templates/page/_list.html.haml"
14
+ copy_file "app/views/quadro/shared/templates/page/_thumbnail.html.haml", "app/views/quadro/shared/templates/page/_thumbnail.html.haml"
15
+ copy_file "app/views/quadro/shared/_navigation.html.haml", "app/views/quadro/shared/_navigation.html.haml"
16
+ copy_file "app/views/quadro/shared/templates/_blank.html.haml", "app/views/quadro/shared/templates/_blank.html.haml"
17
+ copy_file "app/views/quadro/shared/templates/_jumbotron.html.haml", "app/views/quadro/shared/templates/_jumbotron.html.haml"
18
+ copy_file "app/views/quadro/shared/templates/_sidebar.html.haml", "app/views/quadro/shared/templates/_sidebar.html.haml"
19
+ copy_file "app/views/quadro/shared/templates/_demo.html.haml", "app/views/quadro/shared/templates/_demo.html.haml"
20
+ copy_file "app/assets/javascripts/quadro/site.js.coffee", "app/assets/javascripts/quadro/site.js.coffee"
21
+ copy_file "app/assets/stylesheets/quadro/site.css.sass", "app/assets/stylesheets/quadro/site.css.sass"
22
+ copy_file "app/assets/images/quadro/favicon.ico", "app/assets/images/quadro/favicon.ico"
23
+ copy_file "app/assets/images/quadro/quadro-logo-mini.png", "app/assets/images/quadro/quadro-logo-mini.png"
24
+ copy_file "app/assets/images/quadro/quadro-logo.png", "app/assets/images/quadro/quadro-logo.png"
25
+ copy_file "public/maintenance.html", "public/maintenance.html"
26
+ copy_file "public/404.html", "public/404.html"
27
+ copy_file "public/422.html", "public/422.html"
28
+ copy_file "public/500.html", "public/500.html"
29
+
30
+ rake "quadro:install:migrations"
31
+ rake "db:migrate"
32
+ rake "quadro:create_admin_user"
33
+ rake "quadro:create_root_page"
34
+ end
35
+ end
@@ -0,0 +1,17 @@
1
+ %nav.navbar.navbar-default.navbar-fixed-top(role='navigation')
2
+ .container
3
+ .navbar-header
4
+ %button.navbar-toggle.collapsed(data-target='#navigation' data-toggle='collapse' type='button')
5
+ %span.sr-only Toggle navigation
6
+ %span.icon-bar
7
+ %span.icon-bar
8
+ %span.icon-bar
9
+ = link_to root_path, class: 'navbar-brand' do
10
+ = Quadro.config.site
11
+ #navigation.collapse.navbar-collapse
12
+ - unless user_signed_in?
13
+ %ul.nav.navbar-nav.navbar-right
14
+ %li
15
+ = link_to new_user_session_path do
16
+ Sign In
17
+ = navigation_for root, class: "nav navbar-nav navbar-right"
@@ -0,0 +1,11 @@
1
+ = render 'quadro/shared/navigation'
2
+
3
+ .container
4
+ = render_crumbs
5
+
6
+ .page-header
7
+ %h1= page.title
8
+
9
+ %p.lead= page.summary
10
+
11
+ = widget_for :content
@@ -0,0 +1,22 @@
1
+ = render 'quadro/shared/navigation'
2
+
3
+ .container
4
+ = render_crumbs
5
+
6
+ .page-header
7
+ %h1= page.title
8
+
9
+ %p.lead= page.summary
10
+
11
+ = widget_for :content
12
+
13
+ = widget_for :slider, type: :slider
14
+
15
+ = widget_for :gallery, type: :gallery
16
+
17
+ = widget_for :map, type: :map
18
+
19
+ = widget_for :form, type: :form
20
+
21
+ .row
22
+ = render subpages