add contest and fix url

This commit is contained in:
xianbo 2014-03-31 10:56:29 +08:00
parent 2bba27e7a1
commit 5c63ea2378
7 changed files with 104 additions and 45 deletions

View File

@ -17,7 +17,7 @@
class WelcomeController < ApplicationController
caches_action :robots
before_filter :entry_select, :only => [:index]
before_filter :entry_select, :entry_select_contest, :only => [:index]
def index
# @news = News.latest User.current
@ -80,6 +80,10 @@ class WelcomeController < ApplicationController
@student = User.student
end
def contest
end
def search
search_condition = params[:q]
search_type = params[:search_type].to_sym unless search_condition.blank?
@ -113,4 +117,11 @@ class WelcomeController < ApplicationController
(course() and render :course and return 0) if request.original_url.match(/course\.trustie\.net/)
end
def entry_select_contest
if request.original_url.match(/contest\.trustie\.net/)
course
render :contest, layout: false
return 0
end
end
end

View File

@ -1499,12 +1499,15 @@ module ApplicationHelper
def render_dynamic_nav
home_link = link_to l(:field_homepage), {:controller => 'welcome', :action => 'index'}
main_course_link = link_to l(:label_course_practice), {:controller => 'welcome', :action => 'index', :host => Setting.course_domain}
main_project_link = link_to l(:label_project_deposit), {:controller => 'welcome', :action => 'index', :host => Setting.project_domain}
course_all_course_link = link_to l(:label_course_all), {:controller => 'projects', :action => 'course', :project_type => 1, :host => Setting.course_domain}
course_teacher_all_link = link_to l(:label_teacher_all), {:controller => 'users', :action => 'index', :role => 'teacher', :host => Setting.course_domain}
courses_link = link_to l(:label_course_practice), {:controller => 'projects', :action => 'course', :project_type => 1, :host => Setting.course_domain}
projects_link = link_to l(:label_project_deposit), {:controller => 'projects', :action => 'index', :project_type => 0, :host => Setting.project_domain}
users_link = link_to l(:label_software_user), {:controller => 'users', :action => 'index', :host => Setting.user_domain}
contest_link = link_to l(:label_contest_innovate), {:controller => 'bids', :action => 'contest', :project_type => 1 , :host => Setting.project_domain}
contest_link = link_to l(:label_contest_innovate), {:controller => 'bids', :action => 'contest', :project_type => 1 , :host => Setting.contest_domain}
bids_link = link_to l(:label_requirement_enterprise), {:controller => 'bids', :action => 'index'}
forum_link = link_to l(:label_project_module_forums), {:controller => "forums", :action => "index"}
stores_link = link_to l(:label_stores_index), {:controller => 'stores', :action=> 'index'}
@ -1515,13 +1518,16 @@ module ApplicationHelper
nav_list.push(course_all_course_link) if @nav_dispaly_course_all_label
nav_list.push(course_teacher_all_link) if @nav_dispaly_teacher_all_label
nav_list.push(main_project_link) if @nav_dispaly_main_project_label
nav_list.push(main_course_link) if @nav_dispaly_main_course_label
nav_list.push(courses_link) if @nav_dispaly_course_label
nav_list.push(projects_link) if @nav_dispaly_project_label
nav_list.push(users_link) if @nav_dispaly_user_label
nav_list.push(contest_link) if @nav_dispaly_contest_label
nav_list.push(bids_link) if @nav_dispaly_bid_label
nav_list.push(forum_link) if @nav_dispaly_forum_label
nav_list.push(stores_link) if !@nav_dispaly_course_all_label
nav_list.push(stores_link) if @nav_dispaly_store_all_label
content_li = ''
nav_list.collect do |nav_item|

View File

@ -5,8 +5,8 @@
@nav_dispaly_course_label = 1
elsif (realUrl.match(/users/))
@nav_dispaly_home_path_label = 1
@nav_dispaly_course_all_label = 1
@nav_dispaly_project_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/))
@ -21,8 +21,8 @@
@nav_dispaly_contest_label = 1
elsif (realUrl.match(/course\.trustie\.net/))
@nav_dispaly_course_all_label = 1
# @nav_dispaly_teacher_all_label = 1
@nav_dispaly_forum_label = 1
@nav_dispaly_store_all_label = 1
elsif (realUrl.match(/user\.trustie\.net/))
@nav_dispaly_home_path_label = 1
@nav_dispaly_course_all_label = 1

View File

@ -0,0 +1,9 @@
<div class='top_bar'>
<div class="main-content-bar" style="text-align: center; color: green; font-size: 30px; margin-top: 250px">
正在升级中。。。。。。。。。。。。
</div>
</div>
<div style="padding-top: 40px"></div>

View File

@ -17,6 +17,7 @@
RedmineApp::Application.routes.draw do
match 'course', :to => 'welcome#course', :via => :get
match 'contest', :to => 'welcome#contest', :via => :get
resources :stores do
collection do
match 'search', via: [:get, :post]

View File

