Class: QaServer::NavmenuPresenter
- Inherits:
-
Object
- Object
- QaServer::NavmenuPresenter
- Defined in:
- app/presenters/qa_server/navmenu_presenter.rb
Instance Attribute Summary collapse
-
#leftmenu_items ⇒ Array<Hash>
readonly
Label-url pairs for the navigation bar’s menu items justified left.
-
#rightmenu_items ⇒ Array<Hash>
readonly
Label-url pairs for the navigation bar’s menu items justified right.
Instance Method Summary collapse
-
#append_leftmenu_items(additional_items = []) ⇒ Object
Append additional left justified menu items to the main navigation menu.
-
#initialize ⇒ NavmenuPresenter
constructor
A new instance of NavmenuPresenter.
Constructor Details
#initialize ⇒ NavmenuPresenter
Returns a new instance of NavmenuPresenter.
25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'app/presenters/qa_server/navmenu_presenter.rb', line 25 def initialize @leftmenu_items = [] @leftmenu_items << { label: I18n.t("qa_server.menu.home"), url: root_path } @leftmenu_items << { label: I18n.t("qa_server.menu.usage"), url: usage_index_path } @leftmenu_items << { label: I18n.t("qa_server.menu.authorities"), url: } @leftmenu_items << { label: I18n.t("qa_server.menu.check_status"), url: check_status_index_path } @leftmenu_items << { label: I18n.t("qa_server.menu.monitor_status"), url: monitor_status_index_path } @leftmenu_items << { label: I18n.t("qa_server.menu.fetch_term"), url: fetch_index_path } @rightmenu_items = [] @rightmenu_items << { label: "LD4L Gateway", url: "http://ld4l.org/" } end |
Instance Attribute Details
#leftmenu_items ⇒ Array<Hash> (readonly)
Returns label-url pairs for the navigation bar’s menu items justified left.
16 17 18 |
# File 'app/presenters/qa_server/navmenu_presenter.rb', line 16 def @leftmenu_items end |
#rightmenu_items ⇒ Array<Hash> (readonly)
Returns label-url pairs for the navigation bar’s menu items justified right.
23 24 25 |
# File 'app/presenters/qa_server/navmenu_presenter.rb', line 23 def @rightmenu_items end |
Instance Method Details
#append_leftmenu_items(additional_items = []) ⇒ Object
Append additional left justified menu items to the main navigation menu
45 46 47 48 |
# File 'app/presenters/qa_server/navmenu_presenter.rb', line 45 def (additional_items = []) return if additional_items.nil? additional_items.each { |item| @leftmenu_items << item } end |