diff --git a/app/controllers/bids_controller.rb b/app/controllers/bids_controller.rb index b7951fbe6..f4ff47fba 100644 --- a/app/controllers/bids_controller.rb +++ b/app/controllers/bids_controller.rb @@ -15,10 +15,16 @@ class BidsController < ApplicationController helper :projects def index + @project_type = params[:project_type] # Modified by nie # @requirement_title = "4" @offset, @limit = api_offset_and_limit({:limit => 10}) - @bids = Bid.visible + if @project_type == '1' + @bids = Bid.visible.where('reward_type = ?', 3) + else + @bids = Bid.visible.where('reward_type = ? or reward_type = ?', 1, 2) + end + @bids = @bids.like(params[:name]) if params[:name].present? @bid_count = @bids.count @bid_pages = Paginator.new @bid_count, @limit, params['page'] diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index 137079233..08e35566e 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -6,7 +6,7 @@ class CoursesController < ApplicationController def join if User.current.logged? course = Project.find(params[:object_id]) - if params[:course_password].to_i == Course.find_by_extra(course.identifier).state + if params[:course_password] == Course.find_by_extra(course.identifier).password members = [] members << Member.new(:role_ids => [5], :user_id => User.current.id) course.members << members diff --git a/app/controllers/files_controller.rb b/app/controllers/files_controller.rb index 1048c12bd..1e1934ecf 100644 --- a/app/controllers/files_controller.rb +++ b/app/controllers/files_controller.rb @@ -45,7 +45,7 @@ class FilesController < ApplicationController def new @versions = @project.versions.sort @course_tag = @project.project_type - if @course_tag + if @project.project_type == 1 render :layout => 'base_courses' end end diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index e9e35cbd1..f94c5e7d0 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -41,8 +41,9 @@ class ProjectsController < ApplicationController # menu_item l(:label_course_file), :only => files # menu_item l(:label_settings), :only => settings - before_filter :find_project, :except => [ :index, :search,:list, :new, :create, :copy, :statistics, :new_join] - before_filter :authorize, :except => [:new_join, :new_homework, :homework, :statistics, :search, :watcherlist, :index, :list, :new, :create, :copy, :archive, :unarchive, :destroy, :member, :focus, :file, :statistics, :feedback] + before_filter :find_project, :except => [ :index, :search,:list, :new, :create, :copy, :statistics, :new_join, :course] + before_filter :authorize, :except => [:new_join, :new_homework, :homework, :statistics, :search, :watcherlist, :index, :list, :new, :create, :copy, :archive, :unarchive, :destroy, :member, :focus, :file, + :statistics, :feedback, :course] before_filter :authorize_global, :only => [:new, :create] before_filter :require_admin, :only => [ :copy, :archive, :unarchive, :destroy, :calendar] #by young @@ -110,8 +111,17 @@ class ProjectsController < ApplicationController # @offset ||= @project_pages.offset # @projects = Project.visible.offset(@offset).limit(@limit).order('lft').all @project_type = params[:project_type] + @project_type = params[:project_type] + @offset, @limit = api_offset_and_limit({:limit => 10}) - @projects_status = ProjectStatus.visible + @projects_status = ProjectStatus.visible.where("project_type <> ? or project_type is null", 1) + # @projects_status = ProjectStatus.visible + # @projects_status.each do |project| + # if Project.visible.find_by_id("#{project.project_id}") + # project.project_type = Project.visible.find_by_id("#{project.project_id}").project_type + # project.save + # end + # end # @projects.each do |project| # @admin = project.users_by_role[Role.find(3)] # unless @admin.nil? @@ -192,7 +202,122 @@ class ProjectsController < ApplicationController @projects = [] @projects_status.each do |obj| - @projects << Project.visible.find_by_id("#{obj.project_id}") unless Project.visible.find_by_id("#{obj.project_id}").nil? + @projects << Project.visible.find_by_id("#{obj.project_id}") unless Project.visible.find_by_id("#{obj.project_id}").nil? + end + #end + respond_to do |format| + format.html { + render :layout => 'base' + scope = Project + unless params[:closed] + scope = scope.active + end + } + format.api { + # @offset, @limit = api_offset_and_limit + # @project_count = Project.visible.count + # @projects = Project.visible.offset(@offset).limit(@limit).order('lft').all + } + format.atom { + projects = Project.visible.order('created_on DESC').limit(Setting.feeds_limit.to_i).all + render_feed(projects, :title => "#{Setting.app_title}: #{l(:label_project_latest)}") + } + end + end + + def course + #Modified by nie + # @offset, @limit = api_offset_and_limit({:limit => 10}) + # @project_count = Project.visible.count + # @project_pages = Paginator.new @project_count, @limit, params['page'] + # @offset ||= @project_pages.offset + # @projects = Project.visible.offset(@offset).limit(@limit).order('lft').all + + @project_type = params[:project_type] + + @offset, @limit = api_offset_and_limit({:limit => 10}) + @projects_status = ProjectStatus.visible.where("project_type = ?", 1) + # @projects.each do |project| + # @admin = project.users_by_role[Role.find(3)] + # unless @admin.nil? + # @admin.each do |user| + # ProjectInfo.create(:user_id => user.id, :project_id => project.id) + # end + # + # end + # end + # @projects.each do |project| + # ProjectStatus.create(:changesets_count => project.changesets.count, :project_id => project.id, :watchers_count => project.watcher_users.count) + # end + #@projects_status = Project.visible.like(params[:name]) if params[:name].present? + @project_count = @projects_status.count + @project_pages = Paginator.new @project_count, @limit, params['page'] + + @offset ||= @project_pages.reverse_offset + + #@projects = @projects.offset(@offset).limit(@limit).order('created_on DESC').all + if params[:project_sort_type].present? + case params[:project_sort_type] + when '0' + @offset ||= @project_pages.reverse_offset + unless @offset == 0 + @projects_status = @projects_status.offset(@offset).limit(@limit).all.reverse + else + limit = @project_count % @limit + if limit == 0 + limit = @limit + end + @projects_status = @projects_status.offset(@offset).limit(limit).all.reverse + end + @s_type = 0 + # @projects = @projects.sort {|x,y| y.created_on <=> x.created_on } + # @projects = @projects[@offset, @limit] + when '1' + @offset ||= @project_pages.reverse_offset + unless @offset == 0 + @projects_status = @projects_status.reorder('changesets_count').offset(@offset).limit(@limit).all.reverse + else + limit = @project_count % @limit + if limit == 0 + limit = @limit + end + @projects_status = @projects_status.reorder('changesets_count').offset(@offset).limit(limit).all.reverse + end + @s_type = 1 + + #@projects = @projects[@offset, @limit] + when '2' + @offset ||= @project_pages.reverse_offset + unless @offset == 0 + @projects_status = @projects_status.reorder('watchers_count').offset(@offset).limit(@limit).all.reverse + else + limit = @project_count % @limit + if limit == 0 + limit = @limit + end + @projects_status = @projects_status.reorder('watchers_count').offset(@offset).limit(limit).all.reverse + end + @s_type = 2 + end + else + @offset ||= @project_pages.reverse_offset + unless @offset == 0 + @projects_status = @projects_status.reorder('changesets_count').offset(@offset).limit(@limit).all.reverse + else + limit = @project_count % @limit + if limit == 0 + limit = @limit + end + @projects_status = @projects_status.reorder('changesets_count').offset(@offset).limit(limit).all.reverse + end + @s_type = 1 + # @projects = @projects.sort {|x,y| y.created_on <=> x.created_on } + # @projects = @projects[@offset, @limit] + end + + @projects = [] + @projects_status.each do |obj| + @projects << Project.visible.find_by_id("#{obj.project_id}") unless Project.visible.find_by_id("#{obj.project_id}").nil? end #end respond_to do |format| @@ -328,6 +453,7 @@ class ProjectsController < ApplicationController end def new + @project_type = params[:project_type] @course_tag = params[:course] @issue_custom_fields = IssueCustomField.sorted.all @trackers = Tracker.sorted.all @@ -340,7 +466,8 @@ class ProjectsController < ApplicationController render :layout => 'base' end - def create + def create + @course_tag = params[:project][:project_type] if(@course_tag=="1") @course = Course.new @@ -385,7 +512,7 @@ class ProjectsController < ApplicationController redirect_to new_project_path(:course => '1') #Ended by young else - redirect_to settings_project_path(@project) + redirect_to settings_project_path(@project,:project_type => 1) end } format.api { render :action => 'show', :status => :created, :location => url_for(:controller => 'projects', :action => 'show', :id => @project.id) } @@ -482,6 +609,9 @@ class ProjectsController < ApplicationController # Show @project def show + + @project_type = params[:project_type] + # try to redirect to the requested menu item if params[:jump] && redirect_to_project_menu_item(@project, params[:jump]) return @@ -491,7 +621,7 @@ class ProjectsController < ApplicationController @subprojects = @project.children.visible.all @news = @project.news.limit(5).includes(:author, :project).reorder("#{News.table_name}.created_on DESC").all @trackers = @project.rolled_up_trackers - @user = User.find_by_id(ProjectInfo.find_by_project_id(@project.id).user_id) + @user = User.find_by_id(ProjectInfo.find_by_project_id(@project.id).user_id) cond = @project.project_condition(Setting.display_subprojects_issues?) @open_issues_by_tracker = Issue.visible.open.where(cond).count(:group => :tracker) @@ -614,9 +744,11 @@ class ProjectsController < ApplicationController @project.safe_attributes = params[:project] if validate_parent_id && @project.save @course = Course.find_by_extra(@project.identifier) - @course.state = params[:project][:course][:state] + unless @course.nil? + @course.password = params[:project][:course][:password] @course.term = params[:project][:course][:term] - @course.save + @course.save + end @project.set_allowed_parent!(params[:project]['parent_id']) if params[:project].has_key?('parent_id') if params[:project][:is_public] == '0' diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 825c79060..6857e8a11 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -203,6 +203,9 @@ class UsersController < ApplicationController #end def index + + @project_type = params[:project_type] + sort_init 'login', 'asc' sort_update %w(login firstname lastname mail admin created_on last_login_on) diff --git a/app/controllers/welcome_controller.rb b/app/controllers/welcome_controller.rb index c06d4d65f..c00f223c9 100644 --- a/app/controllers/welcome_controller.rb +++ b/app/controllers/welcome_controller.rb @@ -72,4 +72,6 @@ class WelcomeController < ApplicationController @projects = Project.all_public.active render :layout => false, :content_type => 'text/plain' end + + end diff --git a/app/helpers/bids_helper.rb b/app/helpers/bids_helper.rb index ddab8da7e..ed8c8873f 100644 --- a/app/helpers/bids_helper.rb +++ b/app/helpers/bids_helper.rb @@ -39,16 +39,33 @@ module BidsHelper Bid.tagged_with(tag_name).order('updated_on desc') end - def sort_bid(state) + #added by huang + def sort_bid_enterprise(state, project_type) content = ''.html_safe case state when 0 - content << content_tag('li', link_to(l(:label_sort_by_active), calls_path(:bid_sort_type => '1'))) - content << content_tag('li', link_to(l(:label_sort_by_time), calls_path(:bid_sort_type => '0'), :class=>"selected"), :class=>"selected") + content << content_tag('li', link_to(l(:label_sort_by_active), calls_path(:bid_sort_type => '1', :project_type => project_type))) + content << content_tag('li', link_to(l(:label_sort_by_time), calls_path(:bid_sort_type => '0', :project_type => project_type), :class=>"selected"), :class=>"selected") when 1 - content << content_tag('li', link_to(l(:label_sort_by_active), calls_path(:bid_sort_type => '1'), :class=>"selected"), :class=>"selected") - content << content_tag('li', link_to(l(:label_sort_by_time), calls_path(:bid_sort_type => '0'))) + content << content_tag('li', link_to(l(:label_sort_by_active), calls_path(:bid_sort_type => '1', :project_type => project_type), :class=>"selected"), :class=>"selected") + content << content_tag('li', link_to(l(:label_sort_by_time), calls_path(:bid_sort_type => '0', :project_type => project_type))) + end + content = content_tag('ul', content) + content_tag('div', content, :class => "tabs_enterprise") + end + #end + + def sort_bid(state, project_type) + content = ''.html_safe + case state + when 0 + content << content_tag('li', link_to(l(:label_sort_by_active), calls_path(:bid_sort_type => '1', :project_type => project_type))) + content << content_tag('li', link_to(l(:label_sort_by_time), calls_path(:bid_sort_type => '0', :project_type => project_type), :class=>"selected"), :class=>"selected") + + when 1 + content << content_tag('li', link_to(l(:label_sort_by_active), calls_path(:bid_sort_type => '1', :project_type => project_type), :class=>"selected"), :class=>"selected") + content << content_tag('li', link_to(l(:label_sort_by_time), calls_path(:bid_sort_type => '0', :project_type => project_type))) end content = content_tag('ul', content) content_tag('div', content, :class => "tabs") diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb index 661d5c627..b38d3497a 100644 --- a/app/helpers/projects_helper.rb +++ b/app/helpers/projects_helper.rb @@ -38,23 +38,91 @@ module ProjectsHelper end - def sort_project(state) + # added bu huang + def sort_project_enterprise(state, project_type) content = ''.html_safe case state when 0 - content << content_tag('li', link_to(l(:label_sort_by_active), projects_path(:project_sort_type => '1'))) - content << content_tag('li', link_to(l(:label_sort_by_influence), projects_path(:project_sort_type => '2'))) - content << content_tag('li', link_to(l(:label_sort_by_time), projects_path(:project_sort_type => '0'), :class=>"selected"), :class=>"selected") + content << content_tag('li', link_to(l(:label_sort_by_active), projects_path(:project_sort_type => '1', :project_type => project_type))) + content << content_tag('li', link_to(l(:label_sort_by_influence), projects_path(:project_sort_type => '2', :project_type => project_type))) + content << content_tag('li', link_to(l(:label_sort_by_time), projects_path(:project_sort_type => '0', :project_type => project_type), :class=>"selected"), :class=>"selected") when 1 - content << content_tag('li', link_to(l(:label_sort_by_active), projects_path(:project_sort_type => '1'), :class=>"selected"), :class=>"selected") - content << content_tag('li', link_to(l(:label_sort_by_influence), projects_path(:project_sort_type => '2'))) - content << content_tag('li', link_to(l(:label_sort_by_time), projects_path(:project_sort_type => '0'))) + content << content_tag('li', link_to(l(:label_sort_by_active), projects_path(:project_sort_type => '1', :project_type => project_type), :class=>"selected"), :class=>"selected") + content << content_tag('li', link_to(l(:label_sort_by_influence), projects_path(:project_sort_type => '2', :project_type => project_type))) + content << content_tag('li', link_to(l(:label_sort_by_time), projects_path(:project_sort_type => '0', :project_type => project_type))) when 2 - content << content_tag('li', link_to(l(:label_sort_by_active), projects_path(:project_sort_type => '1'))) - content << content_tag('li', link_to(l(:label_sort_by_influence), projects_path(:project_sort_type => '2'), :class=>"selected"), :class=>"selected") - content << content_tag('li', link_to(l(:label_sort_by_time), projects_path(:project_sort_type => '0'))) + content << content_tag('li', link_to(l(:label_sort_by_active), projects_path(:project_sort_type => '1', :project_type => project_type))) + content << content_tag('li', link_to(l(:label_sort_by_influence), projects_path(:project_sort_type => '2', :project_type => project_type), :class=>"selected"), :class=>"selected") + content << content_tag('li', link_to(l(:label_sort_by_time), projects_path(:project_sort_type => '0', :project_type => project_type))) + end + content = content_tag('ul', content) + content_tag('div', content, :class => "tabs_enterprise") + end + + def sort_course(state, project_type) + content = ''.html_safe + case state + when 0 + + content << content_tag('li', link_to(l(:label_sort_by_active), course_path(:project_sort_type => '1', :project_type => project_type))) + content << content_tag('li', link_to(l(:label_sort_by_influence), course_path(:project_sort_type => '2', :project_type => project_type))) + content << content_tag('li', link_to(l(:label_sort_by_time), course_path(:project_sort_type => '0', :project_type => project_type), :class=>"selected"), :class=>"selected") + when 1 + + content << content_tag('li', link_to(l(:label_sort_by_active), course_path(:project_sort_type => '1', :project_type => project_type), :class=>"selected"), :class=>"selected") + content << content_tag('li', link_to(l(:label_sort_by_influence), course_path(:project_sort_type => '2', :project_type => project_type))) + content << content_tag('li', link_to(l(:label_sort_by_time), course_path(:project_sort_type => '0', :project_type => project_type))) + when 2 + content << content_tag('li', link_to(l(:label_sort_by_active), course_path(:project_sort_type => '1', :project_type => project_type))) + content << content_tag('li', link_to(l(:label_sort_by_influence), course_path(:project_sort_type => '2', :project_type => project_type), :class=>"selected"), :class=>"selected") + content << content_tag('li', link_to(l(:label_sort_by_time), course_path(:project_sort_type => '0', :project_type => project_type))) + end + content = content_tag('ul', content) + content_tag('div', content, :class => "tabs_enterprise") + end + # end + + def sort_project(state, project_type) + content = ''.html_safe + case state + when 0 + + content << content_tag('li', link_to(l(:label_sort_by_active), projects_path(:project_sort_type => '1', :project_type => project_type))) + content << content_tag('li', link_to(l(:label_sort_by_influence), projects_path(:project_sort_type => '2', :project_type => project_type))) + content << content_tag('li', link_to(l(:label_sort_by_time), projects_path(:project_sort_type => '0', :project_type => project_type), :class=>"selected"), :class=>"selected") + when 1 + + content << content_tag('li', link_to(l(:label_sort_by_active), projects_path(:project_sort_type => '1', :project_type => project_type), :class=>"selected"), :class=>"selected") + content << content_tag('li', link_to(l(:label_sort_by_influence), projects_path(:project_sort_type => '2', :project_type => project_type))) + content << content_tag('li', link_to(l(:label_sort_by_time), projects_path(:project_sort_type => '0', :project_type => project_type))) + when 2 + content << content_tag('li', link_to(l(:label_sort_by_active), projects_path(:project_sort_type => '1', :project_type => project_type))) + content << content_tag('li', link_to(l(:label_sort_by_influence), projects_path(:project_sort_type => '2', :project_type => project_type), :class=>"selected"), :class=>"selected") + content << content_tag('li', link_to(l(:label_sort_by_time), projects_path(:project_sort_type => '0', :project_type => project_type))) + end + content = content_tag('ul', content) + content_tag('div', content, :class => "tabs") + end + + def sort_course(state, project_type) + content = ''.html_safe + case state + when 0 + + content << content_tag('li', link_to(l(:label_sort_by_active), course_path(:project_sort_type => '1', :project_type => project_type))) + content << content_tag('li', link_to(l(:label_sort_by_influence), course_path(:project_sort_type => '2', :project_type => project_type))) + content << content_tag('li', link_to(l(:label_sort_by_time), course_path(:project_sort_type => '0', :project_type => project_type), :class=>"selected"), :class=>"selected") + when 1 + + content << content_tag('li', link_to(l(:label_sort_by_active), course_path(:project_sort_type => '1', :project_type => project_type), :class=>"selected"), :class=>"selected") + content << content_tag('li', link_to(l(:label_sort_by_influence), course_path(:project_sort_type => '2', :project_type => project_type))) + content << content_tag('li', link_to(l(:label_sort_by_time), course_path(:project_sort_type => '0', :project_type => project_type))) + when 2 + content << content_tag('li', link_to(l(:label_sort_by_active), course_path(:project_sort_type => '1', :project_type => project_type))) + content << content_tag('li', link_to(l(:label_sort_by_influence), course_path(:project_sort_type => '2', :project_type => project_type), :class=>"selected"), :class=>"selected") + content << content_tag('li', link_to(l(:label_sort_by_time), course_path(:project_sort_type => '0', :project_type => project_type))) end content = content_tag('ul', content) content_tag('div', content, :class => "tabs") @@ -95,7 +163,7 @@ module ProjectsHelper render_project_nested_lists(projects) do |project| #Modified by young if (project.project_type==1) - s = link_to_project(project, {}, :class => "#{project.css_classes} #{User.current.member_of?(project) ? 'my-project' : nil}")+"(#{l(:label_course)})".html_safe + s = link_to_project(project, {}, :class => "#{project.css_classes} #{User.current.member_of?(project) ? 'my-project' : nil}").html_safe else s = link_to_project(project, {}, :class => "#{project.css_classes} #{User.current.member_of?(project) ? 'my-project' : nil}") end diff --git a/app/helpers/users_helper.rb b/app/helpers/users_helper.rb index 88e918256..ab163f804 100644 --- a/app/helpers/users_helper.rb +++ b/app/helpers/users_helper.rb @@ -113,24 +113,44 @@ module UsersHelper end # added by huang -def sort_user(state) +def sort_user(state, project_type) content = ''.html_safe case state when 0 - content << content_tag('li', link_to(l(:label_sort_by_active), users_path(:user_sort_type => '1'))) - content << content_tag('li', link_to(l(:label_sort_by_influence), users_path(:user_sort_type => '2'))) - content << content_tag('li', link_to(l(:label_sort_by_time), users_path(:user_sort_type => '0'), :class=>"selected"), :class=>"selected") + content << content_tag('li', link_to(l(:label_sort_by_active), users_path(:user_sort_type => '1', :project_type => project_type))) + content << content_tag('li', link_to(l(:label_sort_by_influence), users_path(:user_sort_type => '2', :project_type => project_type))) + content << content_tag('li', link_to(l(:label_sort_by_time), users_path(:user_sort_type => '0', :project_type => project_type), :class=>"selected"), :class=>"selected") when 1 - content << content_tag('li', link_to(l(:label_sort_by_active), users_path(:user_sort_type => '1'), :class=>"selected"), :class=>"selected") - content << content_tag('li', link_to(l(:label_sort_by_influence), users_path(:user_sort_type => '2'))) - content << content_tag('li', link_to(l(:label_sort_by_time), users_path(:user_sort_type => '0'))) + content << content_tag('li', link_to(l(:label_sort_by_active), users_path(:user_sort_type => '1', :project_type => project_type), :class=>"selected"), :class=>"selected") + content << content_tag('li', link_to(l(:label_sort_by_influence), users_path(:user_sort_type => '2', :project_type => project_type))) + content << content_tag('li', link_to(l(:label_sort_by_time), users_path(:user_sort_type => '0', :project_type => project_type))) when 2 - content << content_tag('li', link_to(l(:label_sort_by_active), users_path(:user_sort_type => '1'))) - content << content_tag('li', link_to(l(:label_sort_by_influence), users_path(:user_sort_type => '2'), :class=>"selected"), :class=>"selected") - content << content_tag('li', link_to(l(:label_sort_by_time), users_path(:user_sort_type => '0'))) + content << content_tag('li', link_to(l(:label_sort_by_active), users_path(:user_sort_type => '1', :project_type => project_type))) + content << content_tag('li', link_to(l(:label_sort_by_influence), users_path(:user_sort_type => '2', :project_type => project_type), :class=>"selected"), :class=>"selected") + content << content_tag('li', link_to(l(:label_sort_by_time), users_path(:user_sort_type => '0', :project_type => project_type))) end content = content_tag('ul', content) content_tag('div', content, :class => "tabs") end + + def sort_user_enterprise(state, project_type) + content = ''.html_safe + case state + when 0 + content << content_tag('li', link_to(l(:label_sort_by_active), users_path(:user_sort_type => '1', :project_type => project_type))) + content << content_tag('li', link_to(l(:label_sort_by_influence), users_path(:user_sort_type => '2', :project_type => project_type))) + content << content_tag('li', link_to(l(:label_sort_by_time), users_path(:user_sort_type => '0', :project_type => project_type), :class=>"selected"), :class=>"selected") + when 1 + content << content_tag('li', link_to(l(:label_sort_by_active), users_path(:user_sort_type => '1', :project_type => project_type), :class=>"selected"), :class=>"selected") + content << content_tag('li', link_to(l(:label_sort_by_influence), users_path(:user_sort_type => '2', :project_type => project_type))) + content << content_tag('li', link_to(l(:label_sort_by_time), users_path(:user_sort_type => '0', :project_type => project_type))) + when 2 + content << content_tag('li', link_to(l(:label_sort_by_active), users_path(:user_sort_type => '1', :project_type => project_type))) + content << content_tag('li', link_to(l(:label_sort_by_influence), users_path(:user_sort_type => '2', :project_type => project_type), :class=>"selected"), :class=>"selected") + content << content_tag('li', link_to(l(:label_sort_by_time), users_path(:user_sort_type => '0', :project_type => project_type))) + end + content = content_tag('ul', content) + content_tag('div', content, :class => "tabs_enterprise") + end #end end diff --git a/app/models/course.rb b/app/models/course.rb index a216798f0..155ad068f 100644 --- a/app/models/course.rb +++ b/app/models/course.rb @@ -14,7 +14,8 @@ class Course < ActiveRecord::Base 'location', 'tea_id', 'password', - 'term' + 'term', + 'password' end diff --git a/app/models/project_status.rb b/app/models/project_status.rb index 02eeb30c8..f6d91bfde 100644 --- a/app/models/project_status.rb +++ b/app/models/project_status.rb @@ -1,5 +1,5 @@ class ProjectStatus < ActiveRecord::Base - attr_accessible :changesets_count, :watchers_count, :project_id + attr_accessible :changesets_count, :watchers_count, :project_id, :project_type belongs_to :projects belongs_to :watchers belongs_to :changesets diff --git a/app/views/bids/_bid_show.html.erb b/app/views/bids/_bid_show.html.erb index d3f1cbb74..03640dc15 100644 --- a/app/views/bids/_bid_show.html.erb +++ b/app/views/bids/_bid_show.html.erb @@ -29,7 +29,7 @@ -
+
diff --git a/app/views/bids/_homework_list.html.erb b/app/views/bids/_homework_list.html.erb index 3e9713bdd..7ec7b7073 100644 --- a/app/views/bids/_homework_list.html.erb +++ b/app/views/bids/_homework_list.html.erb @@ -5,8 +5,12 @@ <% if homework.attachments.any?%>
<%= bid.description%>
- - + + <% if User.current.member_of?(@bid.courses.first) %> + + <% else %> + + <% end %>
<%= link_to image_tag(url_to_avatar(homework.user), :class => "avatar"), user_path(homework.user), :class => "avatar" %>
<%= link_to image_tag(url_to_avatar(homework.user), :class => "avatar"), user_path(homework.user), :class => "avatar" %><%= l(:label_bidding_user_studentcode) %><%= homework.user.user_extensions.student_id%><%= link_to image_tag(url_to_avatar(homework.user), :class => "avatar"), user_path(homework.user), :class => "avatar" %> diff --git a/app/views/bids/_list_projects.html.erb b/app/views/bids/_list_projects.html.erb index 6244cb4e6..8fb2abd00 100644 --- a/app/views/bids/_list_projects.html.erb +++ b/app/views/bids/_list_projects.html.erb @@ -78,7 +78,7 @@
diff --git a/app/views/bids/_project_list.html.erb b/app/views/bids/_project_list.html.erb index 18294d0c8..e6dda6cc3 100644 --- a/app/views/bids/_project_list.html.erb +++ b/app/views/bids/_project_list.html.erb @@ -4,12 +4,16 @@ <% if @bid.deadline > Date.today %>
<%= l(:label_bidding_user) %> - <%= link_to(b_project.user.name, user_path(b_project.user)) %> + <%= link_to(b_project.user.lastname+b_project.user.firstname, user_path(b_project.user)) %>
+ <%if @bid.reward_type == 3 %> + + <% else %> - + <% end %> <% if User.current.logged? %> <% if @bid.reward_type.nil? or @bid.reward_type == 1%> - + <% elsif @bid.reward_type == 2%> <% else %> @@ -67,10 +67,12 @@ <%= link_to l(:label_x_bids_responses, :count => @bid.commit)+"("+@bid.commit.to_s+")", respond_path(@bid)%> +
<%= l(:label_tag) %> -
+
+
<%= l(:label_homework_project) %>(<%= @bidding_project.count%>)<%= l(:label_bidding_project) %>(<%= @bidding_project.count%>)<%= l(:label_homework_project) %>(<%= @bidding_project.count%>) <% if User.current.logged? && (!Member.where('user_id = ? and project_id = ?', User.current.id, @bid.courses.first.id).first.nil? && (Member.where('user_id = ? and project_id = ?', User.current.id, @bid.courses.first.id).first.roles&Role.where('id = ? or id = ?', 5, 7)).size >0) %>
+ <%= toggle_link l(:button_bidding_homework), 'put-bid-form' %>
<% end %> @@ -44,7 +48,10 @@
- + + + + @@ -57,20 +64,22 @@
<%= l(:label_bidding_user_homework) %> : <%= link_to(b_project.user.name, user_path(b_project.user)) %><%= l(:label_bidding_user_studentcode) %> : <%= (b_project.user.user_extensions.student_id) %>
<%= l(:label_bidding_user_homework) %> : <%= link_to(b_project.user.lastname+b_project.user.firstname, user_path(b_project.user)) %>
<%= l(:label_bidding_reason_homewrok) %> : <%= b_project.description %>
<% end %> - <% else %> +<% else %> <% if User.current.logged? %> <% end %>
<%= l(:label_bidding_project) %>(<%= @bidding_project.count%>) - -
- <%= toggle_link l(:button_bidding_homework), 'put-bid-form' %> -
+ +
+ <%= toggle_link l(:label_bid_me), 'put-bid-form' %> +
+
<% end %> +<% unless @bid.reward_type == 3%> <%= render :partial=> "list_projects",:locals => {:bidding_project => @bidding_project,:bid => @bid }%> - +<% end %> diff --git a/app/views/bids/index.html.erb b/app/views/bids/index.html.erb index e41f0ec37..937b1b6dd 100644 --- a/app/views/bids/index.html.erb +++ b/app/views/bids/index.html.erb @@ -3,11 +3,20 @@
- + @@ -15,7 +24,11 @@
<%= l(:label_call_list)%> + <% if @project_type == '1' %> + 作业列表 + <% else %> + <%= l(:label_call_list)%> + <% end %> <% if User.current.logged? %> + <% if @project_type == '0' %> + <%= link_to(l(:label_new_call), {:controller => 'bids', :action => 'new_bid'}, :class => 'icon_enterprise icon_enterprise-add') %> + <% else %> <%= link_to(l(:label_new_call), {:controller => 'bids', :action => 'new_bid'}, :class => 'icon icon-add') %> + <% end %> <% end %>
@@ -26,8 +39,11 @@ <%= render :partial => 'new_bid' %>
<% end %> - -<%= sort_bid(@s_state)%> +<% if @project_type == '0'%> +<%= sort_bid_enterprise(@s_state, @project_type)%> +<% else %> +<%= sort_bid(@s_state, @project_type)%> +<% end %> +
+ +
+ <%= render_menu :account_menu -%> +
+ + <%= content_tag('div', "#{link_to(l(:label_layouts_feedback)+'(' + User.current.count_new_jour.to_s + ')', feedback_path(User.current))}".html_safe, :id => 'loggedas') if User.current.logged? %> + + <%= content_tag('div', "#{l(:label_logged_as)} #{link_to_user(User.current, :format => :username)}".html_safe, :id => 'loggedas') if User.current.logged? %> + <%= content_tag('div', "#{link_to(l(:label_enterprise_college), :controller =>'projects', :action => 'course', :project_type => 1 )}".html_safe, :id=> 'account-enterprise') %> + <%= render_menu :top_enterprise_menu if User.current.logged? || !Setting.login_required? -%> +
+ + + + + + + + + + + + + + diff --git a/app/views/layouts/_base_home_menu.html.erb b/app/views/layouts/_base_home_menu.html.erb new file mode 100644 index 000000000..ca3e5c847 --- /dev/null +++ b/app/views/layouts/_base_home_menu.html.erb @@ -0,0 +1,23 @@ +
+ +
+ <%= render_menu :account_menu -%> +
+ <%= content_tag('div', "#{link_to(l(:label_layouts_feedback)+'(' + User.current.count_new_jour.to_s + ')', feedback_path(User.current))}".html_safe, :id => 'loggedas') if User.current.logged? %> + <%= content_tag('div', "#{l(:label_logged_as)} #{link_to_user(User.current, :format => :username)}".html_safe, :id => 'loggedas') if User.current.logged? %> + + + + + + + <%= render_menu :top_home_menu if User.current.logged? || !Setting.login_required? -%> +
+
+ diff --git a/app/views/layouts/base.html.erb b/app/views/layouts/base.html.erb index f9ecbc54f..3168c4dff 100644 --- a/app/views/layouts/base.html.erb +++ b/app/views/layouts/base.html.erb @@ -19,9 +19,13 @@
- +<% if @project_type == '0' %> +<%=render :partial => 'layouts/base_enterprise_header'%> +<% elsif @project_type == '1' %> +<%=render :partial => 'layouts/base_college_header'%> +<% else %> <%=render :partial => 'layouts/base_header'%> - +<% end %>
<%= render_flash_messages %> diff --git a/app/views/layouts/base_bids.html.erb b/app/views/layouts/base_bids.html.erb index 4ebe4a0eb..77b1edcea 100644 --- a/app/views/layouts/base_bids.html.erb +++ b/app/views/layouts/base_bids.html.erb @@ -20,7 +20,7 @@
- <%=render :partial => 'layouts/base_header'%> + <%=render :partial => 'layouts/base_enterprise_header'%>
<%= l(:label_bids_reward_method) %><%= l(:label_call_bonus) %> <%= l(:label_RMB_sign) %><%= @bid.budget%><%= l(:label_bids_reward_method) %><%= l(:label_call_bonus) %> <%= l(:label_RMB_sign) %><%= @bid.budget%><%= l(:label_bids_reward_method) %><%= @bid.budget%>
+ + + + + + + + - - - + + + diff --git a/config/locales/zh.yml b/config/locales/zh.yml index 2cfaeb932..be1219fb4 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -503,6 +503,8 @@ zh: label_home: 主页 #by young label_requirement: 需求 + label_new_course: 课程 + label_new_homework: 作业 label_requirement_focus: 关注需求 label_developer: 用户 label_investor: 投资人: @@ -523,6 +525,10 @@ zh: label_user_login_tips: 您还没有登录,请登录后留言 #end #by huang # modified by bai + label_college: 高校进入 + label_enterprise_college: 进入高校 + label_enterprise: 企业进入 + lable_college_enterprise: 进入企业 label_term: 学期 label_spring: 春季学期 label_summer: 夏季学期 @@ -962,7 +968,7 @@ zh: text_caracters_maximum: "最多 %{count} 个字符。" text_caracters_minimum: "至少需要 %{count} 个字符。" text_length_between: "长度必须在 %{min} 到 %{max} 个字符之间。" - text_command: 口令仅数字可以使用,学生或其他成员申请加入课程时候需要使用该口令,该口令可以由老师在课堂上公布。 + text_command: 学生或其他成员申请加入课程时候需要使用该口令,该口令可以由老师在课堂上公布。 text_tracker_no_workflow: 此跟踪标签未定义工作流程 text_unallowed_characters: 非法字符 text_comma_separated: 可以使用多个值(用逗号,分开)。 @@ -1275,6 +1281,7 @@ zh: field_homework_type: 作业类型 label_homework_respond: 作业情况 + label_bid_me: 我要应标 label_new_call: 发布需求 label_user_information: "与我相关" label_bid_succeed: "需求发布成功" @@ -1360,6 +1367,7 @@ zh: label_jion_bidding_homework: 已提交! label_bidding_user: 应标人: label_bidding_user_homework: 作业提交者 + label_bidding_user_studentcode: 学号 label_bidding_reason: 应标宣言: label_bidding_reason_homewrok: 作业提交说明 label_username: 用户名: diff --git a/config/routes.rb b/config/routes.rb index a3a300573..b36686ca1 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -156,7 +156,8 @@ RedmineApp::Application.routes.draw do match '/file', :controller => 'projects', :action => 'file', :as => 'file', :via => :get match '/statistics', :controller => 'projects', :action => 'statistics', :as => 'statistics', :via => :get # match '/investor', :controller => 'projects', :action => 'investor', :as => 'investor', :via => :get - match '/homework', :controller => 'projects', :action => 'homework', :as => 'homework', :via => :get + match '/homework', :controller => 'projects', :action => 'homework', :as => 'homework', :via => :get + # match '/activity', :controller => 'activities', :action => 'index', :as => 'activity', :via => :get # match '/repository', :controller => 'repositories', :action => 'show', :repository_id => nil, :path => nil, :rev => nil, :as => 'repository', :via => :get @@ -455,6 +456,7 @@ RedmineApp::Application.routes.draw do match 'new_join', :to => 'projects#new_join', :as => 'try_join' match 'projects/:id/respond', :to => 'projects#project_respond', :via => :post match 'calls/:id/manage',:to => 'bids#manage',:via => [:get,:post] + match 'project/course', :to => 'projects#course', :as => 'course' #added by william # match 'calls/:id/set_results',:controller => 'bids', :action => 'set_results',:via => [:get,:post],:as => 'set_results' diff --git a/db/migrate/20130926140427_add_project_type_to_project_statuses.rb b/db/migrate/20130926140427_add_project_type_to_project_statuses.rb new file mode 100644 index 000000000..ef126c5e9 --- /dev/null +++ b/db/migrate/20130926140427_add_project_type_to_project_statuses.rb @@ -0,0 +1,5 @@ +class AddProjectTypeToProjectStatuses < ActiveRecord::Migration + def change + add_column :project_statuses, :project_type, :integer + end +end diff --git a/db/migrate/20130927011824_add_password_to_courses.rb b/db/migrate/20130927011824_add_password_to_courses.rb new file mode 100644 index 000000000..7d648a67b --- /dev/null +++ b/db/migrate/20130927011824_add_password_to_courses.rb @@ -0,0 +1,5 @@ +class AddPasswordToCourses < ActiveRecord::Migration + def change + add_column :courses, :password, :string + end +end diff --git a/db/schema.rb b/db/schema.rb index c4b87d14e..4659f0f01 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20130926005448) do +ActiveRecord::Schema.define(:version => 20130927011824) do create_table "a_user_watchers", :force => true do |t| t.string "name" @@ -180,6 +180,7 @@ ActiveRecord::Schema.define(:version => 20130926005448) do t.string "location" t.string "term" t.string "string" + t.string "password" end create_table "custom_fields", :force => true do |t| @@ -507,6 +508,7 @@ ActiveRecord::Schema.define(:version => 20130926005448) do t.integer "changesets_count" t.integer "watchers_count" t.integer "project_id" + t.integer "project_type" end add_index "project_statuses", ["changesets_count"], :name => "index_project_statuses_on_changesets_count" diff --git a/lib/redmine.rb b/lib/redmine.rb index 4be99f022..788c2d870 100644 --- a/lib/redmine.rb +++ b/lib/redmine.rb @@ -208,6 +208,46 @@ Redmine::MenuManager.map :top_menu do |menu| # menu.push :help, Redmine::Info.help_url, :last => true end #end + +# by huang +Redmine::MenuManager.map :top_home_menu do |menu| + menu.push :home, :home_path + menu.push :projects, { :controller => 'projects', :action => 'index' }, :caption => :label_project_plural + menu.push :developer, {:controller => 'users', :action => 'index'} + # menu.push :investor, :home_path + # menu.push :theme, :home_path + # menu.push :my_page, { :controller => 'my', :action => 'page' }, :if => Proc.new { User.current.logged? } + # menu.push :administration, { :controller => 'admin', :action => 'index' }, :if => Proc.new { User.current.admin? }, :last => true + # menu.push :help, Redmine::Info.help_url, :last => true +end + +Redmine::MenuManager.map :top_enterprise_menu do |menu| + menu.push :home, :home_path + menu.push :projects, { :controller => 'projects', :action => 'index', :project_type => 0 }, :caption => :label_project_plural + menu.push :requirement, {:controller => 'bids', :action => 'index', :project_type => 0 } + menu.push :developer, {:controller => 'users', :action => 'index', :project_type => 0 } + # menu.push :investor, :home_path + # menu.push :theme, :home_path + # menu.push :my_page, { :controller => 'my', :action => 'page' }, :if => Proc.new { User.current.logged? } + # menu.push :administration, { :controller => 'admin', :action => 'index' }, :if => Proc.new { User.current.admin? }, :last => true + # menu.push :help, Redmine::Info.help_url, :last => true +end + +Redmine::MenuManager.map :top_college_menu do |menu| + menu.push :home, :home_path + menu.push :new_course, {:controller => 'projects', :action => 'course', :project_type => 1 } + menu.push :new_homework, {:controller => 'bids', :action => 'index', :project_type => 1 } + menu.push :projects, { :controller => 'projects', :action => 'index', :project_type => 1 }, :caption => :label_project_plural + menu.push :developer, {:controller => 'users', :action => 'index', :project_type => 1 } + + # menu.push :investor, :home_path + # menu.push :theme, :home_path + # menu.push :my_page, { :controller => 'my', :action => 'page' }, :if => Proc.new { User.current.logged? } + # menu.push :administration, { :controller => 'admin', :action => 'index' }, :if => Proc.new { User.current.admin? }, :last => true + # menu.push :help, Redmine::Info.help_url, :last => true +end +# end + Redmine::MenuManager.map :account_menu do |menu| menu.push :login, :signin_path, :if => Proc.new { !User.current.logged? } menu.push :register, :register_path, :if => Proc.new { !User.current.logged? && Setting.self_registration? } diff --git a/public/images/add_enterprise.png b/public/images/add_enterprise.png new file mode 100644 index 000000000..0a9ae4abe Binary files /dev/null and b/public/images/add_enterprise.png differ diff --git a/public/images/logo2.png b/public/images/logo2.png new file mode 100644 index 000000000..83b09c3a3 Binary files /dev/null and b/public/images/logo2.png differ diff --git a/public/images/logo3.png b/public/images/logo3.png new file mode 100644 index 000000000..f961569ae Binary files /dev/null and b/public/images/logo3.png differ diff --git a/public/images/logo4.png b/public/images/logo4.png new file mode 100644 index 000000000..e7a513a9f Binary files /dev/null and b/public/images/logo4.png differ diff --git a/public/images/logo_ent.png b/public/images/logo_ent.png new file mode 100644 index 000000000..12aaafd0d Binary files /dev/null and b/public/images/logo_ent.png differ diff --git a/public/images/sidebar/add_enterprise.png b/public/images/sidebar/add_enterprise.png new file mode 100644 index 000000000..0a9ae4abe Binary files /dev/null and b/public/images/sidebar/add_enterprise.png differ diff --git a/public/images/sidebar/tags_enterprise.png b/public/images/sidebar/tags_enterprise.png new file mode 100644 index 000000000..9701b19fb Binary files /dev/null and b/public/images/sidebar/tags_enterprise.png differ diff --git a/public/images/sidebar/tool_tag_enterprise.png b/public/images/sidebar/tool_tag_enterprise.png new file mode 100644 index 000000000..4dd8b216d Binary files /dev/null and b/public/images/sidebar/tool_tag_enterprise.png differ diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index 65c5a78cc..bf8d39881 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -11,6 +11,11 @@ h4 {border-bottom: 1px dotted #bbb;} /*new by huang*/ /**/ +.enterprise{ + padding-left: 400px; + padding-top: 10px; +} + .project_avatar_name { position: relative; font-size: 16px; @@ -370,6 +375,16 @@ ul.tool li{list-style-type:none; background-color:#15bccf; overflow:hidden } + +.user_enterprise_underline{ + margin:1; + padding:1; + width:240px; + height:1px; + background-color:#ac344f; + overflow:hidden +} + .user_underline2{ margin:1; padding:1; @@ -660,6 +675,19 @@ ul.newprojects2 li{ } #account {float:right;} +#account-enterprise{ + float: right; + padding-top: 10px; + padding-right: 347px; + +} +#account-college{ + + float: right; + padding-top: 10px; + padding-right: 302px; + +} #header {min-height:5.3em;margin:0;background-color:#628DB6;color:#f8f8f8; padding: 4px 8px 20px 6px; position:relative;} #header a {color:#f8f8f8;} @@ -1462,79 +1490,6 @@ p.progress-info {clear: left; font-size: 80%; margin-top:-4px; color:#777;} #roadmap table.progress td { height: 1.2em; } /***** Tabs *****/ -/** -#content .tabs_new {height: 2.6em; margin-bottom:1.2em; margin-top: 0.8em; position:relative; overflow:hidden;} -#content .tabs_new ul {margin:0; position:absolute; bottom:0; padding-left: 0.5em; width: 2000px; border-bottom: 1px solid #15BCCF;} -#content .tabs_new ul li { - width:75px; - float:left; - list-style-type:none; - white-space:nowrap; - margin-right:4px; - background:#fff; - position:relative; - margin-bottom:-1px; -} -#content .tabs_new ul li a{ - display:block; - font-size: 14px; - text-decoration:none; - line-height:1.2em; - padding-top: 6px; - padding-bottom: 2px; - text-align: center; - border: 1px solid #15BCCF; - border-bottom: 0px solid #15BCCF; - background-color: #fff; - color:#999; - font-weight:bold; - border-top-left-radius:4px; - border-top-right-radius:4px; -} - **/ -/*added by huang*/ -/*.pagination_list{height: 3em; margin-bottom:1.2em; position:relative; overflow:hidden;} -.pagination_list ul{margin:0; position:absolute; bottom:0; padding-left:0.5em; width:2000px; border-bottom: 1px solid #15BCCF;} -.pagination_list ul li{ - float:left; - list-style-type:none; - white-space:nowrap; - margin-right:4px; - background:#fff; - position:relative; - margin-bottom:-1px; -} -.test_new{ - background: #000; - color: #000; - padding-bottom: -1px; -} -.pagination_list ul li a{ - border: 1px solid #15BCCF; - - display:block; - font-size: 0.9em; - text-decoration: none; - line-height:1.3em; - padding:2px 6px 2px 6px; - background-color:#fff; - color:#606060; - font-weight:bold; - border-top-left-radius:3px; - border-top-right-radius:3px; -} -.pagination_list ul li a:hover{background-color: #E2F4FF; - text-decoration:none; - margin-bottom:-1px;} -.pagination_list ul li a.selected{ - - background-color: #000; - border: 1px solid #000; - border-bottom: 1px solid #000; - color:#111; -} -.pagination_list ul li a.selected:hover {background-color: #000;}*/ -/*end*/ #content .tabs {height: 2.6em; margin-bottom:1.2em; position:relative; overflow:hidden;} #content .tabs ul {margin:0; position:absolute; bottom:0; padding-left:0.5em; font-family: 14px; width:2000px; border-bottom: 1px solid #15BCCF;} #content .tabs ul li { @@ -1546,8 +1501,7 @@ p.progress-info {clear: left; font-size: 80%; margin-top:-4px; color:#777;} position:relative; margin-bottom:-1px; } -#content .tabs ul li a{ - +#content .tabs ul li a{ display:block; font-size: 14px; text-decoration: none; @@ -1621,8 +1575,7 @@ button.tab-right { line-height:1.2em; padding-top: 6px; padding-bottom: 2px; - text-align: center; - + text-align: center; border: 1px solid #15BCCF; /*border-bottom: 0px solid #15BCCF;*/ @@ -1671,6 +1624,79 @@ button.tab_new-right { background: #eeeeee url(../images/bullet_arrow_right.png) no-repeat 50% 50%; border-top-right-radius:3px; } + + +/*added by huang*/ +#content .tabs_new_enterprise {height: 2.6em; margin-bottom:1.2em; margin-top: 0.8em; position:relative; overflow:hidden;} +#content .tabs_new_enterprise ul {margin:0; position:absolute; bottom:0; padding-left: 0.5em; width: 2000px; border-bottom: 1px solid #ac344f;font-size:14px;} +#content .tabs_new_enterprise ul li { + width:85px; /*modified by linchun*/ + float:left; + list-style-type:none; + white-space:nowrap; + margin-right:4px; + background:#fff; + position:relative; + margin-bottom:-1px; +} +#content .tabs_new_enterprise ul li a{ + display:block; + font-size: 15px; + text-decoration:none; + line-height:1.2em; + padding-top: 6px; + padding-bottom: 2px; + text-align: center; + + border: 1px solid #b60003; + /*border-bottom: 0px solid #15BCCF;*/ + + color:#606060; + font-weight:bold; + border-top-left-radius:4px; + border-top-right-radius:4px; +} + +#content .tabs_new_enterprise ul li a:hover { + background-color: #cda3ad; + text-decoration:none; +} + +#content .tabs_new_enterprise ul li a.selected { + background-color: #9f4056; # added by bai + border: 1px solid #ac344f; + border-bottom: 1px solid #fff; + color:#FFF; +} + +#content .tabs_new_enterprise ul li a.selected:hover {background-color: #ac344f;} + +div.tabs_new_enterprise-buttons { position:absolute; right: 0; width: 48px; height: 24px; background: white; bottom: 0; border-bottom: 1px solid #bbbbbb; } + +button.tabs_new_enterprise-left, button.tabs_new_enterprise-right { + font-size: 0.9em; + cursor: pointer; + height:24px; + border: 1px solid #ccc; + border-bottom: 1px solid #bbbbbb; + position:absolute; + padding:4px; + width: 20px; + bottom: -1px; +} + +button.tabs_new_enterprise-left { + right: 20px; + background: #eeeeee url(../images/bullet_arrow_left.png) no-repeat 50% 50%; + border-top-left-radius:3px; +} + +button.tabs_new_enterprise-right { + right: 0; + background: #eeeeee url(../images/bullet_arrow_right.png) no-repeat 50% 50%; + border-top-right-radius:3px; +} +/*end*/ /*added by huang*/ #content_ .tabs {height: 3.5em; margin-bottom:1.2em; position:relative; overflow:hidden;} #content_ .tabs ul {margin:0; position:absolute; bottom:0; padding-left:0.5em; width:2000px; border-bottom: 1px solid #15BCCF;font-size:14px;} @@ -1686,7 +1712,7 @@ button.tab_new-right { #content_ .tabs ul li a{ display:block; - font-size: 14px; + font-size: 13px; text-decoration: none; line-height:1.3em; padding:4px 6px 4px 6px; @@ -1711,6 +1737,47 @@ button.tab_new-right { #content_ .tabs ul li a.selected:hover {background-color: #E2F4FF;} /*end*/ +/*added by huang*/ +#content_ .tabs_enterprise {height: 3.5em; margin-bottom:1.2em; position:relative; overflow:hidden;} +#content_ .tabs_enterprise ul {margin:0; position:absolute; bottom:0; padding-left:0.5em; width:2000px; border-bottom: 1px solid #bc7787;font-size:14px;} +#content_ .tabs_enterprise ul li { + float:left; + list-style-type:none; + white-space:nowrap; + margin-right:0px; + background:#fff; + position:relative; + margin-bottom:-1px; +} +#content_ .tabs_enterprise ul li a{ + + display:block; + font-size: 13px; + text-decoration: none; + line-height:1.3em; + padding:4px 6px 4px 6px; + background-color:#fff; + color:#606060; + font-weight:bold; + border-top-left-radius:3px; + border-top-right-radius:3px; +} + +#content_ .tabs_enterprise ul li a:hover { + background-color: #fff; + text-decoration:none; +} + +#content_ .tabs_enterprise ul li a.selected { + background-color: #fff; + border: 1px solid #bc7787; + border-bottom: 1px solid #fff; + color:#111; +} + +#content_ .tabs_enterprise ul li a.selected:hover {background-color: #E2F4FF;} +/*end*/ +/*end*/ /***** Diff *****/ .diff_out { background: #fcc; } .diff_out span { background: #faa; } @@ -1878,6 +1945,15 @@ a.close-icon:hover {background-image:url('../images/close_hl.png');} padding-top: 2px; padding-bottom: 3px; } +.icon_enterprise { + background-position: 0% 50%; + background-repeat: no-repeat; + font-family: '微软雅黑'; /*modify by men*/ + padding-left: 20px; + padding-top: 2px; + padding-bottom: 3px; +} +.icon_enterprise-add { background-image: url(../images/add_enterprise.png); } .icon-add { background-image: url(../images/add.png); } .icon-edit { background-image: url(../images/edit.png); } .icon-copy { background-image: url(../images/copy.png); } diff --git a/public/themes/redpenny-master/stylesheets/application.css b/public/themes/redpenny-master/stylesheets/application.css index 5f23beb47..e7983e74c 100644 --- a/public/themes/redpenny-master/stylesheets/application.css +++ b/public/themes/redpenny-master/stylesheets/application.css @@ -363,6 +363,11 @@ ul.projects li.root color: #000000; } +/* huang*/ + +/**/ + + #top-menu { background-color:#fff; /*顶层导航颜色*/ @@ -397,7 +402,7 @@ ul.projects li.root #top-menu li a { /*by young*/ - color:#fff; + color:#fff; /*the color of the fonts*/ font-weight:6px; padding:4px 3px } @@ -446,6 +451,40 @@ ul.projects li.root min-height:800px; } +/*by huang*/ +#sidebar-enterprise +{ + width:240px; + height: auto; + background:#fff; + margin-bottom: 30px; + border-right:1px solid #f0c082; + overflow:auto; + -moz-box-shadow:#C6E9F1 1px 1px 2px; + -webkit-box-shadow:2px 2px 0px -2px #C6E9F1; +} + +#sidebar-enterprise a,#sidebar-enterprise a.selected +{ + display:inline-block; + padding:4px 4px 4px 21px !important; + transition:all .2s linear; + -moz-transition:all .2s linear; + -o-transition:all .2s linear; + -webkit-transition:all .2s linear; +} + +#sidebar-enterprise a.selected +{ + padding-top:2px; + padding-bottom:2px; + background-position:2px 5px; + margin:auto; + color:#a0a0a0; + font-weight:600 +} + +/*end*/ #sidebar { @@ -1141,8 +1180,8 @@ a.root { padding-bottom: 10px; margin-bottom: 0px; /*background-color: #f5f5f5;*/ - border-bottom: 1px solid #eee; - border-bottom: 1px solid rgba(0, 0, 0, 0.05); + border-bottom: 1px solid #e3c3ca; + border-bottom: 1px solid #e3c3ca; /*-webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; @@ -1204,6 +1243,15 @@ a.img-tag3{ color: rgb(17, 102, 153); } +.stats2 span.info { + width: 145px; + text-align: right; + display: inline-block; + font-weight: bold; + font-size: 1.2em; + color: #ac344f; +} + .stats span { margin-left: 10px; } @@ -1671,7 +1719,7 @@ div.project-search-block { padding: 10px; width: 95%; border-top: 1px solid rgb(242,242,242); - border-bottom: 1px solid rgb(223, 223, 223); + /*border-bottom: 1px solid rgb(223, 223, 223);*/ margin-left: auto; margin-right: auto; } @@ -1686,8 +1734,19 @@ div.project-search { float: right; margin-right: 28px; } -div.project-search input[type="submit"] { - width: 40px; +input.enterprise[type="submit"] { + padding-bottom: 5px; + width: 50px; + height: 25px; + font-family: '微软雅黑',Arial,Helvetica,sans-serif; + font-size: 12px; + color: #fff; + padding: 0px; + background: #ac344f; + border: 1px solid #ac344f; +} +input[type="submit"] { + width: auto; font-family: '微软雅黑',Arial,Helvetica,sans-serif; font-size: 12px; color: rgb(5, 5, 5);
@@ -84,7 +86,7 @@
<%= l(:label_x_followers, :count => @bid.watcher_users.count) %>
-
+
@@ -102,12 +104,12 @@
- +
<%= l(:label_bidding_project) %>
-
+
@@ -124,7 +126,7 @@
- + @@ -133,7 +135,7 @@
<% if display_main_menu?(@bid) %> -
+
<%= render_menu :bid_menu %>
<% end %> diff --git a/app/views/layouts/base_courses.html.erb b/app/views/layouts/base_courses.html.erb index 057f7c037..126c845b5 100644 --- a/app/views/layouts/base_courses.html.erb +++ b/app/views/layouts/base_courses.html.erb @@ -20,7 +20,7 @@
- <%= render :partial => 'layouts/base_header'%> + <%= render :partial => 'layouts/base_college_header'%>
@@ -68,9 +68,7 @@
- + diff --git a/app/views/layouts/base_homework.html.erb b/app/views/layouts/base_homework.html.erb index 52c2fe3c8..1ace06c19 100644 --- a/app/views/layouts/base_homework.html.erb +++ b/app/views/layouts/base_homework.html.erb @@ -20,7 +20,7 @@
- <%= render :partial => 'layouts/base_header'%> + <%= render :partial => 'layouts/base_college_header'%>
主讲老师:<%= @course.teacher.lastname+@course.teacher.firstname %>
-
+
@@ -83,10 +83,10 @@ <%= textilizable @project.description %>
- <%= l(:label_create_time) %>:<%= format_time(@project.created_on) %> + <%= l(:label_create_time) %>:<%= format_time(@project.created_on) %>
-
+
@@ -100,7 +100,7 @@ -
+
<%= l(:label_project_tool)%> @@ -108,25 +108,25 @@ - - - - - <% if @project.identifier == 'trustie' %> - <% else %> @@ -134,11 +134,11 @@
<%=image_tag("/images/sidebar/tool_tag2.png", weight:"15px", height:"15px") %> + <%=image_tag("/images/sidebar/tool_tag_enterprise.png", weight:"15px", height:"15px") %> <%= link_to l(:project_module_documents),project_documents_path(@project) %><%=image_tag("/images/sidebar/tool_tag2.png", weight:"15px", height:"15px") %> + <%=image_tag("/images/sidebar/tool_tag_enterprise.png", weight:"15px", height:"15px") %> <%= link_to l(:project_module_wiki),project_wiki_path(@project) %>
<%=image_tag("/images/sidebar/tool_tag2.png", weight:"15px", height:"15px") %> + <%=image_tag("/images/sidebar/tool_tag_enterprise.png", weight:"15px", height:"15px") %> <%= link_to l(:project_module_calendar),project_calendar_path(@project) %> <%=image_tag("/images/sidebar/tool_tag2.png", weight:"15px", height:"15px") %> + <%=image_tag("/images/sidebar/tool_tag_enterprise.png", weight:"15px", height:"15px") %> <%= link_to l(:project_module_gantt) ,project_gantt_path(@project) %>
<%=image_tag("/images/sidebar/tool_tag2.png", weight:"15px", height:"15px") %> + <%=image_tag("/images/sidebar/tool_tag_enterprise.png", weight:"15px", height:"15px") %> <%= link_to l(:project_module_boards) ,project_boards_path(@project) %> <%=image_tag("/images/sidebar/tool_tag2.png", weight:"15px", height:"15px") %> + <%=image_tag("/images/sidebar/tool_tag_enterprise.png", weight:"15px", height:"15px") %> <%= link_to l(:label_project_tool_response) ,project_feedback_path(@project) %>
-
+
-
+
<%= render_main_menu(@project) %>
<%= yield %> diff --git a/app/views/projects/_project.html.erb b/app/views/projects/_project.html.erb index 8042cfe4d..2c01ea971 100644 --- a/app/views/projects/_project.html.erb +++ b/app/views/projects/_project.html.erb @@ -8,6 +8,22 @@ <%= textilizable(project.short_description, :project => project) %>

