Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions app/views/hyrax/base/_show_actions.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,22 @@
</div>

<div class='px-2 py-1'>
<% if @presenter.workflow.actions.present? && @presenter.solr_document['workflow_state_name_ssim']&.first&.capitalize == 'Deposited' %>
<% workflow_state = @presenter.solr_document['workflow_state_name_ssim']&.first&.downcase %>
<% workflow_actions = @presenter.workflow.actions %>
<% if workflow_actions.present? && workflow_state == 'deposited' %>
<%= form_tag main_app.hyrax_workflow_action_path(presenter), method: :put do %>
<%= hidden_field :workflow_action, :name, value: 'tombstone' %>
<input class="btn btn-default" type="submit" value="Tombstone" data-confirm='<%= t('hyrax.tombstone.confirmation') %>'>
<% end %>
<% else %>
<% elsif workflow_actions.present? && workflow_state == 'tombstoned' %>
<%= form_tag main_app.hyrax_workflow_action_path(presenter), method: :put do %>
<%= hidden_field :workflow_action, :name, value: 'approve' %>
<input class="btn btn-default" type="submit" value="Reapprove" data-confirm='<%= t('hyrax.tombstone.revert') %>' <%= disabled='disabled' unless (@presenter.solr_document['workflow_state_name_ssim']&.first&.capitalize == 'Tombstoned' && current_user.admin?) %>>
<input class="btn btn-default" type="submit" value="Reapprove" data-confirm='<%= t('hyrax.tombstone.revert') %>' <%= disabled='disabled' unless current_user.admin? %>>
<% end %>
<% elsif workflow_actions.present? && workflow_state != 'approved' %>
<%= form_tag main_app.hyrax_workflow_action_path(presenter), method: :put do %>
<%= hidden_field :workflow_action, :name, value: 'approve' %>
<input class="btn btn-default" type="submit" value="Approve" data-confirm='<%= t('hyrax.workflow.approve') %>' <%= disabled='disabled' unless current_user.admin? %>>
<% end %>
<% end %>
</div>
Expand Down
1 change: 1 addition & 0 deletions config/locales/hyrax.en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ en:
content_warning:
content_alert: 'This material contains content or imagery that may be harmful or difficult for some users. By clicking the ‘I Understand’ button you are acknowledging that you have been informed about the content you will view.'
workflow:
approve: 'Are you sure you want to approve this item?'
tombstoned: "This item has been deleted. It is no longer available."
tombstone:
confirmation: 'Are you sure you want to tombstone this item?'
Expand Down