app/views/integral/backend/activities/shared/_grid.haml in integral-1.4.0 vs app/views/integral/backend/activities/shared/_grid.haml in integral-1.5.0
- old
+ new
@@ -1,21 +1,36 @@
+- options = { columns: [:date, :user, :action, :actions], order: true }
+
= render_data_grid do
- = render layout: 'integral/backend/shared/grid', locals: { grid: grid, options: { columns: [:date, :user, :action, :actions], order: true }} do |grid|
- - if grid.assets.any?
- - grid.assets.decorate.each do |activity|
- %tr
- %td= l(activity.created_at)
- %td
- - if activity.whodunnit.present?
- = link_to backend_user_url(activity.whodunnit.id) do
- %span.label.clear
- = image_tag activity.whodunnit.avatar.url(:thumbnail), class: :avatar
- = activity.whodunnit.name
- %td
- %span.label= activity.event
- -# 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
- -# %td= activity.attributes_changed
- %td.actions
- = link_to activity.url do
- = icon('eye')
- - else
- = render partial: 'integral/backend/shared/empty_grid'
+ %table.integral-grid.wice-grid.table-striped
+ %thead
+ %tr
+ - grid.html_columns(*options[:columns]).uniq { |col| col.name }.sort_by{ |item| options[:columns].index item.name }.each do |column|
+ %th{ class: datagrid_column_classes(grid, column) }
+ - if column.supports_order? && options[:order]
+ %button{ data: { sort: column.name, desc: (!grid.descending).to_s }}
+ = column.header
+ - else
+ = column.header
+ %tbody
+ - if grid.assets.any?
+ - grid.assets.decorate.each do |activity|
+ %tr
+ %td= l(activity.created_at)
+ %td
+ - if activity.whodunnit.present?
+ = link_to backend_user_url(activity.whodunnit.id) do
+ %span.label.clear
+ = image_tag activity.whodunnit.avatar.url(:thumbnail), class: :avatar
+ = activity.whodunnit.name
+ %td
+ %span.label= activity.event
+ -# 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
+ -# %td= activity.attributes_changed
+ %td.actions
+ = link_to activity.url do
+ = icon('eye')
+ - else
+ = render partial: 'integral/backend/shared/grid/empty'
+
+ = render partial: 'integral/backend/shared/grid/pagination', locals: { records: grid.assets }
+ = icon('spinner', class: 'fa-pulse fa-3x fa-fw load-indicator')