navigation_helper.rb revision 3a61a38912bb3d0f2b0aef3ff4b767a3919ef07b
row << resource
.send(counter_key) if resource.respond_to?(counter_key) @page_title = current_page @page_title = "#{current_page.capitalize} · #{@page_title}" if current_page != pages[0][0] render :partial => partial, :locals => { current_page: current_page, additional_actions: additional_actions, def team_nav(team, current_page) [:permissions, [team, :permissions]] pages << [:members, [team, :team_users]] if can? :edit, team subnavigation(team, pages, current_page) def active_navigation(controller) if params[:repository_id] 'active' if controller == :ontologies 'active' if controller == :repositories 'active' if [controller.to_s, controller.to_s.gsub('_', '/')].include?(params[:controller]) def menu_entry(title, controller) content_tag :li, class: active_navigation(controller) do link_to title, controller # used for activating tabs in ontology view def in_subcontroller?(page, current_page) %w(classes sentences theorems).include?(controller_name) # used for activating tabs in ontology view ontology_nav_metadata.map{ |m| m[1][-1].to_s }.include?(controller_name) def ontology_nav_metadata ['Projects', [*resource_chain, :projects]], ['Categories', [*resource_chain, :categories]], ['Tasks', [*resource_chain, :tasks]], ['License Models', [*resource_chain, :license_models]], ['Formality Levels', [*resource_chain, :formality_levels]] def repository_settings_nav(repository, current_page) chain = resource_chain.last.is_a?(Ontology) ? resource_chain[0..-2] : resource_chain current_page = t("repository.#{current_page}") pages << [t("repository.urlmaps"), repository_url_maps_path(repository)] pages << [t("repository.errors"), repository_errors_path(repository)] pages << [t("repository.permissions"), [*chain, :permissions]] if can? :permissions, repository pages << [t("repository.edit"), edit_repository_path(repository)] if can? :edit, repository subnavigation(repository, pages, current_page, partial: '/repository_settings/subnav')