integral 1.3.0 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (205) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -30
  3. data/Rakefile +1 -1
  4. data/app/assets/images/integral/defaults/no_image_available.jpg +0 -0
  5. data/app/assets/javascripts/integral/backend.js +102 -11
  6. data/app/assets/javascripts/integral/frontend.js +37 -0
  7. data/app/assets/javascripts/integral/support/confirm_modal.coffee +2 -2
  8. data/app/assets/javascripts/integral/support/gallery.coffee +71 -54
  9. data/app/assets/javascripts/integral/support/lib/lazysizes.js +755 -0
  10. data/app/assets/javascripts/integral/support/lib/materialize-tags.js +49 -44
  11. data/app/assets/javascripts/integral/support/ls.instagram.js +57 -0
  12. data/app/assets/javascripts/integral/support/ls.twitter.js +66 -0
  13. data/app/assets/javascripts/integral/support/record_selector.coffee +1 -1
  14. data/app/assets/javascripts/integral/support/remote_form.coffee +5 -2
  15. data/app/assets/stylesheets/integral/backend.sass +2 -1
  16. data/app/assets/stylesheets/integral/backend/_foundation_settings.scss +3 -4
  17. data/app/assets/stylesheets/integral/backend/dashboard-layout.scss +4 -1
  18. data/app/assets/stylesheets/integral/backend/materialize-tags.sass +1 -1
  19. data/app/assets/stylesheets/integral/backend/modules/timeline.scss +214 -0
  20. data/app/assets/stylesheets/integral/backend/shared.sass +80 -11
  21. data/app/assets/stylesheets/integral/frontend.scss +45 -0
  22. data/app/assets/stylesheets/integral/frontend/_foundation_settings.scss +2 -2
  23. data/app/assets/stylesheets/integral/frontend/blog.sass +155 -142
  24. data/app/assets/stylesheets/integral/frontend/layout.sass +3 -3
  25. data/app/assets/stylesheets/integral/frontend/modules/article-footer.scss +55 -0
  26. data/app/assets/stylesheets/integral/frontend/modules/article.scss +34 -0
  27. data/app/assets/stylesheets/integral/frontend/modules/horizontal-post.scss +44 -0
  28. data/app/assets/stylesheets/integral/frontend/modules/inline-articles.scss +23 -0
  29. data/app/assets/stylesheets/integral/frontend/modules/latest-post.scss +37 -0
  30. data/app/assets/stylesheets/integral/frontend/modules/list-widget.scss +50 -0
  31. data/app/assets/stylesheets/integral/frontend/modules/piped-list.scss +33 -0
  32. data/app/assets/stylesheets/integral/frontend/modules/post-tags.scss +19 -0
  33. data/app/assets/stylesheets/integral/frontend/modules/scroll-container.scss +9 -0
  34. data/app/assets/stylesheets/integral/frontend/modules/sidebar-articles.scss +42 -0
  35. data/app/assets/stylesheets/integral/frontend/modules/sidebar-tags.scss +6 -0
  36. data/app/assets/stylesheets/integral/frontend/modules/sidebar-widget.scss +47 -0
  37. data/app/assets/stylesheets/integral/frontend/modules/vertical-post.scss +31 -0
  38. data/app/assets/stylesheets/integral/frontend/share_modal.sass +0 -5
  39. data/app/assets/stylesheets/integral/support/gallery.sass +8 -0
  40. data/app/assets/stylesheets/integral/support/media-query-indicator.sass +6 -0
  41. data/app/controllers/integral/application_controller.rb +7 -1
  42. data/app/controllers/integral/backend/activities_controller.rb +13 -2
  43. data/app/controllers/integral/backend/base_controller.rb +60 -7
  44. data/app/controllers/integral/backend/categories_controller.rb +49 -0
  45. data/app/controllers/integral/backend/pages_controller.rb +7 -2
  46. data/app/controllers/integral/backend/posts_controller.rb +8 -3
  47. data/app/controllers/integral/backend/static_pages_controller.rb +4 -0
  48. data/app/controllers/integral/backend/users_controller.rb +13 -7
  49. data/app/controllers/integral/categories_controller.rb +31 -0
  50. data/app/controllers/integral/pages_controller.rb +1 -1
  51. data/app/controllers/integral/posts_controller.rb +5 -3
  52. data/app/decorators/integral/category_decorator.rb +30 -0
  53. data/app/decorators/integral/category_version_decorator.rb +7 -0
  54. data/app/decorators/integral/image_version_decorator.rb +7 -0
  55. data/app/decorators/integral/list_decorator.rb +1 -1
  56. data/app/decorators/integral/list_version_decorator.rb +7 -0
  57. data/app/decorators/integral/page_version_decorator.rb +7 -0
  58. data/app/decorators/integral/post_decorator.rb +9 -1
  59. data/app/decorators/integral/post_version_decorator.rb +7 -0
  60. data/app/decorators/integral/user_decorator.rb +1 -1
  61. data/app/decorators/integral/user_version_decorator.rb +7 -0
  62. data/app/decorators/integral/version_decorator.rb +51 -12
  63. data/app/helpers/integral/backend/base_helper.rb +56 -2
  64. data/app/helpers/integral/blog_helper.rb +21 -4
  65. data/app/jobs/integral/webhook/delivery_job.rb +37 -0
  66. data/app/mailers/integral/contact_mailer.rb +4 -1
  67. data/app/models/concerns/integral/lazy_contentable.rb +54 -0
  68. data/app/models/concerns/integral/webhook/delivery.rb +30 -0
  69. data/app/models/concerns/integral/webhook/observable.rb +23 -0
  70. data/app/models/integral/category.rb +20 -0
  71. data/app/models/integral/category_version.rb +8 -0
  72. data/app/models/integral/list_item.rb +1 -2
  73. data/app/models/integral/page.rb +18 -3
  74. data/app/models/integral/post.rb +28 -1
  75. data/app/models/integral/version.rb +2 -2
  76. data/app/models/integral/webhook/endpoint.rb +40 -0
  77. data/app/models/integral/webhook/event.rb +20 -0
  78. data/app/policies/integral/base_policy.rb +1 -0
  79. data/app/policies/integral/category_policy.rb +9 -0
  80. data/app/serializers/integral/post_serializer.rb +24 -0
  81. data/app/uploaders/integral/avatar_uploader.rb +1 -1
  82. data/app/views/integral/backend/activities/_activity.haml +21 -0
  83. data/app/views/integral/backend/activities/_grid.haml +1 -2
  84. data/app/views/integral/backend/activities/shared/_grid.haml +3 -2
  85. data/app/views/integral/backend/activities/shared/{_listing.haml → index.haml} +1 -0
  86. data/app/views/integral/backend/activities/shared/{_log.haml → show.haml} +0 -0
  87. data/app/views/integral/backend/categories/_modal.haml +25 -0
  88. data/app/views/integral/backend/lists/_child_fields.haml +1 -1
  89. data/app/views/integral/backend/lists/_item_container.haml +1 -1
  90. data/app/views/integral/backend/lists/_item_modal.haml +1 -1
  91. data/app/views/integral/backend/lists/_list_item_fields.haml +1 -1
  92. data/app/views/integral/backend/pages/_form.haml +1 -4
  93. data/app/views/integral/backend/pages/_grid.haml +34 -9
  94. data/app/views/integral/backend/pages/edit.haml +9 -3
  95. data/app/views/integral/backend/pages/index.haml +11 -21
  96. data/app/views/integral/backend/pages/list.haml +22 -0
  97. data/app/views/integral/backend/pages/show.haml +48 -0
  98. data/app/views/integral/backend/posts/_form.haml +8 -6
  99. data/app/views/integral/backend/posts/_grid.haml +33 -7
  100. data/app/views/integral/backend/posts/index.haml +13 -19
  101. data/app/views/integral/backend/posts/list.haml +20 -0
  102. data/app/views/integral/backend/posts/show.haml +54 -0
  103. data/app/views/integral/backend/shared/_activity_modal.haml +13 -0
  104. data/app/views/integral/backend/shared/cards/_categories.haml +34 -0
  105. data/app/views/integral/backend/{static_pages/_card.haml → shared/cards/_object.haml} +0 -0
  106. data/app/views/integral/backend/shared/cards/_recent_activity.haml +20 -0
  107. data/app/views/integral/backend/shared/cards/_recent_pages.haml +19 -0
  108. data/app/views/integral/backend/shared/cards/_recent_posts.haml +18 -0
  109. data/app/views/integral/backend/shared/cards/_recent_user_activity.haml +1 -0
  110. data/app/views/integral/backend/shared/cards/_recent_users.haml +19 -0
  111. data/app/views/integral/backend/shared/cards/_top_post_authors.haml +19 -0
  112. data/app/views/integral/backend/shared/record_selector/_record.haml +6 -4
  113. data/app/views/integral/backend/static_pages/dashboard.haml +13 -11
  114. data/app/views/integral/backend/users/_grid.haml +24 -7
  115. data/app/views/integral/backend/users/index.haml +11 -17
  116. data/app/views/integral/backend/users/list.haml +18 -0
  117. data/app/views/integral/backend/users/show.haml +5 -11
  118. data/app/views/integral/categories/show.haml +5 -0
  119. data/app/views/integral/posts/_article_footer.haml +17 -0
  120. data/app/views/integral/posts/_card.haml +11 -0
  121. data/app/views/integral/posts/_latest_post.haml +8 -0
  122. data/app/views/integral/posts/_most_read_section.haml +8 -0
  123. data/app/views/integral/posts/_post.haml +11 -0
  124. data/app/views/integral/posts/_similar_posts.haml +5 -0
  125. data/app/views/integral/posts/index.haml +6 -5
  126. data/app/views/integral/posts/templates/default.haml +34 -33
  127. data/app/views/integral/shared/_subscribe_modal.haml +14 -0
  128. data/app/views/integral/shared/blog/_categories.haml +15 -0
  129. data/app/views/integral/shared/blog/_layout.haml +9 -0
  130. data/app/views/integral/shared/blog/_sidebar.haml +10 -0
  131. data/app/views/integral/shared/gallery/_placeholder.haml +1 -1
  132. data/app/views/integral/shared/gallery/_slide.haml +2 -2
  133. data/app/views/integral/shared/gallery/gallery.haml +5 -2
  134. data/app/views/integral/shared/sidebar/_item.haml +8 -0
  135. data/app/views/integral/shared/sidebar/_newsletter_signup.haml +7 -0
  136. data/app/views/integral/shared/sidebar/_popular_posts.haml +7 -0
  137. data/app/views/integral/shared/sidebar/_popular_tags.haml +7 -0
  138. data/app/views/integral/shared/sidebar/_recent_posts.haml +7 -0
  139. data/app/views/integral/tags/index.haml +2 -2
  140. data/app/views/integral/tags/show.haml +3 -6
  141. data/app/views/layouts/integral/backend.html.haml +3 -0
  142. data/app/views/layouts/integral/backend/_main_menu_items.haml +10 -0
  143. data/app/views/layouts/integral/frontend.html.haml +3 -3
  144. data/config/locales/en.yml +52 -49
  145. data/db/migrate/20190414172018_create_webhook_endpoints.rb +10 -0
  146. data/db/migrate/20190929191412_add_integral_post_categories.rb +13 -0
  147. data/db/migrate/20191203090008_add_image_to_integral_categories.rb +6 -0
  148. data/db/migrate/20200401210442_create_category_versions.rb +20 -0
  149. data/db/seeds.rb +3 -1
  150. data/lib/generators/integral/assets_generator.rb +2 -2
  151. data/lib/generators/integral/install_generator.rb +1 -1
  152. data/lib/generators/integral/views_generator.rb +1 -1
  153. data/lib/generators/templates/integral.rb +5 -0
  154. data/lib/integral.rb +3 -30
  155. data/lib/integral/acts_as_listable.rb +2 -2
  156. data/lib/integral/chart_renderer/base.rb +2 -0
  157. data/lib/integral/content_renderer.rb +2 -2
  158. data/lib/integral/engine.rb +2 -2
  159. data/lib/integral/grids/activities_grid.rb +15 -1
  160. data/lib/integral/list_item_renderer.rb +4 -2
  161. data/lib/integral/list_renderer.rb +1 -0
  162. data/lib/integral/middleware/page_router.rb +15 -6
  163. data/lib/integral/router.rb +19 -3
  164. data/lib/integral/version.rb +1 -1
  165. data/lib/integral/widgets/swiper_list.rb +3 -2
  166. data/public/images/integral/demo/continous-integration.png +0 -0
  167. data/public/images/integral/demo/foundation-frontend-framework.jpg +0 -0
  168. data/public/images/integral/demo/heroku.png +0 -0
  169. data/public/images/integral/demo/integral-cms-without-hassle.jpg +0 -0
  170. data/public/images/integral/demo/integral-features-activity-tracking.jpg +0 -0
  171. data/public/images/integral/demo/integral-features-contact-form.png +0 -0
  172. data/public/images/integral/demo/integral-features-design.jpg +0 -0
  173. data/public/images/integral/demo/integral-features-dynamic-pages.jpg +0 -0
  174. data/public/images/integral/demo/integral-features-image-management.jpg +0 -0
  175. data/public/images/integral/demo/integral-features-integrated-blog.jpg +0 -0
  176. data/public/images/integral/demo/integral-features-list-management.jpg +0 -0
  177. data/public/images/integral/demo/integral-features-seo-ready.jpg +0 -0
  178. data/public/images/integral/demo/integral-features-user-management.jpg +0 -0
  179. data/public/images/integral/demo/integral-presentation.png +0 -0
  180. data/spec/factories.rb +15 -7
  181. metadata +110 -98
  182. data/app/assets/javascripts/ckeditor/plugins/integral-card/icons/copywidget.png +0 -0
  183. data/app/assets/javascripts/ckeditor/plugins/integral-card/icons/editwidget.png +0 -0
  184. data/app/assets/javascripts/ckeditor/plugins/integral-card/icons/hidpi/copywidget.png +0 -0
  185. data/app/assets/javascripts/ckeditor/plugins/integral-card/icons/hidpi/editwidget.png +0 -0
  186. data/app/assets/javascripts/ckeditor/plugins/integral-card/icons/hidpi/removewidget.png +0 -0
  187. data/app/assets/javascripts/ckeditor/plugins/integral-card/icons/hidpi/widget.png +0 -0
  188. data/app/assets/javascripts/ckeditor/plugins/integral-card/icons/removewidget.png +0 -0
  189. data/app/assets/javascripts/ckeditor/plugins/integral-card/icons/widget.png +0 -0
  190. data/app/assets/javascripts/ckeditor/plugins/integral-card/plugin.js +0 -86
  191. data/app/assets/javascripts/ckeditor/plugins/integralrecentposts/dialogs/integralrecentposts.js +0 -40
  192. data/app/assets/javascripts/ckeditor/plugins/integralrecentposts/plugin.js +0 -32
  193. data/app/assets/javascripts/ckeditor/plugins/numericinput/LICENSE.md +0 -363
  194. data/app/assets/javascripts/ckeditor/plugins/numericinput/README.md +0 -16
  195. data/app/assets/javascripts/ckeditor/plugins/numericinput/plugin.js +0 -354
  196. data/app/assets/stylesheets/integral/frontend.sass +0 -25
  197. data/app/views/integral/backend/pages/activities.haml +0 -2
  198. data/app/views/integral/backend/pages/activity.haml +0 -1
  199. data/app/views/integral/backend/posts/activities.haml +0 -3
  200. data/app/views/integral/backend/posts/activity.haml +0 -1
  201. data/app/views/integral/posts/_collection.haml +0 -4
  202. data/app/views/integral/posts/_item.haml +0 -16
  203. data/app/views/integral/shared/_blog_layout.haml +0 -15
  204. data/app/views/integral/shared/_blog_sidebar.haml +0 -49
  205. data/lib/integral/slack_bot.rb +0 -45
