evils fix

This commit is contained in:
xianbo 2014-04-04 15:24:42 +08:00
parent b063364b60
commit 2a72f7aac8
3 changed files with 19 additions and 13 deletions

View File

@ -9,3 +9,19 @@ app\models\setting.rb :165
为了开发方便使之功能在development模式下失效。 为了开发方便使之功能在development模式下失效。
# => nyan # => nyan
================================================================================ ================================================================================
#导航栏匹配域名显示和改变
app\helper\application_helper.rb
# rewrite navigation
app\views\layouts\_base_header.html.erb
# reset navigation by domain name and url through regular match
================================================================================
#首页根据域名匹配进入不同的页面
app\controller\welcome_controller.rb
def entry_select_user
if request.original_url.match(/user\.trustie\.net/)
redirect_to(:controller => "users", :action => "index")
return 0
end
end
================================================================================

View File

@ -126,7 +126,7 @@ class WelcomeController < ApplicationController
end end
def entry_select_user def entry_select_user
if request.original_url.match(/user\.trustie\.net/) if request.original_url.match(/user\.trustie\.net$/)
redirect_to(:controller => "users", :action => "index") redirect_to(:controller => "users", :action => "index")
return 0 return 0
end end

View File

@ -1,23 +1,13 @@
<% <%
request.headers['REQUEST_URI'] = "" if request.headers['REQUEST_URI'].nil? request.headers['REQUEST_URI'] = "" if request.headers['REQUEST_URI'].nil?
realUrl = request.original_url realUrl = request.original_url
if (realUrl.match(/users/)) if (realUrl.match(/forge\.trustie\.net\/*/))
@nav_dispaly_home_path_label = 1
@nav_dispaly_main_course_label = 1
@nav_dispaly_main_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\.trustie\.net\/*/))
@nav_dispaly_project_label = 1 @nav_dispaly_project_label = 1
@nav_dispaly_forum_label = 1 @nav_dispaly_forum_label = 1
elsif (realUrl.match(/course\.trustie\.net\/*/)) elsif (realUrl.match(/course\.trustie\.net\/*/))
@nav_dispaly_course_all_label = 1 @nav_dispaly_course_all_label = 1
@nav_dispaly_forum_label = 1 @nav_dispaly_forum_label = 1
@nav_dispaly_course_label = nil
@nav_dispaly_store_all_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_home_path_label = 1