forked from jacknudt/trustieforge
Merge branch 'develop' of 10.0.47.245:/home/zhangyang into develop
Conflicts: app/controllers/account_controller.rb app/controllers/my_controller.rb app/controllers/projects_controller.rb app/controllers/users_controller.rb app/helpers/projects_helper.rb app/helpers/users_helper.rb app/models/project.rb app/models/user.rb app/models/user_extensions.rb app/views/account/register.html.erb app/views/bids/_bid_show.html.erb app/views/bids/_history.html.erb app/views/bids/_project_list.html.erb app/views/bids/show.html.erb app/views/files/index.html.erb app/views/layouts/base_bids.html.erb app/views/layouts/base_users.html.erb app/views/my/account.html.erb app/views/users/watch_bids.html.erb config/locales/en.yml config/locales/zh.yml config/routes.rb db/schema.rb lib/redmine.rb public/stylesheets/application.css
This commit is contained in:
commit
806fae7b19
|
@ -11,3 +11,6 @@ test/*
|
|||
tmp/*
|
||||
/app/models/tag.rb
|
||||
/app/models/tag.rb
|
||||
/public/images/requirements/reference - 副本 - 副本.jpg
|
||||
|
||||
/public/images/requirements/*.jpg
|
||||
|
|
|
@ -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.
|
|
@ -0,0 +1,4 @@
|
|||
/*
|
||||
Place all the styles related to the matching controller here.
|
||||
They will automatically be included in application.css.
|
||||
*/
|
|
@ -88,7 +88,9 @@ class AccountController < ApplicationController
|
|||
# create a new token for password recovery
|
||||
token = Token.new(:user => user, :action => "recovery")
|
||||
if token.save
|
||||
Thread.new do
|
||||
Mailer.lost_password(token).deliver
|
||||
end
|
||||
flash[:notice] = l(:notice_account_lost_email_sent)
|
||||
redirect_to signin_path
|
||||
return
|
||||
|
|
|
@ -116,12 +116,29 @@ class AttachmentsController < ApplicationController
|
|||
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
|
||||
unless @attachment.container_type == 'Bid' || @attachment.container_type == 'HomeworkAttach'
|
||||
@project = @attachment.project
|
||||
end
|
||||
rescue ActiveRecord::RecordNotFound
|
||||
render_404
|
||||
end
|
||||
|
|
|
@ -3,10 +3,15 @@ class BidsController < ApplicationController
|
|||
#Added by young
|
||||
menu_item :respond
|
||||
menu_item :project, :only => :show_project
|
||||
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]
|
||||
before_filter :find_bid, :only => [:show, :show_project, :create, :destroy, :more, :back, :add, :new, :homework_respond, :add_homework, :homework_statistics]
|
||||
|
||||
helper :watchers
|
||||
helper :attachments
|
||||
include AttachmentsHelper
|
||||
|
||||
def index
|
||||
# Modified by nie
|
||||
# @requirement_title = "4"
|
||||
|
@ -92,9 +97,15 @@ class BidsController < ApplicationController
|
|||
# @journals = @bid.journals.includes(:user, :details).reorder("#{Journal.table_name}.id ASC").all
|
||||
# @journals.each_with_index {|j,i| j.indice = i+1}
|
||||
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
|
||||
|
@ -111,10 +122,47 @@ 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
|
||||
|
@ -127,9 +175,13 @@ class BidsController < ApplicationController
|
|||
if BidingProject.cerate_bidding(@bid.id, project.id, bid_message)
|
||||
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|
|
||||
# format.html { redirect_to_referer_or {render :text => 'Watcher added.', :layout => true}}
|
||||
|
@ -280,6 +332,70 @@ class BidsController < ApplicationController
|
|||
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
|
||||
@jour.each_with_index {|j,i| j.indice = i+1}
|
||||
|
@ -292,6 +408,7 @@ class BidsController < ApplicationController
|
|||
end
|
||||
end
|
||||
|
||||
|
||||
def back
|
||||
@jour = @bid.journals_for_messages
|
||||
@jour.each_with_index {|j,i| j.indice = i+1}
|
||||
|
|
|
@ -19,9 +19,10 @@ 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
|
||||
helper :watchers
|
||||
|
@ -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)
|
||||
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
|
||||
|
|
|
@ -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
|
|
@ -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
|
||||
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
|
||||
|
|
|
@ -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
|
||||
|
||||
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
|
||||
|
|
|
@ -49,8 +49,12 @@ class MessagesController < ApplicationController
|
|||
all
|
||||
|
||||
@reply = Message.new(:subject => "RE: #{@message.subject}")
|
||||
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
|
||||
def new
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -51,7 +51,13 @@ class NewsController < ApplicationController
|
|||
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
|
||||
|
|
|
@ -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
|
||||
|
||||
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]
|
||||
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, :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')
|
||||
|
@ -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
|
||||
|
|
|
@ -43,16 +43,27 @@ class RepositoriesController < ApplicationController
|
|||
@repository = Repository.factory(scm)
|
||||
@repository.is_default = @project.repository.nil?
|
||||
@repository.project = @project
|
||||
@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
|
||||
@course_tag = params[:course]
|
||||
if @course_tag == 1
|
||||
render :layout => 'base_courses'
|
||||
else
|
||||
render :layout => 'base_projects'
|
||||
end
|
||||
end
|
||||
|
||||
def fork
|
||||
@repository_url = params[:repository_url]
|
||||
|
@ -209,9 +220,14 @@ class RepositoriesController < ApplicationController
|
|||
@changesets = @repository.latest_changesets(@path, @rev)
|
||||
@properties = @repository.properties(@path, @rev)
|
||||
@repositories = @project.repositories
|
||||
@course_tag = params[:course]
|
||||
if @course_tag == 1
|
||||
render :action => 'show', :layout => 'base_courses'
|
||||
else
|
||||
render :action => 'show', :layout => 'base_projects'
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
alias_method :browse, :show
|
||||
|
||||
|
@ -369,6 +385,8 @@ class RepositoriesController < ApplicationController
|
|||
end
|
||||
|
||||
def stats
|
||||
@project_id = params[:id]
|
||||
@repository_id = @repository.identifier
|
||||
render :layout => 'base_projects'
|
||||
end
|
||||
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
class TeachersController < ApplicationController
|
||||
def show
|
||||
|
||||
end
|
||||
end
|
|
@ -22,11 +22,13 @@ class UsersController < ApplicationController
|
|||
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
|
||||
|
||||
|
@ -118,6 +120,68 @@ class UsersController < ApplicationController
|
|||
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
|
||||
@jours = @user.journals_for_messages.reverse
|
||||
|
|
|
@ -24,6 +24,41 @@ class WatchersController < ApplicationController
|
|||
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
|
||||
|
||||
|
|
|
@ -32,6 +32,17 @@ 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)
|
||||
|
|
|
@ -32,6 +32,15 @@ module AttachmentsHelper
|
|||
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
|
||||
api.id attachment.id
|
||||
|
|
|
@ -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|
|
||||
#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')
|
||||
|
@ -112,4 +133,17 @@ module ProjectsHelper
|
|||
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
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
module TeachersHelper
|
||||
end
|
|
@ -64,9 +64,9 @@ module UsersHelper
|
|||
# added by fq
|
||||
# <div class="pagination" >
|
||||
# <ul>
|
||||
# <li><%= link_to("所有动态", {:controller => 'users', :action => 'show'}) %></li>
|
||||
# <li><%= link_to("只看自己", {:controller => 'users', :action => 'show', :type => 1}) %></li>
|
||||
# <li><%= link_to("所有反馈", {:controller => 'users', :action => 'show', :type => 2}) %></li>
|
||||
# <li><%= link_to("所有动态", {:controller => 'users', :action => 'show'}) %></li>
|
||||
# <li><%= link_to("只看自己", {:controller => 'users', :action => 'show', :type => 1}) %></li>
|
||||
# <li><%= link_to("所有反馈", {:controller => 'users', :action => 'show', :type => 2}) %></li>
|
||||
# </ul></div>
|
||||
|
||||
def show_activity(state)
|
||||
|
@ -91,6 +91,26 @@ module UsersHelper
|
|||
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)
|
||||
content = ''.html_safe
|
||||
|
|
|
@ -46,6 +46,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)
|
||||
objects = Array.wrap(objects)
|
||||
|
|
|
@ -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}$/
|
||||
|
@ -45,7 +51,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
|
|||
'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)
|
||||
end
|
||||
|
|
|
@ -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
|
|
@ -0,0 +1,9 @@
|
|||
class HomeworkAttach < ActiveRecord::Base
|
||||
attr_accessible :bid_id, :user_id
|
||||
|
||||
belongs_to :user
|
||||
belongs_to :bid
|
||||
|
||||
acts_as_attachable
|
||||
|
||||
end
|
|
@ -0,0 +1,8 @@
|
|||
class HomeworkForCourse < ActiveRecord::Base
|
||||
attr_accessible :bid_id, :project_id
|
||||
|
||||
belongs_to :bid
|
||||
belongs_to :project
|
||||
|
||||
|
||||
end
|
|
@ -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
|
||||
|
|
@ -27,6 +27,15 @@ class Mailer < ActionMailer::Base
|
|||
{ :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.
|
||||
#
|
||||
# Example:
|
||||
|
|
|
@ -53,12 +53,26 @@ 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_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
|
||||
##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',
|
||||
|
@ -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) }
|
||||
|
@ -1028,6 +1045,10 @@ class Project < ActiveRecord::Base
|
|||
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)
|
||||
parent_was = parent
|
||||
|
|
|
@ -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
|
|
@ -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
|
|
@ -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,14 +155,28 @@ 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
|
||||
# update hashed_password if password was set
|
||||
|
|
|
@ -1,173 +1,173 @@
|
|||
<!-- added by bai 增加地区-->
|
||||
<!-- added by bai 增加地区-->
|
||||
<script type="text/javascript" language="javascript">
|
||||
function showcity(province, cityField) {
|
||||
switch (province) {
|
||||
case "北京" :
|
||||
case "北京" :
|
||||
var cityOptions = new Array(
|
||||
"东城","西城","朝阳","丰台","石景山","海淀","门头沟",
|
||||
"房山","通州","顺义","昌平","大兴","平谷","怀柔","密云","延庆");
|
||||
"东城","西城","朝阳","丰台","石景山","海淀","门头沟",
|
||||
"房山","通州","顺义","昌平","大兴","平谷","怀柔","密云","延庆");
|
||||
break;
|
||||
case "上海" :
|
||||
case "上海" :
|
||||
var cityOptions = new Array(
|
||||
"崇明","黄浦","卢湾","徐汇","长宁","静安","普陀","闸北","虹口","杨浦","闵行",
|
||||
"宝山","嘉定","浦东","金山","松江","青浦","南汇","奉贤");
|
||||
"崇明","黄浦","卢湾","徐汇","长宁","静安","普陀","闸北","虹口","杨浦","闵行",
|
||||
"宝山","嘉定","浦东","金山","松江","青浦","南汇","奉贤");
|
||||
break;
|
||||
case "广东" :
|
||||
case "广东" :
|
||||
var cityOptions = new Array(
|
||||
"广州","深圳","珠海","东莞","中山","佛山","惠州","河源","潮州","江门","揭阳","茂名",
|
||||
"梅州","清远","汕头","汕尾","韶关","顺德","阳江","云浮","湛江","肇庆");
|
||||
"广州","深圳","珠海","东莞","中山","佛山","惠州","河源","潮州","江门","揭阳","茂名",
|
||||
"梅州","清远","汕头","汕尾","韶关","顺德","阳江","云浮","湛江","肇庆");
|
||||
break;
|
||||
case "江苏" :
|
||||
case "江苏" :
|
||||
var cityOptions = new Array(
|
||||
"南京","常熟","常州","海门","淮安","江都","江阴","昆山","连云港","南通",
|
||||
"启东","沭阳","宿迁","苏州","太仓","泰州","同里","无锡","徐州","盐城",
|
||||
"扬州","宜兴","仪征","张家港","镇江","周庄");
|
||||
"南京","常熟","常州","海门","淮安","江都","江阴","昆山","连云港","南通",
|
||||
"启东","沭阳","宿迁","苏州","太仓","泰州","同里","无锡","徐州","盐城",
|
||||
"扬州","宜兴","仪征","张家港","镇江","周庄");
|
||||
break;
|
||||
case "重庆" :
|
||||
case "重庆" :
|
||||
var cityOptions = new Array(
|
||||
"万州","涪陵","渝中","大渡口","江北","沙坪坝","九龙坡","南岸","北碚","万盛",
|
||||
"双挢","渝北","巴南","黔江","长寿","綦江","潼南","铜梁","大足","荣昌","壁山",
|
||||
"梁平","城口","丰都","垫江","武隆","忠县","开县","云阳","奉节","巫山","巫溪",
|
||||
"石柱","秀山","酉阳","彭水","江津","合川","永川","南川");
|
||||
"万州","涪陵","渝中","大渡口","江北","沙坪坝","九龙坡","南岸","北碚","万盛",
|
||||
"双挢","渝北","巴南","黔江","长寿","綦江","潼南","铜梁","大足","荣昌","壁山",
|
||||
"梁平","城口","丰都","垫江","武隆","忠县","开县","云阳","奉节","巫山","巫溪",
|
||||
"石柱","秀山","酉阳","彭水","江津","合川","永川","南川");
|
||||
break;
|
||||
case "安徽" :
|
||||
case "安徽" :
|
||||
var cityOptions = new Array(
|
||||
"合肥","安庆","蚌埠","亳州","巢湖","滁州","阜阳","贵池","淮北","淮化","淮南",
|
||||
"黄山","九华山","六安","马鞍山","宿州","铜陵","屯溪","芜湖","宣城");
|
||||
"合肥","安庆","蚌埠","亳州","巢湖","滁州","阜阳","贵池","淮北","淮化","淮南",
|
||||
"黄山","九华山","六安","马鞍山","宿州","铜陵","屯溪","芜湖","宣城");
|
||||
break;
|
||||
case "福建" :
|
||||
case "福建" :
|
||||
var cityOptions = new Array(
|
||||
"福州","厦门","泉州","漳州","龙岩","南平","宁德","莆田","三明");
|
||||
"福州","厦门","泉州","漳州","龙岩","南平","宁德","莆田","三明");
|
||||
break;
|
||||
case "甘肃" :
|
||||
case "甘肃" :
|
||||
var cityOptions = new Array(
|
||||
"兰州","白银","定西","敦煌","甘南","金昌","酒泉","临夏","平凉","天水",
|
||||
"武都","武威","西峰","张掖");
|
||||
"兰州","白银","定西","敦煌","甘南","金昌","酒泉","临夏","平凉","天水",
|
||||
"武都","武威","西峰","张掖");
|
||||
break;
|
||||
case "广西" :
|
||||
case "广西" :
|
||||
var cityOptions = new Array(
|
||||
"南宁","百色","北海","桂林","防城港","贵港","河池","贺州","柳州","钦州","梧州","玉林");
|
||||
"南宁","百色","北海","桂林","防城港","贵港","河池","贺州","柳州","钦州","梧州","玉林");
|
||||
break;
|
||||
case "贵州" :
|
||||
case "贵州" :
|
||||
var cityOptions = new Array(
|
||||
"贵阳","安顺","毕节","都匀","凯里","六盘水","铜仁","兴义","玉屏","遵义");
|
||||
"贵阳","安顺","毕节","都匀","凯里","六盘水","铜仁","兴义","玉屏","遵义");
|
||||
break;
|
||||
case "海南" :
|
||||
case "海南" :
|
||||
var cityOptions = new Array(
|
||||
"海口","儋县","陵水","琼海","三亚","通什","万宁");
|
||||
"海口","儋县","陵水","琼海","三亚","通什","万宁");
|
||||
break;
|
||||
case "河北" :
|
||||
case "河北" :
|
||||
var cityOptions = new Array(
|
||||
"石家庄","保定","北戴河","沧州","承德","丰润","邯郸","衡水","廊坊","南戴河","秦皇岛",
|
||||
"唐山","新城","邢台","张家口");
|
||||
"石家庄","保定","北戴河","沧州","承德","丰润","邯郸","衡水","廊坊","南戴河","秦皇岛",
|
||||
"唐山","新城","邢台","张家口");
|
||||
break;
|
||||
case "黑龙江" :
|
||||
case "黑龙江" :
|
||||
var cityOptions = new Array(
|
||||
"哈尔滨","北安","大庆","大兴安岭","鹤岗","黑河","佳木斯","鸡西","牡丹江","齐齐哈尔",
|
||||
"七台河","双鸭山","绥化","伊春");
|
||||
"哈尔滨","北安","大庆","大兴安岭","鹤岗","黑河","佳木斯","鸡西","牡丹江","齐齐哈尔",
|
||||
"七台河","双鸭山","绥化","伊春");
|
||||
break;
|
||||
case "河南" :
|
||||
case "河南" :
|
||||
var cityOptions = new Array(
|
||||
"郑州","安阳","鹤壁","潢川","焦作","济源","开封","漯河","洛阳","南阳","平顶山",
|
||||
"濮阳","三门峡","商丘","新乡","信阳","许昌","周口","驻马店");
|
||||
"郑州","安阳","鹤壁","潢川","焦作","济源","开封","漯河","洛阳","南阳","平顶山",
|
||||
"濮阳","三门峡","商丘","新乡","信阳","许昌","周口","驻马店");
|
||||
break;
|
||||
case "香港" :
|
||||
case "香港" :
|
||||
var cityOptions = new Array(
|
||||
"香港","九龙","新界");
|
||||
"香港","九龙","新界");
|
||||
break;
|
||||
case "湖北" :
|
||||
case "湖北" :
|
||||
var cityOptions = new Array(
|
||||
"武汉","恩施","鄂州","黄冈","黄石","荆门","荆州","潜江","十堰","随州","武穴",
|
||||
"仙桃","咸宁","襄阳","襄樊","孝感","宜昌");
|
||||
"武汉","恩施","鄂州","黄冈","黄石","荆门","荆州","潜江","十堰","随州","武穴",
|
||||
"仙桃","咸宁","襄阳","襄樊","孝感","宜昌");
|
||||
break;
|
||||
case "湖南" :
|
||||
case "湖南" :
|
||||
var cityOptions = new Array(
|
||||
"长沙","常德","郴州","衡阳","怀化","吉首","娄底","邵阳","湘潭","益阳","岳阳",
|
||||
"永州","张家界","株洲");
|
||||
"长沙","常德","郴州","衡阳","怀化","吉首","娄底","邵阳","湘潭","益阳","岳阳",
|
||||
"永州","张家界","株洲");
|
||||
break;
|
||||
case "江西" :
|
||||
case "江西" :
|
||||
var cityOptions = new Array(
|
||||
"南昌","抚州","赣州","吉安","景德镇","井冈山","九江","庐山","萍乡",
|
||||
"上饶","新余","宜春","鹰潭");
|
||||
"南昌","抚州","赣州","吉安","景德镇","井冈山","九江","庐山","萍乡",
|
||||
"上饶","新余","宜春","鹰潭");
|
||||
break;
|
||||
case "吉林" :
|
||||
case "吉林" :
|
||||
var cityOptions = new Array(
|
||||
"长春","吉林","白城","白山","珲春","辽源","梅河","四平","松原","通化","延吉");
|
||||
"长春","吉林","白城","白山","珲春","辽源","梅河","四平","松原","通化","延吉");
|
||||
break;
|
||||
case "辽宁" :
|
||||
case "辽宁" :
|
||||
var cityOptions = new Array(
|
||||
"沈阳","鞍山","本溪","朝阳","大连","丹东","抚顺","阜新","葫芦岛","锦州",
|
||||
"辽阳","盘锦","铁岭","营口");
|
||||
"沈阳","鞍山","本溪","朝阳","大连","丹东","抚顺","阜新","葫芦岛","锦州",
|
||||
"辽阳","盘锦","铁岭","营口");
|
||||
break;
|
||||
case "澳门" :
|
||||
var cityOptions = new Array("澳门");
|
||||
case "澳门" :
|
||||
var cityOptions = new Array("澳门");
|
||||
break;
|
||||
case "内蒙古" :
|
||||
case "内蒙古" :
|
||||
var cityOptions = new Array(
|
||||
"呼和浩特","阿拉善盟","包头","赤峰","东胜","海拉尔","集宁","临河","通辽","乌海",
|
||||
"乌兰浩特","锡林浩特");
|
||||
"呼和浩特","阿拉善盟","包头","赤峰","东胜","海拉尔","集宁","临河","通辽","乌海",
|
||||
"乌兰浩特","锡林浩特");
|
||||
break;
|
||||
case "宁夏" :
|
||||
case "宁夏" :
|
||||
var cityOptions = new Array(
|
||||
"银川","固源","石嘴山","吴忠");
|
||||
"银川","固源","石嘴山","吴忠");
|
||||
break;
|
||||
case "青海" :
|
||||
case "青海" :
|
||||
var cityOptions = new Array(
|
||||
"西宁","德令哈","格尔木","共和","海东","海晏","玛沁","同仁","玉树");
|
||||
"西宁","德令哈","格尔木","共和","海东","海晏","玛沁","同仁","玉树");
|
||||
break;
|
||||
case "山东" :
|
||||
case "山东" :
|
||||
var cityOptions = new Array(
|
||||
"济南","滨州","兖州","德州","东营","菏泽","济宁","莱芜","聊城","临沂",
|
||||
"蓬莱","青岛","曲阜","日照","泰安","潍坊","威海","烟台","枣庄","淄博");
|
||||
"济南","滨州","兖州","德州","东营","菏泽","济宁","莱芜","聊城","临沂",
|
||||
"蓬莱","青岛","曲阜","日照","泰安","潍坊","威海","烟台","枣庄","淄博");
|
||||
break;
|
||||
case "山西" :
|
||||
case "山西" :
|
||||
var cityOptions = new Array(
|
||||
"太原","长治","大同","候马","晋城","离石","临汾","宁武","朔州","忻州",
|
||||
"阳泉","榆次","运城");
|
||||
"太原","长治","大同","候马","晋城","离石","临汾","宁武","朔州","忻州",
|
||||
"阳泉","榆次","运城");
|
||||
break;
|
||||
case "陕西" :
|
||||
case "陕西" :
|
||||
var cityOptions = new Array(
|
||||
"西安","安康","宝鸡","汉中","渭南","商州","绥德","铜川","咸阳","延安","榆林");
|
||||
"西安","安康","宝鸡","汉中","渭南","商州","绥德","铜川","咸阳","延安","榆林");
|
||||
break;
|
||||
case "四川" :
|
||||
case "四川" :
|
||||
var cityOptions = new Array(
|
||||
"成都","巴中","达川","德阳","都江堰","峨眉山","涪陵","广安","广元","九寨沟",
|
||||
"康定","乐山","泸州","马尔康","绵阳","眉山","南充","内江","攀枝花","遂宁",
|
||||
"汶川","西昌","雅安","宜宾","自贡","资阳");
|
||||
"成都","巴中","达川","德阳","都江堰","峨眉山","涪陵","广安","广元","九寨沟",
|
||||
"康定","乐山","泸州","马尔康","绵阳","眉山","南充","内江","攀枝花","遂宁",
|
||||
"汶川","西昌","雅安","宜宾","自贡","资阳");
|
||||
break;
|
||||
case "台湾" :
|
||||
case "台湾" :
|
||||
var cityOptions = new Array(
|
||||
"台北","基隆","台南","台中","高雄","屏东","南投","云林","新竹","彰化","苗栗",
|
||||
"嘉义","花莲","桃园","宜兰","台东","金门","马祖","澎湖");
|
||||
"台北","基隆","台南","台中","高雄","屏东","南投","云林","新竹","彰化","苗栗",
|
||||
"嘉义","花莲","桃园","宜兰","台东","金门","马祖","澎湖");
|
||||
break;
|
||||
case "天津" :
|
||||
case "天津" :
|
||||
var cityOptions = new Array(
|
||||
"天津","和平","东丽","河东","西青","河西","津南","南开","北辰","河北","武清","红挢",
|
||||
"塘沽","汉沽","大港","宁河","静海","宝坻","蓟县");
|
||||
"天津","和平","东丽","河东","西青","河西","津南","南开","北辰","河北","武清","红挢",
|
||||
"塘沽","汉沽","大港","宁河","静海","宝坻","蓟县");
|
||||
break;
|
||||
case "新疆" :
|
||||
case "新疆" :
|
||||
var cityOptions = new Array(
|
||||
"乌鲁木齐","阿克苏","阿勒泰","阿图什","博乐","昌吉","东山","哈密","和田","喀什",
|
||||
"克拉玛依","库车","库尔勒","奎屯","石河子","塔城","吐鲁番","伊宁");
|
||||
"乌鲁木齐","阿克苏","阿勒泰","阿图什","博乐","昌吉","东山","哈密","和田","喀什",
|
||||
"克拉玛依","库车","库尔勒","奎屯","石河子","塔城","吐鲁番","伊宁");
|
||||
break;
|
||||
case "西藏" :
|
||||
case "西藏" :
|
||||
var cityOptions = new Array(
|
||||
"拉萨","阿里","昌都","林芝","那曲","日喀则","山南");
|
||||
"拉萨","阿里","昌都","林芝","那曲","日喀则","山南");
|
||||
break;
|
||||
case "云南" :
|
||||
case "云南" :
|
||||
var cityOptions = new Array(
|
||||
"昆明","大理","保山","楚雄","大理","东川","个旧","景洪","开远","临沧","丽江",
|
||||
"六库","潞西","曲靖","思茅","文山","西双版纳","玉溪","中甸","昭通");
|
||||
"昆明","大理","保山","楚雄","大理","东川","个旧","景洪","开远","临沧","丽江",
|
||||
"六库","潞西","曲靖","思茅","文山","西双版纳","玉溪","中甸","昭通");
|
||||
break;
|
||||
case "浙江" :
|
||||
case "浙江" :
|
||||
var cityOptions = new Array(
|
||||
"杭州","安吉","慈溪","定海","奉化","海盐","黄岩","湖州","嘉兴","金华","临安",
|
||||
"临海","丽水","宁波","瓯海","平湖","千岛湖","衢州","江山","瑞安","绍兴","嵊州",
|
||||
"台州","温岭","温州","余姚","舟山");
|
||||
"杭州","安吉","慈溪","定海","奉化","海盐","黄岩","湖州","嘉兴","金华","临安",
|
||||
"临海","丽水","宁波","瓯海","平湖","千岛湖","衢州","江山","瑞安","绍兴","嵊州",
|
||||
"台州","温岭","温州","余姚","舟山");
|
||||
break;
|
||||
case "海外" :
|
||||
case "海外" :
|
||||
var cityOptions = new Array(
|
||||
"美国","日本","英国","法国","德国","其他");
|
||||
"美国","日本","英国","法国","德国","其他");
|
||||
break;
|
||||
default:
|
||||
var cityOptions = new Array("");
|
||||
|
@ -187,7 +187,7 @@
|
|||
}
|
||||
</script>
|
||||
|
||||
<!-- added by bai 增加职称-->
|
||||
<!-- added by bai 增加职称-->
|
||||
<script type="text/javascript" language="javascript">
|
||||
function showtechnical_title(identity, technical_titleField) {
|
||||
switch (identity) {
|
||||
|
@ -196,7 +196,7 @@
|
|||
$('#technical_title').show()
|
||||
$('#no').hide()
|
||||
var technical_titleOptions = new Array(
|
||||
"教授","副教授","讲师","助教");
|
||||
"教授","副教授","讲师","助教");
|
||||
|
||||
break;
|
||||
|
||||
|
@ -253,25 +253,25 @@
|
|||
<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('userTechnical_title'));" name="identity" id="userProvince">
|
||||
<option value="">--请选择身份--</option>
|
||||
<option value="0">教师</option>
|
||||
<option value="1">学生</option>
|
||||
<option value="2">企业</option>
|
||||
<option value="3">开发者</option>
|
||||
<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>
|
||||
<input name="no" id="no" placeholder="请输入学号"></select></span>
|
||||
|
||||
</td></tr></table></p>
|
||||
<!-- end -->
|
||||
|
@ -286,42 +286,42 @@
|
|||
<p><table><tr><td class="info" align="right" style="width: 90px"><strong><%= l(:label_location) %></strong></td>
|
||||
<td class="info" style="width: 80px">
|
||||
<select onchange="showcity(this.value, document.getElementById('userCity'));" name="province" id="userProvince">
|
||||
<option value="">--请选择省份--</option>
|
||||
<option value="北京">北京</option>
|
||||
<option value="上海">上海</option>
|
||||
<option value="广东">广东</option>
|
||||
<option value="江苏">江苏</option>
|
||||
<option value="浙江">浙江</option>
|
||||
<option value="重庆">重庆</option>
|
||||
<option value="安徽">安徽</option>
|
||||
<option value="福建">福建</option>
|
||||
<option value="甘肃">甘肃</option>
|
||||
<option value="广西">广西</option>
|
||||
<option value="贵州">贵州</option>
|
||||
<option value="海南">海南</option>
|
||||
<option value="河北">河北</option>
|
||||
<option value="黑龙江">黑龙江</option>
|
||||
<option value="河南">河南</option>
|
||||
<option value="湖北">湖北</option>
|
||||
<option value="湖南">湖南</option>
|
||||
<option value="江西">江西</option>
|
||||
<option value="吉林">吉林</option>
|
||||
<option value="辽宁">辽宁</option>
|
||||
<option value="内蒙古">内蒙古</option>
|
||||
<option value="宁夏">宁夏</option>
|
||||
<option value="青海">青海</option>
|
||||
<option value="山东">山东</option>
|
||||
<option value="山西">山西</option>
|
||||
<option value="陕西">陕西</option>
|
||||
<option value="四川">四川</option>
|
||||
<option value="天津">天津</option>
|
||||
<option value="新疆">新疆</option>
|
||||
<option value="西藏">西藏</option>
|
||||
<option value="云南">云南</option>
|
||||
<option value="香港">香港特别行政区</option>
|
||||
<option value="澳门">澳门特别行政区</option>
|
||||
<option value="台湾">台湾</option>
|
||||
<option value="海外">海外</option>
|
||||
<option value="">--请选择省份--</option>
|
||||
<option value="北京">北京</option>
|
||||
<option value="上海">上海</option>
|
||||
<option value="广东">广东</option>
|
||||
<option value="江苏">江苏</option>
|
||||
<option value="浙江">浙江</option>
|
||||
<option value="重庆">重庆</option>
|
||||
<option value="安徽">安徽</option>
|
||||
<option value="福建">福建</option>
|
||||
<option value="甘肃">甘肃</option>
|
||||
<option value="广西">广西</option>
|
||||
<option value="贵州">贵州</option>
|
||||
<option value="海南">海南</option>
|
||||
<option value="河北">河北</option>
|
||||
<option value="黑龙江">黑龙江</option>
|
||||
<option value="河南">河南</option>
|
||||
<option value="湖北">湖北</option>
|
||||
<option value="湖南">湖南</option>
|
||||
<option value="江西">江西</option>
|
||||
<option value="吉林">吉林</option>
|
||||
<option value="辽宁">辽宁</option>
|
||||
<option value="内蒙古">内蒙古</option>
|
||||
<option value="宁夏">宁夏</option>
|
||||
<option value="青海">青海</option>
|
||||
<option value="山东">山东</option>
|
||||
<option value="山西">山西</option>
|
||||
<option value="陕西">陕西</option>
|
||||
<option value="四川">四川</option>
|
||||
<option value="天津">天津</option>
|
||||
<option value="新疆">新疆</option>
|
||||
<option value="西藏">西藏</option>
|
||||
<option value="云南">云南</option>
|
||||
<option value="香港">香港特别行政区</option>
|
||||
<option value="澳门">澳门特别行政区</option>
|
||||
<option value="台湾">台湾</option>
|
||||
<option value="海外">海外</option>
|
||||
</select></td>
|
||||
<td class="info" style="width: 100px">
|
||||
<select name="city" id="userCity"></select></td></tr></table></p>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
$('#attachments_<%= j params[:attachment_id] %>').remove();
|
|
@ -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') %>: <%= 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) %> <%= 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) %> <%= bid.budget%> <%= 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-->
|
|
@ -1,5 +1,4 @@
|
|||
<!-- fq -->
|
||||
|
||||
<% bids.each do |bid|%>
|
||||
|
||||
<table width="95%" border="0" style="padding-left: 10px; padding-top: 10px;">
|
||||
|
@ -13,24 +12,22 @@
|
|||
<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) %> <%= 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>
|
||||
<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) %> <%= 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) %> <%= bid.budget%> <%= 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 %>
|
||||
<strong><%= l(:label_bids_reward_method) %><span style="color: #00aa83;font-family: 14px; font-family: 微软雅黑"><%= l(:label_bids_credit) %> <%= bid.budget%> <%= l(:label_bids_credit_number) %></span></strong>
|
||||
<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 %>
|
||||
|
||||
<!-- <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>
|
||||
|
@ -68,19 +65,26 @@
|
|||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
||||
<td width="500">
|
||||
<table border="0">
|
||||
<tr><td>
|
||||
<% 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) %> <%= bid.budget%><%= l(:label_RMB_sign) %></span></strong></td>
|
||||
<strong><%= l(:label_bids_reward_method) %><span style="color: #ed8924;font-family: 14px; font-family: 微软雅黑"><%= l(:label_call_bonus) %> <%= l(:label_RMB_sign) %><%= bid.budget%></span></strong>
|
||||
<% 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>
|
||||
<strong><%= l(:label_bids_reward_method) %><span style="color: #15bccf;font-family: 14px; font-family: 微软雅黑"><%= bid.budget%></span></strong>
|
||||
<% else %>
|
||||
<td><strong><%= l(:label_bids_reward_method) %><span style="color: #ed8924;font-family: 14px; font-family: 微软雅黑">学分 <%= bid.budget%>分</span></strong></td>
|
||||
<strong><%= l(:label_bids_reward_method) %><span style="color: #00aa83;font-family: 14px; font-family: 微软雅黑"><%= l(:label_bids_credit) %> <%= bid.budget%> <%= l(:label_bids_credit_number) %></span></strong>
|
||||
<% end %>
|
||||
</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>
|
||||
|
||||
<!-- <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="200px" valign="bottom" style="padding-bottom: 5px">
|
||||
<table>
|
||||
|
|
|
@ -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) %>
|
||||
</p>
|
||||
|
|
|
@ -1,7 +1,14 @@
|
|||
<!-- added by fq -->
|
||||
<table width="660px" border="0" align="center">
|
||||
<tr>
|
||||
<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>
|
||||
|
||||
|
||||
|
@ -18,8 +25,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>
|
||||
<% 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>
|
||||
|
|
|
@ -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>
|
|
@ -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 %>
|
|
@ -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 %>
|
||||
|
|
|
@ -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 %>
|
|
@ -1,5 +1,62 @@
|
|||
<!-- fq -->
|
||||
<%= render_flash_messages %>
|
||||
<% if @bid.reward_type == 3 %>
|
||||
<table width="1000px" border="0" style="padding-left: 15px">
|
||||
<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? %>
|
||||
|
@ -49,3 +106,4 @@
|
|||
</tr>
|
||||
</table>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
|
|
@ -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();
|
|
@ -0,0 +1,4 @@
|
|||
未交作业人数(
|
||||
<% %>)
|
||||
|
||||
已交作业人数
|
|
@ -4,7 +4,23 @@
|
|||
<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">
|
||||
<%= render :partial => "/praise_tread/praise_tread",
|
||||
:locals => {:obj => @bid,:show_flag => true,:user_id =>User.current.id}%>
|
||||
</span>
|
||||
|
||||
</td>
|
||||
<td>
|
||||
<!-- 在这里添加赞和踩-->
|
||||
<span id="praise_tread" style="float: right">
|
||||
<%= render :partial => "/praise_tread/praise_tread",
|
||||
:locals => {:obj => @bid,:show_flag => true,:user_id =>User.current.id}%>
|
||||
</span>
|
||||
|
||||
</td>
|
||||
<td>
|
||||
<!-- 在这里添加赞和踩-->
|
||||
<span id="praise_tread" style="float: right">
|
||||
|
@ -20,7 +36,6 @@
|
|||
<% 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: #00aa83;font-family: 14px; font-family: 微软雅黑"><%= l(:label_bids_credit) %> <%= @bid.budget%> <%= l(:label_bids_credit_number) %></span></strong></td>
|
||||
<% end %>
|
||||
</tr>
|
||||
</table></td>
|
||||
|
@ -31,7 +46,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>
|
||||
|
||||
|
|
|
@ -1,4 +1,9 @@
|
|||
<!-- fq -->
|
||||
|
||||
<% if @bid.homework_type == 1%>
|
||||
<%= render :partial => 'homework' %>
|
||||
|
||||
<% else %>
|
||||
<style>
|
||||
input[type="submit"].bid_btn {
|
||||
vertical-align: middle;
|
||||
|
@ -66,11 +71,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", :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'",
|
||||
|
@ -84,3 +93,5 @@
|
|||
<div id='bidding_project_list'>
|
||||
<%= render :partial => 'project_list', :locals => {:bidding_project => @bidding_project} %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
|
|
|
@ -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>
|
|
@ -0,0 +1,8 @@
|
|||
$('#join').html('<%= escape_javascript join_in_course(course, user) %>');
|
||||
<% if @state %>
|
||||
<% if @state == 0 %>
|
||||
alert("加入成功")
|
||||
<% else %>
|
||||
alert("密码错误")
|
||||
<% end %>
|
||||
<% end %>
|
|
@ -1,6 +1,14 @@
|
|||
<div class="contextual" style="padding-right: 440px;padding-top: 5px;">
|
||||
<% 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)) -%>
|
||||
|
||||
|
|
|
@ -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) %>
|
||||
<%= link_to l(:label_bidding_project)+"("+@bid.biding_projects.count.to_s+")", project_for_bid_path(@bid) %>
|
||||
<%= 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">
|
||||
|
|
|
@ -0,0 +1,174 @@
|
|||
<!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>
|
||||
<tr>
|
||||
<td valign="top" style="padding-left: 8px;">教师单位:</td><td class="font_lighter_sidebar"><%= @course.teacher.user_extensions.occupation %></td>
|
||||
</tr>
|
||||
|
||||
</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>
|
|
@ -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>
|
|
@ -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>
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
<h1><%= link_to("hello", @url) %></h1>
|
||||
<em><%=h @user %></em>
|
|
@ -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>
|
||||
|
|
|
@ -1,12 +1,24 @@
|
|||
<div style="padding-bottom: 10px">
|
||||
<% 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>
|
||||
<% end %>
|
||||
<tr>
|
||||
<td colspan="2" width="580px" ><span class="font_description"><%= textilizable(news, :description) %></span></td>
|
||||
</tr>
|
||||
|
|
|
@ -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 %>
|
|
@ -1,6 +1,10 @@
|
|||
<div class="box tabular" style="margin-right:10px;" >
|
||||
<%= labelled_form_for @project do |f| %>
|
||||
<% 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>
|
|
@ -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' %>
|
||||
|
||||
|
|
|
@ -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>
|
|
@ -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%>
|
|
@ -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 %>
|
|
@ -25,7 +25,14 @@
|
|||
</div>
|
||||
<div class="add-info">
|
||||
<div class="main-language">
|
||||
<!-- 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) %>
|
||||
|
|
|
@ -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>
|
||||
|
|
@ -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 %>
|
||||
|
@ -35,10 +35,57 @@
|
|||
</div> -->
|
||||
|
||||
|
||||
<!-- <div class="pagination_list">
|
||||
<ul>
|
||||
<li>
|
||||
<%= link_to l(:label_sort_by_time), projects_path(:project_sort_type => '0'),:class=>"test_new" %>
|
||||
</li>
|
||||
<li>
|
||||
<%= link_to l(:label_sort_by_active), projects_path(:project_sort_type => '1'),:class=>"test_new" %>
|
||||
</li>
|
||||
<li>
|
||||
<%= link_to l(:label_sort_by_influence), projects_path(:project_sort_type => '2'),:class=>"test_new" %>
|
||||
</li>
|
||||
</ul>
|
||||
</div> -->
|
||||
|
||||
|
||||
<%= sort_project(@s_type)%>
|
||||
<!-- <div class="pagination_list">
|
||||
<ul>
|
||||
<li>
|
||||
<%= link_to l(:label_sort_by_time), projects_path(:project_sort_type => '0'),:class=>"test_new" %>
|
||||
</li>
|
||||
<li>
|
||||
<%= link_to l(:label_sort_by_active), projects_path(:project_sort_type => '1'),:class=>"test_new" %>
|
||||
</li>
|
||||
<li>
|
||||
<%= link_to l(:label_sort_by_influence), projects_path(:project_sort_type => '2'),:class=>"test_new" %>
|
||||
</li>
|
||||
</ul>
|
||||
</div> -->
|
||||
|
||||
|
||||
<%= sort_project(@s_type)%>
|
||||
<!-- <div class="pagination_list">
|
||||
<ul>
|
||||
<li>
|
||||
<%= link_to l(:label_sort_by_time), projects_path(:project_sort_type => '0'),:class=>"test_new" %>
|
||||
</li>
|
||||
<li>
|
||||
<%= link_to l(:label_sort_by_active), projects_path(:project_sort_type => '1'),:class=>"test_new" %>
|
||||
</li>
|
||||
<li>
|
||||
<%= link_to l(:label_sort_by_influence), projects_path(:project_sort_type => '2'),:class=>"test_new" %>
|
||||
</li>
|
||||
</ul>
|
||||
</div> -->
|
||||
|
||||
|
||||
<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 %>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -1,12 +1,19 @@
|
|||
<h3><%=l(:label_project_new)%></h3>
|
||||
|
||||
<%= labelled_form_for @project do |f| %>
|
||||
<!--Added by young-->
|
||||
<% 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' %>
|
||||
<%= javascript_tag "$('#project_name').focus();" %>
|
||||
<% end %>
|
||||
<%= javascript_tag "$('#project_name').focus();" %>
|
||||
</div>
|
||||
<% end %>
|
||||
<!--Ended by young-->
|
||||
|
|
|
@ -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>
|
|
@ -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');
|
|
@ -1,3 +1,7 @@
|
|||
<h3><%=l(:label_settings)%></h3>
|
||||
<% if @project.project_type == 1 %>
|
||||
<%= render_tabs course_settings_tabs %>
|
||||
<% else %>
|
||||
<%= render_tabs project_settings_tabs %>
|
||||
<% end %>
|
||||
<% html_title(l(:label_settings)) -%>
|
||||
|
|
|
@ -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 />
|
||||
|
|
|
@ -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 %>
|
|
@ -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">
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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)) -%>
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
</div>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<div><%= l(:label_tags_no) %></div>
|
||||
<div style="color:#919294;"><%= l(:label_tags_no) %></div>
|
||||
<% end %>
|
||||
|
||||
<% end %>
|
|
@ -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>)
|
||||
|
||||
<%= 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>
|
|
@ -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') %>: <%= 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) %> <%= 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) %> <%= bid.budget%> <%= 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 %>
|
|
@ -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>
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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 %>
|
||||
|
|
@ -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;">
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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) %> <%= 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) %> <%= 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) %> <%= bid.budget%> <%= 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) %> <%= bid.budget%> <%= 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>
|
||||
|
|
|
@ -61,7 +61,6 @@
|
|||
<caption>»<%= 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 -%>
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
|
||||
|
||||
$('#join').html('<%= escape_javascript join_in_course(course, user) %>');
|
|
@ -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
|
||||
|
||||
|
|
|
@ -216,6 +216,14 @@ zh:
|
|||
|
||||
|
||||
field_name: 名称
|
||||
#added by huang
|
||||
field_tea_name: 教师
|
||||
field_location: 工作单位
|
||||
field_couurse_time: 学时
|
||||
field_course_code: 学分
|
||||
field_state: 加入课程口令
|
||||
field_term: 学期
|
||||
#end
|
||||
field_description: 描述
|
||||
field_summary: 摘要
|
||||
field_is_required: 必填
|
||||
|
@ -253,6 +261,8 @@ zh:
|
|||
field_principal: 用户/用户组
|
||||
field_role: 角色
|
||||
field_homepage: 主页
|
||||
field_time: 课时
|
||||
field_code: 学分
|
||||
field_is_public: 公开
|
||||
field_parent: 上级项目
|
||||
field_is_in_roadmap: 在路线图中显示
|
||||
|
@ -510,6 +520,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 +576,7 @@ zh:
|
|||
label_history: 历史记录
|
||||
label_attachment: 文件
|
||||
label_attachment_new: 新建文件
|
||||
label_file_upload: 上传资料
|
||||
label_attachment_delete: 删除文件
|
||||
label_attachment_plural: 文件
|
||||
label_file_added: 文件已添加
|
||||
|
@ -559,12 +584,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 +656,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 +681,7 @@ zh:
|
|||
label_not_contains: 不包含
|
||||
label_day_plural: 天
|
||||
label_repository: 版本库
|
||||
label_course_repository: 代码库
|
||||
label_repository_plural: 版本库
|
||||
label_browse: 浏览
|
||||
label_branch: 分支
|
||||
|
@ -787,11 +821,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 +900,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 +960,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,9 +1264,15 @@ 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: "与我相关"
|
||||
label_bid_succeed: "需求发布成功"
|
||||
|
@ -1237,19 +1280,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 +1319,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 +1335,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 +1355,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 +1421,7 @@ zh:
|
|||
field_birthday: 生日
|
||||
field_brief_introduction: 个人简介
|
||||
field_location: 现住址
|
||||
field_occupation: 工作单位
|
||||
field_work_experience: 工作经验(年)
|
||||
field_zip_code: 邮编
|
||||
label_reward: 奖励:
|
||||
|
@ -1375,14 +1441,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 +1464,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,22 +1489,28 @@ zh:
|
|||
button_projects_feedback_respond: 回复
|
||||
label_projects_feedback_respond_content: 请输入回复内容
|
||||
label_user_create_project: 创建了
|
||||
|
||||
#added by bai
|
||||
label_identity: 身份
|
||||
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
|
||||
|
||||
|
||||
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: 作业统计
|
||||
|
|
|
@ -89,6 +89,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"
|
||||
|
@ -124,25 +125,19 @@ RedmineApp::Application.routes.draw do
|
|||
post 'issues/:object_id/watchers', :to => 'watchers#create', :object_type => 'issue'
|
||||
delete 'issues/:object_id/watchers/:user_id' => 'watchers#destroy', :object_type => 'issue'
|
||||
|
||||
|
||||
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'
|
||||
|
@ -156,13 +151,10 @@ 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
|
||||
|
@ -172,6 +164,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
|
||||
|
@ -442,10 +435,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 'test/index', :controller => 'test', :action => 'index'
|
||||
|
|
|
@ -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
|
|
@ -0,0 +1,12 @@
|
|||
class CreateTeachers < ActiveRecord::Migration
|
||||
def change
|
||||
create_table :teachers do |t|
|
||||
t.string :tea_name
|
||||
t.string :location
|
||||
t.integer :couurse_time
|
||||
t.integer :course_code
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue