Merge branch 'develop' of 10.0.47.245:/home/trustie2 into develop

Conflicts:
	app/controllers/bids_controller.rb
	app/views/bids/_history.html.erb
	app/views/bids/_project_list.html.erb
	app/views/bids/show.html.erb
	config/locales/zh.yml
	config/routes.rb
	lib/redmine.rb
This commit is contained in:
william 2013-09-24 09:52:08 +08:00
commit 61e4021625
204 changed files with 4955 additions and 347 deletions

3
.gitignore vendored
View File

@ -11,3 +11,6 @@ test/*
tmp/*
/app/models/tag.rb
/app/models/tag.rb
/public/images/requirements/reference - 副本 - 副本.jpg
/public/images/requirements/*.jpg

View File

@ -0,0 +1,2 @@
// Place all the behaviors and hooks related to the matching controller here.
// All this logic will automatically be available in application.js.

View File

@ -0,0 +1,4 @@
/*
Place all the styles related to the matching controller here.
They will automatically be included in application.css.
*/

View File

@ -88,10 +88,12 @@ class AccountController < ApplicationController
# create a new token for password recovery
token = Token.new(:user => user, :action => "recovery")
if token.save
Mailer.lost_password(token).deliver
flash[:notice] = l(:notice_account_lost_email_sent)
redirect_to signin_path
return
Thread.new do
Mailer.lost_password(token).deliver
end
flash[:notice] = l(:notice_account_lost_email_sent)
redirect_to signin_path
return
end
end
end

View File

@ -115,13 +115,30 @@ class AttachmentsController < ApplicationController
format.js
end
end
def delete_homework
@bid = @attachment.container.bid
# Make sure association callbacks are called
container = @attachment.container
@attachment.container.attachments.delete(@attachment)
if container.attachments.empty?
container.delete
end
respond_to do |format|
format.html { redirect_to_referer_or respond_path(@bid) }
format.js
end
end
private
def find_project
@attachment = Attachment.find(params[:id])
# Show 404 if the filename in the url is wrong
raise ActiveRecord::RecordNotFound if params[:filename] && params[:filename] != @attachment.filename
@project = @attachment.project
unless @attachment.container_type == 'Bid' || @attachment.container_type == 'HomeworkAttach'
@project = @attachment.project
end
rescue ActiveRecord::RecordNotFound
render_404
end

View File

@ -3,11 +3,16 @@ class BidsController < ApplicationController
#Added by young
menu_item :respond
menu_item :project, :only => [:show_project,:show_results]
menu_item :homework_respond, :only => :homework_respond
menu_item :homework_statistics, :only => :homework_statistics
#Ended by young
before_filter :find_bid, :only => [:show, :show_project, :create,:destroy,:more,:back,:add,:new,:show_results]
before_filter :require_login,:only => [:set_reward]
helper :watchers
helper :attachments
include AttachmentsHelper
def index
# Modified by nie
# @requirement_title = "4"
@ -69,11 +74,17 @@ class BidsController < ApplicationController
@state = false
respond_to do |format|
if @bid.reward_type == 3
format.html {
render :layout => 'base_homework'
}
else
format.html {
render :layout => 'base_bids'
}
end
format.api
end
end
@ -88,14 +99,51 @@ class BidsController < ApplicationController
# @project = Project.where("id in []", a)
@user = @bid.author
@bidding_project = @bid.biding_projects
if @bid.homework_type == 1
@homework = HomeworkAttach.new
@homework_list = @bid.homeworks
end
respond_to do |format|
if @bid.reward_type == 3
format.html {
render :layout => 'base_homework'
}
else
format.html {
render :layout => 'base_bids'
}
end
format.api
end
end
##### by huang
def show_project_homework
# flash[:notice] = ""
@membership = User.current.memberships.all(:conditions => Project.visible_condition(User.current))
@option = []
@membership.each do |membership|
@option << membership.project
end
# a = [1]
# @project = Project.where("id in []", a)
@user = @bid.author
@bidding_project = @bid.biding_projects
respond_to do |format|
if @bid.reward_type == 3
format.html {
render :layout => 'base_homework'
}
else
format.html {
render :layout => 'base_bids'
}
end
format.api
end
end
###添加应标项目
def add
project = Project.where('name = ?', params[:bid]).first
@ -105,7 +153,11 @@ class BidsController < ApplicationController
flash[:notice] = l(:label_bidding_succeed)
end
else
if @bid.reward_type == 3
flash[:error] = l(:label_bidding_homework_fail)
else
flash[:error] = l(:label_bidding_fail)
end
end
@bidding_project = @bid.biding_projects
respond_to do |format|
@ -219,6 +271,70 @@ class BidsController < ApplicationController
render :action => 'new_bid'
end
end
def create_homework
@bid = Bid.new
@bid.name = params[:bid][:name]
@bid.description = params[:bid][:description]
@bid.reward_type = 3
# @bid.budget = params[:bid][:budget]
@bid.deadline = params[:bid][:deadline]
@bid.budget = 0
@bid.author_id = User.current.id
@bid.commit = 0
@bid.homework_type = params[:bid][:homework_type]
@bid.save_attachments(params[:attachments] || (params[:bid] && params[:bid][:uploads]))
# @bid.
if @bid.save
HomeworkForCourse.create(:project_id => params[:course_id], :bid_id => @bid.id)
unless @bid.watched_by?(User.current)
if @bid.add_watcher(User.current)
flash[:notice] = l(:label_bid_succeed)
end
end
redirect_to respond_path(@bid)
else
@bid.safe_attributes = params[:bid]
render :action => 'new_bid'
end
end
def add_homework
# homework = HomeworkAttach.create(:bid_id => @bid.id, :user_id => User.current.id)
# homework.save_attachments(params[:attachments] || (params[:bid] && params[:bid][:uploads]))
@homework = HomeworkAttach.new
@homework.bid_id = @bid.id
@homework.user_id = User.current.id
@homework.save_attachments(params[:attachments])
@homework.save
@homework_list = @bid.homeworks
end
# 作业统计
def homework_statistics
@course = @bid.courses.first
@member = []
@course.memberships.each do |member|
unless (member.roles && Role.where('id = ? ', 3)).empty?
@member.push member
end
end
if @bid.homework_type = 1
@student = User.where("id in (select DISTINCT user_id from #{HomeworkAttach.table_name} where bid_id = ? )", @bid.id)
@homework_type = true
else
@homework_type = false
end
@user = @bid.author
render :layout => 'base_homework'
end
def homework_respond
@user = @bid.author
render :layout => 'base_homework'
end
def more
@jour = @bid.journals_for_messages
@ -231,6 +347,7 @@ class BidsController < ApplicationController
#format.api { render_api_ok }
end
end
def back
@jour = @bid.journals_for_messages

View File

@ -19,8 +19,9 @@ class BoardsController < ApplicationController
layout 'base_projects'#by young
default_search_scope :messages
before_filter :find_project_by_project_id, :find_board_if_available
before_filter :authorize, :except => [:new, :show, :create]
before_filter :authorize, :except => [:new, :show, :create, :index]
accept_rss_auth :index, :show
helper :sort
include SortHelper
@ -33,6 +34,11 @@ class BoardsController < ApplicationController
@board = @boards.first
show
end
if @project.project_type == 1
render :layout => 'base_courses'
else
render :layout => false if request.xhr?
end
end
def show
@ -54,7 +60,11 @@ class BoardsController < ApplicationController
preload(:author, {:last_reply => :author}).
all
@message = Message.new(:board => @board)
render :action => 'show', :layout => !request.xhr?
if @project.project_type
render :action => 'show', :layout => 'base_courses'
else
render :action => 'show', :layout => !request.xhr?
end
}
format.atom {
@messages = @board.messages.
@ -70,6 +80,9 @@ class BoardsController < ApplicationController
def new
@board = @project.boards.build
@board.safe_attributes = params[:board]
if @project.project_type
render :layout => 'base_courses'
end
end
def create
@ -90,6 +103,9 @@ class BoardsController < ApplicationController
end
def update
if @project.project_type
render :layout => 'base_courses'
end
@board.safe_attributes = params[:board]
if @board.save
redirect_to_settings_in_projects

View File

@ -0,0 +1,42 @@
class CoursesController < ApplicationController
before_filter :require_login, :only => [:join, :unjoin]
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
members = []
members << Member.new(:role_ids => [5], :user_id => User.current.id)
course.members << members
StudentsForCourse.create(:student_id => User.current.id, :course_id => params[:object_id])
@state = 0
else
@state = 1
end
end
respond_to do |format|
# format.html { redirect_to_referer_or {render :text => (watching ? 'Watcher added.' : 'Watcher removed.'), :layout => true}}
format.js { render :partial => 'set_join', :locals => {:user => User.current, :course => Project.find(params[:object_id])} }
end
end
def unjoin
if User.current.logged?
@member = Member.where('project_id = ? and user_id = ?', params[:object_id], User.current.id)
@member.first.destroy
joined = StudentsForCourse.where('student_id = ? and course_id = ?', User.current.id, params[:object_id])
joined.each do |join|
join.delete
end
end
respond_to do |format|
# format.html { redirect_to_referer_or {render :text => (watching ? 'Watcher added.' : 'Watcher removed.'), :layout => true}}
format.js { render :partial => 'set_join', :locals => {:user => User.current, :course => Project.find(params[:object_id])} }
end
end
end

View File

@ -22,7 +22,7 @@ class DocumentsController < ApplicationController
before_filter :find_project_by_project_id, :only => [:index, :new, :create]
before_filter :find_model_object, :except => [:index, :new, :create]
before_filter :find_project_from_association, :except => [:index, :new, :create]
before_filter :authorize #, :except => [:index]#Added by young
before_filter :authorize , :except => [:index]#Added by young
helper :attachments
@ -40,11 +40,18 @@ class DocumentsController < ApplicationController
@grouped = documents.group_by(&:category)
end
@document = @project.documents.build
render :layout => false if request.xhr?
if @project.project_type == 1
render :layout => 'base_courses'
else
render :layout => false if request.xhr?
end
end
def show
@attachments = @document.attachments.all
if @project.project_type
render :action => 'show', :layout => 'base_courses'
end
end
def new

View File

@ -34,11 +34,20 @@ class FilesController < ApplicationController
@containers = [ Project.includes(:attachments).reorder(sort_clause).find(@project.id)]
@containers += @project.versions.includes(:attachments).reorder(sort_clause).all.sort.reverse
render :layout => !request.xhr?
if @project.project_type == 1
render :layout => 'base_courses'
else
render :layout => !request.xhr?
end
end
def new
@versions = @project.versions.sort
@course_tag = @project.project_type
if @course_tag
render :layout => 'base_courses'
end
end
def create

View File

@ -49,7 +49,11 @@ class MessagesController < ApplicationController
all
@reply = Message.new(:subject => "RE: #{@message.subject}")
render :action => "show", :layout => "base_projects"#by young
if @message.board.project.project_type
render :action => "show", :layout => "base_courses"#by young
else
render :action => "show", :layout => "base_projects"#by young
end
end
# Create a new topic

View File

@ -77,7 +77,7 @@ class MyController < ApplicationController
# ue.save
# end
# added by bai 往数据库里写职业、性别和地区
# added by bai
if @user.user_extensions.nil?
se = UserExtensions.new
se.user_id = @user.id

View File

@ -46,12 +46,18 @@ class NewsController < ApplicationController
@newss = scope.all(:include => [:author, :project],
:order => "#{News.table_name}.created_on DESC",
:offset => @offset,
:limit => @limit)
:limit => @limit)
respond_to do |format|
format.html {
@news = News.new # for adding news inline
# huang
if @project.project_type == 1
render :layout => 'base_courses'
else
render :layout => false if request.xhr?
end
}
format.api
format.atom { render_feed(@newss, :title => (@project ? @project.name : Setting.app_title) + ": #{l(:label_news_plural)}") }
@ -61,10 +67,18 @@ class NewsController < ApplicationController
def show
@comments = @news.comments
@comments.reverse! if User.current.wants_comments_in_reverse_order?
@course_tag = @project.project_type
if @course_tag
render :layout => 'base_courses'
end
end
def new
@news = News.new(:project => @project, :author => User.current)
@course_tag = @project.project_type
if @course_tag
render :layout => 'base_courses'
end
end
def create

View File

@ -15,20 +15,40 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
class ProjectsController < ApplicationController
# if @project.project_type == 1
layout 'base_projects'# by young
menu_item :overview
menu_item :roadmap, :only => :roadmap
menu_item :settings, :only => :settings
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
menu_item l(:label_homework), :only => :homework
menu_item l(:label_course_file), :only => :index
menu_item l(:label_course_news), :only => :index
# end
# layout 'base_courses'# by young
# menu_item :overview
# menu_item l(:label_homework), :only => :homework
# menu_item :files, :only => :files
#
# layout 'base_courses'
# menu_item l(:label_homework), :only => homework
# 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 ]
before_filter :authorize, :except => [:watcherlist, :index, :search, :list, :new, :create, :copy, :archive, :unarchive, :destroy, :member, :focus, :file, :statistics, :feedback, :project_respond]
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 :authorize_global, :only => [:new, :create]
before_filter :require_admin, :only => [ :copy, :archive, :unarchive, :destroy ]
before_filter :require_admin, :only => [ :copy, :archive, :unarchive, :destroy, :calendar]
#by young
before_filter :member, :file, :statistics, :watcherlist
# before_filter :member, :file, :statistics, :watcherlist
# modified by fq
before_filter :file, :statistics, :watcherlist
#
accept_rss_auth :index
accept_api_auth :index, :show, :create, :update, :destroy
@ -39,6 +59,8 @@ class ProjectsController < ApplicationController
end
end
helper :bids
include BidsHelper
helper :sort
include SortHelper
helper :custom_fields
@ -222,6 +244,43 @@ class ProjectsController < ApplicationController
end
end
# added by fq
def new_join
@course = Project.find(params[:object_id])
end
#Added by young
def homework
@offset, @limit = api_offset_and_limit({:limit => 10})
@bids = @project.homeworks
@bids = @bids.like(params[:name]) if params[:name].present?
@bid_count = @bids.count
@bid_pages = Paginator.new @bid_count, @limit, params['page']
@offset ||= @bid_pages.reverse_offset
#@bids = @bids.offset(@offset).limit(@limit).all.reverse
unless @offset == 0
@bids = @bids.offset(@offset).limit(@limit).all.reverse
else
limit = @bid_count % @limit
@bids = @bids.offset(@offset).limit(limit).all.reverse
end
render :layout => 'base_courses'
end
def new_homework
if User.current.logged? && (User.current.admin? || (!Member.where('user_id = ? and project_id = ?', User.current.id, @project.id).first.nil? && (Member.where('user_id = ? and project_id = ?', User.current.id, @project.id).first.roles&Role.where('id = ? or id = ?', 3, 7)).size >0))
@homework = Bid.new
@homework.safe_attributes = params[:bid]
render :layout => 'base_courses'
else
render_404
end
end
#Ended by young
def feedback
@jours = @project.journals_for_messages.reverse
@limit = 10
@ -269,18 +328,36 @@ class ProjectsController < ApplicationController
end
def new
@course_tag = params[:course]
@issue_custom_fields = IssueCustomField.sorted.all
@trackers = Tracker.sorted.all
@project = Project.new
@project.safe_attributes = params[:project]
##add by huang
@course=Course.new
@course.safe_attributes = params[:course]
##end
render :layout => 'base'
end
def create
@course_tag = params[:project][:project_type]
if(@course_tag=="1")
@course = Course.new
@course.extra='course' + DateTime.parse(Time.now.to_s).strftime('%Y-%m-%d_%H-%M-%S').to_s
@course.safe_attributes = params[:project][:course]
@course.tea_id = User.current.id
@course.save
# project = ProjectInfo.create(:user_id => User.current.id, :project_id => @project.id)
# project_status = ProjectStatus.create(:project_id => @project.id)
end
@issue_custom_fields = IssueCustomField.sorted.all
@trackers = Tracker.sorted.all
@project = Project.new
@project.safe_attributes = params[:project]
if @course_tag == '1'
@project.identifier = @course.extra
end
if validate_parent_id && @project.save
@project.set_allowed_parent!(params[:project]['parent_id']) if params[:project].has_key?('parent_id')
@ -289,7 +366,7 @@ class ProjectsController < ApplicationController
r = Role.givable.find_by_id(Setting.new_project_user_role_id.to_i) || Role.givable.first
m = Member.new(:user => User.current, :roles => [r])
project = ProjectInfo.new(:user_id => User.current.id, :project_id => @project.id)
if params[:project][:is_public] == 1
if params[:project][:is_public] == '1' || @course_tag=="1"
project_status = ProjectStatus.create(:project_id => @project.id, :watchers_count => 0, :changesets_count => 0)
end
@project.members << m
@ -300,7 +377,12 @@ class ProjectsController < ApplicationController
flash[:notice] = l(:notice_successful_create)
if params[:continue]
attrs = {:parent_id => @project.parent_id}.reject {|k,v| v.nil?}
redirect_to new_project_path(attrs)
redirect_to new_project_path(attrs, :course => '0')
#Added by young
elsif params[:course_continue]
redirect_to new_project_path(:course => '1')
#Ended by young
else
redirect_to settings_project_path(@project)
end
@ -358,7 +440,6 @@ class ProjectsController < ApplicationController
@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)
@total_issues_by_tracker = Issue.visible.where(cond).count(:group => :tracker)
@ -378,7 +459,9 @@ class ProjectsController < ApplicationController
"show_issues" => true,
"show_files" => true,
"show_documents" => true,
"show_messages" => true
"show_messages" => true,
"show_news" => true,
"show_bids" => true
}
@date_to ||= Date.today + 1
@date_from = @date_to - @days
@ -415,8 +498,9 @@ class ProjectsController < ApplicationController
end
@document = @project.documents.build
#
@base_courses_tag = @project.project_type
respond_to do |format|
format.html
format.html{render :layout => 'base_courses' if @base_courses_tag==1}
format.api
end
end
@ -427,6 +511,16 @@ class ProjectsController < ApplicationController
@member ||= @project.members.new
@trackers = Tracker.sorted.all
@wiki ||= @project.wiki
#Added by young
# @course_tag = params[:course]
# if @course_tag == '1'
if @project.project_type == 1
@course = Course.find_by_extra(@project.identifier)
render :layout => 'base_courses'
else
render :layout => 'base_projects'
end
#Ended by young
end
def edit
@ -434,9 +528,27 @@ class ProjectsController < ApplicationController
#by young
def member
if @project.project_type == 1
render :layout => 'base_courses'
end
end
# def news
# if @project.project_type == 1
# render :layout => 'base_courses'
# end
# end
def file
# if @project.project_type == 1
# render :layout => 'base_courses'
# end
# @course_tag = params[:course]
# if @course_tag == '1'
# render :layout => 'base_courses'
# end
# User.current
end
def statistics
@ -447,6 +559,10 @@ class ProjectsController < ApplicationController
def update
@project.safe_attributes = params[:project]
if validate_parent_id && @project.save
@course = Course.find_by_extra(@project.identifier)
@course.state = params[:project][:course][:state]
@course.term = params[:project][:course][:term]
@course.save
@project.set_allowed_parent!(params[:project]['parent_id']) if params[:project].has_key?('parent_id')
if params[:project][:is_public] == '0'
@ -459,7 +575,7 @@ class ProjectsController < ApplicationController
respond_to do |format|
format.html {
flash[:notice] = l(:notice_successful_update)
redirect_to settings_project_path(@project)
redirect_to settings_project_path(@project,:course => @project.project_type)
}
format.api { render_api_ok }
end

View File

@ -43,15 +43,26 @@ class RepositoriesController < ApplicationController
@repository = Repository.factory(scm)
@repository.is_default = @project.repository.nil?
@repository.project = @project
render :layout => 'base_projects'
@course_tag = params[:course]
if @course_tag == 1
render :layout => 'base_courses'
else
render :layout => 'base_projects'
end
end
def newrepo
scm = params[:repository_scm] || (Redmine::Scm::Base.all & Setting.enabled_scm).first
@repository = Repository.factory(scm)
@repository.is_default = @project.repository.nil?
@repository.project = @project
render :layout => 'base_projects'
@course_tag = params[:course]
if @course_tag == 1
render :layout => 'base_courses'
else
render :layout => 'base_projects'
end
end
def fork
@ -209,7 +220,12 @@ class RepositoriesController < ApplicationController
@changesets = @repository.latest_changesets(@path, @rev)
@properties = @repository.properties(@path, @rev)
@repositories = @project.repositories
render :action => 'show', :layout => 'base_projects'
@course_tag = params[:course]
if @course_tag == 1
render :action => 'show', :layout => 'base_courses'
else
render :action => 'show', :layout => 'base_projects'
end
end
end
@ -369,6 +385,8 @@ class RepositoriesController < ApplicationController
end
def stats
@project_id = params[:id]
@repository_id = @repository.identifier
render :layout => 'base_projects'
end

View File

@ -0,0 +1,5 @@
class TeachersController < ApplicationController
def show
end
end

View File

@ -17,21 +17,23 @@
class UsersController < ApplicationController
layout 'base_users'
#Added by young
menu_item :activity
menu_item :activity
menu_item :user_information, :only => :info
menu_item :user_project, :only => :user_projects
menu_item :requirement_focus, :only => :watch_bids
menu_item :user_newfeedback, :only => :user_newfeedback
menu_item :user_course, :only => :user_courses
#Ended by young
before_filter :require_admin, :except => [:show, :index, :search, :tag_save, :user_projects, :user_newfeedback, :user_comments, :watch_bids, :info, :user_watchlist, :user_fanslist,:edit,:update]
before_filter :find_user, :only => [:user_fanslist, :user_watchlist, :show, :edit, :update, :destroy, :edit_membership,
before_filter :require_admin, :except => [:show, :index, :search, :tag_save, :user_projects, :user_newfeedback, :user_comments, :watch_bids, :info, :user_watchlist, :user_fanslist,:update, :user_courses]
#edit has been deleted by huang, 2013-9-23
before_filter :find_user, :only => [:user_fanslist, :user_watchlist, :show, :edit, :update, :destroy, :edit_membership, :user_courses,
:destroy_membership, :user_activities, :user_projects, :user_newfeedback, :user_comments, :watch_bids, :info]
accept_api_auth :index, :show, :create, :update, :destroy,:tag_save
#william
before_filter :require_login,:only => :tag_save
before_filter :require_login, :only => :tag_save
helper :sort
@ -117,6 +119,68 @@ class UsersController < ApplicationController
end
end
# end
# added by fq
def user_courses
case params[:type]
when "2"
@membership = @user.memberships.all(:conditions => Project.visible_condition(User.current))
@memberships = []
@membership.each do |membership|
if membership.project.project_type == 1
@membership << membership
end
end
@state = 2
when "1"
@membership = @user.memberships.all(:conditions => Project.visible_condition(User.current))
@memberships = []
@membership.each do |membership|
if membership.project.project_type == 1
@memberships << membership
end
end
@bid = []
@memberships.each do |membership|
@bid += membership.project.homeworks
end
@bid = @bid.group_by {|bid| bid.courses.first.id}
@state = 1
else
@membership = @user.memberships.all(:conditions => Project.visible_condition(User.current))
@memberships = []
@membership.each do |membership|
if membership.project.project_type == 1
@memberships << membership
end
end
@state = 0
end
# events = Redmine::Activity::Fetcher.new(User.current, :author => @user).events(nil, nil, :limit => 20)
# @events_by_day = events.group_by(&:event_date)
# @state = 0
#add by huang
unless User.current.admin?
if !@user.active? #|| (@user != User.current && @memberships.empty? && events.empty?)
render_404
return
end
end
#end
# respond_to do |format|
# format.html
# format.api
# end
end
# end
# modified by fq
def user_newfeedback

View File

@ -23,6 +23,41 @@ class WatchersController < ApplicationController
def unwatch
set_watcher(@watchables, User.current, false)
end
def join
if User.current.logged?
course = Project.find(params[:object_id])
if params[:course_password] == '123'
members = []
members << Member.new(:role_ids => [5], :user_id => User.current.id)
course.members << members
StudentsForCourse.create(:student_id => User.current.id, :course_id => params[:object_id])
else
end
end
respond_to do |format|
# format.html { redirect_to_referer_or {render :text => (watching ? 'Watcher added.' : 'Watcher removed.'), :layout => true}}
format.js { render :partial => 'set_join', :locals => {:user => User.current, :course => Project.find(params[:object_id])} }
end
end
def unjoin
if User.current.logged?
@member = Member.where('project_id = ? and user_id = ?', params[:object_id], User.current.id)
@member.first.destroy
joined = StudentsForCourse.where('student_id = ? and course_id = ?', User.current.id, params[:object_id])
joined.each do |join|
join.delete
end
end
respond_to do |format|
# format.html { redirect_to_referer_or {render :text => (watching ? 'Watcher added.' : 'Watcher removed.'), :layout => true}}
format.js { render :partial => 'set_join', :locals => {:user => User.current, :course => Project.find(params[:object_id])} }
end
end
before_filter :find_project, :authorize, :only => [:new, :create, :append, :destroy, :autocomplete_for_user]
accept_api_auth :create, :destroy

View File

@ -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)
@ -966,7 +977,7 @@ module ApplicationHelper
end
def lang_options_for_select(blank=true)
(blank ? [["(auto)", ""]] : []) + languages_options
{ 'Chinese简体中文 '=> 'zh', :English => :en}
end
def label_tag_for(name, option_tags = nil, options = {})

View File

@ -31,6 +31,15 @@ module AttachmentsHelper
:locals => {:attachments => container.attachments, :options => options, :thumbnails => (options[:thumbnails] && Setting.thumbnails_enabled?)}
end
end
def attach_delete(project)
if User.current.logged? && (User.current.admin? || (!Member.where('user_id = ? and project_id = ?', User.current.id, project.bid.courses.first.id).first.nil? && (Member.where('user_id = ? and project_id = ?', User.current.id, project.bid.courses.first.id).first.roles&Role.where('id = ? or id = ?', 3, 7)).size >0) || project.user_id == User.current.id)
true
else
false
end
end
def render_api_attachment(attachment, api)
api.attachment do

View File

@ -35,6 +35,7 @@ module ProjectsHelper
{:name => 'activities', :action => :manage_project_activities, :partial => 'projects/settings/activities', :label => :enumeration_activities}
]
tabs.select {|tab| User.current.allowed_to?(tab[:action], @project)}
end
def sort_project(state)
@ -60,6 +61,20 @@ module ProjectsHelper
end
#Added by young
def course_settings_tabs
tabs = [{:name => 'info', :action => :edit_project, :partial => 'projects/edit', :label => :label_information_plural, :course=>'1'},
{:name => 'boards', :action => :manage_boards, :partial => 'projects/settings/boards', :label => :label_board_plural},
# {:name => 'repositories', :action => :manage_repository, :partial => 'projects/settings/repositories', :label => :label_repository_plural},
{:name => 'members', :action => :manage_members, :partial => 'projects/settings/members', :label => :label_member_plural}
]
tabs.select {|tab| User.current.allowed_to?(tab[:action], @project)}
end
#Ended by young
def parent_project_select_tag(project)
selected = project.parent
@ -78,7 +93,13 @@ module ProjectsHelper
# Renders the projects index
def render_project_hierarchy(projects)
render_project_nested_lists(projects) do |project|
s = link_to_project(project, {}, :class => "#{project.css_classes} #{User.current.member_of?(project) ? 'my-project' : nil}")
#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}")+"<span style='color:#F00;'>(#{l(:label_course)})</span>".html_safe
else
s = link_to_project(project, {}, :class => "#{project.css_classes} #{User.current.member_of?(project) ? 'my-project' : nil}")
end
#Ended by young
if project.description.present?
#Delete by nie.
# s << content_tag('td', textilizable(project.short_description, :project => project), :class => 'wiki description')
@ -111,5 +132,18 @@ module ProjectsHelper
def get_projects_by_tag(tag_name)
Project.tagged_with(tag_name).order('updated_on desc')
end
# added by fq
def homework_type_option
type = []
option1 = []
option2 = []
option1 << '作业最终以附件形式提交'
option1 << 1
option2 << '作业最终以项目形式提交'
option2 << 2
type << option1
type << option2
end
end

View File

@ -0,0 +1,2 @@
module TeachersHelper
end

View File

@ -90,6 +90,26 @@ module UsersHelper
end
content_tag('div', content, :class => "pagination")
end
def user_course(state)
content = ''.html_safe
case state
when 0
s = content_tag('span', '我的课程', :class => "current-page")
content << content_tag('li', s)
content << content_tag('li', link_to('我的作业', {:controller => 'users', :action => 'user_courses', :type => 1}))
when 1
s = content_tag('span', '我的作业', :class => "current-page")
content << content_tag('li', link_to('我的课程', {:controller => 'users', :action => 'user_courses'}))
content << content_tag('li', s, :class => "current-page")
when 2
s = content_tag('span', '课程通知', :class => "current-page")
content << content_tag('li', link_to('课程通知', {:controller => 'users', :action => 'user_courses'}))
content << content_tag('li', s, :class => "current-page")
end
content_tag('div', content, :class => "pagination")
end
# added by huang
def sort_user(state)

View File

@ -45,6 +45,21 @@ module WatchersHelper
link_to text, url, :remote => true, :method => method, :class => css
end
# added by fq
def join_in_course(course, user)
return '' unless user && user.logged?
joined = user.member_of?(course)
text = joined ? '退出课程' : '加入课程'
url_t = join_path(:object_id => course.id)
url_f = try_join_path(:object_id => course.id)
method = joined ? 'delete' : 'post'
if joined
link_to text, url_t, :remote => true, :method => method, :id => 'join', :confirm => l(:text_are_you_sure)
else
link_to text, url_f, :remote => true, :method => method, :id => 'join'
end
end
# Returns the css class used to identify watch links for a given +object+
def watcher_css(objects)

View File

@ -1,20 +1,26 @@
####by fq
class Bid < ActiveRecord::Base
#attr_accessible :author_id, :budget, :deadline, :name, :description
attr_accessible :author_id, :budget, :deadline, :name, :description, :homework_type
include Redmine::SafeAttributes
belongs_to :author, :class_name => 'User', :foreign_key => :author_id
belongs_to :course
has_many :biding_projects, :dependent => :destroy
has_many :projects, :through => :biding_projects
has_many :journals_for_messages, :as => :jour, :dependent => :destroy
has_many :acts, :class_name => 'Activity', :as => :act, :dependent => :destroy
has_many :homework_for_courses, :dependent => :destroy
has_many :courses, :through => :homework_for_courses, :source => :project
has_many :homeworks, :class_name => 'HomeworkAttach', :dependent => :destroy
acts_as_attachable
NAME_LENGTH_LIMIT = 60
DESCRIPTION_LENGTH_LIMIT = 250
validates_length_of :name, :maximum => NAME_LENGTH_LIMIT
validates_length_of :description, :maximum => DESCRIPTION_LENGTH_LIMIT
validates_presence_of :author_id, :name, :deadline, :budget
validates_presence_of :author_id, :name, :deadline
# validates_presence_of :deadline, :message => 'test'
# validates_format_of :deadline, :with =>
validates_format_of :deadline, :with => /^[\d]{4}[-][\d]{1,2}[-][\d]{1,2}$/
@ -46,7 +52,7 @@ class Bid < ActiveRecord::Base
:author => :author,
:url => Proc.new {|o| {:controller => 'bids', :action => 'show', :id => o.id}}
acts_as_activity_provider :find_options => {:include => [:author]},
acts_as_activity_provider :find_options => {:include => [:projects, :author]},
:author_key => :author_id
@ -54,6 +60,10 @@ class Bid < ActiveRecord::Base
'description',
'budget',
'deadline'
# safe_attributes 'name',
# 'description',
# 'deadline'
def add_jour(user, notes, reference_user_id = 0)
self.journals_for_messages << JournalsForMessage.new(:user_id => user.id, :notes => notes, :reply_id => reference_user_id)

20
app/models/course.rb Normal file
View File

@ -0,0 +1,20 @@
class Course < ActiveRecord::Base
include Redmine::SafeAttributes
attr_accessible :code, :extra, :name, :state, :tea_id, :time , :location, :state, :term
belongs_to :project, :class_name => 'Project', :foreign_key => :extra # 定义一个project方法 该方法通过extra来调用project表
belongs_to :teacher, :class_name => 'User', :foreign_key => :tea_id # 定义一个方法teacher该方法通过tea_id来调用User表
has_many :bid
validates_presence_of :state, :term
safe_attributes 'extra',
'time',
'name',
'extra',
'code',
'location',
'tea_id',
'state',
'term'
end

View File

@ -0,0 +1,9 @@
class HomeworkAttach < ActiveRecord::Base
attr_accessible :bid_id, :user_id
belongs_to :user
belongs_to :bid
acts_as_attachable
end

View File

@ -0,0 +1,8 @@
class HomeworkForCourse < ActiveRecord::Base
attr_accessible :bid_id, :project_id
belongs_to :bid
belongs_to :project
end

View File

@ -0,0 +1,7 @@
# Added by young
class JournalsForMessageObserver < ActiveRecord::Observer
def after_create(journal_for_message)
Mailer.journals_for_message_add(User.current, journal_for_message).deliver
end
end

View File

@ -26,6 +26,15 @@ class Mailer < ActionMailer::Base
def self.default_url_options
{ :host => Setting.host_name, :protocol => Setting.protocol }
end
# Builds a Mail::Message object used to email recipients of the added journals for message.
#
# def journals_for_message_add(user, journals_for_message)
# @user = User.current
# @url = url_for(:controller => 'users', :action => 'user_newfeedback')
# mail :to => user.mail,
# :subject => "hello"
# end
# Builds a Mail::Message object used to email recipients of the added issue.
#

View File

@ -53,13 +53,27 @@ class Project < ActiveRecord::Base
has_many :changesets, :through => :repository
# added by fq
has_many :journals_for_messages, :as => :jour, :dependent => :destroy
has_many :homework_for_courses, :dependent => :destroy
has_many :homeworks, :through => :homework_for_courses, :source => :bid, :dependent => :destroy
has_many :students_for_courses, :dependent => :destroy
has_many :student, :through => :students_for_courses, :source => :user
# has_one :cour, :class_name => 'Course', :foreign_key => :extra, :dependent => :destroy
# end
#ADDED BY NIE
has_many :project_infos, :dependent => :destroy
has_many :project_infos, :dependent => :destroy
has_one :project_status, :class_name => "ProjectStatus", :dependent => :destroy
has_one :project_status, :class_name => "ProjectStatus", :dependent => :destroy
has_one :project_status, :class_name => "ProjectStatus", :dependent => :destroy
has_one :project_status, :class_name => "ProjectStatus", :dependent => :destroy
#end
has_one :wiki, :dependent => :destroy
# Custom field for the project issues
##added by xianbo
has_one :course, :dependent => :destroy ,:order => "#{Version.table_name}.effective_date DESC, #{Version.table_name}.name DESC"
accepts_nested_attributes_for :course
##end
# Custom field for the project issues
has_and_belongs_to_many :issue_custom_fields,
:class_name => 'IssueCustomField',
:order => "#{CustomField.table_name}.position",
@ -682,7 +696,10 @@ class Project < ActiveRecord::Base
'custom_field_values',
'custom_fields',
'tracker_ids',
'issue_custom_field_ids'
'issue_custom_field_ids',
'project_type'
safe_attributes 'enabled_module_names',
:if => lambda {|project, user| project.new_record? || user.allowed_to?(:select_project_modules, project) }
@ -1027,6 +1044,10 @@ class Project < ActiveRecord::Base
def update_position_under_parent
set_or_update_position_under(parent)
end
def course
@course
end
# Inserts/moves the project so that target's children or root projects stay alphabetically sorted
def set_or_update_position_under(target_parent)

View File

@ -0,0 +1,10 @@
class StudentsForCourse < ActiveRecord::Base
attr_accessible :course_id, :student_id
belongs_to :course, :class_name => 'Project', :foreign_key => :course_id
belongs_to :student, :class_name => 'User', :foreign_key => :student_id
validates_presence_of :course_id, :student_id
validates_uniqueness_of :student_id, :scope => :course_id
end

