workarea-admin 3.5.19 → 3.5.25

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/workarea/admin/modules/new_navigation_taxons.js +2 -1
  3. data/app/controllers/workarea/admin/create_release_undos_controller.rb +19 -5
  4. data/app/controllers/workarea/admin/impersonations_controller.rb +2 -1
  5. data/app/controllers/workarea/admin/releases_controller.rb +1 -4
  6. data/app/helpers/workarea/admin/application_helper.rb +4 -0
  7. data/app/helpers/workarea/admin/changesets_helper.rb +20 -4
  8. data/app/view_models/workarea/admin/changeset_summary_view_model.rb +39 -0
  9. data/app/view_models/workarea/admin/product_view_model.rb +5 -8
  10. data/app/view_models/workarea/admin/release_view_model.rb +22 -3
  11. data/app/views/workarea/admin/catalog_categories/edit.html.haml +3 -0
  12. data/app/views/workarea/admin/catalog_products/_cards.html.haml +1 -1
  13. data/app/views/workarea/admin/changesets/index.html.haml +30 -1
  14. data/app/views/workarea/admin/create_release_undos/new.html.haml +6 -3
  15. data/app/views/workarea/admin/create_release_undos/review.html.haml +8 -2
  16. data/app/views/workarea/admin/navigation_menus/_summary.html.haml +1 -1
  17. data/app/views/workarea/admin/navigation_redirects/index.html.haml +5 -0
  18. data/app/views/workarea/admin/pricing_discounts/properties/_product_attribute.html.haml +1 -1
  19. data/app/views/workarea/admin/releases/_cards.html.haml +8 -67
  20. data/app/views/workarea/admin/releases/show.html.haml +8 -0
  21. data/app/views/workarea/admin/tax_categories/_cards.html.haml +1 -1
  22. data/app/views/workarea/admin/tax_rates/edit.html.haml +3 -3
  23. data/app/views/workarea/admin/tax_rates/index.html.haml +3 -3
  24. data/app/views/workarea/admin/tax_rates/new.html.haml +3 -3
  25. data/app/views/workarea/admin/toolbar/show.html.haml +1 -0
  26. data/app/views/workarea/admin/users/insights.html.haml +12 -0
  27. data/config/locales/en.yml +25 -36
  28. data/config/routes.rb +3 -5
  29. data/test/helpers/workarea/admin/changesets_helper_test.rb +24 -0
  30. data/test/integration/workarea/admin/create_release_undos_integration_test.rb +27 -2
  31. data/test/integration/workarea/admin/impersonations_integration_test.rb +24 -1
  32. data/test/javascripts/fixtures/existing_navigation_taxon.html.haml +10 -0
  33. data/test/javascripts/new_navigation_taxons_spec.js +12 -1
  34. data/test/system/workarea/admin/assets_system_test.rb +1 -1
  35. data/test/system/workarea/admin/bookmarks_system_test.rb +2 -2
  36. data/test/system/workarea/admin/bulk_actions_system_test.rb +5 -5
  37. data/test/system/workarea/admin/comments_system_test.rb +1 -1
  38. data/test/system/workarea/admin/content_system_test.rb +1 -1
  39. data/test/system/workarea/admin/dashboard_system_test.rb +1 -1
  40. data/test/system/workarea/admin/impersonation_system_test.rb +2 -5
  41. data/test/system/workarea/admin/inventory_skus_system_test.rb +1 -1
  42. data/test/system/workarea/admin/menus_system_test.rb +1 -1
  43. data/test/system/workarea/admin/pricing_sku_prices_system_test.rb +3 -3
  44. data/test/system/workarea/admin/recommendations_system_test.rb +2 -2
  45. data/test/system/workarea/admin/releases_system_test.rb +51 -22
  46. data/test/system/workarea/admin/tax_categories_system_test.rb +6 -5
  47. data/test/system/workarea/admin/taxonomy_system_test.rb +2 -2
  48. data/test/system/workarea/admin/trash_system_test.rb +1 -1
  49. data/test/view_models/workarea/admin/product_view_model_test.rb +2 -2
  50. metadata +10 -9
  51. data/app/views/workarea/admin/releases/original.html.haml +0 -50
  52. data/app/views/workarea/admin/releases/undo.html.haml +0 -64
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2fa740ba48b4fdf3285077508f27e804b4d04dce69d08981d4e3d72174bdae82
4
- data.tar.gz: 51da60eac496d3e4133ad3667f9c2e72b4a541ebff5e5f397f603d0f7e6e45b7
3
+ metadata.gz: 0a649d1cba8728c8b979eeeef3750e773851272517069f56c09203900e3e57d6
4
+ data.tar.gz: bbd0c3d025a9a58c6366f7267157eae4aff5018d39e7728e8a9e30b4c3e4d15d
5
5
  SHA512:
