diff --git a/app/controllers/welcome_controller.rb b/app/controllers/welcome_controller.rb index a0e79f0f6..387595e0b 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, :only => [:index] + before_filter :entry_select, :entry_select_contest, :only => [:index] def index # @news = News.latest User.current @@ -79,6 +79,10 @@ class WelcomeController < ApplicationController @teacher = User.teacher @student = User.student end + + def contest + + end def search search_condition = params[:q] @@ -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 diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index cc096e76e..fdb77098c 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1490,29 +1490,35 @@ module ApplicationHelper def render_dynamic_nav home_link = link_to l(:field_homepage), {:controller => 'welcome', :action => 'index'} - course_all_course_link = link_to l(:label_course_all), {:controller => 'projects', :action => 'course', :project_type => 1, :subdomain => Setting.course_domain} - course_teacher_all_link = link_to l(:label_teacher_all), {:controller => 'users', :action => 'index', :role => 'teacher', :subdomain => Setting.course_domain} - courses_link = link_to l(:label_course_practice), {:controller => 'projects', :action => 'course', :project_type => 1, :subdomain => Setting.course_domain} - projects_link = link_to l(:label_project_deposit), {:controller => 'projects', :action => 'index', :project_type => 0, :subdomain => Setting.project_domain} - users_link = link_to l(:label_software_user), {:controller => 'users', :action => 'index', :subdomain => Setting.user_domain} - contest_link = link_to l(:label_contest_innovate), {:controller => 'bids', :action => 'contest', :project_type => 1 , :subdomain => Setting.project_domain} + 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.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', :subdomain => Setting.course_domain} + stores_link = link_to l(:label_stores_index), {:controller => 'stores', :action=> 'index'} #@nav_dispaly_project_label nav_list = Array.new nav_list.push(home_link) if !@nav_dispaly_home_path_label 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| diff --git a/app/views/layouts/_base_header.html.erb b/app/views/layouts/_base_header.html.erb index c18d48fcb..9cec45acc 100644 --- a/app/views/layouts/_base_header.html.erb +++ b/app/views/layouts/_base_header.html.erb @@ -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|issues]/)) @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 @@ -42,7 +42,7 @@ %>