evils fix
This commit is contained in:
parent
b063364b60
commit
2a72f7aac8
|
@ -9,3 +9,19 @@ app\models\setting.rb :165
|
|||
为了开发方便,使之功能在development模式下失效。
|
||||
# => 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
|
||||
================================================================================
|
|
@ -126,7 +126,7 @@ class WelcomeController < ApplicationController
|
|||
end
|
||||
|
||||
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")
|
||||
return 0
|
||||
end
|
||||
|
|
|
@ -1,23 +1,13 @@
|
|||
<%
|
||||
request.headers['REQUEST_URI'] = "" if request.headers['REQUEST_URI'].nil?
|
||||
realUrl = request.original_url
|
||||
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(/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\/*/))
|
||||
if (realUrl.match(/forge\.trustie\.net\/*/))
|
||||
@nav_dispaly_project_label = 1
|
||||
@nav_dispaly_forum_label = 1
|
||||
elsif (realUrl.match(/course\.trustie\.net\/*/))
|
||||
@nav_dispaly_course_all_label = 1
|
||||
@nav_dispaly_forum_label = 1
|
||||
@nav_dispaly_course_label = nil
|
||||
@nav_dispaly_store_all_label = 1
|
||||
elsif (realUrl.match(/user\.trustie\.net\/*/))
|
||||
@nav_dispaly_home_path_label = 1
|
||||
|
|
Loading…
Reference in New Issue