13
app/models/teacher.rb Normal file
View File

@ -0,0 +1,13 @@
class Teacher < ActiveRecord::Base
attr_accessible :course_code, :couurse_time, :location, :tea_name
include Redmine::SafeAttributes
belongs_to :project
safe_attributes'tea_name',
'location',
'couurse_time',
'course_code',
'extra'
end

View File

@ -82,8 +82,13 @@ class User < Principal
has_many :bids, :foreign_key => 'author_id', :dependent => :destroy
has_many :journals_for_messages, :as => :jour, :dependent => :destroy
has_many :new_jours, :as => :jour, :class_name => 'JournalsForMessage', :conditions => "status=1"
has_many :journal_replies
has_many :activities
has_many :journal_replies, :dependent => :destroy
has_many :activities, :dependent => :destroy
has_many :students_for_courses, :dependent => :destroy
has_many :courses, :through => :students_for_courses, :source => :project
has_many :acts, :class_name => 'Activity', :as => :act, :dependent => :destroy
has_many :acts, :class_name => 'Activity', :as => :act, :dependent => :destroy
has_many :acts, :class_name => 'Activity', :as => :act, :dependent => :destroy
has_many :acts, :class_name => 'Activity', :as => :act, :dependent => :destroy
#####
@ -150,13 +155,27 @@ class User < Principal
self.journals_for_messages << JournalsForMessage.new(:user_id => user.id, :notes => notes, :reply_id => reference_user_id, :status => true)
end
### fq
def join_in?(course)
joined = StudentsForCourse.where('student_id = ? and course_id = ?', self.id, course.id)
if joined.size > 0
true
else
false
end
end
## end
def count_new_jour
count = self.new_jours.count
end
def set_mail_notification
##add byxianbo
thread=Thread.new do
self.mail_notification = Setting.default_notification_option if self.mail_notification.blank?
true
end
end
def update_hashed_password

View File

@ -187,48 +187,6 @@
}
</script>
<!-- added by bai 增加职称-->
<script type="text/javascript" language="javascript">
function showtechnical_title(identity, technical_titleField) {
switch (identity) {
case '0' :
$('#technical_title').show()
$('#no').hide()
var technical_titleOptions = new Array(
"教授","副教授","讲师","助教");
break;
case '1' :
$('#technical_title').hide()
$('#no').show()
var titleOptions = new Array("");
break;
default:
$('#technical_title').hide()
$('#no').hide()
var titleOptions = new Array("");
break;
}
technical_titleField.options.length = 0;
for(var i = 0; i < technical_titleOptions.length; i++) {
technical_titleField.options[i]=new Option(technical_titleOptions[i],technical_titleOptions[i]);
/*
if (cityField.options[i].value==city)
{
//alert("here put City ok!");
document.oblogform["city"].selectedIndex = i;
}*/
}
}
</script>
<!-- end -->
<h3><%=l(:label_register)%> <%=link_to l(:label_login_with_open_id_option), signin_url if Setting.openid? %></h3>
@ -253,29 +211,14 @@
<em class="info"><%="#{l(:label_mail_attention)} "%></em></p>
<p><%= f.select :language, lang_options_for_select %></p>
<!-- added by bai 增加了身份、性别、地区和教师的职称-->
<!-- added by bai 增加了身份、性别和地区-->
<p><table><tr><td class="info" align="right" style="width: 90px"><strong><%= l(:label_identity) %><span class="required"> *</span></strong></td>
<td class="info" style="width: 10px">
<select onchange="showtechnical_title(this.value, document.getElementById(&#39;userTechnical_title&#39;));" name="identity" id="userProvince">
<option value="">--请选择身份--</option>
<option value="0">教师</option>
<option value="1">学生</option>
<option value="2">企业</option>
<option value="3">开发者</option>
</select></td>
<td class="info" style="width: 100px">
<span id = 'technical_title' style = 'display:none'>
<select name="technical_title" id="userTechnical_title"></select></span>
<span id = 'no' style = 'display:none'>
<input name="no" id="no" placeholder="请输入学号"></select></span>
</td></tr></table></p>
<!-- end -->
<%= select_tag 'identity', "<option value = '0'>#{l(:label_teacher)}</option>
<option value = '1'>#{l(:label_student)}</option>
<option value = '2'>#{l(:label_other)}</option>".html_safe %></td></tr></table></p>
<p><table><tr><td class="info" align="right" style="width: 90px"><strong><%= l(:label_gender) %></strong></td>
@ -283,7 +226,7 @@
<%= select_tag 'gender', "<option value = '0'>#{l(:label_gender_male)}</option>
<option value = '1'>#{l(:label_gender_female)}</option>".html_safe %></td></tr></table></p>
<p><table><tr><td class="info" align="right" style="width: 90px"><strong><%= l(:label_location) %></strong></td>
<p><table><tr><td class="info" align="right" style="width: 90px"><strong><%= l(:label_location) %><span class="required"> *</span></strong></td>
<td class="info" style="width: 80px">
<select onchange="showcity(this.value, document.getElementById(&#39;userCity&#39;));" name="province" id="userProvince">
<option value="">--请选择省份--</option>
@ -328,11 +271,9 @@
<!-- end -->
</div>
<p><table><tr><td><%= submit_tag l(:button_submit) %></td></tr></table></p>
<% end %>
<% if Setting.openid? %>
<p><%= f.text_field :identity_url %></p>
<% end %>

View File

@ -9,11 +9,19 @@
<%= h(" - #{attachment.description}") unless attachment.description.blank? %>
<span class="size">(<%= number_to_human_size attachment.filesize %>)</span>
<% if options[:deletable] %>
<% unless attachment.container_type == 'HomeworkAttach' %>
<%= link_to image_tag('delete.png'), attachment_path(attachment),
:data => {:confirm => l(:text_are_you_sure)},
:method => :delete,
:class => 'delete',
:title => l(:button_delete) %>
<% else %>
<%= link_to image_tag('delete.png'), {:controller => 'attachments', :action => 'delete_homework', :id => attachment.id},
:data => {:confirm => l(:text_are_you_sure)},
:method => :delete,
:class => 'delete',
:title => l(:button_delete) %>
<% end %>
<% end %>
<% if options[:author] %>
<span class="author"><%= h(attachment.author) %>, <%= format_time(attachment.created_on) %></span>

View File

@ -0,0 +1 @@
$('#attachments_<%= j params[:attachment_id] %>').remove();

View File

@ -0,0 +1,46 @@
<!-- huang -->
<% bids.each do |bid|%>
<table width="95%" border="0" style="padding-left: 10px; padding-top: 10px;">
<tr>
<td colspan="2" valign="top" width="50" ><%= link_to(image_tag(url_to_avatar(bid.author), :class => 'avatar'), user_path(bid.author), :class => "avatar") %></td>
<td>
<table width="100%" border="0">
<tr>
<td colspan="2" valign="top"><strong><%= link_to(bid.author.lastname+bid.author.firstname, user_path(bid.author), :class => 'bid_user') %>: &nbsp;<%= link_to(bid.name, respond_path(bid), :class => 'bid_path') %></strong></td>
</tr>
<tr>
<td width="500">
<table border="0">
<tr>
<td> <% if bid.reward_type.nil? or bid.reward_type == 1 %> <strong><%= l(:label_bids_reward_method) %><span style="color: #ed8924;font-family: 14px; font-family: 微软雅黑"><%= l(:label_call_bonus) %>&nbsp;<%= l(:label_RMB_sign) %>
<%= bid.budget%></span></strong> <% elsif bid.reward_type == 2 %> <strong><%= l(:label_bids_reward_method) %><span style="color: #15bccf;font-family: 14px; font-family: 微软雅黑"><%= bid.budget%></span></strong> <% else %>
<!-- <strong><%= l(:label_bids_reward_method) %><span style="color: #00aa83;font-family: 14px; font-family: 微软雅黑"><%= l(:label_bids_credit) %>&nbsp;<%= bid.budget%>&nbsp;<%= l(:label_bids_credit_number) %></span></strong> -->
<% end %> <!-- <td style="color: rgb(255, 0, 0);"><strong><%= l(:label_price) %><%= l(:label_RMB_sign) %><%= bid.budget%></strong></td> --></td>
</tr>
<tr>
<td><span class="font_lighter"><%= l(:label_x_homework_project, :count => bid.biding_projects.count) %>(<strong><%= link_to bid.biding_projects.count, project_for_bid_path(bid.id) %></strong>)</span><span class="font_lighter"><%= l(:label_x_responses, :count => bid.commit) %>(<strong><%= link_to bid.commit, respond_path(bid) %></strong>)</span></td>
</tr>
</table></td>
<td width="200" align="right" class="a"><span class="font_lighter"> <%= format_time bid.created_on %></span></td>
</tr>
<tr>
<td>
<div class="bid-description" style="border-left: 1px solid rgb(225, 225, 225); border-bottom: 1px solid rgb(225, 225, 225); padding-left: 20px; padding-bottom: 10px; margin-bottom: 20px;">
<table width="100%">
<tr>
<td> <%= bid.description%> </td>
</tr>
</table>
</div></td>
</tr>
</table></td>
</tr>
</table>
<% end %>
<div class="pagination">
<ul>
<%= pagination_links_full bid_pages %>
<ul>
</div>
<!--end-->

View File

@ -1,100 +1,41 @@
<!-- fq -->
<% bids.each do |bid|%>
<table width="95%" border="0" style="padding-left: 10px; padding-top: 10px;">
<tr>
<td colspan="2" valign="top" width="50" ><%= link_to(image_tag(url_to_avatar(bid.author), :class => 'avatar'), user_path(bid.author), :class => "avatar") %></td>
<td>
<table width="100%" border="0">
<tr>
<td colspan="2" valign="top"><strong><%= link_to(bid.author, user_path(bid.author), :class => 'bid_user') %>: &nbsp;<%= link_to(bid.name, respond_path(bid), :class => 'bid_path') %></strong></td>
</tr>
<tr>
<td width="500">
<table border="0">
<tr><td>
<% if bid.reward_type.nil? or bid.reward_type == 1%>
<strong><%= l(:label_bids_reward_method) %><span style="color: #ed8924;font-family: 14px; font-family: 微软雅黑"><%= l(:label_call_bonus) %>&nbsp;<%= l(:label_RMB_sign) %><%= bid.budget%></span></strong>
<% elsif bid.reward_type == 2%>
<strong><%= l(:label_bids_reward_method) %><span style="color: #15bccf;font-family: 14px; font-family: 微软雅黑"><%= bid.budget%></span></strong>
<% else %>
<strong><%= l(:label_bids_reward_method) %><span style="color: #00aa83;font-family: 14px; font-family: 微软雅黑"><%= l(:label_bids_credit) %>&nbsp;<%= bid.budget%>&nbsp;<%= l(:label_bids_credit_number) %></span></strong>
<% end %>
<!-- <td style="color: rgb(255, 0, 0);"><strong><%= l(:label_price) %><%= l(:label_RMB_sign) %><%= bid.budget%></strong></td> -->
</td>
</tr>
<tr><td>
<span class="font_lighter"><%= l(:label_x_biding_project, :count => bid.biding_projects.count) %>(<strong><%=link_to bid.biding_projects.count, project_for_bid_path(bid) %></strong>)</span>
<span class="font_lighter"><%= l(:label_x_responses, :count => bid.commit) %>(<strong><%=link_to bid.commit, respond_path(bid) %></strong>)</span>
<span class="font_lighter"><%= l(:label_x_followers, :count => bid.watcher_users.count) %>(<strong><%=link_to bid.watcher_users.count, respond_path(bid) %></strong>)</span>
</td>
</tr>
</table></td>
<td width="200" align="right" class="a"><span class="font_lighter"> <%= format_time bid.created_on %></span></td>
</tr>
<tr>
<td>
<div class="bid-description" style="border-left: 1px solid rgb(225, 225, 225); border-bottom: 1px solid rgb(225, 225, 225); padding-left: 20px; padding-bottom: 10px; margin-bottom: 20px;">
<table width="100%">
<tr>
<td> <%= bid.description%> </td>
</tr>
</table>
</div></td>
</tr>
</table></td>
</tr>
</table>
<% end %>
<div class="pagination">
<ul>
<%= pagination_links_full bid_pages %>
<ul>
</div>
<!--new-->
<!-- <% bids.each do |bid|%>
<table width="98%" border="0" style="padding-left: 20px; padding-top: 10px;">
<tr>
<td valign="top" width="50px"><%= link_to(image_tag(url_to_avatar(bid.author), :class => 'avatar'), user_path(bid.author), :class => "avatar") %></td>
<td colspan="2" valign="top" width="50" ><%= link_to(image_tag(url_to_avatar(bid.author), :class => 'avatar'), user_path(bid.author), :class => "avatar") %></td>
<td>
<table width="100%" border="0" class="font_description">
<table width="100%" border="0">
<tr>
<td><strong><%= link_to(bid.author, user_path(bid.author)) %></strong>
<spanclass="font_lighter">
<%= l(:label_bid_publish) %></span> <strong><%= link_to(bid.name, respond_path(bid), :class => 'bid_path') %></strong>
</td>
<td colspan="2" valign="top"><strong><%= link_to(bid.author, user_path(bid.author), :class => 'bid_user') %>: &nbsp;<%= link_to(bid.name, respond_path(bid), :class => 'bid_path') %></strong></td>
</tr>
<tr>
<% if bid.reward_type.nil? or bid.reward_type == 1%>
<td><strong><%= l(:label_bids_reward_method) %><span style="color: rgb(255, 0, 0);font-family: 14px; font-family: 微软雅黑"><%= l(:label_call_bonus) %>&nbsp;<%= bid.budget%><%= l(:label_RMB_sign) %></span></strong></td>
<% elsif bid.reward_type == 2%>
<td><strong><%= l(:label_bids_reward_method) %><span style="color: #15bccf;font-family: 14px; font-family: 微软雅黑"><%= bid.budget%></span></strong></td>
<% else %>
<td><strong><%= l(:label_bids_reward_method) %><span style="color: #ed8924;font-family: 14px; font-family: 微软雅黑">学分&nbsp;<%= bid.budget%>分</span></strong></td>
<% end %>
<td width="500">
<table border="0">
<tr>
<td> <% if bid.reward_type.nil? or bid.reward_type == 1%> <strong><%= l(:label_bids_reward_method) %><span style="color: #ed8924;font-family: 14px; font-family: 微软雅黑"><%= l(:label_call_bonus) %>&nbsp;<%= l(:label_RMB_sign) %><%= bid.budget%></span></strong> <% elsif bid.reward_type == 2%> <strong><%= l(:label_bids_reward_method) %><span style="color: #15bccf;font-family: 14px; font-family: 微软雅黑"><%= bid.budget%></span></strong> <% else %> <!-- <strong><%= l(:label_bids_reward_method) %><span style="color: #00aa83;font-family: 14px; font-family: 微软雅黑"><%= l(:label_bids_credit) %>&nbsp;<%= bid.budget%>&nbsp;<%= l(:label_bids_credit_number) %></span></strong> --> <% end %> <!-- <td style="color: rgb(255, 0, 0);"><strong><%= l(:label_price) %><%= l(:label_RMB_sign) %><%= bid.budget%></strong></td> --></td>
</tr>
<% unless bid.reward_type == 3 %>
<tr>
<td><span class="font_lighter"><%= l(:label_x_biding_project, :count => bid.biding_projects.count) %>(<strong><%= link_to bid.biding_projects.count, project_for_bid_path(bid) %></strong>)</span><span class="font_lighter"><%= l(:label_x_bids_responses, :count => bid.commit) %>(<strong><%= link_to bid.commit, respond_path(bid) %></strong>)</span><span class="font_lighter"> <%= l(:label_x_followers, :count => bid.watcher_users.count) %>(<strong><%= link_to bid.watcher_users.count, respond_path(bid) %></strong>)</span></td>
</tr>
<% else %>
<tr>
<td><span class="font_lighter"><%= l(:label_x_homework_project, :count => bid.biding_projects.count) %>(<strong><%= link_to bid.biding_projects.count, project_for_bid_path(bid) %></strong>) </span><span class="font_lighter"><%= l(:label_x_responses, :count => bid.commit) %>(<strong><%= link_to bid.commit, respond_path(bid) %></strong>)</span><span class="font_lighter"> <%= l(:label_x_followers, :count => bid.watcher_users.count) %>(<strong><%= link_to bid.watcher_users.count, respond_path(bid) %></strong>)</span></td>
</tr>
<% end %>
</table></td>
<td width="200" align="right" class="a"><span class="font_lighter"> <%= format_time bid.created_on %></span></td>
</tr>
<tr>
<td style="border-left: 1px solid rgb(225, 225, 225); border-bottom: 1px solid rgb(225, 225, 225); padding-left: 20px; padding-bottom: 20px; margin-bottom: 20px;"> <%= bid.description%> </td>
</tr>
</table></td>
<td width="200px" valign="bottom" style="padding-bottom: 5px">
<table>
<tr>
<td style="float: right"><span><%= l(:label_bid_project) %>(<%= link_to bid.biding_projects.count, project_for_bid_path(bid),:class=> "bids_user" %>)</span></td>
</tr>
<tr>
<td style="float: right"><span><%= l(:label_responses) %>(<%= link_to bid.commit, respond_path(bid),:class=> "bids_user" %>)</span></td>
</tr>
<tr>
<td style="float: right"><span><%= l(:label_followers) %>(<%= link_to bid.watcher_users.count, respond_path(bid),:class=> "bids_user" %>)</span></td>
</tr>
<tr>
<td><span style="float: right"><%= l(:field_deadline) %><span class="font_lighter" ><%= format_time bid.created_on %></span></span></td>
<td>
<div class="bid-description" style="border-left: 1px solid rgb(225, 225, 225); border-bottom: 1px solid rgb(225, 225, 225); padding-left: 20px; padding-bottom: 10px; margin-bottom: 20px;">
<table width="100%">
<tr>
<td> <%= bid.description%> </td>
</tr>
</table>
</div></td>
</tr>
</table></td>
</tr>
@ -104,4 +45,5 @@
<ul>
<%= pagination_links_full bid_pages %>
<ul>
</div> -->
</div>

