diff --git a/app/controllers/welcome_controller.rb b/app/controllers/welcome_controller.rb index 7f20abd15..904920c5a 100644 --- a/app/controllers/welcome_controller.rb +++ b/app/controllers/welcome_controller.rb @@ -17,7 +17,7 @@ class WelcomeController < ApplicationController caches_action :robots - before_filter :entry_select_course, :entry_select_contest, :only => [:index] + before_filter :entry_select_course, :entry_select_contest, :entry_select_user, :only => [:index] def index # @news = News.latest User.current @@ -124,4 +124,11 @@ class WelcomeController < ApplicationController return 0 end end + + def entry_select_user + if request.original_url.match(/user\.trustie\.net/) + redirect_to(:controller => "users", :action => "index") + return 0 + end + end end diff --git a/app/views/layouts/_base_header.html.erb b/app/views/layouts/_base_header.html.erb index 4973ae885..42aa4ce94 100644 --- a/app/views/layouts/_base_header.html.erb +++ b/app/views/layouts/_base_header.html.erb @@ -1,43 +1,32 @@ <% request.headers['REQUEST_URI'] = "" if request.headers['REQUEST_URI'].nil? realUrl = request.original_url - if (realUrl.match(/project\/course/)) - @nav_dispaly_course_label = 1 - elsif (realUrl.match(/users/)) + if (realUrl.match(/users/)) @nav_dispaly_home_path_label = 1 @nav_dispaly_main_course_label = 1 @nav_dispaly_main_project_label = 1 - elsif (realUrl.match(/projects/)) - @nav_dispaly_project_label = 1 elsif (realUrl.match(/contest/)) @nav_dispaly_contest_label = 1 elsif (realUrl.match(/calls/)) + @nav_dispaly_home_path_label = 1 @nav_dispaly_bid_label = 1 elsif (realUrl.match(/forums/)) @nav_dispaly_forum_label = 1 - elsif (realUrl.match(/[^forge]\/course[^\.]/)) - @nav_dispaly_course_label = 1 + elsif (realUrl.match(/forge\.trustie\.net\/*/)) @nav_dispaly_project_label = 1 - @nav_dispaly_contest_label = 1 - elsif (realUrl.match(/course\.trustie\.net/)) + @nav_dispaly_forum_label = 1 + elsif (realUrl.match(/course\.trustie\.net\/*/)) @nav_dispaly_course_all_label = 1 @nav_dispaly_forum_label = 1 @nav_dispaly_store_all_label = 1 - elsif (realUrl.match(/user\.trustie\.net/)) + elsif (realUrl.match(/user\.trustie\.net\/*/)) @nav_dispaly_home_path_label = 1 - @nav_dispaly_course_all_label = 1 - @nav_dispaly_project_label = 1 - elsif (realUrl.match(/forge\.trustie\.net/)) - @nav_dispaly_project_label = 1 - @nav_dispaly_user_label = 1 - @nav_dispaly_forum_label = 1 + @nav_dispaly_main_course_label = 1 + @nav_dispaly_main_project_label = 1 else - @nav_dispaly_course_label = 1 - @nav_dispaly_project_label = 1 - @nav_dispaly_user_label = 1 - @nav_dispaly_contest_label = 1 - @nav_dispaly_bid_label = 1 - @nav_dispaly_forum_label = 1 + @nav_dispaly_home_path_label = 1 + @nav_dispaly_main_course_label = 1 + @nav_dispaly_main_project_label = 1 end %>