navigation_helper.rb revision 3163ca485711745703db7bafed31f9675aafeefe
1088N/A 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) alternatives = [controller.to_s, controller.to_s.gsub('_', '/')] if params[:repository_id] 'active' if controller == :ontologies 'active' if controller == :repositories elsif alternatives.include?(controller_name) 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')