@@ -0,0 +1,54 @@
1
+ = content_for :title, @resource.title
2
+
3
+ .grid-x
4
+ .cell.large-6
5
+ -# Left Column
6
+ .grid-x.grid-padding-x
7
+ .cell
8
+ .card
9
+ .card-section
10
+ %h2= @resource.title
11
+ %p.subtitle= @resource.description
12
+ %hr
13
+
14
+ .grid-x.actions
15
+ .cell.xlarge-8.xxlarge-6
16
+ .grid-x.small-up-2
17
+ .cell
18
+ = link_to post_url(@resource) do
19
+ = icon('eye')
20
+ = t('integral.actions.view_on_site')
21
+ - if policy(Integral::Post).manager?
22
+ .cell
23
+ = link_to edit_backend_post_url(@resource.id) do
24
+ = icon('edit')
25
+ = t('integral.actions.edit')
26
+ - if policy(Integral::Post).duplicate?
27
+ .cell
28
+ = link_to duplicate_backend_post_url(@resource.id), method: :post, data: { confirm: t('integral.actions.confirmation.clone') } do
29
+ = icon('clone')
30
+ = t('integral.actions.clone')
31
+ - if policy(Integral::Post).manager?
32
+ .cell
33
+ = link_to backend_post_url(@resource.id), method: :delete, data: { confirm: t('integral.actions.confirmation.deletion') } do
34
+ = icon('remove')
35
+ = t('integral.actions.delete')
36
+ - if policy(Integral::Version).manager?
37
+ .cell
38
+ = link_to activities_backend_post_url(@resource.id) do
39
+ = icon('history')
40
+ = t('integral.actions.view_history')
41
+
42
+ .cell.medium-6.flex-container= render_card(:object, { title: 'Essentials', record: @resource })
43
+ .cell.medium-6.flex-container= render_card(:recent_user_activity)
44
+ .cell.large-6
45
+ -# Right Column
46
+ .grid-x.grid-padding-x
47
+ .cell= render_card(:recent_activity)
48
+ -# Could use the at_a_glance card to show user edits
49
+ -# .cell= render_card(:at_a_glance, { dataset: dataset_dashboard_atg })
50
+ -# .cell
51
+ -# .card
52
+ -# .card-section
53
+ -# %h2= t('integral.backend.cards.last_week')
54
+ -# = render_line_chart(dataset_dashboard_last_week)
@@ -0,0 +1,13 @@
1
+ #activity-placeholder.large.reveal{ data: {reveal: true }}
2
+ %button.close-button{ data: { close: '' }, aria: { label: "Close modal" }}
3
+ %span{ aria: { hidden: true } } ×
4
+ .modal-header
5
+ %h4{data: {title: true }}
6
+ .timeline{data: {timeline: true }}
7
+ = simple_form_for :grid, url: widget_backend_activities_url, method: :post, remote: true, html: { 'data-recent-activity-form' => true } do |f|
8
+ = f.hidden_field(:created_at, value: '')
9
+ = f.hidden_field(:user, value: '')
10
+ = f.hidden_field(:object, value: '')
11
+ = f.hidden_field(:item_id, value: '')
12
+ = f.button(:submit, t('integral.actions.view_more'), class: 'button clear expanded')
13
+
@@ -0,0 +1,34 @@
1
+ .card
2
+ .card-section
3
+ .card-action-title
4
+ %h2 Categories
5
+ %button.button.hollow{ 'data-open' => 'new_category_modal' } Create
6
+ %table.hover
7
+ - Integral::Category.all.decorate.each do |category|
8
+ %tr
9
+ %td= category.title
10
+ %td
11
+ %span.badge= category.posts.count
12
+ %td
13
+ %button.button--action-pane{ 'data-toggle' => "dropdown-pane-actions-category-#{category.id}" }
14
+ = icon('ellipsis-v')
15
+ .dropdown-pane.dropdown-pane--actions{ id: "dropdown-pane-actions-category-#{category.id}", data: { dropdown: true, position: :bottom, alignment: :right, close_on_click: 'true' } }
16
+ %ul.menu.vertical
17
+ %li
18
+ %button{ data: { modal_url: edit_backend_category_url(category.id), button_edit_category: "modal--category-edit-#{category.id}" } }
19
+ = icon('edit')
20
+ = t('integral.actions.edit')
21
+ %li
22
+ - if category.posts.count.zero?
23
+ = link_to backend_category_url(category.id), method: :delete, data: { confirm: t('integral.actions.confirmation.deletion'), button_delete_category: true }, remote: true do
24
+ = icon('remove')
25
+ = t('integral.actions.delete')
26
+
27
+
28
+ - else
29
+ %button.disabled{ title: "Cannot delete categories which include posts.", data: { tooltip: true, position: "bottom", alignment: "center" } }
30
+ = icon('remove')
31
+ = t('integral.actions.delete')
32
+
33
+
34
+ = render partial: 'integral/backend/categories/modal', locals: { title: 'Category Creation' }
@@ -0,0 +1,20 @@
1
+ - classes ||= ''
2
+ - title ||= t('integral.backend.cards.recent_activity')
3
+ - grid ||= recent_site_activity_grid
4
+ - activities = cast_activities(grid.assets.limit(5))
5
+
6
+ .card
7
+ .card-section
8
+ %h2= title
9
+ - if activities.present?
10
+ .timeline{ class: classes }
11
+ = render partial: 'integral/backend/activities/activity', collection: activities
12
+
13
+ - if grid.assets.count > 5
14
+ %button.button.clear.expanded{ data: { recent_activity: true, recent_activity_created_at: activities.last.created_at.utc, recent_activity_user: grid.user, recent_activity_object: grid.object, recent_activity_item_id: grid.item_id, container_id: "modal--recent-activity-#{SecureRandom.hex}", recent_activity_title: title } }
15
+ = t('integral.actions.view_more')
16
+
17
+ - else
18
+ = t('integral.backend.graphs.data_unavailable')
19
+ = image_tag image_path('integral/backend/data-unavailable.png'), class: 'data-unavailable'
20
+
@@ -0,0 +1,19 @@
1
+ -# TODO: Should look to merge this partial with recent_posts to create recent_resources card
2
+ .card
3
+ .card-section
4
+ .card-action-title
5
+ %h2 Recent Pages
6
+ %table.hover
7
+ - Integral::Page.published.limit(5).decorate.each do |record|
8
+ %tr
9
+ %td= record.title
10
+ -# %td
11
+ -# - if record.user.present?
12
+ -# = image_tag record.user.avatar.url(:thumbnail), alt: record.user.name, class: 'avatar'
13
+ -# = record.user.name
14
+ -# - else
15
+ -# "#{record.user_id} [Deleted]"
16
+ %td
17
+ = link_to backend_page_url(record.id), class: 'button--action-pane' do
18
+ = icon('eye')
19
+ = link_to t('integral.actions.view_all'), list_backend_pages_url, class: 'button clear expanded'
@@ -0,0 +1,18 @@
1
+ .card
2
+ .card-section
3
+ .card-action-title
4
+ %h2 Recent Posts
5
+ %table.hover
6
+ - Integral::Post.published.limit(5).decorate.each do |record|
7
+ %tr
8
+ %td= record.title
9
+ %td
10
+ - if record.user.present?
11
+ = image_tag record.user.avatar.url(:thumbnail), alt: record.user.name, class: 'avatar'
12
+ = record.user.name
13
+ - else
14
+ "#{record.user_id} [Deleted]"
15
+ %td
16
+ = link_to backend_post_url(record.id), class: 'button--action-pane' do
17
+ = icon('eye')
18
+ = link_to t('integral.actions.view_all'), list_backend_posts_url, class: 'button clear expanded'
@@ -0,0 +1 @@
1
+ = render partial: 'integral/backend/shared/cards/recent_activity', locals: { title: t('integral.backend.cards.your_activity'), grid: recent_user_activity_grid, classes: 'timeline--compressed' }
@@ -0,0 +1,19 @@
1
+ -# TODO: Should look to merge this partial with recent_posts to create recent_resources card
2
+ .card
3
+ .card-section
4
+ .card-action-title
5
+ %h2 Recent Users
6
+ %table.hover
7
+ - Integral::User.order('created_at DESC').limit(5).decorate.each do |record|
8
+ %tr
9
+ %td= record.name
10
+ -# %td
11
+ -# - if record.user.present?
12
+ -# = image_tag record.user.avatar.url(:thumbnail), alt: record.user.name, class: 'avatar'
13
+ -# = record.user.name
14
+ -# - else
15
+ -# "#{record.user_id} [Deleted]"
16
+ %td
17
+ = link_to backend_user_url(record.id), class: 'button--action-pane' do
18
+ = icon('eye')
19
+ = link_to t('integral.actions.view_all'), list_backend_users_url, class: 'button clear expanded'
@@ -0,0 +1,19 @@
1
+ - user_ids = Integral::Post.published.group(:user_id).count.sort_by(&:last).reverse.to_h
2
+ - post_users = Integral::User.where(id: user_ids.keys).decorate.sort_by { |prod| user_ids.keys.index(prod.id) }
3
+ .card
4
+ .card-section
5
+ .card-action-title
6
+ %h2 Top Authors
7
+ .stat-table
8
+ .stat-table-heading
9
+ .stat-table-header Total Authors
10
+ .stat-table-header-count= user_ids.count
11
+ %table.unstriped.hover
12
+ - post_users.each do |record|
13
+ %tr
14
+ %td
15
+ = image_tag record.avatar.url(:thumbnail), alt: record.name, class: 'avatar'
16
+ = record.name
17
+ %td
18
+ %span.badge.secondary= user_ids[record.id]
19
+
@@ -1,6 +1,8 @@
1
+ :ruby
2
+ if list_item[:image].respond_to?(:url)
3
+ list_item[:image] = list_item[:image].url(:small)
4
+ end
5
+
1
6
  .cell.large-2.medium-3.small-4
