-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
♻️ Replace Homepage Presenter with decorator (#2059)
- Loading branch information
Showing
2 changed files
with
29 additions
and
74 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |