aerogel-pages 1.4.12

Sign up to get free protection for your applications and to get access to all the features.
Files changed (169) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +17 -0
  3. data/Gemfile +4 -0
  4. data/LICENSE.txt +22 -0
  5. data/README.md +14 -0
  6. data/Rakefile +1 -0
  7. data/aerogel-pages.gemspec +26 -0
  8. data/app/helpers/README.md +7 -0
  9. data/app/helpers/decorators.rb +74 -0
  10. data/app/helpers/pages.rb +32 -0
  11. data/app/routes/admin-pages.rb +150 -0
  12. data/app/routes/pages.rb +16 -0
  13. data/assets/javascripts/admin-pages/pages-widget.js.coffee +83 -0
  14. data/assets/javascripts/admin-pages/pane-preview.js.coffee +37 -0
  15. data/assets/javascripts/admin-pages/pane-tree.js.coffee +105 -0
  16. data/assets/javascripts/admin-pages-edit/admin-modal-select.js.coffee +63 -0
  17. data/assets/javascripts/admin-pages-edit/datetime-picker-field.js.coffee +36 -0
  18. data/assets/javascripts/admin-pages-edit/page-blocks.js.coffee +71 -0
  19. data/assets/javascripts/admin-pages-edit/page-content-tabs.js.coffee +40 -0
  20. data/assets/javascripts/admin-pages-utils/attached-footer.js.coffee +62 -0
  21. data/assets/javascripts/admin-pages-utils/autofixed-height.js.coffee +15 -0
  22. data/assets/javascripts/admin-pages-utils/two-pane-widget.js.coffee +78 -0
  23. data/assets/javascripts/aerogel-pages.js.coffee +3 -0
  24. data/assets/javascripts/controllers/admin-pages-edit.js.coffee +33 -0
  25. data/assets/javascripts/controllers/admin-pages.js.coffee +17 -0
  26. data/assets/stylesheets/admin-pages/_admin-pages-alert.css.scss +14 -0
  27. data/assets/stylesheets/admin-pages/_pages-widget.css.scss +113 -0
  28. data/assets/stylesheets/admin-pages/_pane-tree.css.scss +15 -0
  29. data/assets/stylesheets/admin-pages/_preview.css.scss +35 -0
  30. data/assets/stylesheets/admin-pages/_two-pane-widget.css.scss +103 -0
  31. data/assets/stylesheets/admin-pages-common/_admin-modals-select.css.scss +34 -0
  32. data/assets/stylesheets/admin-pages-common/_form-details.css.scss +11 -0
  33. data/assets/stylesheets/admin-pages-common/_nav-tabs.css.scss +6 -0
  34. data/assets/stylesheets/admin-pages-common/_page-blocks.css.scss +18 -0
  35. data/assets/stylesheets/admin-pages-common/_panels.css.scss +11 -0
  36. data/assets/stylesheets/admin-pages-common/_publication-states.css.scss +11 -0
  37. data/assets/stylesheets/admin-pages-common/_smart-links.css.scss +9 -0
  38. data/assets/stylesheets/admin-pages-common/_smart-tree-table-icons.css.scss +42 -0
  39. data/assets/stylesheets/admin-pages-edit/breadcrumbs.css.scss +11 -0
  40. data/assets/stylesheets/admin-pages-edit/form.css.scss +23 -0
  41. data/assets/stylesheets/admin-pages-edit/page-blocks.css.scss +88 -0
  42. data/assets/stylesheets/admin-pages-edit/page-footer.css.scss +21 -0
  43. data/assets/stylesheets/admin-pages-edit/page-header.css.scss +15 -0
  44. data/assets/stylesheets/admin-pages-edit/page.css.scss +30 -0
  45. data/assets/stylesheets/admin-pages-edit/tabs.css.scss +20 -0
  46. data/assets/stylesheets/aerogel-pages.css.scss +20 -0
  47. data/assets/stylesheets/controllers/admin-pages-edit.css.scss +7 -0
  48. data/assets/stylesheets/controllers/admin-pages.css.scss +5 -0
  49. data/assets/stylesheets/pages/_body.css.scss +3 -0
  50. data/assets/stylesheets/pages/_footer.css.scss +13 -0
  51. data/assets/stylesheets/pages/_header.css.scss +5 -0
  52. data/assets/stylesheets/pages/_image.css.scss +18 -0
  53. data/assets/stylesheets/pages/_layout-sticky-footer.css.scss +27 -0
  54. data/assets/stylesheets/pages/_menu.css.scss +45 -0
  55. data/assets/stylesheets/pages/_page-content.css.scss +3 -0
  56. data/assets/vendor/jquery.history.js +1 -0
  57. data/assets/vendor/smart-links.js.coffee +42 -0
  58. data/config/README.md +3 -0
  59. data/config/development/.keep +0 -0
  60. data/config/production/.keep +0 -0
  61. data/db/model/page.rb +137 -0
  62. data/db/model/page_node.rb +43 -0
  63. data/db/model/page_type.rb +15 -0
  64. data/db/model/pages/block.rb +38 -0
  65. data/db/model/pages/blocks/hr.rb +9 -0
  66. data/db/model/pages/blocks/image.rb +16 -0
  67. data/db/model/pages/blocks/pages_list.rb +41 -0
  68. data/db/model/pages/blocks/text.rb +9 -0
  69. data/db/seed/development/.keep +0 -0
  70. data/db/seed/development/01_page_types.seed +8 -0
  71. data/db/seed/development/02_root_page_node.seed +8 -0
  72. data/db/seed/development/03_root_pages.seed +10 -0
  73. data/db/seed/development/04_news_page_node.seed +15 -0
  74. data/db/seed/development/05_news_pages.seed +10 -0
  75. data/db/seed/production/.keep +0 -0
  76. data/db/seed/production/01_page_types.seed +8 -0
  77. data/db/seed/production/02_root_page_node.seed +8 -0
  78. data/db/seed/production/03_root_pages.seed +10 -0
  79. data/db/seed/seed.template +42 -0
  80. data/lib/aerogel/pages/core.rb +37 -0
  81. data/lib/aerogel/pages/traversal.rb +30 -0
  82. data/lib/aerogel/pages/version.rb +5 -0
  83. data/lib/aerogel/pages.rb +19 -0
  84. data/locales/actions.en.yml +11 -0
  85. data/locales/actions.ru.yml +11 -0
  86. data/locales/admin.en.yml +11 -0
  87. data/locales/admin.ru.yml +11 -0
  88. data/locales/models.en.yml +18 -0
  89. data/locales/models.ru.yml +19 -0
  90. data/locales/views.en.yml +38 -0
  91. data/locales/views.ru.yml +39 -0
  92. data/public/README.md +1 -0
  93. data/rake/README.md +3 -0
  94. data/views/admin/pages/_edit_form.html.erb +23 -0
  95. data/views/admin/pages/_page-DISABLED.html.erb +5 -0
  96. data/views/admin/pages/append.html.erb +4 -0
  97. data/views/admin/pages/delete.html.erb +28 -0
  98. data/views/admin/pages/edit/_block.html.erb +16 -0
  99. data/views/admin/pages/edit/_block_header.html.erb +66 -0
  100. data/views/admin/pages/edit/_breadcrumbs.html.erb +13 -0
  101. data/views/admin/pages/edit/_page.html.erb +63 -0
  102. data/views/admin/pages/edit/_page_footer.html.erb +55 -0
  103. data/views/admin/pages/edit/_page_header.html.erb +65 -0
  104. data/views/admin/pages/edit/_page_node.html.erb +79 -0
  105. data/views/admin/pages/edit/block/_default.html.erb +3 -0
  106. data/views/admin/pages/edit/block/_hr.html.erb +5 -0
  107. data/views/admin/pages/edit/block/_image.html.erb +20 -0
  108. data/views/admin/pages/edit/block/_pages_list.html.erb +53 -0
  109. data/views/admin/pages/edit/block/_text.html.erb +3 -0
  110. data/views/admin/pages/edit/select_page.html.erb +59 -0
  111. data/views/admin/pages/edit/select_template.html.erb +50 -0
  112. data/views/admin/pages/edit.html.erb +4 -0
  113. data/views/admin/pages/index/_pane_preview.html.erb +23 -0
  114. data/views/admin/pages/index/_pane_tree.html.erb +50 -0
  115. data/views/admin/pages/index/_pane_tree_tabs.html.erb +26 -0
  116. data/views/admin/pages/index.html.erb +26 -0
  117. data/views/admin/pages/insert.html.erb +4 -0
  118. data/views/admin/pages/preview/_block.html.erb +7 -0
  119. data/views/admin/pages/preview/_breadcrumbs.html.erb +11 -0
  120. data/views/admin/pages/preview/block/_default.html.erb +5 -0
  121. data/views/admin/pages/preview/block/_hr.html.erb +1 -0
  122. data/views/admin/pages/preview/block/_image.html.erb +8 -0
  123. data/views/admin/pages/preview/block/_pages_list.html.erb +14 -0
  124. data/views/admin/pages/preview/block/_text.html.erb +1 -0
  125. data/views/admin/pages/preview.html.erb +30 -0
  126. data/views/admin/table_builder/smart-list-table/_table_column.html.erb +3 -0
  127. data/views/admin/table_builder/smart-list-table/_table_row.html.erb +9 -0
  128. data/views/admin/table_builder/smart-list-table/table.html.erb +10 -0
  129. data/views/admin/table_builder/smart-tree-table/_table_column.html.erb +3 -0
  130. data/views/admin/table_builder/smart-tree-table/_table_row.html.erb +14 -0
  131. data/views/admin/table_builder/smart-tree-table/table.html.erb +10 -0
  132. data/views/admin/tabs_builder/pages-tree-tabs/_tab.html.erb +5 -0
  133. data/views/admin/tabs_builder/pages-tree-tabs/tabs.html.erb +3 -0
  134. data/views/form_builder/admin-pages-edit/field.erb +31 -0
  135. data/views/form_builder/admin-pages-edit/field_datetime.erb +19 -0
  136. data/views/form_builder/admin-pages-edit/field_default.erb +5 -0
  137. data/views/form_builder/admin-pages-edit/field_radio_buttons.erb +22 -0
  138. data/views/form_builder/admin-pages-edit/field_text_addon.erb +17 -0
  139. data/views/form_builder/admin-pages-edit/field_textarea.erb +28 -0
  140. data/views/form_builder/admin-pages-edit/field_title.erb +5 -0
  141. data/views/form_builder/admin-pages-edit/fieldset.erb +4 -0
  142. data/views/form_builder/admin-pages-edit-block/field.erb +31 -0
  143. data/views/form_builder/admin-pages-edit-block/field_default.erb +5 -0
  144. data/views/form_builder/admin-pages-edit-block/field_media-file.erb +60 -0
  145. data/views/form_builder/admin-pages-edit-block/field_media-image.erb +67 -0
  146. data/views/form_builder/admin-pages-edit-block/field_radio_buttons.erb +22 -0
  147. data/views/form_builder/admin-pages-edit-block/field_select_page.erb +34 -0
  148. data/views/form_builder/admin-pages-edit-block/field_select_template.erb +32 -0
  149. data/views/form_builder/admin-pages-edit-block/field_text_inline.erb +5 -0
  150. data/views/form_builder/admin-pages-edit-block/field_textarea.erb +2 -0
  151. data/views/form_builder/admin-pages-edit-block/fieldset.erb +4 -0
  152. data/views/layouts/admin/pages/preview.html.erb +9 -0
  153. data/views/layouts/application.html.erb +62 -0
  154. data/views/layouts/pages/_breadcrumbs.html.erb +20 -0
  155. data/views/layouts/pages/_flashes.html.erb +9 -0
  156. data/views/layouts/pages/_menu.html.erb +37 -0
  157. data/views/layouts/pages/_menu_item.html.erb +15 -0
  158. data/views/layouts/pages/_menu_user.html.erb +8 -0
  159. data/views/pages/_block.html.erb +7 -0
  160. data/views/pages/block/_default.html.erb +5 -0
  161. data/views/pages/block/_hr.html.erb +1 -0
  162. data/views/pages/block/_image.html.erb +8 -0
  163. data/views/pages/block/_pages_list.html.erb +13 -0
  164. data/views/pages/block/_text.html.erb +1 -0
  165. data/views/pages/list/_default.html.erb +7 -0
  166. data/views/pages/list/_table.html.erb +12 -0
  167. data/views/pages/list/_ul.html.erb +7 -0
  168. data/views/pages/view.html.erb +4 -0
  169. metadata +267 -0
