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,14 @@
1
+ module Quadro
2
+ class Widget::Html < Widget
3
+ # attributes
4
+ attr_accessible :content
5
+ store :settings, accessors: [:width, :height]
6
+
7
+ # methods
8
+ class << self
9
+ def short_name
10
+ 'html'
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,13 @@
1
+ module Quadro
2
+ class Widget::Map < Widget
3
+ # attributes
4
+ store :settings, accessors: [:width, :height]
5
+
6
+ # methods
7
+ class << self
8
+ def short_name
9
+ 'map'
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,17 @@
1
+ module Quadro
2
+ class Widget::Slider < Widget
3
+ # attributes
4
+ attr_accessible :content
5
+ store :settings, accessors: [:width, :height]
6
+
7
+ # associations
8
+ has_many :slides, as: :assetable, class_name: Quadro::Asset::Slide
9
+
10
+ # methods
11
+ class << self
12
+ def short_name
13
+ 'slider'
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,33 @@
1
+ !!!
2
+ %html(lang="#{I18n.locale}" prefix="og: http://ogp.me/ns#")
3
+ %head
4
+ %meta(charset='utf-8')
5
+ %meta(content='width=device-width, initial-scale=1.0' name='viewport')
6
+ %title= page.title
7
+ %meta(content="#{page.summary}" name="description")
8
+ %meta(content="#{page.author}" name="author")
9
+ %meta(content="#{Quadro::SIGNATURE}" name="generator")
10
+ %meta(content="#{page.title}" property="og:title")
11
+ %meta(content="#{page.summary}" property="og:description")
12
+ %meta(content="#{page.is_root? ? 'website' : 'article'}" property="og:type")
13
+ %meta(content="#{page.is_root? ? root_url : page_url(page)}" property="og:url")
14
+ %meta(content="#{absolute_url(page.cover.url(:large))}" property="og:image")
15
+ - unless Quadro.config.facebook_id.blank?
16
+ %meta(content="#{Quadro.config.facebook_id}" property="fb:app_id")
17
+ %meta(name="twitter:card" content="summary")
18
+ - unless Quadro.config.twitter_username.blank?
19
+ %meta(name="twitter:site" content="@#{Quadro.config.twitter_username}")
20
+ %link(href="#{page.is_root? ? root_url : page_url(page)}" rel="canonical")
21
+ = auto_discovery_link_tag :rss, rss_path, title: root.title
22
+ = auto_discovery_link_tag :atom, atom_path, title: root.title
23
+ = stylesheet_link_tag 'quadro/application'
24
+ = favicon_link_tag 'quadro/favicon.ico'
25
+ = csrf_meta_tags
26
+ %body(class="#{(user_signed_in? ? 'quadro-signed-in' : '')}")
27
+ = yield
28
+ - if user_signed_in?
29
+ = render 'quadro/shared/toolbar'
30
+ = render 'quadro/shared/modal'
31
+ = javascript_include_tag 'quadro/application'
32
+ = javascript_include_tag "//maps.google.com/maps/api/js?key=#{Quadro.config.google_maps_api_key}"
33
+ = yield :javascript
@@ -0,0 +1,11 @@
1
+ !!!
2
+ %html(lang="#{I18n.locale}")
3
+ %head
4
+ %meta(charset='utf-8')
5
+ %meta(content='width=device-width, initial-scale=1.0' name='viewport')
6
+ %meta(name='robots' content='none')
7
+ = stylesheet_link_tag 'quadro/application'
8
+ = favicon_link_tag 'quadro/favicon.ico'
9
+ = csrf_meta_tags
10
+ %body
11
+ = yield
@@ -0,0 +1,11 @@
1
+ <% if asset.persisted? %>
2
+ <% case asset.type.constantize.short_name %>
3
+ <% when 'image' %>
4
+ $('.asset-list').filter('[data-assetable-type="<%= asset.assetable.class.to_s %>"],[data-assetable-id="<%= asset.assetable.id %>"]').append('<%= escape_javascript(render("quadro/assets/image/image", asset: asset, page: page))%>');
5
+ <% when 'slide' %>
6
+ $('.asset-list').filter('[data-assetable-type="<%= asset.assetable.class.to_s %>"],[data-assetable-id="<%= asset.assetable.id %>"]').append('<%= escape_javascript(render("quadro/assets/slide/slide", asset: asset, widget: widget, page: page))%>');
7
+ <% end %>
8
+ new Message('Asset created');
9
+ <% else %>
10
+ new Message('Asset not created');
11
+ <% end %>
@@ -0,0 +1,11 @@
1
+ <% if asset.destroyed? %>
2
+ <% case asset.type.constantize.short_name %>
3
+ <% when 'image' %>
4
+ $('#image-<%= asset.id %>').remove();
5
+ <% when 'slide' %>
6
+ $('#slide-<%= asset.id %>').remove();
7
+ <% end %>
8
+ new Message('Asset deleted');
9
+ <% else %>
10
+ new Message('Asset not deleted');
11
+ <% end %>
@@ -0,0 +1,9 @@
1
+ <% if asset.present? %>
2
+ <% case asset.type.constantize.short_name %>
3
+ <% when 'image' %>
4
+ $("#quadro-modal .modal-content").html("<%= escape_javascript(render('quadro/assets/image/form', asset: asset, page: page)) %>");
5
+ <% when 'slide' %>
6
+ $("#quadro-modal .modal-content").html("<%= escape_javascript(render('quadro/assets/slide/form', asset: asset, widget: widget, page: page)) %>");
7
+ <% end %>
8
+ $("#quadro-modal").modal("show");
9
+ <% end %>
@@ -0,0 +1,25 @@
1
+ .modal-header
2
+ %button.close(data-dismiss="modal" type="button")
3
+ %span(aria-hidden="true") ×
4
+ %span.sr-only Close
5
+ %h4.modal-title Edit image
6
+ .modal-body
7
+ = simple_form_for asset, as: :asset, url: (widget.present? ? page_widget_asset_path(page_id: page.id, widget_id: widget.id, id: asset.id) : page_asset_path(page_id: page.id, id: asset.id)), method: :put, multipart: true, remote: true do |form|
8
+ .row
9
+ .col-md-4
10
+ .fileinput.fileinput-new(data-provides="fileinput")
11
+ .fileinput-new.thumbnail
12
+ = image_tag form.object.attachment.url(:small)
13
+ .fileinput-preview.fileinput-exists.thumbnail
14
+ .text-center
15
+ %span.btn.btn-default.btn-file
16
+ %span.fileinput-new Select image
17
+ %span.fileinput-exists Change
18
+ = form.input_field :attachment
19
+ %a.btn.btn-default.fileinput-exists(data-dismiss="fileinput" href="#") Remove
20
+ .col-md-8
21
+ = form.input :alt, input_html: { class: 'form-control' }
22
+ = form.input :width, input_html: { class: 'form-control' }
23
+ = form.input :height, input_html: { class: 'form-control' }
24
+ .text-right
25
+ = form.submit class: 'btn btn-primary'
@@ -0,0 +1,10 @@
1
+ .col-xs-6.col-sm-6.col-md-3.col-lg-2(id="image-#{asset.id}")
2
+ .thumbnail
3
+ = image_tag asset.url(:small), alt: asset.alt
4
+ .caption.clearfix
5
+ .pull-right
6
+
7
+ = link_to (widget.present? ? edit_page_widget_asset_path(page_id: page.id, widget_id: widget.id, id: asset.id) : edit_page_asset_path(id: asset.id, page_id: page.id)), remote: true, class: "btn btn-link btn-xs" do
8
+ %i.fa.fa-cog.text-muted
9
+ = link_to (widget.present? ? page_widget_asset_path(page_id: page.id, widget_id: widget.id, id: asset.id) : page_asset_path(id: asset.id, page_id: page.id)), method: "delete", confirm: "Are you sure of delete this image?", remote: true, class: "btn btn-link btn-xs" do
10
+ %i.fa.fa-trash-o.text-danger
@@ -0,0 +1,26 @@
1
+ .modal-header
2
+ %button.close(data-dismiss="modal" type="button")
3
+ %span(aria-hidden="true") ×
4
+ %span.sr-only Close
5
+ %h4.modal-title Edit slide
6
+ .modal-body
7
+ = simple_form_for asset, as: :asset, url: (widget.present? ? page_widget_asset_path(page_id: page.id, widget_id: widget.id, id: asset.id) : page_asset_path(page_id: page.id, id: asset.id)), method: :put, multipart: true, remote: true do |form|
8
+ .row
9
+ .col-md-4
10
+ .fileinput.fileinput-new(data-provides="fileinput")
11
+ .fileinput-new.thumbnail
12
+ = image_tag form.object.attachment.url(:small)
13
+ .fileinput-preview.fileinput-exists.thumbnail
14
+ .text-center
15
+ %span.btn.btn-default.btn-file
16
+ %span.fileinput-new Select slide
17
+ %span.fileinput-exists Change
18
+ = form.input_field :attachment
19
+ %a.btn.btn-default.fileinput-exists(data-dismiss="fileinput" href="#") Remove
20
+ .col-md-8
21
+ = form.input :alt, input_html: { class: 'form-control' }
22
+ = form.input :width, input_html: { class: 'form-control' }
23
+ = form.input :height, input_html: { class: 'form-control' }
24
+ = form.input :href, input_html: { class: 'form-control' }
25
+ .text-right
26
+ = form.submit class: 'btn btn-primary'
@@ -0,0 +1,9 @@
1
+ .col-xs-6.col-sm-4.col-md-3.col-lg-2(id="slide-#{asset.id}")
2
+ .thumbnail
3
+ = image_tag asset.url(:small), alt: asset.alt
4
+ .caption.clearfix
5
+ .pull-right
6
+ = link_to edit_page_widget_asset_path(id: asset.id, widget_id: widget.id, page_id: page.id), remote: true, class: "btn btn-link btn-xs" do
7
+ %i.fa.fa-cog.text-muted
8
+ = link_to page_widget_asset_path(id: asset.id, widget_id: widget.id, page_id: page.id), method: "delete", confirm: "Are you sure of delete this slide?", remote: true, class: "btn btn-link btn-xs" do
9
+ %i.fa.fa-trash-o.text-danger
@@ -0,0 +1,18 @@
1
+ <% if asset.errors.size > 0 %>
2
+ <% case asset.type.constantize.short_name %>
3
+ <% when 'image' %>
4
+ $("#quadro-modal .modal-content").html("<%= escape_javascript(render('quadro/assets/image/form', asset: asset, page: page)) %>");
5
+ <% when 'slide' %>
6
+ $("#quadro-modal .modal-content").html("<%= escape_javascript(render('quadro/assets/slide/form', asset: asset, widget: widget, page: page)) %>");
7
+ <% end %>
8
+ new Message('Asset not updated');
9
+ <% else %>
10
+ <% case asset.type.constantize.short_name %>
11
+ <% when 'image' %>
12
+ $('#image-<%= asset.id %>').replaceWith('<%= escape_javascript(render("quadro/assets/image/image", asset: asset, page: page))%>');
13
+ <% when 'slide' %>
14
+ $('#slide-<%= asset.id %>').replaceWith('<%= escape_javascript(render("quadro/assets/slide/slide", asset: asset, widget: widget, page: page))%>');
15
+ <% end %>
16
+ $("#quadro-modal").modal('hide');
17
+ new Message('Asset updated');
18
+ <% end %>
@@ -0,0 +1,27 @@
1
+ xml.instruct! :xml, version: "1.0", encoding: "utf-8"
2
+ xml.feed xmlns: "http://www.w3.org/2005/Atom" do
3
+ xml.id Quadro.railtie_routes_url_helpers.page_url(root)
4
+ xml.title root.title
5
+ xml.updated l(root.updated_at, format: :atom, locale: :en)
6
+ xml.subtitle root.summary
7
+ xml.link href: Quadro.railtie_routes_url_helpers.atom_url, rel: "self"
8
+ xml.link href: Quadro.railtie_routes_url_helpers.root_url
9
+ xml.icon absolute_url(root.cover.url(:thumb))
10
+ xml.logo absolute_url(root.cover.url(:small))
11
+ xml.generator Quadro::SIGNATURE
12
+
13
+ root.descendants.ordered.each do |page|
14
+ xml.entry do
15
+ xml.id Quadro.railtie_routes_url_helpers.page_url(page)
16
+ xml.title page.title
17
+ xml.updated l(page.updated_at, format: :atom, locale: :en)
18
+ xml.published l(page.created_at, format: :atom, locale: :en)
19
+ xml.summary page.summary
20
+ xml.author do
21
+ xml.name page.author_name
22
+ xml.email page.author_email
23
+ end
24
+ xml.link href: Quadro.railtie_routes_url_helpers.page_url(page)
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,25 @@
1
+ xml.instruct! :xml, version: "1.0", encoding: "utf-8"
2
+ xml.rss version: "2.0" do
3
+ xml.channel do
4
+ xml.title root.title
5
+ xml.description root.summary
6
+ xml.link Quadro.railtie_routes_url_helpers.root_url
7
+ xml.image do
8
+ xml.url absolute_url(root.cover.url(:small))
9
+ xml.title root.title
10
+ xml.link Quadro.railtie_routes_url_helpers.root_url
11
+ end
12
+ xml.generator Quadro::SIGNATURE
13
+
14
+ root.descendants.ordered.each do |page|
15
+ xml.item do
16
+ xml.title page.title
17
+ xml.description page.summary
18
+ xml.link Quadro.railtie_routes_url_helpers.page_url(page)
19
+ xml.pubDate l(page.created_at, format: :rss, locale: :en)
20
+ xml.author page.author_email
21
+ xml.guid Quadro.railtie_routes_url_helpers.page_url(page), isPermaLink: true
22
+ end
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,22 @@
1
+ - user_agent = UserAgent.parse(interaction.user_agent)
2
+ - location = geoip.lookup(interaction.ip_address)
3
+
4
+ %li
5
+ %ul.list-inline
6
+ %li.text-capitalize
7
+ %strong Date
8
+ %li= l(interaction.created_at, format: :long)
9
+ %li.text-capitalize
10
+ %strong Browser
11
+ %li
12
+ = user_agent.browser
13
+ %small= user_agent.version
14
+ %li.text-capitalize
15
+ %strong Location
16
+ %li
17
+ = interaction.ip_address
18
+ %small= location.found? ? location.country.iso_code : '??'
19
+ - interaction.content.keys.each do |key|
20
+ %li.text-capitalize
21
+ %strong= key
22
+ %li= interaction.content[key]
@@ -0,0 +1,35 @@
1
+ .modal-header
2
+ %button.close(data-dismiss="modal" type="button")
3
+ %span(aria-hidden="true") ×
4
+ %span.sr-only Close
5
+ %h4.modal-title Edit page
6
+ .modal-body
7
+ = simple_form_for page, multipart: true, remote: true do |form|
8
+ - form.object.build_cover if form.object.cover.nil?
9
+ = hidden_field_tag :is_root, true if page.is_root?
10
+ .row
11
+ .col-md-4
12
+ .fileinput.fileinput-new(data-provides="fileinput")
13
+ .fileinput-new.thumbnail
14
+ = image_tag form.object.cover.url(:large)
15
+ .fileinput-preview.fileinput-exists.thumbnail
16
+ .text-center
17
+ %span.btn.btn-default.btn-file
18
+ %span.fileinput-new Select cover
19
+ %span.fileinput-exists Change
20
+ = form.simple_fields_for :cover do |cover|
21
+ = cover.input_field :attachment
22
+ %a.btn.btn-default.fileinput-exists(data-dismiss="fileinput" href="#") Remove
23
+ .col-md-8
24
+ = form.input :title, input_html: { class: 'form-control' }
25
+ = form.input :summary, as: :text, input_html: { class: 'form-control', rows: 2 }
26
+ = form.input :author_id, collection: users, input_html: { class: 'form-control' }
27
+ .row
28
+ .col-md-4
29
+ = form.input :template, collection: page.templates, input_html: { class: 'form-control' }
30
+ .col-md-4
31
+ = form.input :frequency, collection: Quadro::Page::SITEMAP_FREQUENCY, input_html: { class: 'form-control' }
32
+ .col-md-4
33
+ = form.input :priority, collection: Quadro::Page::SITEMAP_PRIORITY, input_html: { class: 'form-control' }
34
+ .text-right
35
+ = form.submit class: 'btn btn-primary'
@@ -0,0 +1,11 @@
1
+ .modal-header
2
+ %button.close(data-dismiss="modal" type="button")
3
+ %span(aria-hidden="true") ×
4
+ %span.sr-only Close
5
+ %h4.modal-title New page
6
+ .modal-body
7
+ = simple_form_for page, url: pages_path(parent_id: params[:parent_id]), remote: true do |form|
8
+ = form.input :title, input_html: { class: 'form-control' }
9
+ = form.input :template, collection: page.templates, input_html: { class: 'form-control' }
10
+ %p.text-right
11
+ = form.submit class: 'btn btn-primary'
@@ -0,0 +1 @@
1
+ = render "quadro/shared/templates/page/#{Quadro.config.layout}", page: page
@@ -0,0 +1,7 @@
1
+ <% if page.errors.size > 0 %>
2
+ $("#quadro-modal .modal-body").html("<%= escape_javascript(render('quadro/pages/new', page: page)) %>");
3
+ new Message('Page not created');
4
+ <% else %>
5
+ $("#quadro-modal").modal('hide');
6
+ new Message('Page created');
7
+ <% end %>
@@ -0,0 +1,5 @@
1
+ <% if page.destroyed? %>
2
+ new Message('Page deleted');
3
+ <% else %>
4
+ new Message('Page not deleted');
5
+ <% end %>
@@ -0,0 +1,4 @@
1
+ $("#quadro-modal .modal-content").html("<%= escape_javascript(render('quadro/pages/edit', page: page)) %>");
2
+ $("#page_title").show_char_limit(60);
3
+ $("#page_summary").show_char_limit(160);
4
+ $("#quadro-modal").modal("show");
@@ -0,0 +1,6 @@
1
+ <% if interaction.persisted? %>
2
+ new Message('Message sent');
3
+ $('form#<%= interaction.interactable.name %>')[0].reset();
4
+ <% else %>
5
+ new Message('Message not sent');
6
+ <% end %>
@@ -0,0 +1 @@
1
+ = render "quadro/shared/templates/#{page.template}", page: page
@@ -0,0 +1,2 @@
1
+ $("#quadro-modal .modal-content").html("<%= escape_javascript(render('quadro/pages/new', page: page)) %>");
2
+ $("#quadro-modal").modal("show");
@@ -0,0 +1 @@
1
+ = render "quadro/shared/templates/#{page.template}", page: page
@@ -0,0 +1,7 @@
1
+ <% if page.errors.size > 0 %>
2
+ $("#quadro-modal .modal-content").html("<%= escape_javascript(render('quadro/pages/edit', page: page)) %>");
3
+ new Message('Page not updated');
4
+ <% else %>
5
+ $("#quadro-modal").modal('hide');
6
+ new Message('Page updated');
7
+ <% end %>
@@ -0,0 +1,4 @@
1
+ User-Agent: *
2
+ Allow: /
3
+ Disallow: /auth/*
4
+ Sitemap: <%= sitemap_url %>
@@ -0,0 +1,3 @@
1
+ #quadro-modal.modal.fade
2
+ .modal-dialog.modal-lg
3
+ .modal-content
@@ -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, rel: "nofollow" do
16
+ Sign In
17
+ = navigation_for root, class: "nav navbar-nav navbar-right"