6
- metadata.gz: 869f45549bf0f404dca21df06c01bed3de546d2d7203a99138e83ca82bfac2098990fc99c379ed5e08837e277c6e16945abf2eb8ed37aaf19ea9e49a66849cb6
7
- data.tar.gz: 06eadc8f2a5f7be3d4a24b76d57e9bee8b66a31d7c5a060c86700782b24b617518e6820c9f063242efae9ce97148212dac8fa3aa16009b47cfb8b471b6000987
6
+ metadata.gz: 6dbae9d3250a480c3da57725d1019c7c4203008e472ce83b6f90d21dd5caf6ac7df19d24098d4fe7ba3c3a2201072d37951cda6398f7aeba34816f827a16afc5
7
+ data.tar.gz: c768147f8682d314fa9ff3abc50712c5811d9614cb5aa5ceeb38452b86c5ddc26239c743602b89c2fcbc4c65a40b3900969b2e8784203c0c2909f85fee574a3f
@@ -23,8 +23,9 @@ WORKAREA.registerModule('newNavigationTaxons', (function () {
23
23
  createRemoteSelect = function (event) {
24
24
  var $typeSelect = $(event.currentTarget),
25
25
  $idSelect = $('[name=navigable_id]', event.delegateTarget),
26
+ $section = $typeSelect.closest('[data-new-navigation-taxon]'),
26
27
  settings = getConfig($typeSelect),
27
- selected = $typeSelect.data('newNavigationTaxon');
28
+ selected = $section.data('newNavigationTaxon');
28
29
 
29
30
  if ($idSelect.is('.select2-hidden-accessible') && _.isUndefined(selected)) {
30
31
  destroyRemoteSelect($idSelect);
@@ -13,12 +13,20 @@ module Workarea
13
13
  @undo_release.attributes = params[:release]
14
14
 
15
15
  if @undo_release.save
16
- @release.changesets.each do |changeset|
17
- changeset.build_undo(release: @undo_release.model).save!
16
+ @release.changesets.limit(Workarea.config.per_page).each do |changeset|
17
+ if changeset.releasable.present?
18
+ changeset.build_undo(release: @undo_release.model).save!
19
+ changeset.releasable.run_callbacks(:save)
20
+ end
18
21
  end
19
22
 
23
+ BuildReleaseUndoChangesets.perform_async(
24
+ @undo_release.id,
25
+ @release.id
26
+ ) if @release.changeset_count > Workarea.config.per_page
27
+
20
28
  flash[:success] = t('workarea.admin.create_release_undos.flash_messages.saved')
21
- redirect_to review_release_undo_path(@release)
29
+ redirect_to review_release_undo_path(@release, @undo_release)
22
30
  else
23
31
  render :new, status: :unprocessable_entity
24
32
  end
@@ -35,8 +43,14 @@ module Workarea
35
43
  end
36
44
 
37
45
  def find_undo_release
38
- model = @release.model.undo || @release.build_undo(params[:release])
39
- @undo_release = ReleaseViewModel.new(model, view_model_options)
46
+ model =
47
+ if params[:id].present?
48
+ @release.model.undos.find(params[:id])
49
+ else
50
+ @release.build_undo
51
+ end
52
+
53
+ @undo_release = ReleaseViewModel.wrap(model, view_model_options)
40
54
  end
41
55
  end
42
56
  end
@@ -27,7 +27,8 @@ module Workarea
27
27
  clear_current_order
28
28
 
29
29
  flash[:success] = t('workarea.admin.users.flash_messages.stopped')
30
- redirect_to user_path(previous_user_id)
30
+ referrer = URI.parse(request.referrer).request_uri rescue nil
31
+ redirect_back_or(referrer.presence || user_path(previous_user_id))
31
32
  end
32
33
  end
33
34
  end
@@ -43,9 +43,6 @@ module Workarea
43
43
  end
44
44
  end
45
45
 
46
- def original
47
- end
48
-
49
46
  def publish
50
47
  self.current_release = nil
51
48
  PublishRelease.perform_async(@release.id)
@@ -59,7 +56,7 @@ module Workarea
59
56
  @release.destroy
60
57
 
61
58
  flash[:success] = t('workarea.admin.releases.flash_messages.removed')
62
- redirect_to releases_path
59
+ redirect_back_or releases_path
63
60
  end
64
61
 
65
62
  def calendar_feed
@@ -175,6 +175,10 @@ module Workarea
175
175
  .map { |unit, val| t("workarea.duration.#{unit}", count: val) }
176
176
  .to_sentence
177
177
  end
178
+
179
+ def navigation_redirects_enabled?
180
+ !Rails.application.config.consider_all_requests_local
181
+ end
178
182
  end
179
183
  end
180
184
  end
@@ -2,13 +2,29 @@ module Workarea
2
2
  module Admin::ChangesetsHelper
3
3
  def changeset_icon(changeset, options = {})
4
4
  type = changeset.root.model_name.element
5
- inline_svg(icon_path(type), options)
5
+ inline_svg(
6
+ releasable_icon_path(type),
7
+ options.reverse_merge(fallback: default_releasable_icon_path)
8
+ )
6
9
  end
7
10
 
8
- private
11
+ def releaseable_icon(model, options = {})
12
+ type = model.model_name.element
13
+ inline_svg(
14
+ releasable_icon_path(type),
15
+ options.reverse_merge(fallback: default_releasable_icon_path)
16
+ )
17
+ end
18
+
19
+ def releasable_icon_path(type)
20
+ return default_releasable_icon_path unless type.present?
21
+
22
+ Workarea.config.releasable_icons[type.to_sym] ||
23
+ "workarea/admin/icons/#{type}.svg"
24
+ end
9
25
 
10
- def icon_path(type)
11
- Workarea.config.releasable_icons[type.to_sym] || "workarea/admin/icons/#{type}.svg"
26
+ def default_releasable_icon_path
27
+ 'workarea/admin/icons/release.svg'
12
28
  end
13
29
  end
14
30
  end
@@ -0,0 +1,39 @@
1
+ module Workarea
2
+ module Admin
3
+ class ChangesetSummaryViewModel < ApplicationViewModel
4
+ delegate :model_name, to: :model_class
5
+
6
+ def count
7
+ model['count']
8
+ end
9
+
10
+ def type
11
+ model['_id']
12
+ end
13
+
14
+ def type_filter
15
+ search_model&.type || model_name.param_key
16
+ end
17
+
18
+ def label
19
+ type_filter.titleize.pluralize(count)
20
+ end
21
+
22
+ def searchable?
23
+ search_model.present?
24
+ end
25
+
26
+ private
27
+
28
+ def model_class
29
+ @model_class ||= type.constantize
30
+ end
31
+
32
+ def search_model
33
+ return @search_model if defined?(@serch_model)
34
+
35
+ @search_model = Search::Admin.for(model_class.new)
36
+ end
37
+ end
38
+ end
39
+ end
@@ -42,7 +42,7 @@ module Workarea
42
42
  def storefront_view_model
43
43
  @storefront_view_model ||= Storefront::ProductViewModel.wrap(
44
44
  model,
45
- @options
45
+ options
46
46
  )
47
47
  end
48
48
 
@@ -93,16 +93,13 @@ module Workarea
93
93
  end
94
94
  end
95
95
 
96
- def options
97
- variants.reduce({}) do |memo, variant|
96
+ def variant_details
97
+ variants.each_with_object({}) do |variant, memo|
98
98
  variant.details.each do |name, value|
99
99
  memo[name] ||= []
100
- memo[name] << value
101
- memo[name].flatten!
100
+ memo[name] += Array.wrap(value)
102
101
  memo[name].uniq!
103
102
  end
104
-
105
- memo
106
103
  end
107
104
  end
108
105
 
@@ -125,7 +122,7 @@ module Workarea
125
122
  end
126
123
 
127
124
  def insights
128
- @insights ||= Insights::ProductViewModel.wrap(model, @options)
125
+ @insights ||= Insights::ProductViewModel.wrap(model, options)
129
126
  end
130
127
 
131
128
  def inventory
@@ -7,9 +7,29 @@ module Workarea
7
7
  @timeline ||= TimelineViewModel.new(model)
8
8
  end
9
9
 
10
+ def changeset_count
11
+ @changeset_count ||= model.changesets.count
12
+ end
13
+
14
+ def additional_changesets_count
15
+ [changeset_count - Workarea.config.per_page, 0].max
16
+ end
17
+
18
+ def show_changeset_summary?
19
+ changeset_count > Workarea.config.per_page
20
+ end
21
+
22
+ def changeset_summary
23
+ @changeset_summary ||=
24
+ Release::Changeset.summary(model.id).map do |type|
25
+ ChangesetSummaryViewModel.new(type)
26
+ end
27
+ end
28
+
10
29
  def changesets_with_releasable
11
30
  @changesets_with_releasable ||= model
12
31
  .changesets
32
+ .latest
13
33
  .map { |c| ChangesetViewModel.wrap(c) }
14
34
  .select { |changeset| changeset.root.present? }
15
35
  .reject { |changeset| changeset.releasable.blank? }
@@ -23,9 +43,8 @@ module Workarea
23
43
  calendar_at&.to_date
24
44
  end
25
45
 
26
- def undo
27
- return unless undo?
28
- @undo ||= ReleaseViewModel.wrap(model.undo, options)
46
+ def undos
47
+ @undos ||= ReleaseViewModel.wrap(model.undos, options)
29
48
  end
30
49
 
31
50
  def undoes
@@ -60,6 +60,9 @@
60
60
  .property
61
61
  = label_tag 'category_default_sort', t('workarea.admin.fields.default_sort'), class: 'property__name'
62
62
  = select_tag 'category[default_sort]', options_for_select(@category.sort_options, selected: @category.default_sort)
63
+ - if @category.featured_products?
64
+ %span.property__note
65
+ = t('workarea.admin.catalog_categories.edit.default_sort_note')
63
66
 
64
67
  .property
65
68
  = label_tag 'category_terms_facets_list', t('workarea.admin.fields.terms_facets_list'), class: 'property__name'
@@ -108,7 +108,7 @@
108
108
  %p.align-center= t('workarea.admin.fields.inventory')
109
109
 
110
110
  %span.heading.heading--3.heading--no-margin.align-center
111
- = model.options.keys.to_sentence
111
+ = model.variant_details.keys.to_sentence
112
112
  %p.align-center= t('workarea.admin.fields.options')
113
113
 
114
114
  = link_to catalog_product_variants_path(model), class: 'card__button' do
@@ -13,12 +13,37 @@
13
13
  .view__container
14
14
  = render_cards_for(@release, :planned_changes)
15
15
 
16
- - if @release.changesets_with_releasable.blank?
16
+ - if @release.changeset_count.zero?
17
17
  .section.align-center
18
18
  %p.heading.heading--3= t('workarea.admin.changesets.no_changesets')
19
19
  %p.heading.heading--3= link_to t('workarea.admin.changesets.plan_some_changes'), release_releasables_path(@release)
20
20
 
21
+ .browsing-controls.browsing-controls--with-divider
22
+ %p.browsing-controls__count{ data: { browsing_controls_count: @release.changeset_count } }
23
+ = t('workarea.admin.changesets.pluralize_change', count: @release.changeset_count)
24
+
25
+
21
26
  .grid.grid--center
27
+ - if @release.show_changeset_summary?
28
+ .grid__cell.grid__cell--80-at-medium
29
+ .section
30
+ .grid.grid--center.grid--auto
31
+ - @release.changeset_summary.each do |summary|
32
+ .grid__cell
33
+ - if summary.searchable?
34
+ .card.card--button
35
+ = link_to search_path(type: [summary.type_filter], upcoming_changes: [@release.id]), class: 'card__header' do
36
+ .card__header-text #{summary.count} #{summary.label}
37
+ = releaseable_icon summary, { class: 'card__icon'}
38
+ - else
39
+ .card
40
+ .card__header
41
+ .card__header-text #{summary.count} #{summary.label}
42
+ = releaseable_icon summary, { class: 'card__icon'}
43
+
44
+ .grid__cell.grid__cell--80-at-medium
45
+ %h2.align-center= t('workarea.admin.changesets.recent')
46
+
22
47
  .grid__cell.grid__cell--80-at-medium
23
48
  %ul.list-reset
24
49
  - @release.changesets_with_releasable.each do |changeset|
@@ -42,3 +67,7 @@
42
67
  .release-changeset__body
43
68
  - changeset.changed_fields.each do |field|
44
69
  = render_changeset_field(changeset, field)
70
+
71
+ - if @release.show_changeset_summary?
72
+ %li.text.text--large.align-center
73
+ = link_to t('workarea.admin.cards.more', amount: @release.additional_changesets_count ), search_path(upcoming_changes: [@release.id])
@@ -9,7 +9,7 @@
9
9
  - @undo_release.errors.full_messages.each do |message|
10
10
  = render_message 'error', message
11
11
 
12
- = form_tag release_undo_path(@release), method: 'post' do
12
+ = form_tag release_undos_path(@release), method: 'post' do
13
13
  .section
14
14
  .property.property--required
15
15
  = label_tag 'release_name', t('workarea.admin.fields.name'), class: 'property__name'
@@ -26,12 +26,15 @@
26
26
  .grid__cell.grid__cell--50-at-medium
27
27
  .property
28
28
  = label_tag 'release_publish_at', t('workarea.admin.fields.undo_at'), class: 'property__name'
29
- .box.box--rounded= hidden_field_tag 'release[publish_at]', @undo_release.publish_at, data: { datetimepicker_field: { inline: true } }
29
+ .box.box--rounded= hidden_field_tag 'release[publish_at]', @undo_release.publish_at, data: { datetimepicker_field: { inline: true, uiOptions: { minDate: (@release.publish_at.present? ? @release.publish_at.to_s(:date_only) : 0) } } }
30
30
 
31
31
  .workflow-bar
32
32
  .grid.grid--middle
33
33
  .grid__cell.grid__cell--20
34
- = link_to t('workarea.admin.form.cancel'), undo_release_path(@release), class: 'workflow-bar__button workflow-bar__button--delete'
34
+ - if @undo_release.persisted?
35
+ = link_to t('workarea.admin.form.cancel'), release_path(@undo_release, return_to: release_path(@release)), class: 'workflow-bar__button workflow-bar__button--delete', data: { method: 'delete', confirm: t('workarea.admin.create_release_undos.workflow.delete_confirmation') }
36
+ - else
37
+ = link_to t('workarea.admin.form.cancel'), release_path(@release), class: 'workflow-bar__button workflow-bar__button--delete'
35
38
 
36
39
  .grid__cell.grid__cell--60
37
40
  %ol.workflow-bar__steps
@@ -34,15 +34,21 @@
34
34
  - changeset.changed_fields.each do |field|
35
35
  = render_changeset_field(changeset, field)
36
36
 
37
+ - if @release.show_changeset_summary?
38
+ %li.text.text--large.align-center
39
+ = t('workarea.admin.cards.more', amount: @release.additional_changesets_count )
40
+
41
+ %p= t('workarea.admin.create_release_undos.review.change_count_message')
42
+
37
43
  .workflow-bar
38
44
  .grid.grid--middle
39
45
  .grid__cell.grid__cell--20
40
- = link_to t('workarea.admin.form.cancel'), release_path(@undo_release), class: 'workflow-bar__button workflow-bar__button--delete', data: { method: 'delete', confirm: t('workarea.admin.create_release_undos.workflow.delete_confirmation') }
46
+ = link_to t('workarea.admin.form.cancel'), release_path(@undo_release, return_to: release_path(@release)), class: 'workflow-bar__button workflow-bar__button--delete', data: { method: 'delete', confirm: t('workarea.admin.create_release_undos.workflow.delete_confirmation') }
41
47
 
42
48
  .grid__cell.grid__cell--60
43
49
  %ol.workflow-bar__steps
44
50
  %li.workflow-bar__step
45
- 1) #{link_to t('workarea.admin.create_release_undos.workflow.setup'), new_release_undo_path(@release)}
51
+ 1) #{link_to t('workarea.admin.create_release_undos.workflow.setup'), new_release_undo_path(@release, id: @undo_release.id)}
46
52
  %li.workflow-bar__step
47
53
  %strong 2) #{t('workarea.admin.create_release_undos.workflow.review')}
48
54
 
@@ -6,5 +6,5 @@
6
6
  #{local_time_ago(model.updated_at)}
7
7
  - else
8
8
  %span.summary__info-text-inactive= t('workarea.admin.navigation_menus.summary.inactive')
9
- %span.summary__info= t('workarea.admin.navigation_menus.summary.content_block', count: model.content.try(:blocks).size)
9
+ %span.summary__info= t('workarea.admin.navigation_menus.summary.content_block', count: model.content&.blocks&.size.to_i)
10
10
  %span.summary__type{ title: t('workarea.admin.navigation_menus.summary.type') }= t('workarea.admin.navigation_menus.summary.type')
@@ -5,6 +5,11 @@
5
5
  .view__heading
6
6
  = link_to "↑ #{t('workarea.admin.navigation_redirects.index.dashboard_link')}", settings_dashboards_path, class: 'view__dashboard-button'
7
7
  %h1= t('workarea.admin.navigation_redirects.index.title')
8
+ - unless navigation_redirects_enabled?
9
+ .grid.grid--center
10
+ .grid__cell.grid__cell--50
11
+ = render_message 'warning' do
12
+ = t('workarea.admin.navigation_redirects.index.disabled')
8
13
 
9
14
  .view__container
10
15
 
@@ -5,7 +5,7 @@
5
5
  %span.discount__node
6
6
  %span.property.property--inline
7
7
  = text_field_tag 'discount[amount]', @discount.amount, class: 'text-box text-box--small', title: 'Amount of Discount', placeholder: '10', required: true
8
- %span.discount__node off products
8
+ %span.discount__node off the item's unit price
9
9
 
10
10
  .discount__node-line
11
11
  %p.discount__node-group
@@ -62,80 +62,21 @@
62
62
 
63
63
  - if local_assigns[:active].blank?
64
64
  .card__body
65
- - if model.changesets_with_releasable.empty?
65
+ - if model.changeset_count.zero?
66
66
  %p.card__empty-note= t('workarea.admin.releases.cards.planned_changes.empty_note')
67
67
  = link_to release_changesets_path(model), class: 'card__button' do
68
68
  %span.button.button--small= t('workarea.admin.releases.cards.planned_changes.button')
69
69
  - else
70
- - model.changesets_with_releasable.take(3).each do |changeset|
71
-
72
- .activity
73
- .activity__header
74
- .activity__avatar
75
- = changeset_icon changeset, { class: 'svg-icon'}
76
- .activity__name= changeset.name
77
- .activity__time
78
- = changeset.publish_humanized
79
- - if changeset.release_date.present?
80
- = local_time(changeset.release_date, :long)
81
- .activity__message
82
- .release-changeset.release-changeset--activity
83
- .release-changeset__body
84
- - changeset.changed_fields.each do |field|
85
- = render_changeset_field(changeset, field)
70
+ %table
71
+ %tbody
72
+ - model.changeset_summary.each do |summary|
73
+ %tr
74
+ %td.align-right
75
+ %strong= summary.count
76
+ %td= summary.label
86
77
 
87
78
  = link_to release_changesets_path(model), class: 'card__button' do
88
79
  %span.button.button--small= t('workarea.admin.releases.cards.planned_changes.button')
89
80
 
90
- .grid__cell
91
- - if model.undoes?
92
- .card{ class: card_classes(:original, local_assigns[:active]) }
93
- = link_to original_release_path(model), class: 'card__header' do
94
- %span.card__header-text= t('workarea.admin.releases.cards.original.title')
95
- = inline_svg 'workarea/admin/icons/planned_changes.svg', class: 'card__icon'
96
-
97
- - if local_assigns[:active].blank?
98
- .card__body
99
- .card__empty-note
100
- %p= t('workarea.admin.releases.cards.original.undoes_html', link: link_to(model.undoes.name, release_path(model.undoes)))
101
-
102
- - if model.undoes.publish_at.present? && model.undoes.publish_at.future?
103
- %p= t('workarea.admin.releases.cards.undo.set_to_publish_html', link: link_to(model.undoes.name, release_path(model.undoes)), at: local_time_ago(model.undoes.publish_at))
104
- - elsif model.undoes.published_at.present?
105
- %p= t('workarea.admin.releases.cards.undo.published_html', link: link_to(model.undoes.name, release_path(model.undoes)), at: local_time_ago(model.undoes.published_at))
106
- - else
107
- %p= t('workarea.admin.releases.cards.undo.unscheduled_html', link: link_to(model.undoes.name, release_path(model.undoes)))
108
-
109
- = link_to original_release_path(model), class: 'card__button' do
110
- %span.button.button--small= t('workarea.admin.releases.cards.original.learn_more')
111
-
112
- - else
113
- .card{ class: card_classes(:undo, local_assigns[:active]) }
114
- = link_to undo_release_path(model), class: 'card__header' do
115
- %span.card__header-text= t('workarea.admin.releases.cards.undo.title')
116
- = inline_svg 'workarea/admin/icons/planned_changes.svg', class: 'card__icon'
117
-
118
- - if local_assigns[:active].blank?
119
- .card__body
120
- .card__empty-note
121
- - if model.undo.blank?
122
- %p= t('workarea.admin.releases.cards.undo.not_setup')
123
-
124
- = link_to undo_release_path(model), class: 'card__button' do
125
- %span.button.button--small= t('workarea.admin.releases.cards.undo.build_an_undo')
126
-
127
- - else
128
- %p= t('workarea.admin.releases.cards.undo.undo_html', link: link_to(model.undo.name, release_path(model.undo)), at: local_time_ago(model.undo.created_at))
129
-
130
- - if model.undo.publish_at.present? && model.undo.publish_at.future?
131
- %p= t('workarea.admin.releases.cards.undo.set_to_publish_html', link: link_to(model.undo.name, release_path(model.undo)), at: local_time_ago(model.undo.publish_at))
132
- - elsif model.undo.published_at.present?
133
- %p= t('workarea.admin.releases.cards.undo.published_html', link: link_to(model.undo.name, release_path(model.undo)), at: local_time_ago(model.undo.published_at))
134
- - else
135
- %p= t('workarea.admin.releases.cards.undo.unscheduled_html', link: link_to(model.undo.name, release_path(model.undo)))
136
-
137
- = link_to undo_release_path(model), class: 'card__button' do
138
- %span.button.button--small= t('workarea.admin.releases.cards.undo.learn_more')
139
-
140
81
  .grid__cell
141
82
  = render 'workarea/admin/comments/card', commentable: model, active: local_assigns[:active]