@@ -0,0 +1,67 @@
1
+ <!-- label for="<%= field.css_id %>"><%= field.label -%>
2
+ <% if field.required? -%> <abbr class="required" title="<%= t 'aerogel.forms.required' %>">*</abbr>
3
+ <% end -%>
4
+ </label -->
5
+
6
+ <div class="smart-file-input">
7
+ <%= tag :input, type: :hidden,
8
+ name: field.html_name("retained_#{field.name}"),
9
+ value: field.data_object.send(:"retained_#{field.name}")
10
+ %>
11
+ <%= tag :input, type: :hidden,
12
+ name: field.html_name("remove_#{field.name}"),
13
+ class: "file-remove-field"
14
+ %>
15
+ <input id="<%= field.css_id %>" type="file" name="<%= field.html_name %>" <%= field.html_params %> />
16
+
17
+ <div class="file-empty">
18
+ <div>
19
+ <span class="file-label"><i><%= t.aerogel.forms.file.empty %></i></span>
20
+ </div>
21
+ <span class="btn btn-default btn-sm btn-file-select">
22
+ <%= t.aerogel.forms.file.select %>
23
+ </span>
24
+ </div>
25
+ <div class="file-exists">
26
+
27
+ <% if field.value %>
28
+ <div class="file-old">
29
+ <%= image_thumb_tag field.value, 'x'+( field.options[:height] ? field.options[:height] : '100' ) %>
30
+ <!--
31
+ <br/>
32
+ <span class="file-label"><%= field.value.try(:description) %></span>
33
+ -->
34
+ </div>
35
+ <% end %>
36
+
37
+ <div class="file-new">
38
+ <img class="file-preview fancybox"
39
+ height="<%= field.options[:height] ? field.options[:height] : '100' %>" />
40
+ <!--
41
+ <br/>
42
+ <span class="file-label"></span>
43
+ -->
44
+ </div>
45
+ <!-- span class="btn btn-default btn-sm btn-file-change">
46
+ <%= t.aerogel.forms.file.change %>
47
+ </span -->
48
+ <!-- span class="btn btn-default btn-sm btn-file-remove">
49
+ <%= t.aerogel.forms.file.remove %>
50
+ </span -->
51
+ </div>
52
+ </div>
53
+
54
+ <% field.form_object.options[:multipart] = true %>
55
+
56
+
57
+ <script type="text/javascript">
58
+ $(function(){
59
+ console.log("applying smart-file-input started");
60
+ $("#<%= field.css_id %>").closest(".smart-file-input").each(function(){
61
+ console.log("found element for smart-file-input");
62
+ smart_file_input( $(this) );
63
+ });
64
+ console.log("applying smart-file-input finished");
65
+ });
66
+ </script>
67
+
@@ -0,0 +1,22 @@
1
+ <!-- label for="<%= field.css_id %>"><%= field.label -%>
2
+ <% if field.required? -%> <abbr class="required" title="<%= t 'aerogel.forms.required' %>">*</abbr>
3
+ <% end -%>
4
+ </label -->
5
+
6
+ <div class="input-group">
7
+ <div class="btn-group" data-toggle="buttons">
8
+ <% unless field.required? %>
9
+ <label class="btn btn-default btn-sm <%= field.value.blank? ? 'active' : '' %>">
10
+ <input type="radio" class="form-control" name="<%= field.html_name %>" id="<%= field.css_id %>-11"
11
+ value <%= field.value.blank? ? 'checked=""' : '' %>>
12
+ <%= icon 'fa-times' %>
13
+ </label>
14
+ <% end %>
15
+ <% field.options[:values].each_with_index do |value, i| %>
16
+ <label class="btn btn-default btn-sm <%= value.to_s == field.value.to_s ? 'active' : '' %>" >
17
+ <input type="radio" class="form-control" name="<%= field.html_name %>" id="<%= field.css_id %>-11" value="<%= h value %>" <%= value.to_s == field.value.to_s ? 'checked=""' : '' %>>
18
+ <%= field.options[:labels].present? ? ( field.options[:labels][i] ) : h( value ) %>
19
+ </label>
20
+ <% end %>
21
+ </div>
22
+ </div>
@@ -0,0 +1,34 @@
1
+ <%
2
+ # Find selected page label:
3
+ current_lang = field.options[:lang] or
4
+ raise ArgumentError.new( "field_select requires :lang option to be set")
5
+ selected_page_node = nil
6
+ selected_page_label = ''
7
+ if field.value.present?
8
+ selected_page_node = PageNode.find field.value
9
+ selected_page_label = selected_page_node.page(current_lang).try(:title) if selected_page_node.present?
10
+ end
11
+ %>
12
+
13
+ <div class="input-group input-group-sm field-select-page id-<%= field.css_id %>"
14
+ data-lang="<%= current_lang %>"
15
+ >
16
+ <span class="input-group-btn">
17
+ <button class="btn btn-default btn-clear" type="button">
18
+ <%= icon 'fa-times' %>
19
+ </button>
20
+ </span>
21
+ <input id="<%= field.css_id %>" type="hidden" name="<%= field.html_name %>"
22
+ value="<%= h field.value %>"
23
+ class="form-control input-text-inline page-node-id"
24
+ />
25
+ <input type="text" placeholder="<%= h field.placeholder %>" class="form-control page-label" readonly="readonly"
26
+ value="<%= h selected_page_label %>"
27
+ />
28
+ <!-- input type="text" class="form-control"/ -->
29
+ <span class="input-group-btn">
30
+ <button class="btn btn-default btn-select" type="button">
31
+ &hellip;
32
+ </button>
33
+ </span>
34
+ </div>
@@ -0,0 +1,32 @@
1
+ <%
2
+ template_prefix = field.options[:prefix] or
3
+ raise ArgumentError.new("field_select_template requires :prefix option to be set")
4
+ template_label = field.value.present? ? field.value.sub(/^#{template_prefix}/, '') : ''
5
+ %>
6
+
7
+ <div class="input-group input-group-sm field-select-template id-<%= field.css_id %>"
8
+ data-prefix="<%= h template_prefix %>"
9
+ >
10
+ <span class="input-group-btn">
11
+ <button class="btn btn-default btn-clear" type="button"
12
+ >
13
+ <%= icon 'fa-times' %>
14
+ </button>
15
+ </span>
16
+ <span class="input-group-addon">
17
+ <%= template_prefix %>
18
+ </span>
19
+ <input id="<%= field.css_id %>" type="hidden" name="<%= field.html_name %>"
20
+ value="<%= h field.value %>"
21
+ class="form-control input-text-inline template-id"
22
+ />
23
+ <input type="text" placeholder="<%= h field.placeholder %>" class="form-control template-label" readonly="readonly"
24
+ value="<%= h template_label %>"
25
+ />
26
+ <span class="input-group-btn">
27
+ <button class="btn btn-default btn-select" type="button"
28
+ >
29
+ &hellip;
30
+ </button>
31
+ </span>
32
+ </div>
@@ -0,0 +1,5 @@
1
+ <input id="<%= field.css_id %>" type="<%= field.type %>" name="<%= field.html_name %>"
2
+ value="<%= h field.value %>" <%= field.required? ? 'required' : '' %>
3
+ placeholder="<%= h field.label %><%= field.required? ? ' *' : '' %>"
4
+ class="form-control input-text-inline input-sm" <%= field.html_params %>
5
+ />
@@ -0,0 +1,2 @@
1
+ <textarea id="<%= field.css_id %>" type="text" name="<%= field.html_name %>" <%= field.required? ? 'required' : '' %> class="form-control" rows="<%= (field.value || "").split("\n").size+1 %>"
2
+ ><%= h field.value %></textarea>
@@ -0,0 +1,4 @@
1
+ <fieldset class="<%= fieldset.object_name %> <%= 'fieldset-with-errors' if fieldset.invalid? %> id-<%= fieldset.object.id %> page_block">
2
+ <%= content %>
3
+ <%= fieldset.object.persisted? ? fieldset.hidden(:id) : '' %>
4
+ </fieldset>
@@ -0,0 +1,9 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>preview</title>
5
+ </head>
6
+ <body>
7
+ <%= yield %>
8
+ </body>
9
+ </html>
@@ -0,0 +1,62 @@
1
+ <!DOCTYPE html>
2
+ <html lang="<%= current_locale %>">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
6
+ <meta name="viewport" content="width=device-width, initial-scale=1">
7
+
8
+ <title><%= page_title ? page_title : (config.title? ? config.title : 'aerogel') %></title>
9
+
10
+ <script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
11
+
12
+ <%= assets %>
13
+
14
+ </head>
15
+ <body>
16
+
17
+ <div id="page-header-and-content">
18
+ <div class="header container">
19
+ <%= partial 'layouts/pages/menu', cacheable: [page_root, current_page, current_user] %>
20
+ <%= partial 'layouts/pages/breadcrumbs', cacheable: [page_root, current_page] %>
21
+ </div>
22
+
23
+ <article id="page-content" class="container">
24
+ <h3 class="title">
25
+ <%= page_title %>
26
+ </h3>
27
+ <div class="headers">
28
+ <% if current_page %>
29
+ <div class="published_at">
30
+ <%= l current_page.published_at.try(:to_date),
31
+ default: nil,
32
+ format: :long
33
+ %>
34
+ </div>
35
+ <% end %>
36
+ </div>
37
+
38
+ <hr/>
39
+
40
+ <%= partial 'layouts/pages/flashes' %>
41
+ <%= yield %>
42
+ </article>
43
+ </div>
44
+
45
+ <div id="page-footer">
46
+ <div id="footer-content" class="container">
47
+ <div class="footer">
48
+ <% if can? '/admin/' %>
49
+ <%= link_to '/admin/', icon('fa-dashboard')+" admin" %>
50
+ <% end %>
51
+ environment: <%= settings.environment %>
52
+
53
+ <span class="pull-right">
54
+ <%= icon 'aerogel-logo', style: 'vertical-align:middle' %> aerogel / pages
55
+ </span>
56
+ </div>
57
+ </div>
58
+ </div>
59
+
60
+ </body>
61
+ </html>
62
+
@@ -0,0 +1,20 @@
1
+ <% if current_page.present? && !current_page.root? %>
2
+ <ol class="breadcrumb">
3
+ <% current_page.page_node.ancestors.sort_by(&:depth).each do |page_node| %>
4
+ <li>
5
+ <%= render_once :home, icon('fa-home') %>
6
+ <%= link_to page_node.page(current_locale).try(:url),
7
+ h( page_node.page(current_locale).try(:title) )
8
+ %>
9
+ </li>
10
+ <% end %>
11
+ </ol>
12
+ <% elsif current_page.blank? %>
13
+ <ol class="breadcrumb">
14
+ <li>
15
+ <%= render_once :home, icon('fa-home') %>
16
+ <%= link_to Page.root( current_locale ).try(:url), h( Page.root( current_locale ).try(:title) ) %>
17
+ </li>
18
+ </ol>
19
+
20
+ <% end %>
@@ -0,0 +1,9 @@
1
+ <% if flash[:error] %>
2
+ <div class="alert alert-danger"><%= flash[:error] %></div>
3
+ <% end %>
4
+ <% if flash[:debug] %>
5
+ <div class="alert alert-warning"><%= flash[:debug] %></div>
6
+ <% end %>
7
+ <% if flash[:notice] %>
8
+ <div class="alert alert-info"><%= flash[:notice] %></div>
9
+ <% end %>
@@ -0,0 +1,37 @@
1
+ <ul class="menu open">
2
+ <li>
3
+ <%= link_to "/", icon('fa-home')+" "+Page.root(current_locale).try(:title) %>
4
+ </li>
5
+ <%= partial "layouts/pages/menu_item", collection: Page.root(current_locale).try(:children) %>
6
+
7
+ <li class="divider"></li>
8
+ <li>
9
+ <a href="#" class="smart-link"
10
+ data-show-id=".menu.closed"
11
+ data-hide-id=".menu.open"
12
+ data-effect="slide"
13
+ >
14
+ <%= icon 'fa-bars' %> <%= icon 'fa-caret-up' %>
15
+ </a>
16
+ </li>
17
+ </ul>
18
+
19
+ <ul class="menu closed">
20
+ <li>
21
+ <a href="#" class="smart-link"
22
+ data-show-id=".menu.open"
23
+ data-hide-id=".menu.closed"
24
+ data-effect="slide"
25
+ >
26
+ <%= icon 'fa-bars' %> <%= icon 'fa-caret-down' %>
27
+ </a>
28
+ </li>
29
+ <% Page.available_langs.each do |lang| %>
30
+ <li class="<%= (lang == current_locale) ? 'active' : '' %>">
31
+ <%= link_to current_page_url( locale: lang ), lang.to_s %>
32
+ </li>
33
+ <% end %>
34
+
35
+ <%= partial 'layouts/pages/menu_user', cacheable: current_user %>
36
+
37
+ </ul>
@@ -0,0 +1,15 @@
1
+ <%
2
+ page = menu_item
3
+ subpages = page.children.published.to_a
4
+ %>
5
+ <li class="<%= (current_url.start_with? page.url) ? 'active' : '' %>">
6
+ <%= link_to page.url, h(page.title) %>
7
+
8
+ <% if subpages.present? %>
9
+ <ul class="menu">
10
+ <%= partial "layouts/pages/menu_item", collection: subpages %>
11
+ </ul>
12
+ <% end %>
13
+
14
+ </li>
15
+
@@ -0,0 +1,8 @@
1
+ <li class="pull-right">
2
+ <% if current_user %>
3
+ <%= link_to '/user', icon('fa-user')+" #{current_user.full_name}" %> /
4
+ <%= link_to '/user/logout', icon('glyphicon-log-out')+ " #{t.aerogel.users.actions.logout}" %>
5
+ <% else %>
6
+ <%= link_to '/user/login', icon('glyphicon-log-in')+" #{t.aerogel.users.actions.login}" %>
7
+ <% end %>
8
+ </li>
@@ -0,0 +1,7 @@
1
+ <%=
2
+ begin
3
+ partial "pages/block/#{block.type}", locals: { block: block }, scope: self
4
+ rescue Errno::ENOENT
5
+ partial "pages/block/default", locals: { block: block }, scope: self
6
+ end
7
+ %>
@@ -0,0 +1,5 @@
1
+ <div>
2
+ <span class="nodata">
3
+ &lt; block :<%= block.type %> ignored &gt;
4
+ </span>
5
+ </div>
@@ -0,0 +1 @@
1
+ <hr/>
@@ -0,0 +1,8 @@
1
+ <div class="image <%= block.alignment %>">
2
+ <% if block.thumb.present? %>
3
+ <%= image_thumb_tag block.image, block.thumb, title: block.name %>
4
+ <% else %>
5
+ <%= image_tag block.image %><br/>
6
+ <%= block.name %>
7
+ <% end %>
8
+ </div>
@@ -0,0 +1,13 @@
1
+ <%=
2
+ begin
3
+ if block.template.present?
4
+ partial_name = block.template.sub(/.erb$/, '')
5
+ else
6
+ partial_name = "pages/list/_default.html"
7
+ end
8
+ (erb partial_name.to_sym, locals: { block: block }, scope: self, layout: false)
9
+ rescue Errno::ENOENT
10
+ "<!-- failed to render list using template '#{block.template}', using default template -->"+
11
+ (partial "pages/list/default", locals: { block: block }, scope: self)
12
+ end
13
+ %>
@@ -0,0 +1 @@
1
+ <%= block.content %>
@@ -0,0 +1,7 @@
1
+ <ul class="pages-list">
2
+ <% block.listed_pages.each do |page| %>
3
+ <li>
4
+ <%= link_to page.url, h(page.title) %>
5
+ </li>
6
+ <% end %>
7
+ </ul>
@@ -0,0 +1,12 @@
1
+ <%
2
+ table block.listed_pages do
3
+ unless block.ordered_by == :position
4
+ column block.ordered_by, style: "width:25%" do |page|
5
+ l page.try( block.ordered_by ).try(:to_date), default: '--'
6
+ end
7
+ end
8
+ column :title do |page|
9
+ link_to page.url, page.title
10
+ end
11
+ end
12
+ %>
@@ -0,0 +1,7 @@
1
+ <ul class="pages-list">
2
+ <% block.listed_pages.each do |page| %>
3
+ <li>
4
+ <%= link_to page.url, h(page.title) %>
5
+ </li>
6
+ <% end %>
7
+ </ul>
@@ -0,0 +1,4 @@
1
+ <%= partial "pages/block",
2
+ collection: current_page.page_blocks,
3
+ cacheable: current_page
4
+ %>