@ -13,6 +13,14 @@
ActiveRecord::Schema.define(:version => 20140319092720) do
create_table "a_user_watchers", :force => true do |t|
t.string "name"
t.text "description"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.integer "member_id"
end
create_table "activities", :force => true do |t|
t.integer "act_id", :null => false
t.string "act_type", :null => false
@ -296,7 +304,7 @@ ActiveRecord::Schema.define(:version => 20140319092720) do
create_table "issue_relations", :force => true do |t|
t.integer "issue_from_id", :null => false
t.integer "issue_to_id", :null => false
t.string "relation_type", :default => "", :null => false
t.string "relation_type", :null => false
t.integer "delay"
end
@ -464,6 +472,22 @@ ActiveRecord::Schema.define(:version => 20140319092720) do
add_index "messages", ["last_reply_id"], :name => "index_messages_on_last_reply_id"
add_index "messages", ["parent_id"], :name => "messages_parent_id"
create_table "messages_for_bids", :force => true do |t|
t.string "message"
t.integer "user_id"
t.integer "bid_id"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
create_table "messages_for_users", :force => true do |t|
t.integer "messager_id"
t.integer "user_id"
t.string "message"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
create_table "news", :force => true do |t|
t.integer "project_id"
t.string "title", :limit => 60, :default => "", :null => false
@ -523,11 +547,23 @@ ActiveRecord::Schema.define(:version => 20140319092720) do
t.integer "watchers_count"
t.integer "project_id"
t.integer "project_type"
t.integer "gitlab_group_id", :limit => 8
t.float "grade", :default => 0.0
t.integer "course_ac_para", :default => 0
end
add_index "project_statuses", ["changesets_count"], :name => "index_project_statuses_on_changesets_count"
add_index "project_statuses", ["grade"], :name => "index_project_statuses_on_grade"
add_index "project_statuses", ["watchers_count"], :name => "index_project_statuses_on_watchers_count"
create_table "project_tags", :force => true do |t|
t.integer "project_id"
t.integer "tag_id"
t.string "description"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.integer "user_id"
end
create_table "projects", :force => true do |t|
t.string "name", :default => "", :null => false
@ -584,6 +620,7 @@ ActiveRecord::Schema.define(:version => 20140319092720) do
t.text "extra_info"
t.string "identifier"
t.boolean "is_default", :default => false
t.string "git_project_id"
end
add_index "repositories", ["project_id"], :name => "index_repositories_on_project_id"
@ -602,26 +639,6 @@ ActiveRecord::Schema.define(:version => 20140319092720) do
t.string "province"
end
create_table "seems_rateable_cached_ratings", :force => true do |t|
t.integer "cacheable_id", :limit => 8
t.string "cacheable_type"
t.float "avg", :null => false
t.integer "cnt", :null => false
t.string "dimension"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
create_table "seems_rateable_rates", :force => true do |t|
t.integer "rater_id", :limit => 8
t.integer "rateable_id"
t.string "rateable_type"
t.float "stars", :null => false
t.string "dimension"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
create_table "settings", :force => true do |t|
t.string "name", :default => "", :null => false
t.text "value"
@ -632,9 +649,9 @@ ActiveRecord::Schema.define(:version => 20140319092720) do
create_table "shares", :force => true do |t|
t.date "created_on"
t.string "url"
t.string "title"
t.integer "share_type"
t.string "share_type"
t.string "url"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.integer "project_id"
@ -642,6 +659,12 @@ ActiveRecord::Schema.define(:version => 20140319092720) do
t.string "description"
end
create_table "students", :force => true do |t|
t.string "name"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
create_table "students_for_courses", :force => true do |t|
t.integer "student_id"
t.integer "course_id"
@ -700,7 +723,7 @@ ActiveRecord::Schema.define(:version => 20140319092720) do
create_table "tokens", :force => true do |t|
t.integer "user_id", :default => 0, :null => false
t.string "action", :limit => 30, :default => "", :null => false
t.string "value", :limit => 40, :default => "", :null => false
t.string "value", :limit => 40
t.datetime "created_on", :null => false
end
@ -726,12 +749,13 @@ ActiveRecord::Schema.define(:version => 20140319092720) do
t.integer "zip_code"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.string "technical_title"
t.integer "identity"
t.string "technical_title"
t.string "student_id"
t.string "teacher_realname"
t.string "student_realname"
t.string "location_city"
t.string "git_token"
end
create_table "user_grades", :force => true do |t|
@ -768,6 +792,14 @@ ActiveRecord::Schema.define(:version => 20140319092720) do
add_index "user_statuses", ["grade"], :name => "index_user_statuses_on_grade"
add_index "user_statuses", ["watchers_count"], :name => "index_user_statuses_on_watchers_count"
create_table "user_tags", :force => true do |t|
t.integer "user_id"
t.integer "tag_id"
t.string "description"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
create_table "users", :force => true do |t|
t.string "login", :default => "", :null => false
t.string "hashed_password", :limit => 40, :default => "", :null => false

View File

@ -264,7 +264,7 @@ end
# end
Redmine::MenuManager.map :account_menu do |menu|
menu.push :login, {:controller => 'account', :action => 'login', :host => Setting.project_domain}, :if => Proc.new { !User.current.logged? }
menu.push :login, {:controller => 'account', :action => 'login', :host => Setting.user_domain}, :if => Proc.new { !User.current.logged? }
menu.push :register, {:controller => 'account', :action => 'register'}, :if => Proc.new { !User.current.logged? && Setting.self_registration? }
# menu.push :my_account, { :controller => 'my', :action => 'account' }, :if => Proc.new { User.current.logged? }
menu.push :logout, {:controller => 'account', :action => 'logout'}, :html => {:method => 'post'}, :if => Proc.new { User.current.logged? }