change route of wiki's table of content

we need the id of the related wiki page when displaying
the table of content in order to highlight the menu item
and highlight the current position in the toc
pull/41/head
Romano Licker 12 years ago committed by Jens Ulferts
parent 98afc0f37a
commit 6110dcbc5c
  1. 1
      config/routes.rb
  2. 2
      lib/redmine/menu_manager/menu_helper.rb

@ -44,6 +44,7 @@ ActionController::Routing::Routes.draw do |map|
map.wiki_create 'projects/:project_id/wiki/new', :controller => 'wiki', :action => 'create', :conditions => { :method => :post }
map.wiki_preview 'projects/:project_id/wiki/preview', :controller => 'wiki', :action => 'preview', :conditions => { :method => :post }
map.wiki_new_child 'projects/:project_id/wiki/:id/new', :controller => 'wiki', :action => 'new_child', :conditions => { :method => :get }
map.wiki_page_toc 'projects/:project_id/wiki/:id/toc', :controller => 'wiki', :action => 'index', :conditions => { :method => :get }
map.connect 'projects/:id/wiki', :controller => 'wikis', :action => 'edit', :conditions => {:method => :post}
map.connect 'projects/:id/wiki/destroy', :controller => 'wikis', :action => 'destroy', :conditions => {:method => :get}
map.connect 'projects/:id/wiki/destroy', :controller => 'wikis', :action => 'destroy', :conditions => {:method => :post}

@ -40,7 +40,7 @@ module Redmine::MenuManager::MenuHelper
:parent => "#{main_item.title}".to_sym if main_item.new_wiki_page and
WikiPage.find_by_wiki_id_and_title(project_wiki.id, main_item.title)
menu.push :table_of_contents, {:action => 'index', :controller => 'wiki'}, :param => :project_id, :caption => :label_table_of_contents, :parent => "#{main_item.title}".to_sym if main_item.index_page
menu.push :table_of_contents, {:action => 'index', :controller => 'wiki', :id => h(main_item.title)}, :param => :project_id, :caption => :label_table_of_contents, :parent => "#{main_item.title}".to_sym if main_item.index_page
main_item.children.each do |child|
menu.push "#{child.title}".to_sym,

Loading…
Cancel
Save