From e4cbc7533ef3f70075ef80a0cfc0a6b71d183260 Mon Sep 17 00:00:00 2001 From: huangjingquan Date: Sat, 14 Sep 2013 09:51:26 +0800 Subject: [PATCH] =?UTF-8?q?tabs=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/projects_controller.rb | 11 ++++------- app/helpers/application_helper.rb | 13 ++++++++++++- app/views/bids/show_project.html.erb | 3 +++ app/views/layouts/base_courses.html.erb | 12 ++++++------ app/views/layouts/base_homework.html.erb | 11 +++++------ lib/redmine/menu_manager.rb | 1 + 6 files changed, 31 insertions(+), 20 deletions(-) diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 976b0f816..898ed5da2 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -24,13 +24,10 @@ class ProjectsController < ApplicationController menu_item l(:label_sort_by_time), :only => :index menu_item l(:label_sort_by_active), :only => :index menu_item l(:label_sort_by_influence), :only => :index - # else - # layout 'base_courses' - # menu_item :overview - # menu_item l(:label_homework), :only => :homework - # menu_item l(:label_course_file), :only => :index - # menu_item l(:label_course_news), :only => :index - # menu_item l(:label_settings), :only => :settings + + menu_item l(:label_homework), :only => :homework + menu_item l(:label_course_file), :only => :index + menu_item l(:label_course_news), :only => :index # end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 5204788cf..b8a3fd791 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -31,7 +31,18 @@ module ApplicationHelper extend Forwardable def_delegators :wiki_helper, :wikitoolbar_for, :heads_for_wiki_formatter - + + #Added by young + #Define the course menu's link class + def link_class(label) + if current_menu_item == label + @class = 'selected' + else + @class = '' + end + return @class + end + #Ended by young # Return true if user is authorized for controller/action, otherwise false def authorize_for(controller, action) User.current.allowed_to?({:controller => controller, :action => action}, @project) diff --git a/app/views/bids/show_project.html.erb b/app/views/bids/show_project.html.erb index 3b7af6c97..dc842d9ab 100644 --- a/app/views/bids/show_project.html.erb +++ b/app/views/bids/show_project.html.erb @@ -1,6 +1,8 @@ + <% if @bid.homework_type == 1%> <%= render :partial => 'homework' %> + <% else %>