-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replaced menu partials with Refinery::Pages::MenuPresenter.
This has many advantages not least of which is that we can test it without requesting pages. * Using config_accessor and attr_accessor instead of passing options around. * Added leaf? to MenuItem and made use of has_children? in the MenuPresenter * All methods besides initialize and to_html are private to this class. * Moved Refinery::Core#menu_css to the Refinery::Pages::MenuPresenter. * Uses MenuItem#depth instead of scanning ancestors. * Renamed levels to max_depth and added within_max_depth? * Refactored Menu and MenuItem as proper objects, not pretending to be hashes or arrays (ht: @awagener) * Move Menu#initialize logic to Menu#append so that more items can be appended after initialize. * Moved all page presenters and their specs under app/presenters and spec/presenters where they belong.
- Loading branch information
Showing
24 changed files
with
183 additions
and
170 deletions.
There are no files selected for viewing
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
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 |
---|---|---|
@@ -1,7 +1,4 @@ | ||
<h1 id='logo'> | ||
<%= link_to Refinery::Core.site_name, refinery.root_path %> | ||
</h1> | ||
<%= render(:partial => "/refinery/menu", :locals => { | ||
:dom_id => 'menu', | ||
:css => 'menu' | ||
}) %> | ||
<%= Refinery::Pages::MenuPresenter.new(refinery_menu_pages, self).to_html %> |
This file was deleted.
Oops, something went wrong.
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
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
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
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
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
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
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
File renamed without changes.
File renamed without changes.
Oops, something went wrong.
b507ee5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@parndt What's the suggested way to customize the css classes for the ul, li, a, etc. For example, if I want to use foundation or bootstrap nav, I need to add specific classes, data attributes and dropdown classes to parents. In the old method we could just overwrite the view partials.
Should/Can we override the menu presenter like we do with model and page decorators?
b507ee5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
b507ee5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
b507ee5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.