2
7
  .record{ data: list_item }
3
- - if list_item[:image].respond_to?(:url)
4
- %img{ src: list_item[:image].url(:small) }
5
- - else
6
- %img{ src: list_item[:image] }
8
+ %img{ src: list_item[:image] }
@@ -1,19 +1,21 @@
1
+ = content_for :title, t('.title')
2
+
1
3
  .grid-x
2
4
  .cell.large-6
5
+ -# Left Column
3
6
  .grid-x.grid-padding-x
4
- .cell.small-12
5
- = render partial: 'integral/backend/shared/cards/welcome'
6
- - if Integral.blog_enabled?
7
- .cell.small-12.medium-6.flex-container
8
- = render partial: 'integral/backend/static_pages/card', locals: { title: t('.recent_post'), record: Integral::Post.published.last }
9
- .cell.small-12.medium-6.flex-container
10
- = render partial: 'integral/backend/static_pages/card', locals: { title: t('.recent_page'), record: Integral::Page.published.last }
7
+ .cell= render_card(:welcome)
8
+ - if Integral.blog_enabled? & Integral::Post.published.last.present?
9
+ .cell.medium-6.flex-container= render_card(:object, { title: t('.recent_post'), record: Integral::Post.published.last })
10
+
11
+ .cell.medium-6.flex-container= render_card(:recent_user_activity)
12
+ .cell.medium-6.flex-container= render_card(:object, { title: t('.recent_page'), record: Integral::Page.published.last })
11
13
  .cell.large-6
