3

Does anyone know how one can change the default page of a given project in redmine? If I click on the project I get redirected to its "Overview" page. But I need to get redirected to the Issues page instead. How should I change the routes.rb to achieve that?

PS. Redmine 1.3.2.stable (SQLite)

azerIO
  • 385
  • 1
  • 4
  • 14

3 Answers3

2

I have managed to change default landing page for ALL projects (so if you click any project name on projects list, then you are redirected to the issues page instead of overview). It works in my Redmine 1.3.3 and possibly in other versions.

The trick is to change the source file /usr/share/redmine/app/helpers/application_helper.rb

Find the function beginning with

def link_to_project(project, options={}, html_options = nil)

and change the line

url = {:controller => 'projects', :action => 'show', :id => project}.merge(options)

to

url = {:controller => 'issues', :action => 'index', :project_id => project}.merge(options) 

and that's it!

Peachy
  • 638
  • 4
  • 18
wesol
  • 21
  • 2
0

Based on answers from Miguel and wesol, you can combine them to make it work for redmine 2.x and 3.x:

Edit file app/helpers/application_helper.rb

Search for the function link_to_project

Just before the line link_to project.name, project_path(project, options), html_options, insert the following:

options[:jump] = 'issues'

This will work when clicking a project in the Projects page. When using the dropdown, you will go to the same tab on the target project (i.e. it does not change the dropdown behavior).

youen
  • 191
  • 2
  • 8
0

Another possible solution for this is to change the jump option on the projects combo-box (upper right combo-box). This way you will get to the issues pages of the project(s) you want and not ALL projects.

Edit the app/helpers/application_helper.rb file and look for the render_project_jump_box method.

Replace the options variable to jump to the issues page for the project you want (change 'ABC' to your project name in the code below):

options << project_tree_options_for_select(projects, :selected => @project) do |p|
    # adding the jump to issues on project ABC
    # (combo-box on the upper right side)
    if p.to_s == 'ABC' && current_menu_item.to_s != 'issues'
      { :value => project_path(:id => p, :jump => 'issues') }
    else
      { :value => project_path(:id => p, :jump => current_menu_item) }
    end
  end

Now whenever you choose project 'ABC' from the projects combo-box, you will see the Issues page for project 'ABC', and not its Overview page.