View File

@ -26,7 +26,7 @@
<p><%= f.text_field :name, :required => true, :size => 60, :style => "width:490px;", :maxlength => Bid::NAME_LENGTH_LIMIT, :placeholder => "#{l(:label_requirement_name)}" %></p>
<p style="margin-left:-10px;padding-right: 20px;"><%= f.text_area :description, :rows => 8, :class => 'wiki-edit', :style => "font-size:small;width:490px;margin-left:10px;", :maxlength => Bid::DESCRIPTION_LENGTH_LIMIT, :placeholder => "#{l(:label_requirement_description)}" %></p>
<p><%= select_tag 'bid_reward_type', "<option value = '0'>#{l(:label_choose_reward)}</option><option value = '1'>#{l(:label_money)}</option><option value = '3'>#{l(:label_bids_credit)}</option><option value = '2'>#{l(:label_reward_1)}</option>".html_safe,
<p><%= select_tag 'bid_reward_type', "<option value = '0'>#{l(:label_choose_reward)}</option><option value = '1'>#{l(:label_money)}</option><option value = '2'>#{l(:label_reward_1)}</option>".html_safe,
:onChange => "show('bid_reward_type', 'bid_budget', '"+l(:label_bids_reward_what)+"','"+l(:label_bids_new_money)+"','"+l(:label_bids_new_credit)+"','"+l(:label_bids_new_content)+"')" %>
<%= f.text_field :budget, :required => true, :size => 60, :style => "width:350px;", :placeholder => l(:label_bids_reward_what) %>

View File

@ -5,9 +5,16 @@
when the manager closed it or to the deadline.
-->
<table width="660px" border="0" align="center">
<tr>
<td class="font_lighter" style="font-size: 15px;"><%=l(:label_user_response)%></td>
<table width="660px" border="0" align="center" style="padding-left: 26px">
<tr><td>
<!-- modified by huang -->
<% if @bid.reward_type ==3 %>
<td class="font_lighter" style="font-size: 15px;"><%=l(:label_student_response)%></td>
<% else %>
<td class="font_lighter" style="font-size: 15px;"><%=l(:label_user_response)%></td>
<% end %>
</td>
<!-- end -->
</tr></table>
@ -24,8 +31,13 @@
<td colspan="2" valign="top" width="50" ><%= link_to image_tag(url_to_avatar(journal.user), :class => "avatar"), user_path(journal.user), :class => "avatar" %></td>
<td><table width="580px" border="0">
<tr>
<td colspan="2" valign="top"><strong> <%=link_to journal.user, user_path(journal.user)%></strong> <span class="font_lighter"><%= l(:label_respond_requirement) %></span></td>
<% if @bid.reward_type == 3 %>
<td colspan="2" valign="top"><strong> <%=link_to journal.user, user_path(journal.user)%></strong> <span class="font_lighter"><%= l(:label_question_requirement) %></span></td>
<% else %>
<td colspan="2" valign="top"><strong> <%=link_to journal.user, user_path(journal.user)%></strong> <span class="font_lighter"><%= l(:label_respond_requirement) %></span></td>
<% end %>
</tr>
<tr>
<td colspan="2" width="580px" ><p class="font_description"><%= textilizable journal.notes%></p></td>
</tr>

View File

@ -0,0 +1,22 @@
<div id="put-bid-form" style="display: none">
<%= form_for "bid_for_save", :remote=>true, :url => {:controller => 'bids', :action => 'add_homework'},
:update => "bidding_project_list",
:complete => '$("#put-bid-form").hide();' do |f| %>
<fieldset><legend><%= l(:label_attachment_plural) %></legend>
<p><%= render :partial => 'attachments/form', :locals => {:container => @homework} %></p>
</fieldset>
<%= submit_tag l(:button_create) %>
<% end %>
</div>
<% 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) %>
<div class='icon icon-add'>
<%= toggle_link l(:button_bidding_homework), 'put-bid-form' %>
</div>
<% elsif @homework_list.empty? %>
<div class="font_lighter_sidebar" style="padding-left: 10px">暂无学生提交作业!</div>
<% end %>
<div id='bidding_project_list'>
<%= render :partial => 'homework_list', :locals => {:homework => @homework_list} %>
</div>

View File

@ -0,0 +1,30 @@
<!-- fq -->
<%= render_flash_messages %>
<% @homework_list.each do |homework|%>
<% if homework.attachments.any?%>
<table width="660px" border="0" align="center">
<tr>
<td colspan="2" valign="top" width="50" ><%= link_to image_tag(url_to_avatar(homework.user), :class => "avatar"), user_path(homework.user), :class => "avatar" %></td>
<td>
<table width="580px" border="0">
<tr>
<td colspan="2" valign="top"><strong> <%= link_to homework.user, user_path(homework.user)%></strong> <span class="font_lighter">提交了作业</span></td>
</tr>
<tr>
<td colspan="2" width="580px" >
<p class="font_description">
<% options = {:author => true, :deletable => attach_delete(homework)} %>
<%= render :partial => 'attachments/links',
:locals => {:attachments => homework.attachments, :options => options} %>
<% end %>
</p></td>
</tr>
</table></td>
</tr>
</table>
<div class="line_under"></div>
<% end %>

View File

@ -65,14 +65,18 @@
<% if User.current.logged? %>
<table border="0" width="525px" align="center" >
<tr>
<td><%= f.text_area 'message', :rows => 3, :cols => 65, :value => "#{l(:label_my_respond)}", :onfocus => "clearInfo('bid_message_message', '#{l(:label_my_respond)}')", :onblur => "showInfo('bid_message_message', '#{l(:label_my_respond)}')", :style => "resize: none;", :class => 'noline'%></td>
<% if @bid.reward_type ==3 %>
<td><%= f.text_area 'message', :rows => 3, :cols => 65, :placeholder => l(:label_my_question), :style => "resize: none;", :class => 'noline'%></td>
<% else %>
<td><%= f.text_area 'message', :rows => 3, :cols => 65, :placeholder => l(:label_my_respond), :style => "resize: none;", :class => 'noline'%></td>
<% end %>
</tr>
</table>
<%= f.text_field :reference_user_id, :style=>"display:none"%>
<table border="0" width="525px" align="center">
<tr>
<td align="right"> <%= submit_tag l(:button_leave_meassge), :name => nil , :class => "bid_btn", :onmouseout => "this.style.backgroundPosition = 'left top'", :onmouseover => "this.style.backgroundPosition = 'left -31px'"%>
<%= submit_tag l(:button_clear), :name => nil, :onclick => "clearMessage('bid_message_message');", :type => 'button', :class => "bid_btn", :onmouseout => "this.style.backgroundPosition = 'left top'", :onmouseover => "this.style.backgroundPosition = 'left -31px'" %> </td>
<%= submit_tag l(:button_clear_requirement), :name => nil, :onclick => "clearMessage('bid_message_message');", :type => 'button', :class => "bid_btn", :onmouseout => "this.style.backgroundPosition = 'left top'", :onmouseover => "this.style.backgroundPosition = 'left -31px'" %> </td>
</tr>
</table>
<% else %>

View File

@ -0,0 +1,51 @@
<!-- fq -->
<%= render_flash_messages %>
<table width="1000px" border="0" style="padding-left: 15px">
<td class="font_lighter" style="font-size: 15px;"><%= l(:label_bidding_project) %>(<%= @bidding_project.count%>)</td>
<% if User.current.logged? %>
<td>
<div class='icon icon-add'>
<%= toggle_link l(:button_bidding), 'put-bid-form' %>
</div></td>
<% end %>
</table>
<% @bidding_project.each do |b_project|%>
<table width="90%" border="0" align='center'>
<tr>
<td>
<table width="660px" border="0" align='center'>
<tr>
<td width="50px" valign="top" colspan="2" align="middle">
<div style="width: 50px; height: 50px;">
<%= link_to image_tag(url_to_avatar(b_project.project), :class => 'avatar3'), :class => "avatar" %>
</div></td>
<td width="60%" valign="top">
<table width="100%" valign="top">
<tr>
<td colspan="2" valign="top"><strong><%= link_to(b_project.project.name, project_path(b_project.project)) %></strong><a class="font_lighter"><%= l(:label_join_bidding)%></a></td>
</tr>
<tr></tr>
<tr>
<td valign="top"><%= b_project.project.description %></td>
</tr>
<tr>
<td valign="top"><a class="font_lighter"><%= b_project.created_at%></a></td>
</tr>
</table></td>
<td width="30%">
<div class="bid-user-message" style="border-left: 1px solid rgb(225, 225, 225); margin-left: 20px; padding-left: 20px;">
<table width="100%">
<tr>
<td><%= l(:label_bidding_user) %><%= link_to(b_project.user.name, user_path(b_project.user)) %></td>
</tr>
<tr>
<td style=" word-wrap: break-word; word-break: break-all"><%= l(:label_bidding_reason) %><%= b_project.description %></td>
</tr>
</table>
</div></td>
</tr>
</table></td>
</tr>
</table>
<% end %>

View File

@ -1,12 +1,68 @@
<!-- fq -->
<%= render_flash_messages %>
<!-- 当需求结束时 隐藏我要参加按钮 -->
<!-- 当需求结束时 隐藏我要参加按钮 -->
<% if @bid.deadline > Date.today %>
<table width="1000px" border="0" style="padding-left: 15px">
<td class="font_lighter" style="font-size: 18px;"><%= l(:label_bidding_project) %>(<%= @bidding_project.count%>)</td>
<td class="font_lighter" style="font-size: 15px;"><%= l(:label_homework_project) %>(<%= @bidding_project.count%>)</td>
<% if User.current.logged? %>
<td>
<% 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) %>
<div class='icon icon-add'>
<%= toggle_link l(:button_bidding_homework), 'put-bid-form' %>
</div>
<% end %>
</td>
<% end %>
</table>
<% @bidding_project.each do |b_project|%>
<table width="90%" border="0" align='center'>
<tr>
<td>
<table width="660px" border="0" align='center'>
<tr>
<td width="50px" valign="top" colspan="2" align="middle">
<div style="width: 50px; height: 50px;">
<%= link_to image_tag(url_to_avatar(b_project.project), :class => 'avatar3'), :class => "avatar" %>
</div></td>
<td width="60%" valign="top">
<table width="100%" valign="top">
<tr>
<td colspan="2" valign="top"><strong><%= link_to(b_project.project.name, project_path(b_project.project)) %></strong><a class="font_lighter"><%= l(:label_jion_bidding_homework)%></a></td>
</tr>
<tr></tr>
<tr>
<td valign="top"><%= b_project.project.description %></td>
</tr>
<tr>
<td valign="top"><a class="font_lighter"><%=format_time(b_project.created_at) %></a></td>
</tr>
</table></td>
<td width="30%">
<div class="bid-user-message" style="border-left: 1px solid rgb(225, 225, 225); margin-left: 20px; padding-left: 20px;">
<table width="100%">
<tr>
<td><%= l(:label_bidding_user_homework) %> : <%= link_to(b_project.user.name, user_path(b_project.user)) %></td>
</tr>
<tr>
<td style=" word-wrap: break-word; word-break: break-all"><%= l(:label_bidding_reason_homewrok) %> : <%= b_project.description %></td>
</tr>
</table>
</div></td>
</tr>
</table></td>
</tr>
</table>
<% end %>
<% else %>
<table width="1000px" border="0" style="padding-left: 15px">
<td class="font_lighter" style="font-size: 15px;"><%= l(:label_bidding_project) %>(<%= @bidding_project.count%>)</td>
<% if User.current.logged? %>
@ -29,6 +85,6 @@
<% end %>
<!-- 应标项目列表 -->
<!-- 应标项目列表 -->
<%= render :partial=> "list_projects",:locals => {:bidding_project => @bidding_project,:bid => @bid }%>

View File

@ -0,0 +1,4 @@
$('#bidding_project_list').html('<%= escape_javascript(render(:partial => 'homework_list', :locals => {:homework => @homework_list})) %>');
$("#project_id").val("请选择项目");
$("#bid_message").val("#{l(:label_bid_reason)} ");
$("#put-bid-form").hide();

View File

View File

