<% if index == 0 %>
-
<%= markdown(title) %>
- <%= presenter.permission_badge %> <%= presenter.workflow.badge %>
-
+
<%= markdown(title) %> <%= presenter.permission_badge %> <%= presenter.workflow.badge %>
<% else %>
<%= markdown(title) %>
<% end %>
diff --git a/app/views/themes/cultural_show/hyrax/base/show.html.erb b/app/views/themes/cultural_show/hyrax/base/show.html.erb
index 60eed7cfc..0c8e7b8e0 100644
--- a/app/views/themes/cultural_show/hyrax/base/show.html.erb
+++ b/app/views/themes/cultural_show/hyrax/base/show.html.erb
@@ -11,9 +11,6 @@
<%= render 'workflow_actions_widget', presenter: @presenter %>
-
- <%= render "show_actions", presenter: @presenter %>
-
<% if @presenter.video_embed_viewer? %>
<%= render 'video_embed_viewer', presenter: @presenter %>
<% elsif @presenter.iiif_viewer? %>
@@ -29,6 +26,9 @@
<%= render 'representative_media', presenter: @presenter, viewer: false %>
<% end %>
+
+ <%= render "show_actions", presenter: @presenter %>
+
<%= render 'work_description', presenter: @presenter %>
<%= render 'metadata', presenter: @presenter %>
@@ -38,7 +38,9 @@
<%= render 'relationships', presenter: @presenter %>
<%= render('download_pdf', presenter: @presenter, file_set_id: @presenter.file_set_presenters.first.id) if @presenter.show_pdf_download_button? %>
+
<%= render 'citations', presenter: @presenter %>
+
<%#= render 'analytics_button', presenter: @presenter %>
diff --git a/app/views/themes/scholarly_show/hyrax/base/_show_actions.html.erb b/app/views/themes/scholarly_show/hyrax/base/_show_actions.html.erb
new file mode 100644
index 000000000..aa1345edb
--- /dev/null
+++ b/app/views/themes/scholarly_show/hyrax/base/_show_actions.html.erb
@@ -0,0 +1,54 @@
+<%# OVERRIDE Hyrax v5.0.1 Adjust permission checks for delete and add analytics button and add ENV to control turbolinks %>
+
+
+ <% if Hyrax.config.analytics_reporting? %>
+ <% # turbolinks needs to be turned off or the page will use the cache and the %>
+ <% # analytics graph will not show unless the page is refreshed. %>
+ <%= link_to t('.analytics'), presenter.stats_path, id: 'stats', class: 'btn btn-secondary', data: { turbolinks: false } %>
+ <% end %>
+ <% if presenter.editor? && !workflow_restriction?(presenter) %>
+ <%= link_to t('.edit'), edit_polymorphic_path([main_app, presenter]), class: 'btn btn-secondary', data: { turbolinks: block_valkyrie_redirect? } %>
+ <% if presenter.member_count > 1 %>
+ <%= link_to t("hyrax.file_manager.link_text"), polymorphic_path([main_app, :file_manager, presenter]), class: 'btn btn-secondary' %>
+ <% end %>
+ <% if presenter.valid_child_concerns.length > 0 %>
+
+
+
+
+ <% end %>
+ <%# OVERRIDE to validate delete permission %>
+ <% if current_ability.can?(:delete, presenter.solr_document) %>
+ <%= link_to t('.delete'), [main_app, presenter], class: 'btn btn-danger', data: { confirm: t('.confirm_delete', work_type: presenter.human_readable_type) }, method: :delete %>
+ <% end %>
+ <% if !workflow_restriction?(presenter) %>
+ <% if presenter.show_deposit_for?(collections: @user_collections) %>
+
+ <%= button_tag t('hyrax.dashboard.my.action.add_to_collection'),
+ class: 'btn btn-secondary submits-batches submits-batches-add',
+ data: { toggle: "modal", target: "#collection-list-container" } %>
+ <% end %>
+ <% if presenter.work_featurable? %>
+ <%= link_to t('.feature'), hyrax.featured_work_path(presenter, format: :json),
+ data: { behavior: 'feature' },
+ class: presenter.display_feature_link? ? 'btn btn-secondary' : 'btn btn-secondary collapse' %>
+
+ <%= link_to t('.unfeature'), hyrax.featured_work_path(presenter, format: :json),
+ data: { behavior: 'unfeature' },
+ class: presenter.display_unfeature_link? ? 'btn btn-secondary' : 'btn btn-secondary collapse' %>
+ <% end %>
+ <% end %>
+ <% end %>
+
+
+
+
+
+
+ <%= render 'hyrax/dashboard/collections/form_for_select_collection', user_collections: @user_collections %>
diff --git a/app/views/themes/scholarly_show/hyrax/base/_work_title.html.erb b/app/views/themes/scholarly_show/hyrax/base/_work_title.html.erb
index 998be1d71..1baf9452c 100644
--- a/app/views/themes/scholarly_show/hyrax/base/_work_title.html.erb
+++ b/app/views/themes/scholarly_show/hyrax/base/_work_title.html.erb
@@ -2,9 +2,7 @@
<% if index == 0 %>
-
<%= markdown(title) %>
- <%= presenter.permission_badge %> <%= presenter.workflow.badge %>
-
+
<%= markdown(title) %> <%= presenter.permission_badge %> <%= presenter.workflow.badge %>
<% else %>
<%= markdown(title) %>
<% end %>
diff --git a/app/views/themes/scholarly_show/hyrax/base/show.html.erb b/app/views/themes/scholarly_show/hyrax/base/show.html.erb
index 277c1b3e4..fb8a69050 100644
--- a/app/views/themes/scholarly_show/hyrax/base/show.html.erb
+++ b/app/views/themes/scholarly_show/hyrax/base/show.html.erb
@@ -54,7 +54,7 @@
<%= render 'metadata', presenter: @presenter %>
-
+
<%= render('download_pdf', presenter: @presenter, file_set_id: @presenter.file_set_presenters.first.id) if @presenter.show_pdf_download_button? %>
<%= render 'citations', presenter: @presenter %>
@@ -62,7 +62,7 @@
-
+
<%= render 'relationships', presenter: @presenter %>
<% if @presenter.class == Hyrax::OerPresenter %>
<%= render 'hyrax/oers/related_items', presenter: @presenter %>
diff --git a/spec/services/create_account_spec.rb b/spec/services/create_account_spec.rb
index d5562384c..70ba896ff 100644
--- a/spec/services/create_account_spec.rb
+++ b/spec/services/create_account_spec.rb
@@ -6,6 +6,11 @@
let(:account) { FactoryBot.build(:sign_up_account) }
let(:stubbed_admin_set) { double(AdminSetResource, id: "admin_set/id") }
+ after do
+ # Ensure we reset to the default tenant after each test
+ Apartment::Tenant.switch!(Apartment.default_tenant)
+ end
+
describe '#create_tenant' do
it 'creates a new apartment tenant' do
expect(Apartment::Tenant).to receive(:create).with(account.tenant)