+ <% if @project_type == '0' %> +
+

+ <%= content_tag('span', @project.watcher_users.count, :class => "info") %><%= content_tag('span', l(:label_x_follow_people,:count =>@project.watcher_users.count)) %> +

+

+ <%= content_tag('span', "#{@project.users.count}", :class => "info") %><%= content_tag('span', l(:label_x_current_contributors, :count => @project.users.count)) %> +

+

+ <%= content_tag('span', "#{(@project.repository.nil? || @project.repository.changesets[0].nil?) ? '0' : distance_of_time_in_words(Time.now, @project.repository.changesets[0].committed_on)}", :class => "info") %><%= content_tag('span', l(:label_since_last_commits)) %> +

+

+ <%= content_tag('span', "#{@project.repository.nil? ? '0' : @project.project_status.changesets_count }", :class => "info") %><%= content_tag('span', l(:label_commit_on)) %> +

+
+ <% else %>

<%= content_tag('span', @project.watcher_users.count, :class => "info") %><%= content_tag('span', l(:label_x_follow_people,:count =>@project.watcher_users.count)) %> @@ -22,6 +38,7 @@ <%= content_tag('span', "#{@project.repository.nil? ? '0' : @project.project_status.changesets_count }", :class => "info") %><%= content_tag('span', l(:label_commit_on)) %>

