class AdminUI::TopMenu
Top menu bar
contains a hash of menu paths to menus contains a hash of normalized routes to page names and descriptions
Attributes
Public Class Methods
Source
# File app/lib/ui/context.rb, line 81 def self.instance @instance ||= TopMenu.new @instance end
Source
# File app/lib/ui/context.rb, line 110 def initialize @paths = {} @route_names = {} super('/', '', parent: nil) end
              Calls superclass method
              
        AdminUI::Menu::new
            Public Instance Methods
Source
# File app/lib/ui/context.rb, line 127 def description_for_route(route) desc = '' if @route_names.key?(route) desc = @route_names[route].fetch(:description, '') if @route_names[route].fetch(:breadcrumb, false) && desc.empty? @route_names.each do |key, value| next unless File.dirname(key) == route desc += if %w[post delete].include?(value[:method]) "\n- #{value[:title]} ⚙️" else "\n- [#{value[:title]}](#{value[:route]})" end end end end desc end
Source
# File app/lib/ui/context.rb, line 147 def render s = %( <nav> <ul class="menu" role="menubar"> ) children.each do |item| s += item.render end s += %( <li class="search"> <span class="search"> <form action="/search" method="post" class="search"> <label for="search">Search: </label> <select id="search_type" class="search" name="search_type"> <option value="ark">Ark</option> <option value="inv_object_id">inv_object_id</option> <option value="localid">Local Id</option> <option value="erc_what">erc_what</option> <option value="erc_who">erc_who</option> <option value="erc_when">erc_when</option> <option value="filename">filename</option> <option value="container">container</option> </select> <input id="search"class="search" name="search" type="text" width="25" value=""/> <input type="submit" value="Go" /> </form> </span> </li> </ul> </nav> ) s end