@ -0,0 +1,4 @@
未交作业人数(
<% %>
已交作业人数

View File

@ -4,7 +4,7 @@
<td width="50" valign="top"><%= link_to image_tag(url_to_avatar(@bid.author), :class => "avatar"), user_path(@bid.author), :class => "avatar" %></td>
<td><table width="100%" border="0">
<tr>
<td><h3><%= link_to(@bid.author.name, user_path(@bid.author))%><%= @bid.name %></h3></td>
<td><h3><%= link_to(@bid.author.lastname+@bid.author.firstname, user_path(@bid.author))%><%= @bid.name %></h3></td>
<td>
<!-- 在这里添加赞和踩-->
<span id="praise_tread" style="float: right">
@ -13,6 +13,7 @@
</span>
</td>
</tr>
<tr>
<% if @bid.reward_type.nil? or @bid.reward_type == 1%>
@ -40,7 +41,13 @@
<tr>
<td></td>
</tr>
<tr><td style="font-size: 13px; color: rgb(0,0,0);"><%= @bid.description %></td></tr>
<tr><td style="font-size: 13px; color: rgb(0,0,0);"><%= @bid.description %>
<% if @bid.attachments.any?%>
<% options = {:author => true} %>
<%= render :partial => 'attachments/links',
:locals => {:attachments => @bid.attachments, :options => options} %>
<% end %>
</td></tr>
</table>
</div>

View File

@ -1,4 +1,9 @@
<!-- fq -->
<% if @bid.homework_type == 1%>
<%= render :partial => 'homework' %>
<% else %>
<style>
input[type="submit"].bid_btn {
vertical-align: middle;
@ -67,11 +72,15 @@
<tr>
<td><%= select_tag 'bid', options_for_select(@option), :name => 'bid', :class => 'grayline' %></td>
</tr>
<% if @bid.reward_type == 3 %>
<tr>
<td><%= f.text_area :bid_message, :id => "bid_message", :required => true, :rows => 4, :cols => 40,
:onfocus => "clearInfo('bid_message','#{l(:label_bid_reason)}')", :onblur => "showInfo('bid_message','#{l(:label_bid_reason)}')",
:value => "#{l(:label_bid_reason)}", :style => "resize: none;", :class => 'noline'%></td>
<td><%= f.text_area :bid_message, :id => "bid_message", :required => true, :rows => 4, :cols => 40, :placeholder => l(:label_bid_reason_homework), :style => "resize: none;", :class => 'noline'%></td>
</tr>
<% else %>
<tr>
<td><%= f.text_area :bid_message, :id => "bid_message", :required => true, :rows => 4, :cols => 40, :placeholder => l(:label_bid_reason), :style => "resize: none;", :class => 'noline'%></td>
</tr>
<% end %>
<tr>
<td align="right">
<%= submit_tag l(:button_add), :name => nil , :class => "bid_btn",
@ -90,3 +99,5 @@
<div id='bidding_project_list'>
<%= render :partial => 'project_list', :locals => {:bidding_project => @bidding_project,:bid => @bid} %>
</div>
<% end %>

View File

@ -0,0 +1,86 @@
<!-- fq -->
<style>
input[type="submit"].bid_btn {
vertical-align: middle;
width: 60px;
height: 30px;
line-height: 18px;
font-size: 14px;
color: rgb(0, 0, 0);
background: url("/images/button/bg103.jpg") no-repeat scroll left top transparent;
padding: 0px 0px 4px 0px;
border-radius: 2px;
border: 1px solid rgb(148, 148, 148);
box-shadow: none;
text-shadow: none;
margin-top: -10px;
/*margin-right: -4px;*/
}
input[type="button"].bid_btn {
width: 60px;
height: 30px;
line-height: 18px;
font-size: 14px;
color: rgb(0, 0, 0);
background: url("/images/button/bg103.jpg") no-repeat scroll left top transparent;
padding: 0px 0px 4px 0px;
border-radius: 2px;
border: 1px solid rgb(148, 148, 148);
box-shadow: none;
text-shadow: none;
margin-top: -10px;
margin-right: -2px;
}
textarea:focus {
border: #d5dee9 1px solid;
}
</style>
<script type="text/javascript" language="javascript">
function clearInfo(id,content) {
var text = $('#' + id);
if (text.val() == content) {
$('#' + id).val('');
}
}
function showInfo(id,content) {
var text = $('#' + id);
if (text.val() == '') {
$('#' + id).val(content);
}
}
function cancel() {
$("#put-bid-form").hide();
}
</script>
<% if User.current.logged? %>
<div id = 'flash' style="float:left; width: 100%; display: none" ></div>
<div id="put-bid-form" style="display: none">
<%= form_for "bid_for_save", :remote=>true, :url => {:controller => 'bids', :action => 'add'},
:update => "bidding_project_list",
:complete => '$("#put-bid-form").hide();' do |f| %>
<table id="bidding_table" border="0" width="400" style="margin-left: 40px;">
<tr>
<td><%= select_tag 'bid', options_for_select(@option), :name => 'bid', :class => 'grayline' %></td>
</tr>
<tr>
<td><%= f.text_area :bid_message, :id => "bid_message", :required => true, :rows => 4, :cols => 40,
:onfocus => "clearInfo('bid_message','#{l(:label_bid_reason)}')", :onblur => "showInfo('bid_message','#{l(:label_bid_reason)}')",
:value => "#{l(:label_bid_reason)}", :style => "resize: none;", :class => 'noline'%></td>
</tr>
<tr>
<td align="right"><%= submit_tag l(:button_add), :name => nil , :class => "bid_btn", :onmouseout => "this.style.backgroundPosition = 'left top'", :onmouseover => "this.style.backgroundPosition = 'left -30px'"%>
<%= submit_tag l(:button_cancel), :name => nil, :onclick => "cancel();", :type => 'button', :class => "bid_btn", :onmouseout => "this.style.backgroundPosition = 'left top'",
:onmouseover => "this.style.backgroundPosition = 'left -30px'" %> </td>
</tr>
</table>
<% end %>
</div>
<% end %>
<div id='bidding_project_list'>
<%= render :partial => 'project_list', :locals => {:bidding_project => @bidding_project} %>
</div>

View File

@ -0,0 +1,8 @@
$('#join').html('<%= escape_javascript join_in_course(course, user) %>');
<% if @state %>
<% if @state == 0 %>
alert("加入成功")
<% else %>
alert("密码错误")
<% end %>
<% end %>

View File

@ -1,6 +1,14 @@
<div class="contextual" style="padding-right: 440px;padding-top: 5px;">
<%= link_to(l(:label_attachment_new), new_project_file_path(@project), :class => 'icon icon-add') if User.current.allowed_to?(:manage_files, @project) %>
<% if @project.project_type == 1 %>
<div class="contextual" style="padding-right: 540px;padding-top: 5px;">
<% if User.current.member_of?(@project) %>
<%= link_to(l(:label_file_upload), new_project_file_path(@project), :class => 'icon icon-add') if User.current.allowed_to?(:manage_files, @project) %>
<% end %>
</div>
<% else %>
<div class="contextual" style="padding-right: 540px;padding-top: 5px;">
<%= link_to(l(:label_attachment_new), new_project_file_path(@project), :class => 'icon icon-add') if User.current.allowed_to?(:manage_files, @project) %>
</div>
<% end %>
<h3><%=l(:label_attachment_plural)%></h3>
@ -11,8 +19,8 @@
<%= sort_header_tag('filename', :caption => l(:field_filename)) %>
<%= sort_header_tag('created_on', :caption => l(:label_date), :default_order => 'desc') %>
<%= sort_header_tag('size', :caption => l(:field_filesize), :default_order => 'desc') %>
<%= sort_header_tag('downloads', :caption => l(:label_downloads_abbr), :default_order => 'desc') %>
<th>MD5</th>
<!-- <%= sort_header_tag('downloads', :caption => l(:label_downloads_abbr), :default_order => 'desc') %> -->
<th> <%= sort_header_tag('description', :caption => l(:field_description)) %></th>
<th></th>
</tr></thead>
<tbody>
@ -30,8 +38,8 @@
<td class="filename"><%= link_to_attachment file, :download => true, :title => file.description %></td>
<td class="created_on"><%= format_time(file.created_on) %></td>
<td class="filesize"><%= number_to_human_size(file.filesize) %></td>
<td class="downloads"><%= file.downloads %></td>
<td class="digest"><%= file.digest %></td>
<!-- <td class="downloads"><%= file.downloads %></td> -->
<td class="digest" width="300px"><%= file.description %></td>
<td align="center">
<%= link_to(image_tag('delete.png'), attachment_path(file),
:data => {:confirm => l(:text_are_you_sure)}, :method => :delete) if delete_allowed %>
@ -44,3 +52,4 @@
</table>
<% html_title(l(:label_attachment_plural)) -%>

View File

@ -64,7 +64,7 @@
<div>
<%= link_to l(:label_x_followers, :count => @bid.watcher_users.count)+"("+@bid.watcher_users.count.to_s+")", respond_path(@bid) %> &nbsp;
<%= link_to l(:label_bidding_project)+"("+@bid.biding_projects.count.to_s+")", project_for_bid_path(@bid) %>&nbsp;
<%= link_to l(:label_x_responses, :count => @bid.commit)+"("+@bid.commit.to_s+")", respond_path(@bid)%>
<%= link_to l(:label_x_bids_responses, :count => @bid.commit)+"("+@bid.commit.to_s+")", respond_path(@bid)%>
</div>
</div>
<div class="user_fans">

View File

@ -0,0 +1,180 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title><%= h html_title %></title>
<meta name="description" content="<%= Redmine::Info.app_name %>" />
<meta name="keywords" content="issue,bug,tracker" />
<%= csrf_meta_tag %>
<%= favicon %>
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'application', :media => 'all' %>
<%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %>
<%= javascript_heads %>
<%= heads_for_theme %>
<%= call_hook :view_layouts_base_html_head %>
<!-- page specific tags -->
<%= yield :header_tags -%>
</head>
<!--add by huang-->
<body class="<%= h body_css_classes %>">
<div id="wrapper">
<div id="wrapper2">
<div id="wrapper3">
<%= render :partial => 'layouts/base_header'%>
<div id="main">
<!--project page-->
<div id="sidebar">
<div class="spaceleft">
<!--informations-->
<div class="inf_user_image">
<% @project = Project.find_by_id(@project.id)%>
<% @course = Course.find_by_extra(@project.identifier)%>
<table>
<tr>
<td><%= link_to image_tag(url_to_avatar(@project), :class => 'avatar2') %></td>
<td align="center">
<div class="info_font" style=" word-wrap: break-word; word-break: break-all">
<%= @project.name %>
</div>
<%= join_in_course(@project, User.current)%>
</td>
</tr>
</table>
</div>
<!--parameter-->
<div class="user_fans">
<table width="240" border="0">
<tr align="center" width="80px">
<% files_count = @project.attachments.count %>
<% @project.versions.each do |version| %>
<% files_count += version.attachments.count %>
<% end %>
<td class="font_index"><%=link_to "#{@project.members.count}", project_member_path(@project) ,:course =>'1'%></td>
<td class="font_index"><%=link_to files_count, project_files_path(@project) %></td>
<tr class="font_aram">
<td align="center" width="80px"> <%= "成员" %></td>
<td align="center" width="80px"><%= l(:label_course_data) %></td>
</tr>
</table>
<div class="user_underline"></div>
</div>
<!--info-->
<div class="inf_user_context">
<table style="font-family:微软雅黑" >
<!-- <tr>
<td valign="top" style="padding-left: 8px;">课程口令:</td><td class="font_lighter_sidebar"><%= @course.state%></td>
</tr> -->
<tr>
<td valign="top" style="padding-left: 8px;">主讲老师:</td><td class="font_lighter_sidebar"><%= @course.teacher.lastname+@course.teacher.firstname %></td>
</tr>
<tr>
<td valign="top" style="padding-left: 8px;">课程学期:</td><td class="font_lighter_sidebar"><%= @course.term %></td>
</tr>
<% unless @course.teacher.user_extensions.occupation.nil? %>
<tr>
<td valign="top" style="padding-left: 8px;">教师单位:</td><td class="font_lighter_sidebar"><%= @course.teacher.user_extensions.occupation %></td>
</tr>
<% else %>
<tr>
<td valign="top" style="padding-left: 8px;">教师单位:</td><td class="font_lighter_sidebar"><%= l(:field_course_un) %></td>
</tr>
<% end %>
</table>
</div>
<div class="user_underline"></div>
<!--description-->
<div class="inf_user_context">
<div class="font_title_left">
<%= l(:label_project_overview) %>
</div>
<div style="padding-bottom: 8px">
<% if @project.description.size>0 %>
<div class="font_lighter_sidebar">
<%= textilizable @project.description %>
</div>
<% else %>
<div class="font_lighter_sidebar">
<%= l(:label_course_description_no) %>
</div>
<% end %>
<div class="created_on_project">
<strong style="color: #068d9c"><%= l(:label_create_time) %></strong><%= format_time(@project.created_on) %>
</div>
</div>
<div class="user_underline"></div>
</div>
<!--tags-->
<div class="user_fans">
<!-- added by william -for tag -->
<div class="user_tags">
<div id="tags">
<%= render :partial => 'tags/tag', :locals => {:obj => @project,:object_flag => "2"}%>
</div></div>
</div>
<!--tool-->
<!-- <div class="user_underline"></div> -->
<!-- <div class="tool">
<div class="font_title_left">
<%= l(:label_project_tool)%>
</div>
<table class="font_tool">
<tr>
<td align="left" width="60px" valign="center"><%=image_tag("/images/sidebar/tool_tag2.png", weight:"15px", height:"15px") %>
<%= link_to l(:project_module_documents),project_documents_path(@project) %></td>
</tr>
<tr>
<td align="left" width="190px" valign="left"><%=image_tag("/images/sidebar/tool_tag2.png", weight:"15px", height:"15px") %>
<%= link_to l(:project_module_boards) ,project_boards_path(@project) %>
</td>
</tr>
</table>
</div> -->
<div class="user_underline"></div>
</div>
</div>
<div id="content">
<div class="tabs_new">
<ul>
<li><%= link_to l(:label_course_overview), project_path(@project), :class => link_class(:overview)%></li>
<li><%= link_to l(:label_homework), {:controller => 'projects', :action => 'homework'}, :class => link_class('Homework')%></li>
<li><%= link_to l(:label_course_file), project_files_path(@project), :class => link_class(:files)%></li>
<li><%= link_to l(:label_course_news), {:controller => 'news', :action => 'index', :project_id => @project}, :class => link_class(:news)%></li>
<!-- <li><%= link_to(l(:label_course_repository), {:controller => 'repositories', :action => 'show', :id => @project, :repository_id => nil, :path => nil, :rev => nil, :course => 1 })%></li> -->
<% if User.current.logged? && (User.current.admin? || (!Member.where('user_id = ? and project_id = ?', User.current.id, @project.id).first.nil? && (Member.where('user_id = ? and project_id = ?', User.current.id, @project.id).first.roles&Role.where('id = ? or id = ?', 3, 7)).size >0))%>
<li><%= link_to l(:label_settings), {:controller => 'projects', :action => 'settings', :id => @project}, :class => link_class(:settings)%></li></ul>
<% end %>
</div>
<%= yield %>
<%= call_hook :view_layouts_base_content %>
<div style="clear:both;"></div>
<%= render_flash_messages %>
</div>
<%= render :partial => 'layouts/base_footer'%>
</div>
<div id="ajax-indicator" style="display:none;">
<span><%= l(:label_loading) %></span>
</div>
<div id="ajax-modal" style="display:none;"></div>
</div>
</div>
<%= call_hook :view_layouts_base_body_bottom %>
</body>
</html>

View File

@ -0,0 +1,143 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title><%= h html_title %></title>
<meta name="description" content="<%= Redmine::Info.app_name %>" />
<meta name="keywords" content="issue,bug,tracker" />
<%= csrf_meta_tag %>
<%= favicon %>
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'application', :media => 'all' %>
<%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %>
<%= javascript_heads %>
<%= heads_for_theme %>
<%= call_hook :view_layouts_base_html_head %>
<!-- page specific tags -->
<%= yield :header_tags -%>
</head>
<body class="<%= h body_css_classes %>">
<div id="wrapper">
<div id="wrapper2">
<div id="wrapper3">
<%= render :partial => 'layouts/base_header'%>
<div id="main" class="">
<div id="sidebar">
<div class="main_context">
<div class="spaceleft">
<div>
<table style="padding-top: 20px ;width: 232px ; height: 80px;">
<tr>
<td class="info_font" align="center" style=" word-wrap: break-word; word-break: break-all; color: #ed8924 "><%= h @bid.name %></td>
</tr>
<tr>
<td align="center"> <%= watcher_link(@bid, User.current) %> </td>
</tr>
</table>
</div>
<div class="user_underline"></div>
<!-- info -->
<div class="inf_user_image">
<table>
<tr>
<td style="text-align: justify ; text-justify: inter-ideograph; width: 180px"><%= l(:label_teacher_homework) %> : <%= link_to(@user.lastname+@user.firstname, user_path(@user)) %></td>
</tr>
<tr>
<td><%= l(:label_course_homework) %> : <%= link_to(@bid.courses.first.name, project_path(@bid.courses.first)) %></td>
</tr>
<tr>
<td><%= l(:label_limit_time) %> <%= @bid.deadline %></td>
</tr>
</table>
</div>
<!-- tags -->
<div class="user_fans">
<div class="user_underline"></div>
<table style="font-family:微软雅黑; padding-left: 8px">
<tr>
<td><!-- added by william -for tag --> <%= render :partial => 'tags/tag', :locals => {:obj => @bid, :object_flag => "4"}%> </td>
</tr>
</table>
</div>
<!--homework-->
<div class="user_fans">
<div class="font_title_left">
<strong><%= l(:label_commit_homework) %></strong>
</div>
<div class="user_underline"></div>
<div class="left_wf">
<table>
<tr>
<td style="padding-top: 5px"> <% if @bid.homework_type == 1%>
<% if @bid.homeworks.size>0 %>
<% for homework in @bid.homeworks %>
<%= link_to image_tag(url_to_avatar(homework.user), :class => "avatar", :title => homework.user.name), user_path(homework.user), :class => "avatar" %>
<% end %>
<% else %>
<p class="font_lighter">
<%= l(:label_no_course_project) %>
</p> <% end %>
<% else %>
<% if @bid.projects.size>0 %>
<% for project in @bid.projects%>
<%= link_to image_tag(url_to_avatar(project), :class => "avatar", :title => project.name), project_path(project), :class => "avatar" %>
<% end %>
<% else %>
<p class="font_lighter">
<%= l(:label_no_course_project) %>
</p> <% end %>
<% end %> </td>
</tr>
</table>
</div>
</div>
<div class="user_underline"></div>
</div>
</div>
<!-- end -->
</div>
<div id="content">
<div class="tabs_new">
<ul>
<li>
<%= link_to l(:label_question_student), {:controller => 'bids', :action => 'show' },:class => link_class(:respond)%>
</li>
<li>
<% 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) %>
<%= link_to l(:label_homework_commit), {:controller => 'bids', :action => 'show_project' },:class => link_class(:project)%>
<% else %>
<%= link_to l(:label_homework_info), {:controller => 'bids', :action => 'show_project' },:class => link_class(:project)%>
<% end %>
</li>
<!-- <li><%= link_to l(:label_homework_statistics), { :controller => 'bids', :action => 'homework_statistics' },:class => link_class(:homework_statistics)%></li> -->
<!-- <li><%= link_to l(:label_homework_respond), { :controller => 'bids', :action => 'homework_respond' },:class => link_class(:homework_respond)%></li>
--><ul>
</div>
<%= yield %>
<%= call_hook :view_layouts_base_content %>
<div style="clear:both;"></div>
</div>
<%= render :partial => 'layouts/base_footer'%>
</div>
</div>
</div>
<div id="ajax-indicator" style="display:none;">
<span><%= l(:label_loading) %></span>
</div>
<div id="ajax-modal" style="display:none;"></div>
</div>
<%= call_hook :view_layouts_base_body_bottom %>
</body>
</html>

View File

@ -96,10 +96,10 @@
<div class="inf_user_context">
<table style="font-family:微软雅黑" width="240">
<tr>
<td style="padding-left: 8px" width="70px"><%= l(:label_user_joinin) %></td><td class="font_lighter_sidebar" style="padding-left: 0px" width="170px"><%= format_date(@user.created_on) %></td>
<td style="padding-left: 8px" width="70px"><%= l(:label_user_joinin) %></td><td class="font_lighter_sidebar" style="padding-left: 0px" width="170px"><%= format_time(@user.created_on) %></td>
</tr>
<tr>
<td style="padding-left: 8px"><%= l(:label_user_login) %></td><td class="font_lighter_sidebar" style="padding-left: 0px"><%= format_date(@user.last_login_on) %></td>
<td style="padding-left: 8px"><%= l(:label_user_login) %></td><td class="font_lighter_sidebar" style="padding-left: 0px"><%= format_time(@user.last_login_on) %></td>
</tr>
<tr>
<td valign="top" style="padding-left: 8px;"><%= l(:label_user_mail) %></td><td class="font_lighter_sidebar" style="padding-left: 0px; word-wrap: break-word; word-break: break-all"><%= mail_to(h(@user.mail), nil, :encode => 'javascript') %></td>

View File

@ -0,0 +1,2 @@
<h1><%= link_to("hello", @url) %></h1>
<em><%=h @user %></em>

View File

@ -2,7 +2,7 @@
<div class="box tabular">
<p><%= f.text_field :title, :required => true, :size => 60, :style => "width:488px;" %></p>
<p style="margin-left:-10px;"><%= f.text_area :summary, :cols => 60, :rows => 2, :style => "width:490px;margin-left:10px;" %></p>
<!-- <p style="margin-left:-10px;"><%= f.text_area :summary, :cols => 60, :rows => 2, :style => "width:490px;margin-left:10px;" %></p> -->
<p><%= f.text_area :description, :required => true, :cols => 60, :rows => 15, :class => 'wiki-edit', :style => "width:490px;" %></p>
<p id="attachments_form" style="margin-left:-10px;"><label style="padding-right: 15px;"><%= l(:label_attachment_plural) %></label><%= render :partial => 'attachments/form', :locals => {:container => @news} %></p>
</div>

View File

@ -1,12 +1,24 @@
<div style="padding-bottom: 10px">
<%= link_to(l(:label_news_new),
<% if @project.project_type == 1%>
<%= link_to(l(:label_news_notice),
new_project_news_path(@project),
:class => 'icon icon-add',
:onclick => 'showAndScrollTo("add-news", "news_title"); return false;') if @project && User.current.allowed_to?(:manage_news, @project) %>
<% else %>
<%= link_to(l(:label_news_new),
new_project_news_path(@project),
:class => 'icon icon-add',
:onclick => 'showAndScrollTo("add-news", "news_title"); return false;') if @project && User.current.allowed_to?(:manage_news, @project) %>
<% end %>
</div>
<div id="add-news" style="display:none;">
<% if @project.project_type == 1 %>
<h3><%=l(:bale_news_notice)%></h3>
<% else %>
<h3><%=l(:label_news_new)%></h3>
<% end %>
<%= labelled_form_for @news, :url => project_news_index_path(@project),
:html => { :id => 'news-form', :multipart => true } do |f| %>
<%= render :partial => 'news/form', :locals => { :f => f } %>
@ -39,13 +51,19 @@
<p class="nodata"><%= l(:label_no_data) %></p>
<% else %>
<% @newss.each do |news| %>
<table width="660px" border="0" align="center" style="border-bottom: 1px dashed rgb(204, 204, 204); margin-bottom: 10px;">
<table width="660px" border="0" align="center" style="border-bottom: 1px dashed rgb(204, 204, 204); margin-bottom: 10px;font-size:14px;">
<tr>
<td colspan="2" valign="top" width="50" ><%=link_to image_tag(url_to_avatar(news.author), :class => "avatar"), user_path(news.author) %></td>
<td><table width="580px" border="0">
<% if @project.project_type == 1 %>
<tr>
<td colspan="2" valign="top"><strong><%=link_to_user(news.author)if news.respond_to?(:author) %></strong> <span class="font_lighter"><%= l(:label_project_notice)%></span> <%= link_to h(news.title), news_path(news) %></td>
</tr>
<% else %>
<tr>
<td colspan="2" valign="top"><strong><%=link_to_user(news.author)if news.respond_to?(:author) %></strong> <span class="font_lighter"><%= l(:label_project_newshare)%></span> <%= link_to h(news.title), news_path(news) %></td>
</tr>
</tr>
<% end %>
<tr>
<td colspan="2" width="580px" ><span class="font_description"><%= textilizable(news, :description) %></span></td>
</tr>

View File

@ -0,0 +1,58 @@
<%= error_messages_for 'project' %>
<%= error_messages_for 'course' %>
<!--[form:project]-->
<% unless @project.new_record? %>
<p><%= render :partial=>"avatar/avatar_form",:locals=> {source:@project} %></p>
<% end %>
<p><%= f.text_field :name, :required => true, :size => 60, :style => "width:490px;" %></p>
<p style="margin-left:-10px;padding-right: 20px;"><%= f.text_area :description, :rows => 8, :class => 'wiki-edit', :style => "font-size:small;width:490px;margin-left:10px;" %></p><!--by young-->
<!-- <p><%= f.text_field :identifier, :required => true, :size => 60, :style => "width:488px;", :disabled => @project.identifier_frozen?, :maxlength => Project::IDENTIFIER_MAX_LENGTH %>
<% unless @project.identifier_frozen? %>
<em class="info"><%= l(:text_length_between, :min => 1, :max => Project::IDENTIFIER_MAX_LENGTH) %> <%= l(:text_project_identifier_info).html_safe %></em>
<% end %></p> -->
<%= f.fields_for @course do |m| %>
<!-- added by huang -->
<p style="margin-left:-10px;"><%= m.text_field :state, :required => true, :size => 60, :style => "width:488px;margin-left: 10px;" %></p>
<em class="info" style="margin-left:95px;"><%= l(:text_command) %></em>
<p style="margin-left:-10px;"><%= m.text_field :term, :required => true, :size => 60, :style => "width:488px;margin-left: 10px;" %></p>
<!-- <p style="margin-left:-28px;"><em class="info"><%= l(:label_term) %> <%= select_tag 'term', "<option value = '0'>#{l(:label_spring)}</option><option value = '1'>#{l(:label_summer)}</option><option value = '2'>#{l(:label_autumn)}</option>".html_safe %></em></p> -->
<% end %>
<!-- <p style="margin-left:-10px;"><%= f.check_box :is_public, :style => "margin-left:10px;" %></p> -->
<p style="display:none;"><%= f.text_field :project_type, :value => 1 %></p>
<%= wikitoolbar_for 'project_description' %>
<% @project.custom_field_values.each do |value| %>
<p><%= custom_field_tag_with_label :project, value %></p>
<% end %>
<%= call_hook(:view_projects_form, :project => @project, :form => f) %>
<!--[eoform:project]-->
<% unless @project.identifier_frozen? %>
<% content_for :header_tags do %>
<%= javascript_include_tag 'project_identifier' %>
<% end %>
<% end %>
<% if !User.current.admin? && @project.inherit_members? && @project.parent && User.current.member_of?(@project.parent) %>
<%= javascript_tag do %>
$(document).ready(function() {
$("#project_inherit_members").change(function(){
if (!$(this).is(':checked')) {
if (!confirm("<%= escape_javascript(l(:text_own_membership_delete_confirmation)) %>")) {
$("#project_inherit_members").attr("checked", true);
}
}
});
});
<% end %>
<% end %>

View File

@ -1,6 +1,10 @@
<div class="box tabular" style="margin-right:10px;" >
<%= labelled_form_for @project do |f| %>
<%= render :partial => 'form', :locals => { :f => f } %>
<%= submit_tag l(:button_save) %>
<% if @project.project_type == 1%>
<%= render :partial => 'course_form', :locals => { :f => f } %>
<% else %>
<%= render :partial => 'form', :locals => { :f => f } %>
<% end %>
<%= submit_tag l(:button_save) %>
<% end %>
</div>
</div>

View File

@ -10,9 +10,9 @@
<% unless @project.identifier_frozen? %>
<em class="info"><%= l(:text_length_between, :min => 1, :max => Project::IDENTIFIER_MAX_LENGTH) %> <%= l(:text_project_identifier_info).html_safe %></em>
<% end %></p>
<p style="margin-left:-10px;"><%= f.text_field :homepage, :size => 60, :style => "width:488px;margin-left: 10px;" %></p>
<p style="margin-left:-10px;"><%= f.check_box :is_public, :style => "margin-left:10px;" %></p>
<!-- <p style="margin-left:-10px;"><%= f.text_field :homepage, :size => 60, :style => "width:488px;margin-left: 10px;" %></p> --> <!-- by huang -->
<p style="margin-left:-10px;"><em style ="color: #888888;display: block;font-size: 90%;font-style: normal;"><%= f.check_box :is_public, :style => "margin-left:10px;" %><%= l(:label_public_info) %></em></p>
<p style="display:none;"><%= f.text_field :project_type, :value => 0 %></p>
<%= wikitoolbar_for 'project_description' %>

View File

@ -0,0 +1,41 @@
<!-- fq -->
<script type="text/javascript" language="javascript">
function show(id, id_t, label_reward, label_money, label_credit, label_content) {
var text = $('#' + id);
var text_t = $('#' + id_t);
if (text.val() == 0) {
text_t.attr("placeholder", label_reward);
}
if (text.val() == 1) {
text_t.attr("placeholder", label_money);
}
if (text.val() == 3) {
text_t.attr("placeholder", label_credit);
}
if (text.val() == 2) {
text_t.attr("placeholder", label_content);
}
return content;
}
</script>
<%= error_messages_for 'bid' %>
<!--[form:project]-->
<p><%= l(:label_homeworks_form_new_description) %></p>
<p><%= f.text_field :name, :required => true, :size => 60, :style => "width:490px;", :maxlength => Bid::NAME_LENGTH_LIMIT %></p>
<p style="margin-left:-10px;padding-right: 20px;"><%= f.text_area :description, :rows => 8, :class => 'wiki-edit', :style => "font-size:small;width:490px;margin-left:10px;", :maxlength => Bid::DESCRIPTION_LENGTH_LIMIT %></p>
<!-- <p><%= select_tag 'bid_reward_type', "<option value = '0'>#{l(:label_choose_reward)}</option><option value = '1'>#{l(:label_money)}</option><option value = '3'>#{l(:label_bids_credit)}</option><option value = '2'>#{l(:label_reward_1)}</option>".html_safe,
:onChange => "show('bid_reward_type', 'bid_budget', '"+l(:label_bids_reward_what)+"','"+l(:label_bids_new_money)+"','"+l(:label_bids_new_credit)+"','"+l(:label_bids_new_content)+"')" %>
<%= f.text_field :budget, :required => true, :size => 60, :style => "width:350px;", :placeholder => l(:label_bids_reward_what) %>
</p> -->
<p><%= f.text_field :deadline, :required => true, :size => 60, :style => "width:150px;" %><%= calendar_for('bid_deadline')%>
</p>
<p><%= f.select :homework_type, homework_type_option %>
</p>
<p><%= hidden_field_tag 'course_id', @project.id %>
</p>
<fieldset><legend><%= l(:label_attachment_plural) %></legend>
<p><%= render :partial => 'attachments/form', :locals => {:container => @homework} %></p>
</fieldset>

View File

@ -0,0 +1,81 @@
<!-- fq -->
<style>
input[type="submit"].bid_btn {
vertical-align: middle;
width: 80px;
height: 30px;
line-height: 18px;
font-size: 14px;
color: rgb(0, 0, 0);
background: url("../images/button/bg106.jpg") no-repeat scroll left top transparent;
padding: 0px 0px 4px 0px;
border-radius: 2px;
border: 1px solid rgb(148, 148, 148);
box-shadow: none;
text-shadow: none;
margin-top: -10px;
margin-right: -5px;
}
textarea:focus {
border: #d5dee9 1px solid;
}
</style>
<script type="text/javascript" language="javascript">
function clearInfo(id, content) {
var text = $('#' + id);
if (text.val() == content) {
$('#' + id).val('');
}
}
function showInfo(id, content) {
var text = $('#' + id);
if (text.val() == '') {
$('#' + id).val(content);
}
}
</script>
<%= form_tag({:controller => 'bids',
:action => 'new_bid',
:remote => true,
:method => :post,
:id => 'new-bid-form'}) do %>
<table border="0" width="600px" style="border-left: 1px solid #acaeb1; border-right: 1px solid #acaeb1;
border-top: 1px solid #acaeb1; border-bottom: 1px solid #acaeb1; margin-top: 30px; margin-left: 30px;">
<tr>
<td colspan="2"><%= text_field_tag 'bid_title', "#{l(:label_requirement_name)}", :class => 'noline', :required => true, :onfocus => "clearInfo('bid_title', '#{l(:label_requirement_name)}')", :onblur => "showInfo('bid_title', '#{l(:label_requirement_name)}')"%></td>
</tr>
<tr>
<td colspan="2"><div class="tableline"></div></td>
</tr>
<tr>
<td colspan="2"><%= text_area_tag 'bid_description', "#{l(:label_requirement_description)}", :class => 'noline', :required => true, :style => "resize: none;", :rows => 6,
:onfocus => "clearInfo('bid_description', '#{l(:label_requirement_description)}')", :onblur => "showInfo('bid_description', '#{l(:label_requirement_description)}')" %></td>
</tr>
<tr>
<td colspan="2"><div class="tableline"></div></td>
</tr>
<!-- <tr>
<td width="22%"><%= select_tag 'bid_reward_type', "<option value = '0'>#{l(:label_choose_reward)}</option><option value = '1'>#{l(:label_money)}</option><option value = '2'>#{l(:label_reward_1)}</option><option value = '3'>#{l(:label_bids_credit)}</option>".html_safe, :class => 'noline' %></td>
<td><%= text_field_tag 'bid_budget', "#{l(:label_requirement_bargain_money)}", :class => 'noline', :required => true,
:onfocus => "clearInfo('bid_budget', '#{l(:label_requirement_bargain_money)}')", :onblur => "showInfo('bid_budget', '#{l(:label_requirement_bargain_money)}')" %>
</td>
</tr> -->
<tr>
<td colspan="2"><div class="tableline"></div></td>
</tr>
<tr>
<td colspan="2"><%= text_field_tag 'bid_deadline', "#{l(:label_deadline)}", :class => 'noline', :required => true,
:onfocus => "clearInfo('bid_deadline', '#{l(:label_deadline)}')", :onblur => "showInfo('bid_deadline', '#{l(:label_deadline)}')"%>
<%= calendar_for('bid_deadline')%></td>
</tr>
</table>
<table id="bidding_table" border="0" width="600" style="margin-top: 10px; margin-left: 30px;">
<tr>
<td align="right"> <%= submit_tag l(:button_new_bid), :name => nil , :class => "bid_btn", :onmouseout => "this.style.backgroundPosition = 'left top'", :onmouseover => "this.style.backgroundPosition = 'left -31px'"%> </td>
</tr>
</table>
<%end%>

View File

@ -0,0 +1,54 @@
<!-- added by fq -->
<style>
input[type="submit"].bid_btn {
vertical-align: middle;
width: 60px;/*modified by ming*/
height: 25px;
line-height: 19px;
font-size: 14px;
color: rgb(0, 0, 0);
background: buttonface;/*url("/images/button/bg103.jpg") no-repeat scroll left top transparent;*/
padding: 0px 0px 4px 0px;
border-radius: 2px;
border: 1px solid rgb(148, 148, 148);
box-shadow: none;
text-shadow: none;
margin-top: -10px;
/*margin-right: -4px;*/
}
input[type="button"].bid_btn {
width: 60px;/*modified by ming*/
height: 25px;
line-height: 19px;
font-size: 14px;
color: rgb(0, 0, 0);
background: buttonface;/*url("/images/button/bg103.jpg") no-repeat scroll left top transparent;*/
padding: 0px 0px 4px 0px;
border-radius: 2px;
border: 1px solid rgb(148, 148, 148);
box-shadow: none;
text-shadow: none;
margin-top: -10px;
margin-right: -2px;
}
textarea:focus {
border: #d5dee9 1px solid;
}
</style>
<h3 class="title">请输入课程密码</h3>
<%= form_tag({:controller => 'courses',
:action => 'join',
:object_id => course.id},
:remote => true,
:method => :post,
:id => 'new-watcher-form') do %>
<%= text_field_tag 'course_password', nil, :size => 48%>
<p class="buttons" style="padding-top: 10px; padding-bottom: 1px; margin-bottom: 1px">
<%= submit_tag '加入', :name => nil, :class => "bid_btn", :onclick => "hideModal(this);" %>
<%= submit_tag l(:button_cancel), :name => nil, :class => "bid_btn", :onclick => "hideModal(this);", :type => 'button' %>
</p>
<% end %>

View File

@ -25,7 +25,14 @@
</div>
<div class="add-info">
<div class="main-language">
<%= content_tag('span', "#{l(:default_role_manager)}: ") %>
<!-- add by huang -->
<% if(@project.project_type==1)%>
<%= content_tag('span', "#{l(:field_tea_name)}: ") %>
<% else %>
<%= content_tag('span', "#{l(:default_role_manager)}: ") %>
<% end %>
<!-- end -->
<!-- <%= content_tag('span', "#{l(:default_role_manager)}: ") %> -->
<% @admin = @project.project_infos%>
<% if @admin.size > 0 %>
<%= content_tag('a', @admin.collect{|u| link_to(u.user.name, user_path(u.user_id))}.join(", ").html_safe) %>

View File

@ -0,0 +1,28 @@
<!-- fq -->
<div class="project-search-block">
<table width="100%" valign="center">
<tr>
<td width="16%"><span style="margin-left:0px"><%= l(:label_course_homework_list)%></span></td>
<td valign="center"><% if User.current.logged? && (User.current.admin? || (!Member.where('user_id = ? and project_id = ?', User.current.id, @project.id).first.nil? && (Member.where('user_id = ? and project_id = ?', User.current.id, @project.id).first.roles&Role.where('id = ? or id = ?', 3, 7)).size >0))%>
<!-- <div class='icon icon-add'> -->
<%= link_to(l(:label_course_homework_new), {:controller => 'projects', :action => 'new_homework'}, :class => 'icon icon-add') %>
<!-- <%= toggle_link l(:label_new_call), 'put-bid-form', {:focus => 'project_id'} %> -->
<!-- </div> -->
<% end %></td>
<td align="right">
<div class="project-search">
<%= text_field_tag 'name', params[:name], :size => 30 %>
<%= submit_tag l(:label_search), :class => "small", :name => nil %>
</div></td>
</tr></table>
</div>
<div id="bid-show">
<%= render :partial => 'bids/bid_homework_show', :locals => {:bids => @bids, :bid_pages => @bid_pages} %>
</div>

View File

@ -7,8 +7,8 @@
<table width="100%" valign="center">
<tr>
<td width="16%"><span style="margin-left:0px"><%= l(:label_project_plural)%></span></td>
<td valign="center"><%= link_to(l(:label_project_new), {:controller => 'projects', :action => 'new'}, :class => 'icon icon-add') if User.current.allowed_to?(:add_project, nil, :global => true) %></td>
<td valign="center"><%= 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) %></td>
<td valign="center"><%= 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) %></td>
<td align="right">
<div class="project-search">
<%= text_field_tag 'name', params[:name], :size => 30 %>
@ -17,7 +17,7 @@
</tr>
</table>
</div>
<%end%>
<% end %>
<%= sort_project(@s_type)%>
<!-- <div class="pagination_list">
@ -38,7 +38,7 @@
<div id="projects-index">
<%= render_project_hierarchy(@projects)%>
</div>
<!-- <p class="pagination"><%= pagination_links_full @project_pages%></p> -->
<div class="pagination">
<ul>
<%= pagination_links_full @project_pages %>