+ <% end %>
@@ -50,7 +67,12 @@
+ <% if @project_type == '0' %> + <%= image_tag( "/images/sidebar/tags_enterprise.png") %> + + <% else %> <%= image_tag( "/images/sidebar/tags.png") %> + <% end %> <%= render :partial => 'tags/tag_name', :locals => {:obj => @project,:object_flag => "2",:non_list_all => true }%>
diff --git a/app/views/projects/course.html.erb b/app/views/projects/course.html.erb new file mode 100644 index 000000000..1f05347a7 --- /dev/null +++ b/app/views/projects/course.html.erb @@ -0,0 +1,67 @@ +<% content_for :header_tags do %> +<%= auto_discovery_link_tag(:atom, {:action => 'index', :format => 'atom', :key => User.current.rss_key}) %> +<% end %> + +<%= form_tag(:controller => 'projects', :action => 'search', :method => :get) do %> +
+ + + + + + +
<%= l(:label_new_course)%><%= link_to(l(:label_course_new), {:controller => 'projects', :action => 'new', :course => 1, :project_type => @project_type}, :class => 'icon icon-add') if User.current.allowed_to?(:add_project, nil, :global => true) %> +
+
+<% end %> + +<%= sort_course(@s_type, @project_type)%> + + + +
+ <%= render_project_hierarchy(@projects)%> +
+ + + +<% if User.current.logged? %> +