14
+ -# Right Column
12
15
  .grid-x.grid-padding-x
13
- .cell.small-12
14
- = render partial: 'integral/backend/shared/cards/at_a_glance', locals: { dataset: dataset_dashboard_atg }
15
-
16
- .cell.small-12
16
+ .cell= render_card(:recent_activity)
17
+ .cell= render_card(:at_a_glance, { dataset: dataset_dashboard_atg })
18
+ .cell
17
19
  .card
18
20
  .card-section
19
21
  %h2= t('integral.backend.cards.last_week')
@@ -2,18 +2,35 @@
2
2
  = render layout: 'integral/backend/shared/grid', locals: { grid: @grid, options: { columns: [:name, :email, :updated_at, :actions], order: true }} do |grid|
3
3
  - if grid.assets.any?
4
4
  - grid.assets.decorate.each do |record|
5
- %tr
5
+ %tr.tr--clickable{ data: { href: backend_user_url(record.id), context_menu: "dropdown-pane-actions-user-#{record.id}" }}
6
6
  %td
7
7
  = image_tag record.avatar.url(:thumbnail), class: :avatar
8
8
  = record.name.truncate(30)
9
9
  %td= record.email
10
10
  %td= l(record.updated_at, format: :long)
11
11
  %td.actions
12
- = link_to backend_user_url(record) do
13
- = icon('eye')
14
- = link_to edit_backend_user_url(record) do
15
- = icon('edit')
16
- = link_to backend_user_url(record), method: :delete, data: { confirm: t('integral.actions.confirmation.deletion') } do
17
- = icon('remove')
12
+ %button.button--action-pane{ 'data-toggle' => "dropdown-pane-actions-user-#{record.id}" }
13
+ = icon('ellipsis-v')
14
+ .dropdown-pane.dropdown-pane--actions{ id: "dropdown-pane-actions-user-#{record.id}", data: { dropdown: true, position: :bottom, alignment: :right, close_on_click: 'true' } }
15
+ %ul.menu.vertical
16
+ - if policy(Integral::User).manager?
17
+ %li
18
+ = link_to edit_backend_user_url(record.id) do
19
+ = icon('edit')
20
+ = t('integral.actions.edit')
21
+ %li
22
+ = link_to backend_user_url(record.id), target: :blank do
23
+ = icon('external-link')
24
+ = t('integral.actions.open_in_new_tab')
25
+ -# - if policy(Integral::Version).manager?
26
+ -# %li
27
+ -# = link_to activities_backend_post_url(record.id) do
28
+ -# = icon('history')
29
+ -# = t('integral.actions.view_history')
30
+ - if policy(Integral::User).manager?
31
+ %li
32
+ = link_to backend_user_url(record.id), method: :delete, data: { confirm: t('integral.actions.confirmation.deletion') } do
33
+ = icon('remove')
34
+ = t('integral.actions.delete')
18
35
  - else