View File

@ -14,7 +14,23 @@
<% end %>
<%= member.user.nil? ? '' : (link_to image_tag(url_to_avatar(member.user), :class => 'avatar'), :class => "avatar") %>
<%= content_tag "div", link_to_user(member.principal), :class => "nomargin avatar_name" %>
<!-- added by huang -->
<% if @project.project_type == 1 %>
<div class ="clear avatar_name"> <p>
<% if member.roles.sort.collect(&:to_s).join(', ') =='Manager' %>
Teacher
<% elsif member.roles.sort.collect(&:to_s).join(', ') =='Reporter' %>
Student
<% elsif member.roles.sort.collect(&:to_s).join(', ') =='TA' %>
TA
<% else %>
<% end %>
</p></div>
<% else%>
<%= content_tag "div", content_tag("p", member.roles.sort.collect(&:to_s).join(', ')), :class => "clear avatar_name" %>
<% end %>
<!-- end -->
<%= call_hook(:view_projects_settings_members_table_row, { :project => @project, :member => member}) %>
</div>

View File

@ -1,12 +1,19 @@
<h3><%=l(:label_project_new)%></h3>
<%= labelled_form_for @project do |f| %>
<!--Added by young-->
<div class="box tabular">
<%= render :partial => 'form', :locals => { :f => f } %>
<%= submit_tag l(:button_create) %>
<%= submit_tag l(:button_create_and_continue), :name => 'continue' %>
<%= javascript_tag "$('#project_name').focus();" %>
<% end %>
</div>
<% if @course_tag == '1' %>
<h3><%=l(:label_course_new)%></h3>
<div class="box tabular">
<%= render :partial => 'course_form', :locals => { :f => f } %>
<%= submit_tag l(:button_create) %>
<%= submit_tag l(:button_create_and_continue), :name => 'course_continue' %>
<% else %>
<h3><%=l(:label_project_new)%></h3>
<div class="box tabular">
<%= render :partial => 'form', :locals => { :f => f } %>
<%= submit_tag l(:button_create) %>
<%= submit_tag l(:button_create_and_continue), :name => 'continue' %>
<% end %>
<%= javascript_tag "$('#project_name').focus();" %>
</div>
<% end %>
<!--Ended by young-->

