Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

♻️ Hyrax 5 refactor homepage presenter #2059

Merged
merged 1 commit into from
Dec 15, 2023
Merged
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
74 changes: 0 additions & 74 deletions app/presenters/hyrax/homepage_presenter.rb

This file was deleted.

29 changes: 29 additions & 0 deletions app/presenters/hyrax/homepage_presenter_decorator.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# # frozen_string_literal: true

# OVERRIDE Hyrax 5.0 to hide features via flipper
# hide featured researcher
# hide featured works
# hide recently uploaded
# hide share button
module Hyrax
module HomepagePresenterDecorator
def display_share_button?
Flipflop.show_share_button? && current_ability.can_create_any_work? ||
Flipflop.show_share_button? && user_unregistered?
end

def display_featured_researcher?
Flipflop.show_featured_researcher?
end

def display_featured_works?
Flipflop.show_featured_works?
end

def display_recently_uploaded?
Flipflop.show_recently_uploaded?
end
end
end

Hyrax::HomepagePresenter.prepend(Hyrax::HomepagePresenterDecorator)
Loading