19
36
  = render partial: 'integral/backend/shared/empty_grid'
@@ -1,18 +1,12 @@
1
- .card.listing
2
- .card-section
3
- %h2.show-for-small-only= t('.title')
4
- = link_to t('integral.actions.create'), new_backend_user_url, class: 'button hollow show-for-small-only create'
5
- .top-bar
6
- .top-bar-left.hide-for-small-only
7
- = link_to t('integral.actions.create'), new_backend_user_url, class: 'button hollow'
8
- .top-bar-right
9
- = simple_form_for :grid, url: backend_users_url, method: :get, remote: true, html: { id: :grid_form, 'data-type' => :json } do |f|
10
- = hidden_field_tag(:gridview, true)
11
- = f.hidden_field(:descending, value: @grid.descending, class: 'desc-field')
12
- = f.hidden_field(:order, value: @grid.order, class: 'order-field')
13
- = f.hidden_field(:page, value: grid_options[:page], class: 'page-field')
1
+ .grid-x.grid-padding-x
2
+ -# Left Column
3
+ .cell.large-6
4
+ .grid-x.grid-padding-x
5
+ .cell= render_card(:recent_users)
6
+ .cell.large-6= render_card(:recent_user_activity)
7
+ -# .cell= render_card(:at_a_glance, { dataset: dataset_at_a_glance_posts })
14
8
 
