diff --git a/app/helpers/hyku_knapsack/application_helper.rb b/app/helpers/hyku_knapsack/application_helper.rb index 80b31de..6bf92f0 100644 --- a/app/helpers/hyku_knapsack/application_helper.rb +++ b/app/helpers/hyku_knapsack/application_helper.rb @@ -2,5 +2,12 @@ module HykuKnapsack module ApplicationHelper + def tenant_registered_curation_concern_types + if current_account.mobius? + MOBIUS_CONCERNS + else + Hyrax.config.registered_curation_concern_types - MOBIUS_CONCERNS + end + end end end diff --git a/app/models/account_decorator.rb b/app/models/account_decorator.rb new file mode 100644 index 0000000..74d241e --- /dev/null +++ b/app/models/account_decorator.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +module AccountDecorator + MOBIUS_TENANTS = %w[ + atsu + ccis + covenant + crowder + eastcentral + jewell + kenrick + mbts + mobap + mobius-search + moval + mssu + nwmsu + sbuniv + stlcc + truman + webster + ].freeze + + def mobius? + name.in?(MOBIUS_TENANTS) + end +end + +Account.prepend(AccountDecorator) diff --git a/app/models/site_decorator.rb b/app/models/site_decorator.rb new file mode 100644 index 0000000..4aa2911 --- /dev/null +++ b/app/models/site_decorator.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +# OVERRIDE Hyku to set tenants with appropriate works + +module SiteDecorator + def instance + return NilSite.instance if Account.global_tenant? + + first_or_create do |site| + account = Account.find_by(tenant: Apartment::Tenant.current) + if account.mobius? + site.available_works = MOBIUS_CONCERNS + else + site.available_works = Hyrax.config.registered_curation_concern_types - MOBIUS_CONCERNS + end + end + end +end + +Site.singleton_class.send(:prepend, SiteDecorator) diff --git a/app/views/admin/work_types/edit.html.erb b/app/views/admin/work_types/edit.html.erb new file mode 100644 index 0000000..ba35cdf --- /dev/null +++ b/app/views/admin/work_types/edit.html.erb @@ -0,0 +1,19 @@ +<% provide :page_header do %> +