+ <%= l(:label_my_projects) %> +

+<% end %> + +<% other_formats_links do |f| %> +<%= f.link_to 'Atom', :url => {:key => User.current.rss_key} %> +<% end %> + +<% content_for :sidebar do %> +<%= form_tag({}, :method => :get) do %> +

<%= l(:label_project_plural) %>

+ +

+ <%= submit_tag l(:button_apply), :class => 'button-small', :name => nil %> +

+<% end %> +<% end %> + +<% html_title(l(:label_project_plural)) -%> diff --git a/app/views/projects/index.html.erb b/app/views/projects/index.html.erb index bac032778..0399524a1 100644 --- a/app/views/projects/index.html.erb +++ b/app/views/projects/index.html.erb @@ -7,19 +7,31 @@ - - - + <% else %> + + <% end %> +
<%= l(:label_project_plural)%><%= link_to(l(:label_project_new), {:controller => 'projects', :action => 'new', :course => 0}, :class => 'icon icon-add') if User.current.allowed_to?(:add_project, nil, :global => true) %><%= link_to(l(:label_course_new), {:controller => 'projects', :action => 'new', :course => 1}, :class => 'icon icon-add') if User.current.allowed_to?(:add_project, nil, :global => true) %> + <% if @project_type == '0' %> + <%= link_to(l(:label_project_new), {:controller => 'projects', :action => 'new', :course => 0, :project_type => @project_type}, :class => 'icon_enterprise icon_enterprise-add') if User.current.allowed_to?(:add_project, nil, :global => true) %><%= link_to(l(:label_project_new), {:controller => 'projects', :action => 'new', :course => 0, :project_type => @project_type}, :class => 'icon icon-add') if User.current.allowed_to?(:add_project, nil, :global => true) %>
<% end %> - -<%= sort_project(@s_type)%> +<% if @project_type == '0' %> +<%= sort_project_enterprise(@s_type, @project_type) %> +<% else %> +<%= sort_project(@s_type, @project_type) %> +<% end %> +
-<%= sort_user(@s_type)%> +<% if @project_type == '0' %> +<%= sort_user_enterprise(@s_type, @project_type)%> +<% else %> +<%= sort_user(@s_type, @project_type)%> +<% end %> -
<%=link_to l(:label_enterprise), :controller=>'projects', :action=>'index', :project_type => 0 %><%=link_to l(:label_college), :controller=>'projects', :action=>'course', :project_type => 1 %>
-
- <%= l(:label_features) %>
-
-
+
+ <%= l(:label_features) %>
+
+
<%= image_tag("/images/welcome/discuss.png", weight:"30px", height: "26px") %><%= l(:label_board) %>