integral 1.4.0 → 1.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/README.md +4 -3
- data/app/assets/javascripts/integral/backend.js +86 -2
- data/app/assets/javascripts/integral/support/character_counter.js +13 -8
- data/app/assets/javascripts/integral/support/list.coffee +1 -0
- data/app/assets/javascripts/integral/support/record_selector.coffee +2 -0
- data/app/assets/javascripts/integral/support/slug_generator.coffee +1 -0
- data/app/assets/stylesheets/integral/backend.sass +34 -23
- data/app/assets/stylesheets/integral/backend/_foundation_settings.scss +2 -2
- data/app/assets/stylesheets/integral/backend/dashboard-layout.scss +27 -63
- data/app/assets/stylesheets/integral/backend/devise.sass +2 -3
- data/app/assets/stylesheets/integral/backend/materialize-tags.sass +1 -0
- data/app/assets/stylesheets/integral/backend/modules/dropdown_pane_notifications.scss +150 -0
- data/app/assets/stylesheets/integral/backend/modules/dropdown_pane_profile.scss +59 -0
- data/app/assets/stylesheets/integral/backend/shared.sass +41 -2
- data/app/assets/stylesheets/integral/frontend/layout.sass +10 -0
- data/app/assets/stylesheets/integral/support/media-query-indicator.sass +4 -4
- data/app/controllers/integral/backend/activities_controller.rb +21 -27
- data/app/controllers/integral/backend/base_controller.rb +87 -37
- data/app/controllers/integral/backend/images_controller.rb +26 -8
- data/app/controllers/integral/backend/lists_controller.rb +2 -14
- data/app/controllers/integral/backend/notification_subscriptions_controller.rb +23 -0
- data/app/controllers/integral/backend/pages_controller.rb +0 -4
- data/app/controllers/integral/backend/posts_controller.rb +0 -4
- data/app/controllers/integral/backend/settings_controller.rb +4 -0
- data/app/controllers/integral/backend/static_pages_controller.rb +6 -0
- data/app/controllers/integral/backend/users_controller.rb +43 -24
- data/app/controllers/integral/blog_controller.rb +12 -0
- data/app/controllers/integral/categories_controller.rb +17 -3
- data/app/controllers/integral/tags_controller.rb +5 -2
- data/app/decorators/integral/base_decorator.rb +16 -0
- data/app/decorators/integral/image_decorator.rb +2 -2
- data/app/decorators/integral/list_decorator.rb +1 -13
- data/app/decorators/integral/notification/notification_decorator.rb +74 -0
- data/app/decorators/integral/page_decorator.rb +1 -13
- data/app/decorators/integral/post_decorator.rb +1 -2
- data/app/decorators/integral/user_decorator.rb +1 -13
- data/app/decorators/integral/version_decorator.rb +8 -4
- data/app/helpers/integral/backend/base_helper.rb +97 -31
- data/app/jobs/integral/application_job.rb +1 -0
- data/app/jobs/integral/newsletter_signup_job.rb +0 -2
- data/app/mailers/integral/devise_mailer.rb +6 -0
- data/app/models/concerns/integral/notification/subscribable.rb +67 -0
- data/app/models/integral/application_record.rb +9 -0
- data/app/models/integral/category.rb +9 -0
- data/app/models/integral/image.rb +40 -3
- data/app/models/integral/list.rb +10 -2
- data/app/models/integral/list_item.rb +14 -14
- data/app/models/integral/list_item_connection.rb +6 -0
- data/app/models/integral/notification/notification.rb +28 -0
- data/app/models/integral/notification/subscription.rb +14 -0
- data/app/models/integral/page.rb +15 -8
- data/app/models/integral/post.rb +11 -13
- data/app/models/integral/user.rb +45 -2
- data/app/policies/integral/base_policy.rb +7 -12
- data/app/policies/integral/page_policy.rb +1 -0
- data/app/policies/integral/version_policy.rb +0 -8
- data/app/views/devise/invitations/edit.haml +1 -4
- data/app/views/devise/mailer/invitation_instructions.inky-haml +20 -0
- data/app/views/integral/backend/activities/grid/_dropdown_actions.haml +1 -0
- data/app/views/integral/backend/activities/grid/_row_content.haml +13 -0
- data/app/views/integral/backend/activities/index.haml +7 -13
- data/app/views/integral/backend/activities/shared/_grid.haml +35 -20
- data/app/views/integral/backend/activities/shared/index.haml +12 -12
- data/app/views/integral/backend/activities/shared/show.haml +7 -7
- data/app/views/integral/backend/activities/show.haml +1 -1
- data/app/views/integral/backend/categories/_modal.haml +2 -3
- data/app/views/integral/backend/images/_form.haml +13 -25
- data/app/views/integral/backend/images/edit.haml +1 -9
- data/app/views/integral/backend/images/grid/_dropdown_actions.haml +5 -0
- data/app/views/integral/backend/images/grid/_row_content.haml +5 -0
- data/app/views/integral/backend/images/index.haml +11 -17
- data/app/views/integral/backend/images/list.haml +11 -0
- data/app/views/integral/backend/images/show.haml +26 -0
- data/app/views/integral/backend/lists/_form.haml +6 -19
- data/app/views/integral/backend/lists/_item_modal.haml +3 -3
- data/app/views/integral/backend/lists/_manager.haml +11 -13
- data/app/views/integral/backend/lists/edit.haml +6 -20
- data/app/views/integral/backend/lists/grid/_dropdown_actions.haml +9 -0
- data/app/views/integral/backend/lists/grid/_row_content.haml +3 -0
- data/app/views/integral/backend/lists/index.haml +11 -17
- data/app/views/integral/backend/lists/list.haml +11 -0
- data/app/views/integral/backend/lists/show.haml +30 -0
- data/app/views/integral/backend/notifications/_notification.haml +21 -0
- data/app/views/integral/backend/pages/_form.haml +19 -43
- data/app/views/integral/backend/pages/edit.haml +4 -12
- data/app/views/integral/backend/pages/grid/_dropdown_actions.haml +11 -0
- data/app/views/integral/backend/pages/grid/_row_content.haml +5 -0
- data/app/views/integral/backend/pages/index.haml +6 -6
- data/app/views/integral/backend/pages/list.haml +12 -19
- data/app/views/integral/backend/pages/show.haml +19 -35
- data/app/views/integral/backend/posts/_form.haml +18 -56
- data/app/views/integral/backend/posts/edit.haml +4 -14
- data/app/views/integral/backend/posts/grid/_dropdown_actions.haml +10 -0
- data/app/views/integral/backend/posts/grid/_row_content.haml +6 -0
- data/app/views/integral/backend/posts/index.haml +6 -6
- data/app/views/integral/backend/posts/list.haml +11 -18
- data/app/views/integral/backend/posts/new.haml +0 -1
- data/app/views/integral/backend/posts/show.haml +18 -41
- data/app/views/integral/backend/shared/_breadcrumbs.haml +7 -4
- data/app/views/integral/backend/shared/_image_preview.haml +10 -3
- data/app/views/integral/backend/shared/_image_selector.haml +1 -1
- data/app/views/integral/backend/shared/_notification_subscription_toggle.haml +22 -0
- data/app/views/integral/backend/shared/action_bar/_index.haml +9 -0
- data/app/views/integral/backend/shared/action_bar/_show.haml +3 -0
- data/app/views/integral/backend/shared/cards/_at_a_glance.haml +3 -3
- data/app/views/integral/backend/shared/cards/_categories.haml +27 -28
- data/app/views/integral/backend/shared/cards/_object.haml +1 -1
- data/app/views/integral/backend/shared/cards/_recent_activity.haml +12 -12
- data/app/views/integral/backend/shared/cards/_recent_resources.haml +17 -0
- data/app/views/integral/backend/shared/cards/_top_post_authors.haml +14 -15
- data/app/views/integral/backend/shared/cards/_welcome.haml +24 -25
- data/app/views/integral/backend/shared/{_empty_grid.haml → grid/_empty.haml} +0 -0
- data/app/views/integral/backend/shared/grid/_form.haml +9 -0
- data/app/views/integral/backend/shared/grid/_grid.haml +21 -0
- data/app/views/integral/backend/shared/{_pagination.haml → grid/_pagination.haml} +0 -0
- data/app/views/integral/backend/shared/grid/_row_layout.haml +8 -0
- data/app/views/integral/backend/shared/record_selector/_collection.haml +1 -0
- data/app/views/integral/backend/shared/record_selector/_modal.haml +9 -10
- data/app/views/integral/backend/static_pages/dashboard.haml +6 -7
- data/app/views/integral/backend/users/_form.haml +34 -46
- data/app/views/integral/backend/users/grid/_dropdown_actions.haml +17 -0
- data/app/views/integral/backend/users/grid/_row_content.haml +8 -0
- data/app/views/integral/backend/users/index.haml +6 -6
- data/app/views/integral/backend/users/list.haml +10 -16
- data/app/views/integral/backend/users/show.haml +10 -1
- data/app/views/integral/categories/show.haml +3 -3
- data/app/views/integral/posts/_article_footer.haml +1 -1
- data/app/views/integral/posts/_card.haml +1 -1
- data/app/views/integral/posts/_most_read_section.haml +1 -1
- data/app/views/integral/posts/_post.haml +1 -1
- data/app/views/integral/posts/templates/default.haml +1 -1
- data/app/views/integral/shared/sidebar/_item.haml +1 -1
- data/app/views/layouts/integral/backend.html.haml +24 -5
- data/app/views/layouts/integral/backend/_create_dropdown.haml +1 -30
- data/app/views/layouts/integral/backend/_main_menu_items.haml +1 -101
- data/config/initializers/devise.rb +1 -1
- data/config/locales/en.yml +60 -2
- data/config/routes.rb +2 -0
- data/db/migrate/20200407022636_create_integral_notifications.rb +25 -0
- data/db/migrate/20200421223602_add_status_to_integral_users.rb +5 -0
- data/db/seeds.rb +15 -11
- data/lib/integral.rb +1 -0
- data/lib/integral/acts_as_integral.rb +115 -0
- data/lib/integral/acts_as_listable.rb +1 -1
- data/lib/integral/engine.rb +9 -0
- data/lib/integral/grids/activities_grid.rb +0 -1
- data/lib/integral/grids/lists_grid.rb +1 -0
- data/lib/integral/grids/posts_grid.rb +5 -1
- data/lib/integral/grids/users_grid.rb +5 -0
- data/lib/integral/list_renderer.rb +5 -1
- data/lib/integral/router.rb +20 -4
- data/lib/integral/version.rb +1 -1
- data/spec/factories.rb +15 -1
- metadata +45 -39
- data/app/decorators/integral/category_version_decorator.rb +0 -7
- data/app/decorators/integral/image_version_decorator.rb +0 -7
- data/app/decorators/integral/list_version_decorator.rb +0 -7
- data/app/decorators/integral/page_version_decorator.rb +0 -7
- data/app/decorators/integral/post_version_decorator.rb +0 -7
- data/app/decorators/integral/user_version_decorator.rb +0 -7
- data/app/views/devise/mailer/invitation_instructions.html.erb +0 -13
- data/app/views/integral/backend/activities/_grid.haml +0 -22
- data/app/views/integral/backend/images/_grid.haml +0 -16
- data/app/views/integral/backend/lists/_grid.haml +0 -14
- data/app/views/integral/backend/pages/_grid.haml +0 -46
- data/app/views/integral/backend/posts/_grid.haml +0 -51
- data/app/views/integral/backend/shared/_grid.haml +0 -18
- data/app/views/integral/backend/shared/cards/_recent_pages.haml +0 -19
- data/app/views/integral/backend/shared/cards/_recent_posts.haml +0 -18
- data/app/views/integral/backend/shared/cards/_recent_users.haml +0 -19
- data/app/views/integral/backend/users/_grid.haml +0 -36
@@ -2,20 +2,10 @@
|
|
2
2
|
|
3
3
|
= content_for :actionbar do
|
4
4
|
%ul.menu.horizontal
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
= t('integral.actions.view')
|
9
|
-
- if policy(Integral::Post).duplicate?
|
10
|
-
%li
|
11
|
-
= link_to duplicate_backend_post_url(@resource.id), class: 'button white', method: :post, data: { confirm: t('integral.actions.confirmation.clone') } do
|
12
|
-
= icon('history')
|
13
|
-
= t('integral.actions.clone')
|
5
|
+
= link_to t('integral.actions.view_on_site'), post_url(@resource), class: 'button white', icon: :eye, wrapper: :li
|
6
|
+
- if policy(resource_klass).duplicate?
|
7
|
+
= link_to t('integral.actions.clone'), duplicate_backend_resource_url(@resource.id), class: 'button white', method: :post, data: { confirm: t('integral.actions.confirmation.clone') }, icon: :history, wrapper: :li
|
14
8
|
- if policy(Integral::Version).manager?
|
15
|
-
|
16
|
-
= link_to activities_backend_post_url(@resource.id), class: 'button white' do
|
17
|
-
= icon('history')
|
18
|
-
= t('integral.navigation.activity')
|
9
|
+
= link_to t('integral.navigation.activity'), activities_backend_resource_url(@resource.id), class: 'button white', icon: :history, wrapper: :li
|
19
10
|
|
20
11
|
= render 'form'
|
21
|
-
|
@@ -0,0 +1,10 @@
|
|
1
|
+
- if policy(resource_klass).update?
|
2
|
+
= link_to t('integral.actions.edit'), edit_backend_resource_url(resource.id), icon: :edit, wrapper: :li
|
3
|
+
= link_to t('integral.actions.view_on_site'), post_url(resource), icon: :eye, wrapper: :li
|
4
|
+
= link_to t('integral.actions.open_in_new_tab'), backend_resource_url(resource.id), target: :blank, icon: 'external-link', wrapper: :li
|
5
|
+
- if policy(resource_klass).duplicate?
|
6
|
+
= link_to t('integral.actions.clone'), duplicate_backend_resource_url(resource.id), method: :post, data: { confirm: t('integral.actions.confirmation.clone') }, icon: :clone, wrapper: :li
|
7
|
+
- if policy(Integral::Version).manager?
|
8
|
+
= link_to t('integral.actions.view_history'), activities_backend_resource_url(resource.id), icon: :history, wrapper: :li
|
9
|
+
- if policy(resource_klass).destroy?
|
10
|
+
= link_to t('integral.actions.delete'), backend_resource_url(resource.id), method: :delete, data: { confirm: t('integral.actions.confirmation.deletion') }, icon: :remove, wrapper: :li
|
@@ -1,14 +1,14 @@
|
|
1
|
-
.grid-x
|
1
|
+
.grid-x
|
2
2
|
-# Left Column
|
3
3
|
.cell.large-6
|
4
|
-
.grid-x
|
5
|
-
.cell= render_card(:
|
4
|
+
.grid-x
|
5
|
+
.cell= render_card(:recent_resources)
|
6
6
|
.cell= render_card(:categories)
|
7
|
-
.cell= render_card(:at_a_glance
|
7
|
+
.cell= render_card(:at_a_glance)
|
8
8
|
|
9
9
|
-# Right Column
|
10
10
|
.cell.large-6
|
11
|
-
.grid-x
|
11
|
+
.grid-x
|
12
12
|
.cell= render_card(:recent_activity)
|
13
|
-
.cell.
|
13
|
+
.cell.xlarge-6= render_card(:recent_user_activity)
|
14
14
|
.cell.large-6= render_card(:top_post_authors)
|
@@ -1,20 +1,13 @@
|
|
1
1
|
.card.listing
|
2
|
-
.
|
3
|
-
|
4
|
-
|
5
|
-
.top-bar
|
6
|
-
.
|
7
|
-
|
8
|
-
|
9
|
-
=
|
10
|
-
|
11
|
-
|
12
|
-
= f.hidden_field(:order, value: @grid.order, class: 'order-field')
|
13
|
-
= f.hidden_field(:page, value: grid_options[:page], class: 'page-field')
|
2
|
+
%h2.show-for-small-only= page_title
|
3
|
+
= link_to t('integral.actions.create'), new_backend_resource_url, class: 'button hollow show-for-small-only create'
|
4
|
+
.top-bar
|
5
|
+
.top-bar-left.hide-for-small-only
|
6
|
+
= link_to t('integral.actions.create'), new_backend_resource_url, class: 'button hollow'
|
7
|
+
.top-bar-right
|
8
|
+
= render_resource_grid_form do |f|
|
9
|
+
%li= f.input :user, collection: Integral::User.all, label: t('integral.records.attributes.user'), wrapper_html: { class: 'filter' }, input_html: { 'data-filter' => true }, required: false
|
10
|
+
%li= f.input :status, collection: resource_klass.available_statuses, label: t('integral.records.attributes.status'), wrapper_html: { class: 'filter' }, input_html: { 'data-filter' => true }, required: false
|
11
|
+
%li= f.input :title, placeholder: t('integral.actions.search'), wrapper_html: { class: 'filter search' }, hint: false, label: false
|
14
12
|
|
15
|
-
|
16
|
-
%li= f.input :user, collection: Integral::User.all, label: t('integral.records.attributes.user'), wrapper_html: { class: 'filter' }, input_html: { 'data-filter' => true }, required: false
|
17
|
-
%li= f.input :status, collection: Integral::Post.available_statuses, label: t('integral.records.attributes.status'), wrapper_html: { class: 'filter' }, input_html: { 'data-filter' => true }, required: false
|
18
|
-
%li= f.input :title, placeholder: t('integral.actions.search'), wrapper_html: { class: 'filter search' }, hint: false, label: false
|
19
|
-
|
20
|
-
= render partial: 'grid'
|
13
|
+
= render_resource_grid
|
@@ -3,52 +3,29 @@
|
|
3
3
|
.grid-x
|
4
4
|
.cell.large-6
|
5
5
|
-# Left Column
|
6
|
-
.grid-x
|
6
|
+
.grid-x
|
7
7
|
.cell
|
8
8
|
.card
|
9
|
-
.
|
10
|
-
|
11
|
-
|
12
|
-
%hr
|
9
|
+
%h2= @resource.title
|
10
|
+
%p.subtitle= @resource.description
|
11
|
+
%hr
|
13
12
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
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')
|
13
|
+
.grid-x.actions
|
14
|
+
.cell.xlarge-8.xxlarge-6
|
15
|
+
.grid-x.small-up-2
|
16
|
+
= link_to t('integral.actions.view_on_site'), post_url(@resource), icon: :eye, wrapper: :cell
|
17
|
+
- if policy(resource_klass).manager?
|
18
|
+
= link_to t('integral.actions.edit'), edit_backend_resource_url(@resource.id), icon: :edit, wrapper: :cell
|
19
|
+
- if policy(resource_klass).duplicate?
|
20
|
+
= link_to t('integral.actions.clone'), duplicate_backend_resource_url(@resource.id), method: :post, data: { confirm: t('integral.actions.confirmation.clone') }, icon: :clone, wrapper: :cell
|
21
|
+
- if policy(resource_klass).manager?
|
22
|
+
= link_to t('integral.actions.delete'), backend_resource_url(@resource.id), icon: :remove, wrapper: :cell, method: :delete, data: { confirm: t('integral.actions.confirmation.deletion') }
|
23
|
+
- if policy(resource_klass).manager?
|
24
|
+
= link_to t('integral.actions.view_history'), activities_backend_resource_url(@resource.id), icon: :history, wrapper: :cell
|
41
25
|
|
42
26
|
.cell.medium-6.flex-container= render_card(:object, { title: 'Essentials', record: @resource })
|
43
|
-
.cell.
|
27
|
+
.cell.xlarge-6.flex-container= render_card(:recent_user_activity)
|
44
28
|
.cell.large-6
|
45
29
|
-# Right Column
|
46
|
-
.grid-x
|
30
|
+
.grid-x
|
47
31
|
.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)
|
@@ -1,9 +1,12 @@
|
|
1
|
-
- if @breadcrumbs.present? || content_for?(:actionbar)
|
1
|
+
- if @breadcrumbs.present? || content_for?(:actionbar) || render_default_action_bar?
|
2
2
|
#action-bar.top-bar
|
3
3
|
- if @breadcrumbs.present?
|
4
4
|
.top-bar-left
|
5
5
|
%ul.breadcrumbs
|
6
|
-
= render_breadcrumbs :
|
7
|
-
- if content_for?(:actionbar)
|
6
|
+
= render_breadcrumbs tag: :li, separator: ""
|
7
|
+
- if content_for?(:actionbar) || render_default_action_bar?
|
8
8
|
.top-bar-right
|
9
|
-
|
9
|
+
- if content_for?(:actionbar)
|
10
|
+
= content_for(:actionbar)
|
11
|
+
- else
|
12
|
+
= render partial: "integral/backend/shared/action_bar/#{action_name}"
|
@@ -1,12 +1,14 @@
|
|
1
|
-
-
|
1
|
+
- attribute = attribute.present? ? attribute : :image
|
2
|
+
- help_text = help_text.present? ? help_text : ''
|
3
|
+
- image = f.object.send(attribute)
|
2
4
|
- image_path = image&.file&.url(:medium)
|
3
5
|
- unlinkHiddenClass = image.present? ? '' : 'hide'
|
4
6
|
- placeholderHiddenClass = image.present? ? 'hide' : ''
|
5
7
|
|
6
8
|
.image-select
|
7
|
-
|
9
|
+
= f.label attribute
|
8
10
|
.image-container
|
9
|
-
= f.hidden_field "#{
|
11
|
+
= f.hidden_field "#{attribute}_id"
|
10
12
|
= image_tag image_url('integral/image-not-set.png'), class: "placeholder #{placeholderHiddenClass}"
|
11
13
|
%img.actual{ src: image_path }
|
12
14
|
%ul.menu.align-left.menu-unlinked{ class: placeholderHiddenClass }
|
@@ -21,3 +23,8 @@
|
|
21
23
|
%li
|
22
24
|
%button.button.clear.edit
|
23
25
|
= icon('pencil-square-o')
|
26
|
+
|
27
|
+
- if help_text.present?
|
28
|
+
%br
|
29
|
+
%p.help-text= help_text
|
30
|
+
|
@@ -1,4 +1,4 @@
|
|
1
1
|
- initialize = defined?(initialize) ? initialize : false
|
2
2
|
.image-selector
|
3
|
-
= render partial: 'integral/backend/shared/record_selector/modal', locals: { search_path:
|
3
|
+
= render partial: 'integral/backend/shared/record_selector/modal', locals: { search_path: list_backend_img_index_path, title: t('integral.prompts.select_image'), name: 'Image', create_modal: '#new_image_modal', initialize: initialize, data_attributes: { 'image-selector' => true }}
|
4
4
|
= render partial: 'integral/backend/images/create_modal'
|
@@ -0,0 +1,22 @@
|
|
1
|
+
:ruby
|
2
|
+
if subscribable.is_a?(Class)
|
3
|
+
subscribable_id = nil
|
4
|
+
subscribable_type = subscribable.name
|
5
|
+
else
|
6
|
+
subscribable_id = subscribable.id
|
7
|
+
subscribable_type = subscribable.class.name
|
8
|
+
end
|
9
|
+
receives_notifications = current_user.receives_notifications_for?(subscribable)
|
10
|
+
|
11
|
+
= simple_form_for :subscription, url: backend_notification_subscription_url(id: 1), remote: true, method: :put, html: { 'data-form-unsubscribe-notifications' => true, class: receives_notifications ? '' : 'hide' } do |f|
|
12
|
+
= f.hidden_field :state, value: :unsubscribed
|
13
|
+
= f.hidden_field :subscribable_type, value: subscribable_type
|
14
|
+
= f.hidden_field :subscribable_id, value: subscribable_id
|
15
|
+
= f.button :button, class: 'clear', data: { tooltip: true, position: :left, alignment: :center }, title: t('integral.tooltips.unsubscribe') do
|
16
|
+
= icon('bell-slash-o')
|
17
|
+
= simple_form_for :subscription, url: backend_notification_subscription_url(id: 1), remote: true, method: :put, html: { 'data-form-subscribe-notifications' => true, class: receives_notifications ? 'hide' : '' } do |f|
|
18
|
+
= f.hidden_field :state, value: :subscribed
|
19
|
+
= f.hidden_field :subscribable_type, value: subscribable_type
|
20
|
+
= f.hidden_field :subscribable_id, value: subscribable_id
|
21
|
+
= f.button :button, class: 'clear', data: { tooltip: true, position: :left, alignment: :center }, title: t('integral.tooltips.subscribe') do
|
22
|
+
= icon('bell-o')
|
@@ -0,0 +1,9 @@
|
|
1
|
+
%ul.menu.horizontal
|
2
|
+
- if policy(resource_klass).new?
|
3
|
+
%li
|
4
|
+
= link_to new_backend_resource_url, class: 'button white' do
|
5
|
+
= icon('plus')
|
6
|
+
= t('integral.actions.create')
|
7
|
+
= resource_klass.model_name.human.capitalize
|
8
|
+
- if resource_klass.respond_to?(:subscribable?) && resource_klass.subscribable?
|
9
|
+
%li= render partial: 'integral/backend/shared/notification_subscription_toggle', locals: { subscribable: resource_klass }
|
@@ -1,34 +1,33 @@
|
|
1
1
|
.card
|
2
|
-
.card-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
%
|
9
|
-
|
10
|
-
%
|
11
|
-
|
12
|
-
%
|
13
|
-
|
14
|
-
|
15
|
-
.
|
16
|
-
%
|
17
|
-
%
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
=
|
24
|
-
|
25
|
-
= t('integral.actions.delete')
|
2
|
+
.card-action-title
|
3
|
+
%h2 Categories
|
4
|
+
%button.button.hollow{ 'data-open' => 'new_category_modal' } Create
|
5
|
+
%table.hover
|
6
|
+
- Integral::Category.all.decorate.each do |category|
|
7
|
+
%tr
|
8
|
+
%td= category.title
|
9
|
+
%td
|
10
|
+
%span.badge= category.posts.count
|
11
|
+
%td
|
12
|
+
%button.button--action-pane{ 'data-toggle' => "dropdown-pane-actions-category-#{category.id}" }
|
13
|
+
= icon('ellipsis-v')
|
14
|
+
.dropdown-pane.dropdown-pane--actions{ id: "dropdown-pane-actions-category-#{category.id}", data: { dropdown: true, position: :bottom, alignment: :right, close_on_click: 'true' } }
|
15
|
+
%ul.menu.vertical
|
16
|
+
%li
|
17
|
+
%button{ data: { modal_url: edit_backend_category_url(category.id), button_edit_category: "modal--category-edit-#{category.id}" } }
|
18
|
+
= icon('edit')
|
19
|
+
= t('integral.actions.edit')
|
20
|
+
%li
|
21
|
+
- if category.posts.count.zero?
|
22
|
+
= link_to backend_category_url(category.id), method: :delete, data: { confirm: t('integral.actions.confirmation.deletion'), button_delete_category: true }, remote: true do
|
23
|
+
= icon('remove')
|
24
|
+
= t('integral.actions.delete')
|
26
25
|
|
27
26
|
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
27
|
+
- else
|
28
|
+
%button.disabled{ title: "Cannot delete categories which include posts.", data: { tooltip: true, position: "bottom", alignment: "center" } }
|
29
|
+
= icon('remove')
|
30
|
+
= t('integral.actions.delete')
|
32
31
|
|
33
32
|
|
34
33
|
= render partial: 'integral/backend/categories/modal', locals: { title: 'Category Creation' }
|
@@ -3,18 +3,18 @@
|
|
3
3
|
- grid ||= recent_site_activity_grid
|
4
4
|
- activities = cast_activities(grid.assets.limit(5))
|
5
5
|
|
6
|
-
.card
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
= render partial: 'integral/backend/activities/activity', collection: activities
|
6
|
+
.card.flex-auto
|
7
|
+
%h2= title
|
8
|
+
- if activities.present?
|
9
|
+
.timeline{ class: classes }
|
10
|
+
= render partial: 'integral/backend/activities/activity', collection: activities
|
12
11
|
|
13
|
-
|
14
|
-
|
15
|
-
|
12
|
+
- if grid.assets.count > 5
|
13
|
+
%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 } }
|
14
|
+
= t('integral.actions.view_more')
|
16
15
|
|
17
|
-
|
18
|
-
|
19
|
-
=
|
16
|
+
- else
|
17
|
+
%p.data-unavailable
|
18
|
+
%span= t('integral.backend.graphs.data_unavailable')
|
19
|
+
= image_tag image_path('integral/backend/data-unavailable.png')
|
20
20
|
|
@@ -0,0 +1,17 @@
|
|
1
|
+
-# This partial could be updated to allow for customising the rows, scope and title
|
2
|
+
.card
|
3
|
+
.card-action-title
|
4
|
+
%h2
|
5
|
+
Recent
|
6
|
+
= resource_klass.model_name.human.pluralize
|
7
|
+
%table.hover
|
8
|
+
- resource_klass.limit(5).order('updated_at DESC').decorate.each do |resource|
|
9
|
+
%tr
|
10
|
+
%td= resource.title
|
11
|
+
%td
|
12
|
+
= link_to backend_resource_url(resource.id), class: 'button--action-pane' do
|
13
|
+
= icon('eye')
|
14
|
+
-# = link_to edit_backend_resource_url(resource.id), class: 'button--action-pane' do
|
15
|
+
-# = icon('edit')
|
16
|
+
|
17
|
+
= link_to t('integral.actions.view_all'), list_backend_resources_url, class: 'button clear expanded'
|
@@ -1,19 +1,18 @@
|
|
1
1
|
- user_ids = Integral::Post.published.group(:user_id).count.sort_by(&:last).reverse.to_h
|
2
2
|
- post_users = Integral::User.where(id: user_ids.keys).decorate.sort_by { |prod| user_ids.keys.index(prod.id) }
|
3
3
|
.card
|
4
|
-
.card-
|
5
|
-
|
6
|
-
|
7
|
-
.stat-table
|
8
|
-
.stat-table-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
%
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
%
|
18
|
-
%span.badge.secondary= user_ids[record.id]
|
4
|
+
.card-action-title
|
5
|
+
%h2 Top Authors
|
6
|
+
.stat-table
|
7
|
+
.stat-table-heading
|
8
|
+
.stat-table-header Total Authors
|
9
|
+
.stat-table-header-count= user_ids.count
|
10
|
+
%table.unstriped.hover
|
11
|
+
- post_users.each do |record|
|
12
|
+
%tr
|
13
|
+
%td
|
14
|
+
= image_tag record.avatar.url(:thumbnail), alt: record.name, class: 'avatar'
|
15
|
+
= record.name
|
16
|
+
%td
|
17
|
+
%span.badge.secondary= user_ids[record.id]
|
19
18
|
|
@@ -1,29 +1,28 @@
|
|
1
1
|
.card
|
2
|
-
.
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
.
|
7
|
-
.
|
8
|
-
.
|
2
|
+
%h2= t('.title')
|
3
|
+
%p.subtitle= t('.get_started')
|
4
|
+
%hr
|
5
|
+
.grid-x.actions
|
6
|
+
.cell.shrink
|
7
|
+
.grid-y
|
8
|
+
.cell.shrink
|
9
|
+
= link_to edit_backend_user_url(current_user) do
|
10
|
+
= icon('edit')
|
11
|
+
= t('integral.actions.edit_profile')
|
12
|
+
- if policy(Integral::Page).manager?
|
9
13
|
.cell.shrink
|
10
|
-
= link_to
|
11
|
-
= icon('
|
12
|
-
= t('integral.actions.
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
= icon('plus')
|
17
|
-
= t('integral.actions.new_page')
|
18
|
-
.cell.shrink
|
19
|
-
.grid-y
|
20
|
-
- if policy(Integral::Post).manager? && Integral.blog_enabled?
|
21
|
-
.cell.shrink
|
22
|
-
= link_to new_backend_post_url do
|
23
|
-
= icon('plus')
|
24
|
-
= t('integral.actions.new_post')
|
14
|
+
= link_to new_backend_page_url do
|
15
|
+
= icon('plus')
|
16
|
+
= t('integral.actions.new_page')
|
17
|
+
.cell.shrink
|
18
|
+
.grid-y
|
19
|
+
- if policy(Integral::Post).manager? && Integral.blog_enabled?
|
25
20
|
.cell.shrink
|
26
|
-
= link_to
|
27
|
-
= icon('
|
28
|
-
= t('integral.actions.
|
21
|
+
= link_to new_backend_post_url do
|
22
|
+
= icon('plus')
|
23
|
+
= t('integral.actions.new_post')
|
24
|
+
.cell.shrink
|
25
|
+
= link_to root_path do
|
26
|
+
= icon('eye')
|
27
|
+
= t('integral.actions.view_main_site')
|
29
28
|
|