View File

@ -0,0 +1,9 @@
<h3><%=l(:label_course_new_homework)%></h3>
<%= labelled_form_for @homework, :url => {:controller => 'bids', :action => 'create_homework'} do |f| %>
<div class="box tabular">
<%= render :partial => 'homework_form', :locals => { :f => f } %>
<%= submit_tag l(:button_create) %>
<%= javascript_tag "$('#bid_name').focus();" %>
<% end %>
</div>

View File

@ -0,0 +1,3 @@
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'projects/new_join', :locals => {:course => @course}) %>');
showModal('ajax-modal', '400px');
$('#ajax-modal').addClass('new-watcher');

View File

@ -1,3 +1,7 @@
<h3><%=l(:label_settings)%></h3>
<%= render_tabs project_settings_tabs %>
<% if @project.project_type == 1 %>
<%= render_tabs course_settings_tabs %>
<% else %>
<%= render_tabs project_settings_tabs %>
<% end %>
<% html_title(l(:label_settings)) -%>

View File

@ -17,7 +17,22 @@
<div class="splitcontentright" style="width:30%;margin-top: 60px;">
<p><%= l(:label_role_plural) %>:
<% roles.each do |role| %>
<label><%= check_box_tag 'membership[role_ids][]', role.id %> <%=h role %></label>
<label>
<% if @project.project_type == 1 %>
<% if role == Role.find(3) %>
<%= check_box_tag 'membership[role_ids][]', role.id %>Teacher
<% elsif role == Role.find(5) %>
<%= check_box_tag 'membership[role_ids][]', role.id %>Student
<% elsif role == Role.find(4)%>
<% else %>
<%= check_box_tag 'membership[role_ids][]', role.id %><%=h role %>
<% end %>
<% else %>
<% if role == Role.find(7) %>
<% else %>
<%= check_box_tag 'membership[role_ids][]', role.id %><%=h role %>
<% end %>
<% end %></label>
<% end %></p>
</div>
</fieldset>
@ -40,11 +55,39 @@
<tr id="member-<%= member.id %>" class="<%= cycle 'odd', 'even' %> member">
<td class="<%= member.principal.class.name.downcase %>"><%= link_to_user member.principal %></td>
<td class="roles">
<span id="member-<%= member.id %>-roles"><%=h member.roles.sort.collect(&:to_s).join(', ') %></span>
<span id="member-<%= member.id %>-roles">
<% if @project.project_type == 1 %>
<% if member.roles.sort.collect(&:to_s).join(', ') =='Manager' %>
Teacher
<% elsif member.roles.sort.collect(&:to_s).join(', ') =='Reporter' %>
Student
<% elsif member.roles.sort.collect(&:to_s).join(', ') =='TA' %>
TA
<% else %>
<% end %>
<% else %>
<% if member.roles.sort.collect(&:to_s).join(', ') =='Manager' %>
Manager
<% elsif member.roles.sort.collect(&:to_s).join(', ') =='Developer' %>
Developer
<% elsif member.roles.sort.collect(&:to_s).join(', ') =='Reporter' %>
Reporter
<% else %>
<% end %>
<% end %>
</span>
<%= form_for(member, {:as => :membership, :remote => true, :url => membership_path(member),
:method => :put,
:html => { :id => "member-#{member.id}-roles-form", :class => 'hol' }}
) do |f| %>
<p><% roles.each do |role| %>
<label><%= check_box_tag 'membership[role_ids][]', role.id, member.roles.include?(role),
:disabled => member.member_roles.detect {|mr| mr.role_id == role.id && !mr.inherited_from.nil?} %> <%=h role %></label><br />

View File

@ -55,11 +55,12 @@
<p class="nodata"><%= l(:label_no_data) %></p>
<% end %>
<% course_tag = @project.project_type %>
<% if User.current.allowed_to?(:manage_repository, @project) %>
<p><%= link_to l(:label_repository_new), new_project_repository_path(@project), :class => 'icon icon-add' %></p>
<p><%= link_to l(:label_repository_new), new_project_repository_path(@project, :course => course_tag), :class => 'icon icon-add' %></p>
<% end %>
<!-- no repository new by xianbo-->
<% if User.current.allowed_to?(:manage_repository, @project) %>
<p><%= l(:label_repository_no) %>
<%= link_to l(:label_repository_new_repos), newrepo_project_repository_path(@project), :class => 'icon icon-add' %></p>
<%= link_to l(:label_repository_new_repos), newrepo_project_repository_path(@project, :course => course_tag), :class => 'icon icon-add' %></p>
<% end %>

View File

@ -10,7 +10,7 @@
<div>
<% sort_activity_events(@events_by_day[day]).each do |e, in_group| -%>
<div class="issue-note">
<table width="660px" border="0" align="center">
<table width="660px" border="0" align="center" style="font-size: 14px;">
<tr>
<td colspan="2" valign="top" width="50" ><%= image_tag(url_to_avatar(e.event_author), :class => "avatar")%></td>
<td><table width="580px" border="0">

View File

View File