15
- %ul.align-right.menu.filters
16
- %li= f.input :name, placeholder: t('integral.actions.search'), wrapper_html: { class: 'filter search' }, hint: false, label: false
17
-
18
- = render partial: 'grid'
9
+ -# Right Column
10
+ .cell.large-6
11
+ .grid-x.grid-padding-x
12
+ .cell= render_card(:recent_activity)
@@ -0,0 +1,18 @@
1
+ .card.listing
2
+ .card-section
3
+ %h2.show-for-small-only= page_title
4
+ = link_to t('integral.actions.create'), new_backend_user_url, class: 'button hollow show-for-small-only create'
5
+ .top-bar
6
+ .top-bar-left.hide-for-small-only
7
+ = link_to t('integral.actions.create'), new_backend_user_url, class: 'button hollow'
8
+ .top-bar-right
9
+ = simple_form_for :grid, url: backend_users_url, method: :get, remote: true, html: { id: :grid_form, 'data-type' => :json } do |f|
10
+ = hidden_field_tag(:gridview, true)
11
+ = f.hidden_field(:descending, value: @grid.descending, class: 'desc-field')
12
+ = f.hidden_field(:order, value: @grid.order, class: 'order-field')
13
+ = f.hidden_field(:page, value: grid_options[:page], class: 'page-field')
14
+
15
+ %ul.align-right.menu.filters
16
+ %li= f.input :name, placeholder: t('integral.actions.search'), wrapper_html: { class: 'filter search' }, hint: false, label: false
17
+
18
+ = render partial: 'grid'
@@ -1,6 +1,6 @@
1
1
  = content_for :title, t('.title', name: @resource.name)
