integral 1.4.0 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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
|
@@ -25,27 +25,22 @@ module Integral
|
|
|
25
25
|
!permitted_attribute?(attribute)
|
|
26
26
|
end
|
|
27
27
|
|
|
28
|
-
# @return [Array] attributes the user is
|
|
28
|
+
# @return [Array] attributes the user is authorized to edit
|
|
29
29
|
def permitted_attributes
|
|
30
30
|
raise NotImplementedError
|
|
31
31
|
end
|
|
32
32
|
|
|
33
|
+
%i[destroy block unblock index list show new create edit update duplicate grid receives_notifications].each do |method|
|
|
34
|
+
define_method "#{method}?" do
|
|
35
|
+
manager?
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
|
|
33
39
|
private
|
|
34
40
|
|
|
35
41
|
# @return [Symbol] role name
|
|
36
42
|
def role_name
|
|
37
43
|
raise NotImplementedError
|
|
38
44
|
end
|
|
39
|
-
|
|
40
|
-
alias destroy? manager?
|
|
41
|
-
alias index? manager?
|
|
42
|
-
alias list? manager?
|
|
43
|
-
alias show? manager?
|
|
44
|
-
alias new? manager?
|
|
45
|
-
alias create? manager?
|
|
46
|
-
alias edit? manager?
|
|
47
|
-
alias update? manager?
|
|
48
|
-
alias duplicate? manager?
|
|
49
|
-
alias grid? manager?
|
|
50
45
|
end
|
|
51
46
|
end
|
|
@@ -1,18 +1,10 @@
|
|
|
1
1
|
module Integral
|
|
2
2
|
# Handles Activity authorization
|
|
3
3
|
class VersionPolicy < BasePolicy
|
|
4
|
-
# For some reason authorize_with_klass seems to be delegating manager? calls to BasePolicy rather than using the override
|
|
5
|
-
# app/controllers/integral/backend/activities_controller.rb:37:in `authorize_with_klass'
|
|
6
|
-
# @return [Boolean] whether or not user has manager access
|
|
7
|
-
def index?
|
|
8
|
-
manager?
|
|
9
|
-
end
|
|
10
|
-
|
|
11
4
|
def manager?
|
|
12
5
|
user.admin?
|
|
13
6
|
end
|
|
14
7
|
|
|
15
|
-
alias grid? manager?
|
|
16
8
|
alias activity? manager?
|
|
17
9
|
alias activities? manager?
|
|
18
10
|
end
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
.input-group
|
|
5
5
|
%span.input-group-label
|
|
6
6
|
= icon('key')
|
|
7
|
-
= f.input :password, input_html: { class: 'input-group-field' }, label: false
|
|
7
|
+
= f.input :password, input_html: { 'data-character-counter' => 'false', class: 'input-group-field' }, label: false
|
|
8
8
|
.input-group
|
|
9
9
|
%span.input-group-label
|
|
10
10
|
= icon('key')
|
|
@@ -12,6 +12,3 @@
|
|
|
12
12
|
|
|
13
13
|
.form-actions
|
|
14
14
|
= f.button :button, t("devise.invitations.edit.submit_button"), class: 'button expanded'
|
|
15
|
-
|
|
16
|
-
= render "devise/shared/links"
|
|
17
|
-
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
:ruby
|
|
2
|
+
name = @resource.invited_by.present? ? @resource.invited_by.name : 'Someone'
|
|
3
|
+
|
|
4
|
+
%p
|
|
5
|
+
= t("devise.mailer.invitation_instructions.hello", email: @resource.name)
|
|
6
|
+
\!
|
|
7
|
+
|
|
8
|
+
%p= t("devise.mailer.invitation_instructions.someone_invited_you", url: integral.backend_dashboard_url, name: name)
|
|
9
|
+
|
|
10
|
+
%row
|
|
11
|
+
%columns{ small: 12 }
|
|
12
|
+
%spacer{ size: 10 }
|
|
13
|
+
%center
|
|
14
|
+
%button{ href: accept_invitation_url(@resource, :invitation_token => @token), class: 'large' }= t("devise.mailer.invitation_instructions.accept")
|
|
15
|
+
%spacer{ size: 10 }
|
|
16
|
+
|
|
17
|
+
- if @resource.invitation_due_at
|
|
18
|
+
%p= t("devise.mailer.invitation_instructions.accept_until", due_date: l(@resource.invitation_due_at, format: :'devise.mailer.invitation_instructions.accept_until_format'))
|
|
19
|
+
|
|
20
|
+
%p= t("devise.mailer.invitation_instructions.ignore").html_safe
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
= link_to t('integral.actions.open_in_new_tab'), backend_resource_url(resource), target: :blank, icon: 'external-link', wrapper: :li
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
%td= l(resource.created_at)
|
|
2
|
+
%td
|
|
3
|
+
- if resource.whodunnit.present?
|
|
4
|
+
= link_to backend_user_url(resource.whodunnit.id) do
|
|
5
|
+
%span.label.clear
|
|
6
|
+
= image_tag resource.whodunnit.avatar.url(:thumbnail), class: :avatar
|
|
7
|
+
= resource.whodunnit.name
|
|
8
|
+
%td
|
|
9
|
+
%span.label= resource.event
|
|
10
|
+
%td= resource.item_type.constantize.model_name.human
|
|
11
|
+
%td
|
|
12
|
+
= link_to resource.item_url do
|
|
13
|
+
= resource.item_title
|
|
@@ -1,15 +1,9 @@
|
|
|
1
1
|
.card.listing
|
|
2
|
-
.
|
|
3
|
-
|
|
4
|
-
=
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
.top-bar
|
|
3
|
+
.top-bar-right
|
|
4
|
+
= render_resource_grid_form do |f|
|
|
5
|
+
%li= f.input :user, collection: Integral::User.all.map {|u| [u.name, u.id]}, label: t('integral.records.attributes.user'), wrapper_html: { class: 'filter' }, input_html: { 'data-filter' => true }, required: false
|
|
6
|
+
%li= f.input :action, collection: Integral::Version.available_actions, label: 'Action', wrapper_html: { class: 'filter' }, input_html: { 'data-filter' => true }, required: false
|
|
7
|
+
%li= f.input :object, collection: Integral::Version.available_objects, label: 'Object', wrapper_html: { class: 'filter' }, input_html: { 'data-filter' => true }, required: false
|
|
7
8
|
|
|
8
|
-
|
|
9
|
-
.top-bar-right
|
|
10
|
-
%ul.align-right.menu.filters
|
|
11
|
-
%li= f.input :user, collection: Integral::User.all.map {|u| [u.name, u.id]}, label: t('integral.records.attributes.user'), wrapper_html: { class: 'filter' }, input_html: { 'data-filter' => true }, required: false
|
|
12
|
-
%li= f.input :action, collection: Integral::Version.available_actions, label: 'Action', wrapper_html: { class: 'filter' }, input_html: { 'data-filter' => true }, required: false
|
|
13
|
-
%li= f.input :object, collection: Integral::Version.available_objects, label: 'Object', wrapper_html: { class: 'filter' }, input_html: { 'data-filter' => true }, required: false
|
|
14
|
-
|
|
15
|
-
= render_data_grid
|
|
9
|
+
= render_resource_grid
|
|
@@ -1,21 +1,36 @@
|
|
|
1
|
+
- options = { columns: [:date, :user, :action, :actions], order: true }
|
|
2
|
+
|
|
1
3
|
= render_data_grid do
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
%
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
4
|
+
%table.integral-grid.wice-grid.table-striped
|
|
5
|
+
%thead
|
|
6
|
+
%tr
|
|
7
|
+
- grid.html_columns(*options[:columns]).uniq { |col| col.name }.sort_by{ |item| options[:columns].index item.name }.each do |column|
|
|
8
|
+
%th{ class: datagrid_column_classes(grid, column) }
|
|
9
|
+
- if column.supports_order? && options[:order]
|
|
10
|
+
%button{ data: { sort: column.name, desc: (!grid.descending).to_s }}
|
|
11
|
+
= column.header
|
|
12
|
+
- else
|
|
13
|
+
= column.header
|
|
14
|
+
%tbody
|
|
15
|
+
- if grid.assets.any?
|
|
16
|
+
- grid.assets.decorate.each do |activity|
|
|
17
|
+
%tr
|
|
18
|
+
%td= l(activity.created_at)
|
|
19
|
+
%td
|
|
20
|
+
- if activity.whodunnit.present?
|
|
21
|
+
= link_to backend_user_url(activity.whodunnit.id) do
|
|
22
|
+
%span.label.clear
|
|
23
|
+
= image_tag activity.whodunnit.avatar.url(:thumbnail), class: :avatar
|
|
24
|
+
= activity.whodunnit.name
|
|
25
|
+
%td
|
|
26
|
+
%span.label= activity.event
|
|
27
|
+
-# Currently not possible to show this as changeset isn't available in the query resultset for performance reasons - One possible solution would be to create a Grid class for each Version - rather than unioning all the tables it only includes it's own
|
|
28
|
+
-# %td= activity.attributes_changed
|
|
29
|
+
%td.actions
|
|
30
|
+
= link_to activity.url do
|
|
31
|
+
= icon('eye')
|
|
32
|
+
- else
|
|
33
|
+
= render partial: 'integral/backend/shared/grid/empty'
|
|
34
|
+
|
|
35
|
+
= render partial: 'integral/backend/shared/grid/pagination', locals: { records: grid.assets }
|
|
36
|
+
= icon('spinner', class: 'fa-pulse fa-3x fa-fw load-indicator')
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
- content_for :title, t('.title', title:
|
|
1
|
+
- content_for :title, t('.title', title: decorated_resource.title)
|
|
2
2
|
.card.listing
|
|
3
|
-
|
|
4
|
-
=
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
= f.hidden_field(:page, value: grid_options[:page], class: 'page-field')
|
|
3
|
+
= simple_form_for :grid, url: form_url, method: :get, remote: true, html: { id: :grid_form, 'data-type' => :json } do |f|
|
|
4
|
+
= f.hidden_field(:descending, value: @grid.descending, class: 'desc-field')
|
|
5
|
+
= f.hidden_field(:order, value: @grid.order, class: 'order-field')
|
|
6
|
+
= f.hidden_field(:page, value: grid_options[:page], class: 'page-field')
|
|
8
7
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
.top-bar
|
|
9
|
+
.top-bar-right
|
|
10
|
+
%ul.align-right.menu.filters
|
|
11
|
+
%li= f.input :user, collection: Integral::User.all.map {|u| [u.name, u.id]}, label: t('integral.records.attributes.user'), wrapper_html: { class: 'filter' }, input_html: { 'data-filter' => true }, required: false
|
|
12
|
+
%li= f.input :action, collection: Integral::Version.available_actions, label: 'Action', wrapper_html: { class: 'filter' }, input_html: { 'data-filter' => true }, required: false
|
|
13
|
+
|
|
14
|
+
= render partial: 'integral/backend/activities/shared/grid', locals: { grid: @grid }
|
|
14
15
|
|
|
15
|
-
= render partial: 'integral/backend/activities/shared/grid', locals: { grid: @grid }
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
- content_for :title, t('integral.navigation.activity_log')
|
|
2
|
-
.grid-x
|
|
3
|
-
.cell.
|
|
4
|
-
.card.object
|
|
2
|
+
.grid-x
|
|
3
|
+
.cell.medium-9
|
|
4
|
+
.card-unpadded.object
|
|
5
5
|
.card-section
|
|
6
6
|
%h2 Activity Data
|
|
7
7
|
-# - if record.to_card[:image].present?
|
|
@@ -26,15 +26,15 @@
|
|
|
26
26
|
= image_tag @activity.whodunnit.avatar.url(:thumbnail), class: :avatar
|
|
27
27
|
= @activity.whodunnit.name
|
|
28
28
|
|
|
29
|
-
.cell.
|
|
30
|
-
%ul.
|
|
29
|
+
.cell.medium-3
|
|
30
|
+
%ul.no-bullet
|
|
31
31
|
%li
|
|
32
|
-
= link_to @activity.item_url, class: 'button white' do
|
|
32
|
+
= link_to @activity.item_url, class: 'button white expanded' do
|
|
33
33
|
= icon('eye')
|
|
34
34
|
= t('integral.actions.view_record')
|
|
35
35
|
- if @activity.whodunnit.present?
|
|
36
36
|
%li
|
|
37
|
-
= link_to backend_user_url(@activity.whodunnit.id), class: 'button white' do
|
|
37
|
+
= link_to backend_user_url(@activity.whodunnit.id), class: 'button white expanded' do
|
|
38
38
|
= icon('eye')
|
|
39
39
|
= t('integral.actions.view_user')
|
|
40
40
|
-# %li
|
|
@@ -13,11 +13,10 @@
|
|
|
13
13
|
= f.input :title, wrapper_html: { class: 'alternative' }, input_html: { id: slug_id }
|
|
14
14
|
= f.input :slug, wrapper_html: { class: 'alternative' }, input_html: { data: { slugify: "##{slug_id}" } }
|
|
15
15
|
= f.input :description, as: :text, wrapper_html: { class: 'alternative' }
|
|
16
|
-
%hr
|
|
17
|
-
%h2= t('integral.records.attributes.featured_image')
|
|
16
|
+
%hr.dark
|
|
18
17
|
.grid-x
|
|
19
18
|
.cell.medium-6
|
|
20
|
-
= render partial: 'integral/backend/shared/image_preview', locals: { f:f
|
|
19
|
+
= render partial: 'integral/backend/shared/image_preview', locals: { f:f }
|
|
21
20
|
|
|
22
21
|
.modal-footer
|
|
23
22
|
= f.button :button, class: 'button'
|
|
@@ -3,39 +3,27 @@
|
|
|
3
3
|
|
|
4
4
|
= simple_form_for @resource, validate: true, multipart: true, authenticity_token: true, url: form_path do |f|
|
|
5
5
|
= f.input :lock_version, as: :hidden
|
|
6
|
-
.grid-x
|
|
6
|
+
.grid-x
|
|
7
7
|
.cell.medium-8
|
|
8
8
|
.grid-y
|
|
9
|
-
.
|
|
10
|
-
|
|
11
|
-
.card-section
|
|
12
|
-
= f.input :title
|
|
13
|
-
.cell
|
|
14
|
-
.card
|
|
15
|
-
.card-section
|
|
16
|
-
= f.input :description
|
|
9
|
+
= f.input :title
|
|
10
|
+
= f.input :description
|
|
17
11
|
.cell.medium-4
|
|
18
12
|
.grid-y
|
|
19
13
|
.cell
|
|
20
14
|
.card
|
|
21
|
-
.
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
= f.input :file, as: :string, label: false, disabled: true
|
|
15
|
+
- if @resource.persisted?
|
|
16
|
+
= image_tag @resource.url
|
|
17
|
+
- if !@resource.persisted? || Integral.editable_persisted_images
|
|
18
|
+
= f.input :file, :wrapper_html => { :class => "file-field" }, validate: { presence: true }, input_html: { accept: "image/*" }
|
|
19
|
+
- else
|
|
20
|
+
= f.input :file, as: :string, label: false, disabled: true
|
|
28
21
|
- if @resource.persisted?
|
|
29
22
|
.cell
|
|
30
|
-
.grid-x
|
|
23
|
+
.grid-x
|
|
31
24
|
.cell.medium-6
|
|
32
|
-
.card
|
|
33
|
-
.card-section
|
|
34
|
-
= f.input :dimensions, readonly: true, input_html: { value: @resource.dimensions }
|
|
25
|
+
.card= f.input :dimensions, readonly: true, input_html: { value: @resource.dimensions }
|
|
35
26
|
.cell.medium-6
|
|
36
|
-
.card
|
|
37
|
-
.card-section
|
|
38
|
-
= f.input :file_size, as: :string, readonly: true, input_html: { value: number_to_human_size(@resource.file_size) }
|
|
27
|
+
.card= f.input :file_size, as: :string, readonly: true, input_html: { value: number_to_human_size(@resource.file_size) }
|
|
39
28
|
|
|
40
|
-
.cell
|
|
41
|
-
= f.button :button
|
|
29
|
+
.cell= f.button :button
|
|
@@ -1,11 +1,3 @@
|
|
|
1
1
|
= content_for :title, t('.title', name: @resource.title)
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
-# %ul.menu.horizontal
|
|
5
|
-
-# - if policy(Integral::Version).manager?
|
|
6
|
-
-# %li
|
|
7
|
-
-# = link_to activities_backend_page_url(@resource.id), class: 'button white' do
|
|
8
|
-
-# = icon('history')
|
|
9
|
-
-# = t('integral.navigation.activity')
|
|
10
|
-
|
|
11
|
-
= render 'form'
|
|
3
|
+
= render partial: 'form', locals: { form_path: backend_img_url(@resource) }
|
|
@@ -0,0 +1,5 @@
|
|
|
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.open_in_new_tab'), backend_resource_url(resource.id), target: :blank, icon: 'external-link', wrapper: :li
|
|
4
|
+
- if policy(resource_klass).destroy?
|
|
5
|
+
= 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,18 +1,12 @@
|
|
|
1
|
-
.
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
.
|
|
7
|
-
= link_to t('integral.actions.upload'), new_backend_img_url, class: 'button hollow'
|
|
8
|
-
.top-bar-right
|
|
9
|
-
= simple_form_for :grid, url: backend_img_index_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
|
|
2
|
+
-# Left Column
|
|
3
|
+
.cell.large-6
|
|
4
|
+
.grid-y
|
|
5
|
+
.cell= render_card(:recent_resources)
|
|
6
|
+
.cell= render_card(:at_a_glance)
|
|
14
7
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
8
|
+
-# Right Column
|
|
9
|
+
.cell.large-6
|
|
10
|
+
.grid-y
|
|
11
|
+
.cell= render_card(:recent_activity)
|
|
12
|
+
.cell.xlarge-6= render_card(:recent_user_activity)
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
.card.listing
|
|
2
|
+
%h2.show-for-small-only= page_title
|
|
3
|
+
= link_to t('integral.actions.upload'), 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.upload'), new_backend_resource_url, class: 'button hollow'
|
|
7
|
+
.top-bar-right
|
|
8
|
+
= render_resource_grid_form do |f|
|
|
9
|
+
%li= f.input :title, placeholder: t('integral.actions.search'), wrapper_html: { class: 'filter search' }, hint: false, label: false
|
|
10
|
+
|
|
11
|
+
= render_resource_grid
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
= content_for :title, @resource.title
|
|
2
|
+
|
|
3
|
+
.grid-x
|
|
4
|
+
.cell.large-6
|
|
5
|
+
-# Left Column
|
|
6
|
+
.grid-x
|
|
7
|
+
.cell
|
|
8
|
+
.card
|
|
9
|
+
%h2= @resource.title
|
|
10
|
+
%p.subtitle= @resource.description
|
|
11
|
+
%hr
|
|
12
|
+
|
|
13
|
+
.grid-x.actions
|
|
14
|
+
.cell.xlarge-8.xxlarge-6
|
|
15
|
+
.grid-x.small-up-2
|
|
16
|
+
- if policy(resource_klass).manager?
|
|
17
|
+
= link_to t('integral.actions.edit'), edit_backend_resource_url(@resource.id), icon: :edit, wrapper: :cell
|
|
18
|
+
- if policy(resource_klass).destroy?
|
|
19
|
+
= link_to t('integral.actions.delete'), backend_resource_url(@resource.id), method: :delete, data: { confirm: t('integral.actions.confirmation.deletion') }, icon: :remove, wrapper: :cell
|
|
20
|
+
|
|
21
|
+
-# .cell.medium-6.flex-container= render_card(:object, { title: 'Essentials', record: @resource })
|
|
22
|
+
.cell.xlarge-6.flex-container= render_card(:recent_user_activity)
|
|
23
|
+
.cell.large-6
|
|
24
|
+
-# Right Column
|
|
25
|
+
.grid-x
|
|
26
|
+
.cell= render_card(:recent_activity)
|
|
@@ -1,25 +1,12 @@
|
|
|
1
1
|
= simple_form_for [:backend, @resource], validate: true, html: { class: 'are-you-sure', 'data-confirm-dirty-form' => true, id: :list_form } do |f|
|
|
2
2
|
= f.input :lock_version, as: :hidden
|
|
3
|
-
.grid-x
|
|
3
|
+
.grid-x
|
|
4
4
|
.cell.medium-8
|
|
5
5
|
.grid-y
|
|
6
|
-
.
|
|
7
|
-
|
|
8
|
-
.card-section
|
|
9
|
-
= f.input :title
|
|
10
|
-
.cell
|
|
11
|
-
.card
|
|
12
|
-
.card-section
|
|
13
|
-
= f.input :description
|
|
6
|
+
= f.input :title
|
|
7
|
+
= f.input :description
|
|
14
8
|
.cell.medium-4
|
|
15
9
|
.grid-y
|
|
16
|
-
.
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
= f.input :list_item_limit
|
|
20
|
-
.cell
|
|
21
|
-
.card
|
|
22
|
-
.card-section
|
|
23
|
-
= f.input :children
|
|
24
|
-
.cell
|
|
25
|
-
= f.button :button
|
|
10
|
+
= f.input :list_item_limit
|
|
11
|
+
= f.input :children
|
|
12
|
+
.cell= f.button :button
|