@ -3,7 +3,7 @@
<% end %>
<%= link_to l(:label_statistics),
{:action => 'stats', :id => @project, :repository_id => @repository.identifier_param},
{:controller => 'repositories', :action => 'stats', :id => @project, :repository_id => @repository.identifier_param},
:class => 'icon icon-stats' if @repository.supports_all_revisions? %>
<%= form_tag({:action => controller.action_name,

View File

@ -1,12 +1,6 @@
<h3><%= l(:label_statistics) %></h3>
<p>
<%= tag("embed", :width => 670, :height => 300, :type => "image/svg+xml", :src => url_for(:controller => 'repositories', :action => 'graph', :id => @project, :repository_id => @repository.identifier_param, :graph => "commits_per_month")) %>
</p>
<p>
<%= tag("embed", :width => 670, :height => 400, :type => "image/svg+xml", :src => url_for(:controller => 'repositories', :action => 'graph', :id => @project, :repository_id => @repository.identifier_param, :graph => "commits_per_author")) %>
</p>
<p><%= link_to l(:button_back), :action => 'show', :id => @project %></p>
<% src = "http://localhost:3000/statistics/"+@project_id+"/index.html"%>
<iframe src=<%= src %> name="top" style="border:0;width:100%;height:1000px;"></iframe>
<% html_title(l(:label_repository), l(:label_statistics)) -%>

View File

@ -35,7 +35,7 @@
</div>
<% end %>
<% else %>
<div><%= l(:label_tags_no) %></div>
<div style="color:#919294;"><%= l(:label_tags_no) %></div>
<% end %>
<% end %>

View File

@ -0,0 +1,57 @@
<div class="content_frame">
<% unless @memberships.empty? %>
<ul class="user_project_sort">
<% for membership in @memberships %>
<li>
<table width="660" border="0" align="center" style="border-bottom: 1px dashed rgb(204, 204, 204); margin-bottom: 10px;font-size:14px;">
<tr>
<td colspan="2" valign="top" width="50" ><%= link_to image_tag(url_to_avatar(membership.project), :class => 'avatar'), project_path(membership.project) %></td>
<td>
<table width="580" border="0">
<tr>
<td colspan="2" valign="top"><span><%= link_to_project(membership.project) %></span>
<span style="float: right"><%= l(:label_homework) %> (<span class=""><%= link_to (membership.project.homeworks.count), {:controller => 'projects', :action => 'homework', :id => membership.project.identifier} %></span>)
&nbsp;&nbsp;&nbsp;
<%= l(:label_course_news)%> (<span style="color: #ed8924"><%= link_to (membership.project.news.count), {:controller => 'news', :action => 'index', :project_id => membership.project.identifier} %></span>)
<!-- <%= l(:label_member)%>(<span style="color: #ed8924"><%= link_to (membership.project.members.count), {:controller => 'news', :action => 'index', :project_id => membership.project.identifier} %></span>) </span> --></td>
</tr>
<tr>
<td colspan="2" width="580" >
<p class="font_description">
<%= membership.project.description%>
</p></td>
</tr>
<tr>
<td align="left"><span class="font_lighter"> <%= format_time(membership.created_on) %></span></td><!-- modified by ming -->
<td align="right" >
<% if membership.roles.sort.collect(&:to_s).join(', ') =='Manager' %>
Teacher
<% elsif membership.roles.sort.collect(&:to_s).join(', ') =='Reporter' %>
Student
<% elsif membership.roles.sort.collect(&:to_s).join(', ') =='TA' %>
TA
<% end %>
</td>
</tr>
</table></td>
</tr>
</table>
</li>
<% end %>
</ul>
<% else %>
<% if @user != User.current %>
<p class="font_description">
<%= l(:label_project_course_un) %>
</p>
<% else %>
<p class="font_description">
<%= l(:label_project_course_unadd) %><%= link_to"#{l(:label_new)}",:controller=>'projects',:action=>'new', :course => 1 %>
</p>
<% end %>
<% end %>
<%= call_hook :view_account_left_bottom, :user => @user %>
</div>

View File

@ -0,0 +1,48 @@
<!-- fq -->
<% if @bid.size > 0%>
<% @bid.each do |bids|%>
<h2><%= link_to(Project.find(bids[0]).name, project_path(bids[0])) %></h2>
<% for bid in bids[1]%>
<table width="95%" border="0" style="padding-left: 10px; padding-top: 10px;">
<tr>
<td colspan="2" valign="top" width="50" ><%= link_to(image_tag(url_to_avatar(bid.author), :class => 'avatar'), user_path(bid.author), :class => "avatar") %></td>
<td>
<table width="100%" border="0">
<tr>
<td colspan="2" valign="top"><strong><%= link_to(bid.author.lastname+bid.author.firstname, user_path(bid.author), :class => 'bid_user') %>: &nbsp;<%= link_to(bid.name, respond_path(bid), :class => 'bid_path') %></strong></td>
</tr>
<tr>
<td width="500">
<table border="0">
<tr>
<td> <% if bid.reward_type.nil? or bid.reward_type == 1 %> <strong><%= l(:label_bids_reward_method) %><span style="color: #ed8924;font-family: 14px; font-family: 微软雅黑"><%= l(:label_call_bonus) %>&nbsp;<%= l(:label_RMB_sign) %><%= bid.budget%></span></strong> <% elsif bid.reward_type == 2 %> <strong><%= l(:label_bids_reward_method) %><span style="color: #15bccf;font-family: 14px; font-family: 微软雅黑"><%= bid.budget%></span></strong> <% else %> <!-- <strong><%= l(:label_bids_reward_method) %><span style="color: #00aa83;font-family: 14px; font-family: 微软雅黑"><%= l(:label_bids_credit) %>&nbsp;<%= bid.budget%>&nbsp;<%= l(:label_bids_credit_number) %></span></strong> --> <% end %> <!-- <td style="color: rgb(255, 0, 0);"><strong><%= l(:label_price) %><%= l(:label_RMB_sign) %><%= bid.budget%></strong></td> --></td>
</tr>
<tr>
<td><span class="font_lighter"><%= l(:label_x_homework_project, :count => bid.biding_projects.count) %>(<strong><%= link_to bid.biding_projects.count, project_for_bid_path(bid.id) %></strong>)</span><span class="font_lighter"><%= l(:label_x_responses, :count => bid.commit) %>(<strong><%= link_to bid.commit, respond_path(bid) %></strong>)</span></td>
</tr>
</table></td>
<td width="200" align="right" class="a"><span class="font_lighter"> <%= format_time bid.created_on %></span></td>
</tr>
<tr>
<td>
<div class="bid-description" style="border-left: 1px solid rgb(225, 225, 225); border-bottom: 1px solid rgb(225, 225, 225); padding-left: 20px; padding-bottom: 10px; margin-bottom: 20px;">
<table width="100%">
<tr>
<td> <%= bid.description%> </td>
</tr>
</table>
</div></td>
</tr>
</table></td>
</tr>
</table>
<% end %>
<% end %>
<% else %>
<p class="font_description">暂无任何作业</p>
<% end %>

View File

@ -0,0 +1,48 @@
<!-- < added by huang > -->
<div class="content_frame">
<% unless @memberships.empty? %>
<ul class="user_project_sort">
<% for membership in @memberships %>
<li>
<table width="660" border="0" align="center" style="border-bottom: 1px dashed rgb(204, 204, 204); margin-bottom: 10px;font-size:14px;">
<tr>
<td colspan="2" valign="top" width="50" ><%= link_to image_tag(url_to_avatar(membership.project), :class => 'avatar'), project_path(membership.project) %></td>
<td>
<table width="580" border="0">
<tr>
<td colspan="2" valign="top"><span><%= link_to_project(membership.project) %></span>
<span style="float: right"><%= l(:label_homework) %> (<span style="color: #ed8924">8</span>)
<%= l(:label_course_news)%> (<span style="color: #ed8924">8</span>)
<%= l(:label_member)%>(<span style="color: #ed8924"><%=link_to (membership.project.members.count)%></span>)
</span>
</td>
</tr>
<tr>
<td colspan="2" width="580" >
<p class="font_description">
<%= membership.project.description%>
</p></td>
</tr>
<tr>
<td align="left"><span class="font_lighter"> <%= format_time(membership.created_on) %></span></td><!-- modified by ming -->
<td align="right" ><%= h membership.roles.sort.collect(&:to_s).join(', ') %> </td>
</tr>
</table></td>
</tr>
</table>
</li>
<% end %>
</ul>
<% else %>
<% if @user != User.current %>
<p class="font_description"><%= l(:label_project_un) %></p>
<% else %>
<p class="font_description"><%= l(:label_project_unadd) %><%= link_to"#{l(:label_new)}",:controller=>'projects',:action=>'new'%></p>
<% end %>
<% end %>
<%= call_hook :view_account_left_bottom, :user => @user %>
</div>

View File

@ -2,7 +2,7 @@
<% unless @message.empty? %>
<div id="activity">
<% @message.each do |e| -%>
<table width="660" border="0" align="left" style="border-bottom: 1px dashed rgb(204, 204, 204); margin-bottom: 10px;">
<table width="660" border="0" align="left" style="border-bottom: 1px dashed rgb(204, 204, 204); margin-bottom: 10px;font-size:14px;">
<tr>
<!-- fq -->
<td colspan="2" valign="top" width="50" ><%= link_to image_tag(url_to_avatar(e.user), :class => "avatar"), user_path(e.user), :class => "avatar" %></td>

View File

@ -7,7 +7,7 @@
<% @activity.each do |e| %>
<% act = e.act %>
<% unless act.nil? %>
<table width="660" border="0" align="left" style="border-bottom: 1px dashed rgb(204, 204, 204); margin-bottom: 10px;">
<table width="660" border="0" align="left" style="border-bottom: 1px dashed rgb(204, 204, 204); margin-bottom: 10px;font-size:14px;">
<tr>
<!-- fq -->
<td colspan="2" valign="top" width="50" ><%= link_to image_tag(url_to_avatar(e.user), :class => "avatar"), user_path(e.user_id), :class => "avatar" %></td>

View File

@ -0,0 +1,11 @@
<!-- added by fq -->
<%= user_course @state%>
<% if @state == 0 %>
<%= render :partial => 'my_course' %>
<% elsif @state == 1 %>
<%= render :partial => 'my_homework' %>
<% else @state == 2 %>
<%= render :partial => 'my_notice' %>
<% end %>

View File

@ -6,7 +6,7 @@
<%= l(:label_newfeedback_message) %><%= @feedback_count%>
</div>
<div id="message">
<div id="message" style="font-size: 14px;">
<%= render :partial => 'words/message', :locals => {:jour => @jour, :state => @state, :user => @user, :feedback_pages => @feedback_pages} %>
</div>
<div class="pagination" style="float:left;">

View File

@ -4,7 +4,7 @@
<ul class="user_project_sort">
<% for membership in @memberships %>
<li>
<table width="660" border="0" align="center" style="border-bottom: 1px dashed rgb(204, 204, 204); margin-bottom: 10px;">
<table width="660" border="0" align="center" style="border-bottom: 1px dashed rgb(204, 204, 204); margin-bottom: 10px;font-size:14px;">
<tr>
<td colspan="2" valign="top" width="50" ><%= link_to image_tag(url_to_avatar(membership.project), :class => 'avatar'), project_path(membership.project) %></td>
<td>

View File

@ -5,7 +5,7 @@
<% for bid in @bid%>
<table width="90%" border="0" align="center" style="border-bottom: 1px dashed rgb(204, 204, 204); margin-bottom: 10px; margin-top: 30px;">
<table width="90%" border="0" align="center" style="border-bottom: 1px dashed rgb(204, 204, 204); margin-bottom: 10px; margin-top: 30px;font-size:14px;">
<tr>
<td colspan="2" valign="top" width="50" ><%= link_to image_tag(url_to_avatar(bid.author), :class => 'avatar'),user_path(bid.author), :class => "avatar" %></td>
<td>
@ -18,19 +18,24 @@
<table border="0">
<tr><td>
<% if bid.reward_type.nil? or bid.reward_type == 1%>
<strong><%= l(:label_bids_reward_method) %><span style="color: #ed8924;font-family: 14px; font-family: 微软雅黑"><%= l(:label_call_bonus) %>&nbsp;<%= l(:label_RMB_sign) %><%= bid.budget%></span></strong>
<strong><%= l(:label_bids_reward_method) %><span style="color: #ed8924;font-family: 14px; font-family: ΢ÈíÑźÚ"><%= l(:label_call_bonus) %>&nbsp;<%= l(:label_RMB_sign) %><%= bid.budget%></span></strong>
<% elsif bid.reward_type == 2%>
<strong><%= l(:label_bids_reward_method) %><span style="color: #15bccf;font-family: 14px; font-family: 微软雅黑"><%= bid.budget%></span></strong>
<strong><%= l(:label_bids_reward_method) %><span style="color: #15bccf;font-family: 14px; font-family: ΢ÈíÑźÚ"><%= bid.budget%></span></strong>
<% else %>
<strong><%= l(:label_bids_reward_method) %><span style="color: #00aa83;font-family: 14px; font-family: 微软雅黑"><%= l(:label_bids_credit) %>&nbsp;<%= bid.budget%>&nbsp;<%= l(:label_bids_credit_number) %></span></strong>
<strong><%= l(:label_bids_reward_method) %><span style="color: #00aa83;font-family: 14px; font-family: ΢ÈíÑźÚ"><%= l(:label_bids_credit) %>&nbsp;<%= bid.budget%>&nbsp;<%= l(:label_bids_credit_number) %></span></strong>
<% end %>
<!-- <td style="color: rgb(255, 0, 0);"><strong><%= l(:label_price) %><%= l(:label_RMB_sign) %><%= bid.budget%></strong></td> -->
</td>
</tr>
<tr><td>
<span class="font_lighter"><%= l(:label_x_biding_project, :count => bid.biding_projects.count) %>(<strong><%=link_to bid.biding_projects.count, project_for_bid_path(bid) %></strong>)</span>
<% if bid.reward_type == 3 %>
<span class="font_lighter"><%= l(:label_x_homework_project, :count => bid.biding_projects.count) %>(<strong><%=link_to bid.biding_projects.count, project_for_bid_path(bid) %></strong>)</span>
<span class="font_lighter"><%= l(:label_x_responses, :count => bid.commit) %>(<strong><%=link_to bid.commit, respond_path(bid) %></strong>)</span>
<% else %>
<span class="font_lighter"><%= l(:label_x_biding_project, :count => bid.biding_projects.count) %>(<strong><%=link_to bid.biding_projects.count, project_for_bid_path(bid) %></strong>)</span>
<span class="font_lighter"><%= l(:label_x_bids_responses, :count => bid.commit) %>(<strong><%=link_to bid.commit, respond_path(bid) %></strong>)</span>
<% end %>
<span class="font_lighter"><%= l(:label_x_followers, :count => bid.watcher_users.count) %>(<strong><%=link_to bid.watcher_users.count, respond_path(bid) %></strong>)</span>
</td>
</tr>

View File

@ -61,7 +61,6 @@
<caption>&#187;<%= l(:label_related_issues) %></caption>
<% issues.each do |issue| -%>
<tr class="hascontextmenu">
<td class="checkbox"><%= check_box_tag 'ids[]', issue.id, false, :id => nil %></td>
<td><%= link_to_issue(issue, :project => (@project != issue.project)) %></td>
</tr>
<% end -%>

View File

@ -0,0 +1,3 @@
$('#join').html('<%= escape_javascript join_in_course(course, user) %>');

View File

@ -5,7 +5,7 @@
production:
adapter: mysql2
database: redmine
database: bitnami_redmine
host: 10.0.47.245
#socket: /home/pdl/redmine-2.3.1-2/mysql/tmp/mysql.sock
port: 3306

View File

@ -656,7 +656,7 @@ en:
label_query_new: New query
label_my_queries: My custom queries
label_filter_add: Add filter
label_filter_plural: Filter
label_filter_plural: Query condition
label_equals: is
label_not_equals: is not
label_in_less_than: in less than
@ -917,8 +917,8 @@ en:
button_edit_associated_wikipage: "Edit associated Wiki page: %{page_title}"
button_add: Add
button_change: Change
button_apply: Apply
button_clear: Clear
button_apply: Query
button_clear: Cancel query
button_lock: Lock
button_unlock: Unlock
button_download: Download
@ -1416,13 +1416,19 @@ en:
label_identity: Identity
label_teacher: Teacher
label_student: Student
label_enterprise: Enterprise
label_developer: Developer
label_other: Other
label_gender: Gender
label_gender_male: male
label_gender_female: female
label_location: Location
label_brief_introduction: Modified my status
label_my_brief_introduction: Howdy guys! please leave your foot print~
#end
label_course: Course
label_course_new: New course
label_public_info: If you don't choose public, only the project's members can see the project.
label_course_student: Student
label_homework: Homework
label_course_new_homework: New homework
label_course_homework_list: Homework List
label_course_homework_new: new homework
label_course_data: Data

View File

@ -216,6 +216,15 @@ zh:
field_name: 名称
#added by huang
field_tea_name: 教师
field_location: 工作单位
field_couurse_time: 学时
field_course_code: 学分
field_state: 加入课程口令
field_term: 学期
field_course_un: 暂未填写
#end
field_description: 描述
field_summary: 摘要
field_is_required: 必填
@ -253,6 +262,8 @@ zh:
field_principal: 用户/用户组
field_role: 角色
field_homepage: 主页
field_time: 课时
field_code: 学分
field_is_public: 公开
field_parent: 上级项目
field_is_in_roadmap: 在路线图中显示
@ -510,6 +521,20 @@ zh:
label_activities_settings: 显示设置
label_user_login_new: 登录
label_user_login_tips: 您还没有登录,请登录后留言
#end
#by huang
label_term: 学期
label_spring: 春季
label_summer: 夏季
label_autumn: 秋季
label_followers: 关注
label_teacher: 教师
label_limit_time: 截止日期
label_commit_homework: 提交作业
label_course_homework: 对应课程
label_homework_response: 作业咨询
label_bidding_homework: 提交作业
#end
label_my_page: 我的工作台
label_my_account: 我的帐号
@ -552,6 +577,7 @@ zh:
label_history: 历史记录
label_attachment: 文件
label_attachment_new: 新建文件
label_file_upload: 上传资料
label_attachment_delete: 删除文件
label_attachment_plural: 文件
label_file_added: 文件已添加
@ -559,12 +585,20 @@ zh:
label_report_plural: 报表
label_news: 新闻
label_news_new: 添加新闻
bale_news_notice: 添加通知 #huang
label_news_notice: 发布课程通知
label_news_plural: 新闻
label_news_latest: 最近的新闻
label_news_view_all: 查看所有新闻
label_news_added: 新闻已添加
label_settings: 配置
label_overview: 活动
label_overview: 项目动态
label_course_overview: "课程动态"
label_question_student: 学生反馈 #huang
label_homework_commit: 提交作业 #huang
label_homework_info: 作业情况 #huang
label_course_file: 资料下载
label_course_news: 课程通知
label_version: 版本
label_version_new: 新建版本
label_version_plural: 版本
@ -623,7 +657,7 @@ zh:
label_query_new: 新建查询
label_filter_add: 增加过滤器
label_filter_plural: 过滤器
label_filter_plural: 查询条件
label_equals: 等于
label_not_equals: 不等于
label_in_less_than: 剩余天数小于
@ -648,6 +682,7 @@ zh:
label_not_contains: 不包含
label_day_plural:
label_repository: 版本库
label_course_repository: 代码库
label_repository_plural: 版本库
label_browse: 浏览
label_branch: 分支
@ -787,11 +822,12 @@ zh:
label_project_issues: "缺陷"
label_project_newother: "查看其他评论"
label_project_newshare: "分享了"
label_project_notice: "发布了通知:"
label_project_newadd: "添加了"
label_project_unadd: "暂无项目,赶快去创建吧!"
label_project_un: "该用户暂未参与任何项目!"
label_project_course_un: "该用户暂未加入任何课程!"
label_project_course_unadd: "你还未创建课程,赶快去创建吧!"
#end by huang
label_user_mail_option_selected: "收取选中项目的所有通知..."
label_user_mail_option_none: "不收取任何通知"
@ -865,8 +901,9 @@ zh:
button_add: 新增
button_change: 修改
button_apply: 应用
button_clear: 清除
button_apply: 查询
button_clear: 取消查询
button_clear_requirement: 取消
button_lock: 锁定
button_unlock: 解锁
button_download: 下载
@ -924,6 +961,7 @@ zh:
text_caracters_maximum: "最多 %{count} 个字符。"
text_caracters_minimum: "至少需要 %{count} 个字符。"
text_length_between: "长度必须在 %{min} 到 %{max} 个字符之间。"
text_command: 口令仅数字可以使用,学生或其他成员申请加入课程时候需要使用该口令,该口令可以由老师在课堂上公布。
text_tracker_no_workflow: 此跟踪标签未定义工作流程
text_unallowed_characters: 非法字符
text_comma_separated: 可以使用多个值(用逗号,分开)。
@ -1227,8 +1265,14 @@ zh:
field_add: 添加于 %{time} 之前
button_more: 更多
label_user_response: 用户反馈
label_student_response: 学生反馈
label_bidding_project: 参与项目
label_homework_project: 已提交作业 #huang
button_bidding: 我要参加
button_bidding_homework: 提交作业 #huang
field_homework_type: 作业类型
label_homework_respond: 作业情况
label_new_call: 发布需求
label_user_information: "与我相关"
@ -1237,19 +1281,35 @@ zh:
label_wrong_date: 时间格式错误,请输入正确的时间 yyyy-mm-dd
label_bidding_succeed: 应标成功
label_bidding_fail: 应标失败,该项目已经应标
label_bidding_homework_fail: 作业提交失败,该作业已经被提交!
label_requirement_list: 需求列表
label_x_biding_project: #modify by men
zero: 项目
one: 项目
other: 项目
zero: 应标项目
one: 应标项目
other: 应标项目
#end
label_x_homework_project: #modify by huang
zero: 已提交的作业
one: 已提交的作业
other: 已提交的作业
#end
label_x_responses: #modify by men
zero: 留言
one: 留言
other: 留言
#end
label_x_responses: #modify by huang
zero: 学生提问
one: 学生提问
other: 学生提问
#end
label_x_bids_responses: #modify by huang
zero: 用户反馈
one: 用户反馈
other: 用户反馈
#end
label_x_followers: #modify by men
zero: 关注
one: 关注
@ -1260,7 +1320,9 @@ zh:
label_investment_budget: 投资预算:
label_investment_time_limit: 投资时限:
label_my_respond: 我要反馈:
label_my_question: 有疑问请在此处提出!
label_respond_requirement: 对需求进行了反馈
label_question_requirement: 对作业提出了问题!
label_deadline: 投资时限yyyy-mm-dd
label_requirement_name: 为你的需求起个名字~~
label_requirement_description: 内容:对你的需求进行描述
@ -1274,6 +1336,7 @@ zh:
label_praise:
label_cancel_praise: 取消赞
label_bid_reason: 请输入参与理由
label_bid_reason_homework: 请输入作业提交说明!
label_create_new_projects: 创建项目
label_call_for_bids: 发布需求
label_create_course: 创建课程
@ -1293,8 +1356,11 @@ zh:
label_my:
label_i:
label_join_bidding: 参与了应标
label_jion_bidding_homework: 已提交!
label_bidding_user: 应标人:
label_bidding_user_homework: 作业提交者
label_bidding_reason: 应标宣言:
label_bidding_reason_homewrok: 作业提交说明
label_username: 用户名:
label_password: 密码:
label_about_requirement: 对需求:
@ -1356,6 +1422,7 @@ zh:
field_birthday: 生日
field_brief_introduction: 个人简介
field_location: 现住址
field_occupation: 工作单位
field_work_experience: 工作经验(年)
field_zip_code: 邮编
label_reward: 奖励:
@ -1375,14 +1442,17 @@ zh:
label_issue_cancel_query: 取消查询
field_reward_type: 奖励类型
label_tags_no: 暂无标签!
label_course_description_no: 你还未对该课程添加描述!
label_bid_publish: 发布了
label_bid_project: 项目
label_project_no_follow: 该项目暂未被关注!
label_no_bid_project: 暂无参与项目
label_no_course_project: 暂无已提交的作业!
label_bids_reward_method: 奖励方式
label_bids_reward_what: 输入奖励内容
label_call_bonus: 奖金
label_bids_form_new_description: 发布一个需求,一次竞赛或者一个课程的作业
label_homeworks_form_new_description: 发布一个作业,作业提交方式可以是附件或者项目形式,在作业类型里面设置。
label_bids_new_money: 输入奖励金额,如 500,2.5等
label_bids_new_credit: 输入该作业对应课程的学分,如 3,2.5等
label_bids_new_content: 输入奖励内容,如 奖项,物品等
@ -1395,6 +1465,7 @@ zh:
label_welcome_trustie: Trustie
label_welcome_trustie_description: 面向有创意和激情的高校大学生与创业者,提供社交化的项目管理、协同研究、软件开发和众包平台。
label_user_project: 项目
label_user_course: 课程
label_bid_respond_quote: 回复
label_bid_if_agreement: 如果喜欢我,请点击我
label_bid_respond_delete: 删除
@ -1419,24 +1490,32 @@ zh:
button_projects_feedback_respond: 回复
label_projects_feedback_respond_content: 请输入回复内容
label_user_create_project: 创建了
#added by bai
label_identity: 身份
label_teacher: 教师
label_teacher: 教 师
label_teacher_homework: 教师姓名
label_student: 学生
label_enterprise: 企业
label_developer: 开发者
label_technical_title: "职称:"
label_other: 其他
label_gender: 性别
label_gender_male:
label_gender_female:
label_location: "地区:"
field_occupation: "工作单位:"
notice_lost_location: 请选择地区信息
label_location: 地区
label_brief_introduction: 修改我的状态
label_my_brief_introduction: 今天的心情如何?留下你的脚印吧~
#end
# added by william
label_course: 课程
label_course_new: 新建课程
label_public_info: 若不公开,仅项目成员可见该项目
label_course_student: 学生
label_homework: 课程作业
label_course_file: 资料共享
label_course_new_homework: 新建作业
label_course_homework_list: 作业列表
label_course_homework_new: 发布作业
label_course_data: 资料
label_homework_statistics: 作业统计
# added by william
label_bidding_results: 应标结果
label_bid_end: 该需求已经结束!
label_special_reward: 特等奖
@ -1444,5 +1523,4 @@ zh:
label_second_reward: 二等奖
label_third_reward: 三等奖
label_excellence_reward: 优秀奖
label_comfort_reward: 入围奖
label_comfort_reward: 入围

View File

@ -91,6 +91,7 @@ RedmineApp::Application.routes.draw do
match 'info', :to => 'users#info', :via => [:get , :post], :as => 'user_info'
match 'user_watchlist', :to => 'users#user_watchlist', :via => :get, :as => "user_watchlist" #add by huang
match 'user_fanslist', :to => 'users#user_fanslist', :via => :get, :as => "user_fanslist" #add by huang
match 'user_courses', :to => 'users#user_courses', :via => :get
end
end
match 'users/:id/user_newfeedback', :to => 'users#user_newfeedback', :via => :get, :as => "feedback"
@ -129,21 +130,16 @@ RedmineApp::Application.routes.draw do
resources :projects do
member do
get 'settings(/:tab)', :action => 'settings', :as => 'settings'
# get 'show', :action => 'show', :as => 'project_show'
# get 'activity', :controller => 'activities', :action => 'index', :as => 'activity'
# get 'repository', :controller => 'repositories', :action => 'show', :repository_id => nil, :path => nil, :rev => nil, :as => 'repository'
#by young
get 'member', :controller => 'projects', :action => 'member', :as => 'member'
# get 'focus', :action => 'focus', :as => 'focus'
# get 'investor', :action => 'investor', :as => 'investor'
# get 'issue', :action =>'issue', :as => 'issue'
# get 'mission', :action => 'mission', :as => 'mission'
# get 'on', :action => 'on', :as => 'on'
get 'file', :action => 'file', :as => 'file'
get 'statistics', :action => 'statistics', :as => 'statistics'
get 'feedback', :action => 'feedback', :as => 'project_feedback'
get 'watcherlist', :action=> 'watcherlist'
match 'user_watcherlist', :to => 'projects#watcherlist', :via => :get, :as => "watcherlist" #add by huang
get 'homework', :action => 'homework', :as => 'homework'
get 'new_homework', :action => 'new_homework', :as => 'new_homework'
#get 'news', :action => 'news', :as => 'news'
#end
post 'modules'
@ -157,14 +153,11 @@ RedmineApp::Application.routes.draw do
#by young
match '/member', :controller => 'projects', :action => 'member', :as => 'member', :via => :get
# match '/focus', :controller => 'projects', :action => 'focus', :as => 'focus', :via => :get
# match '/mission', :controller => 'projects', :action => 'mission', :as => 'mission', :via => :get
# match '/on', :controller => 'projects', :action => 'on', :as => 'on', :via => :get
# match '/settings(/:tab)', :controller => 'projects', :action => 'settings', :as => 'settings', :via => :get
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 '/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
# match '/', :controller => 'projects', :action => 'show', :as => 'project_show', :via => :get
@ -173,6 +166,7 @@ RedmineApp::Application.routes.draw do
# match '/show', :controller => 'projects', :action => 'show', :as => 'project_show', :via => :get
match '/watcherlist', :controller=>'projects', :action=> 'watcherlist', :as => 'watcherlist', :via => :get #add by huang
# matche '/news', :controller => 'news', :action => 'index', :as => 'news', :via => :get
#end
resources :memberships, :shallow => true, :controller => 'members', :only => [:index, :show, :new, :create, :update, :destroy] do
@ -443,10 +437,20 @@ RedmineApp::Application.routes.draw do
get 'calls/back', :to=> 'bids#back'
match 'calls/new_bid', :controller => 'bids', :action => 'new_bid'
match 'calls/:id/show_project', :controller => 'bids', :action => 'show_project', :as => 'project_for_bid'
match 'calls/:id/show_project_homework', :controller => 'bids', :action => 'show_project_homework', :as => 'project_for_bid_homework' # by huang
match 'calls/:id/add', :controller => 'bids', :action => 'add'
match 'calls/:id/add_homework', :controller => 'bids', :action => 'add_homework'
match 'words/add_project_respond', :controller => 'words', :action => 'add_project_respond'
match 'projects/:id/feedback', :to => 'projects#feedback', :via => :get, :as => 'project_feedback'
match 'calls/create_bid', :to => 'bids#create_bid'
match 'calls/create_homework', :to => 'bids#create_homework'
match 'calls/:id/homework_respond', :to => 'bids#homework_respond'
match 'calls/:id/homework_statistics', :to => 'bids#homework_statistics'
post 'join_in/join', :to => 'courses#join', :as => 'join'
delete 'join_in/join', :to => 'courses#unjoin'
delete 'attachment/:id', :to => 'attachments#delete_homework'
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]

View File

@ -0,0 +1,9 @@
class AddProjectTypeToProject < ActiveRecord::Migration
def self.up
add_column :projects, :project_type, :integer
end
def self.down
remove_column :projects, :project_type
end
end

Some files were not shown because too many files have changed in this diff Show More