2
2
  .grid-x.grid-padding-x
3
- .cell.small-12.medium-6
3
+ .cell.medium-6
4
4
  .grid-y
5
5
  .cell
6
6
  .card.profile
@@ -24,13 +24,7 @@
24
24
  .roles
25
25
  - @resource.roles.each do |role|
26
26
  .label= role.label
27
- -# .cell
28
- -# .card
29
- -# .card-section
30
- -# Creates Graph
31
- -# .cell.small-12.medium-6
32
- -# .grid-y
33
- -# .cell
34
- -# .card
35
- -# .card-section
36
- -# %h2 Activity
27
+
28
+ .cell.medium-6
29
+ .grid-y
30
+ .cell= render_card(:recent_activity, { grid: recent_activity_grid(user: @resource.id) })
@@ -0,0 +1,5 @@
1
+ = render_posts_as_json_ld(@posts.decorate, title: @resource.title, url: category_path(@resource), description: @resource.description)
2
+
3
+ = render layout: 'integral/shared/blog/layout', locals: { title: @resource.title } do
4
+ = render partial: @posts.decorate, cached: true
5
+ .center= will_paginate @posts, renderer: FoundationPagination::Rails
@@ -0,0 +1,17 @@
1
+ %footer.article-footer
2
+ .grid-x
3
+ .cell.medium-7
4
+ %ul.post-tags
5
+ %li
6
+ %span
7
+ = "#{t('integral.navigation.tags')}:"
8
+ - @post.tags_on(@post.tag_context).each do |tag|
9
+ %li= link_to tag.name, tag_url(tag)
10
+ .cell.medium-5.article-footer-actions
11
+ %button.button.secondary{ 'data-open' => 'share-modal' }= t('integral.actions.share')
12
+ %button.button{ 'data-open' => 'subscribe-modal' }= t('integral.actions.subscribe')
13
+ %section.grid-x.grid-margin-x
14
+ .cell.small-2.medium-3.large-2
15
+ %article.article-footer-image= @post.avatar
16
+ .cell.small-10.medium-9.large-10
17
+ %p= t('integral.posts.show.footer.blurb')
@@ -0,0 +1,11 @@
1
+ .cell.small-3.flex-container
2
+ .card.post-card
3
+ = link_to integral.post_url(post) do
4
+ = image_tag post.image(:medium), class: 'post-card-image'
5
+ .card-section
6
+ %h3= post.title
7
+ %p= post.description
8
+ %ul.list-unstyled.piped-list
9
+ %li= post.published_at
10
+ -# %li= link_to 'Category', root_url
11
+ %li= post.category.title
@@ -0,0 +1,8 @@
1
+ .latest-post
2
+ = link_to integral.post_url(post) do
3
+ = image_tag post.image(:large)
4
+ %h2.latest-post-title= link_to post.title, integral.post_path(post)
5
+ %p= post.description
6
+ %ul.list-unstyled.piped-list
7
+ %li= post.published_at
8
+ %li= link_to post.category.title, category_path(post.category)
@@ -0,0 +1,8 @@
1
+ .inline-articles{ 'data-most-read-posts' => true}
2
+ %h2= t('integral.blog.widgets.most_read')
3
+ .grid-x.grid-padding-x
4
+ - most_read_posts.each do |post|
5
+ .cell.small-6.medium-3
6
+ = link_to post do
7
+ = image_tag post.image(:medium)
8
+ .inline-articles-title= post.title
@@ -0,0 +1,11 @@
1
+ .horizontal-post
2
+ .grid-x.grid-padding-x
3
+ .cell.small-4
4
+ = link_to integral.post_url(post) do
5
+ = image_tag post.image
6
+ .cell.small-8.horizontal-post-body
7
+ %h3= link_to post.title, integral.post_url(post)
8
+ %p.show-for-medium= post.description
9
+ %ul.list-unstyled.piped-list
10
+ %li= post.published_at
11
+ %li= link_to post.category.title, category_path(post.category)