app/views/workarea/admin/releases/_cards.html.haml in workarea-admin-3.4.45 vs app/views/workarea/admin/releases/_cards.html.haml in workarea-admin-3.5.0.beta.1

- old
+ new

@@ -13,28 +13,16 @@ - if model.publish_at.present? #{local_time_ago(model.publish_at)} - else = t('workarea.admin.releases.cards.attributes.unscheduled') %li - %strong= t('workarea.admin.releases.cards.attributes.undo_at') - - if model.undo_at.present? - #{local_time_ago(model.undo_at)} - - else - = t('workarea.admin.releases.cards.attributes.unscheduled') - %li %strong= t('workarea.admin.releases.cards.attributes.last_published') - if model.published_at.present? #{local_time_ago(model.published_at)} - else = t('workarea.admin.releases.cards.attributes.never') %li - %strong= t('workarea.admin.releases.cards.attributes.last_undone') - - if model.undone_at.present? - #{local_time_ago(model.undone_at)} - - else - = t('workarea.admin.releases.cards.attributes.never') - %li %strong= t('workarea.admin.fields.tags') = model.tags.join(', ').presence || t('workarea.admin.releases.cards.attributes.none') %li %strong= t('workarea.admin.fields.updated_at') #{local_time_ago(model.updated_at)} @@ -96,8 +84,58 @@ - changeset.changed_fields.each do |field| = render_changeset_field(changeset, field) = link_to release_changesets_path(model), class: 'card__button' do %span.button.button--small= t('workarea.admin.releases.cards.planned_changes.button') + + .grid__cell + - if model.undoes? + .card{ class: card_classes(:original, local_assigns[:active]) } + = link_to original_release_path(model), class: 'card__header' do + %span.card__header-text= t('workarea.admin.releases.cards.original.title') + = inline_svg 'workarea/admin/icons/planned_changes.svg', class: 'card__icon' + + - if local_assigns[:active].blank? + .card__body + .card__empty-note + %p= t('workarea.admin.releases.cards.original.undoes_html', link: link_to(model.undoes.name, release_path(model.undoes))) + + - if model.undoes.publish_at.present? && model.undoes.publish_at.future? + %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)) + - elsif model.undoes.published_at.present? + %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)) + - else + %p= t('workarea.admin.releases.cards.undo.unscheduled_html', link: link_to(model.undoes.name, release_path(model.undoes))) + + = link_to original_release_path(model), class: 'card__button' do + %span.button.button--small= t('workarea.admin.releases.cards.original.learn_more') + + - else + .card{ class: card_classes(:undo, local_assigns[:active]) } + = link_to undo_release_path(model), class: 'card__header' do + %span.card__header-text= t('workarea.admin.releases.cards.undo.title') + = inline_svg 'workarea/admin/icons/planned_changes.svg', class: 'card__icon' + + - if local_assigns[:active].blank? + .card__body + .card__empty-note + - if model.undo.blank? + %p= t('workarea.admin.releases.cards.undo.not_setup') + + = link_to undo_release_path(model), class: 'card__button' do + %span.button.button--small= t('workarea.admin.releases.cards.undo.build_an_undo') + + - else + %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)) + + - if model.undo.publish_at.present? && model.undo.publish_at.future? + %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)) + - elsif model.undo.published_at.present? + %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)) + - else + %p= t('workarea.admin.releases.cards.undo.unscheduled_html', link: link_to(model.undo.name, release_path(model.undo))) + + = link_to undo_release_path(model), class: 'card__button' do + %span.button.button--small= t('workarea.admin.releases.cards.undo.learn_more') .grid__cell = render 'workarea/admin/comments/card', commentable: model, active: local_assigns[:active]