Merge remote-tracking branch 'origin/szzh' into guange_dev
Conflicts: app/controllers/zipdown_controller.rb app/views/bids/_homework_list.html.erb config/routes.rb db/schema.rb public/javascripts/attachments.js
This commit is contained in:
commit
f139427f03
4
Gemfile
4
Gemfile
|
@ -23,7 +23,7 @@ gem 'ruby-ole'
|
|||
#gem 'email_verifier', path: 'lib/email_verifier'
|
||||
gem 'rufus-scheduler'
|
||||
#gem 'dalli', path: 'lib/dalli-2.7.2'
|
||||
gem 'rails_kindeditor'
|
||||
gem 'rails_kindeditor',path:'lib/rails_kindeditor'
|
||||
group :development do
|
||||
gem 'grape-swagger'
|
||||
#gem 'grape-swagger-ui', git: 'https://github.com/guange2015/grape-swagger-ui.git'
|
||||
|
@ -32,7 +32,7 @@ group :development do
|
|||
if RUBY_VERSION >= '2.0.0'
|
||||
gem 'pry-byebug'
|
||||
else
|
||||
gem 'pry-debugger'
|
||||
# gem 'pry-debugger'
|
||||
end
|
||||
gem 'pry-stack_explorer'
|
||||
gem 'better_errors', '~> 1.1.0'
|
||||
|
|
|
@ -15,7 +15,7 @@ class BidsController < ApplicationController
|
|||
before_filter :can_show_contest,only: []
|
||||
#Ended by young
|
||||
before_filter :find_bid, :only => [:show, :show_project, :create,:destroy,:more,:back,:add,:delete,:new,:show_results,:set_reward, :add_homework, :fork, :create_fork,
|
||||
:show_course, :show_courseEx,:show_bid_project, :show_bid_user, :join_in_contest, :unjoin_in_contest, :new_join,:show_participator, :settings]
|
||||
:show_course, :show_courseEx,:show_bid_project, :show_bid_user, :join_in_contest, :unjoin_in_contest, :new_join,:show_participator, :settings]
|
||||
# added by fq
|
||||
before_filter :require_login, :only => [:join_in_contest, :unjoin_in_contest]
|
||||
# end
|
||||
|
@ -48,7 +48,7 @@ class BidsController < ApplicationController
|
|||
format.js
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
def index
|
||||
@project_type = params[:project_type]
|
||||
|
@ -57,8 +57,8 @@ class BidsController < ApplicationController
|
|||
@offset, @limit = api_offset_and_limit({:limit => 10})
|
||||
if @project_type == '1'
|
||||
@bids = Bid.visible.where('reward_type = ?', 3)
|
||||
# elsif
|
||||
# @bids = Bid.visible.where('reward_type = ? or reward_type = ?', 4)
|
||||
# elsif
|
||||
# @bids = Bid.visible.where('reward_type = ? or reward_type = ?', 4)
|
||||
else
|
||||
@bids = Bid.visible.where('reward_type = ?', 1)
|
||||
end
|
||||
|
@ -71,33 +71,33 @@ class BidsController < ApplicationController
|
|||
#added by nie
|
||||
if params[:bid_sort_type].present?
|
||||
case params[:bid_sort_type]
|
||||
when '0'
|
||||
unless @offset == 0
|
||||
@bids = @bids.offset(@offset).limit(@limit).all.reverse
|
||||
else
|
||||
limit = @bid_count % @limit
|
||||
limit = @limit if limit == 0
|
||||
@bids = @bids.offset(@offset).limit(limit).all.reverse
|
||||
end
|
||||
@s_state = 0
|
||||
when '1'
|
||||
unless @offset == 0
|
||||
@bids = @bids.reorder('bids.commit').offset(@offset).limit(@limit).all.reverse
|
||||
else
|
||||
limit = @bid_count % @limit
|
||||
limit = @limit if limit == 0
|
||||
@bids = @bids.reorder('bids.commit').offset(@offset).limit(limit).all.reverse
|
||||
end
|
||||
@s_state = 1
|
||||
when '2'
|
||||
unless @offset == 0
|
||||
@bids = @bids.offset(@offset).limit(@limit).all.reverse
|
||||
else
|
||||
limit = @bid_count % @limit
|
||||
limit = @limit if limit == 0
|
||||
@bids = @bids.offset(@offset).limit(@limit).all.reverse
|
||||
end
|
||||
@s_state = 0
|
||||
when '0'
|
||||
unless @offset == 0
|
||||
@bids = @bids.offset(@offset).limit(@limit).all.reverse
|
||||
else
|
||||
limit = @bid_count % @limit
|
||||
limit = @limit if limit == 0
|
||||
@bids = @bids.offset(@offset).limit(limit).all.reverse
|
||||
end
|
||||
@s_state = 0
|
||||
when '1'
|
||||
unless @offset == 0
|
||||
@bids = @bids.reorder('bids.commit').offset(@offset).limit(@limit).all.reverse
|
||||
else
|
||||
limit = @bid_count % @limit
|
||||
limit = @limit if limit == 0
|
||||
@bids = @bids.reorder('bids.commit').offset(@offset).limit(limit).all.reverse
|
||||
end
|
||||
@s_state = 1
|
||||
when '2'
|
||||
unless @offset == 0
|
||||
@bids = @bids.offset(@offset).limit(@limit).all.reverse
|
||||
else
|
||||
limit = @bid_count % @limit
|
||||
limit = @limit if limit == 0
|
||||
@bids = @bids.offset(@offset).limit(@limit).all.reverse
|
||||
end
|
||||
@s_state = 0
|
||||
end
|
||||
else
|
||||
unless @offset == 0
|
||||
|
@ -109,7 +109,7 @@ class BidsController < ApplicationController
|
|||
end
|
||||
@s_state = 1
|
||||
end
|
||||
#end
|
||||
#end
|
||||
end
|
||||
#huang
|
||||
def contest
|
||||
|
@ -130,33 +130,33 @@ class BidsController < ApplicationController
|
|||
#added by nie
|
||||
if params[:contest_sort_type].present?
|
||||
case params[:contest_sort_type]
|
||||
when '0'
|
||||
unless @offset == 0
|
||||
@bids = @bids.offset(@offset).limit(@limit).all.reverse
|
||||
else
|
||||
limit = @bid_count % @limit
|
||||
limit = @limit if limit == 0
|
||||
@bids = @bids.offset(@offset).limit(limit).all.reverse
|
||||
end
|
||||
@s_state = 0
|
||||
when '1'
|
||||
unless @offset == 0
|
||||
@bids = @bids.reorder('bids.commit').offset(@offset).limit(@limit).all.reverse
|
||||
else
|
||||
limit = @bid_count % @limit
|
||||
limit = @limit if limit == 0
|
||||
@bids = @bids.reorder('bids.commit').offset(@offset).limit(limit).all.reverse
|
||||
end
|
||||
@s_state = 1
|
||||
when '2'
|
||||
unless @offset == 0
|
||||
@bids = @bids.offset(@offset).limit(@limit).all.reverse
|
||||
else
|
||||
limit = @bid_count % @limit
|
||||
limit = @limit if limit == 0
|
||||
@bids = @bids.offset(@offset).limit(@limit).all.reverse
|
||||
end
|
||||
@s_state = 0
|
||||
when '0'
|
||||
unless @offset == 0
|
||||
@bids = @bids.offset(@offset).limit(@limit).all.reverse
|
||||
else
|
||||
limit = @bid_count % @limit
|
||||
limit = @limit if limit == 0
|
||||
@bids = @bids.offset(@offset).limit(limit).all.reverse
|
||||
end
|
||||
@s_state = 0
|
||||
when '1'
|
||||
unless @offset == 0
|
||||
@bids = @bids.reorder('bids.commit').offset(@offset).limit(@limit).all.reverse
|
||||
else
|
||||
limit = @bid_count % @limit
|
||||
limit = @limit if limit == 0
|
||||
@bids = @bids.reorder('bids.commit').offset(@offset).limit(limit).all.reverse
|
||||
end
|
||||
@s_state = 1
|
||||
when '2'
|
||||
unless @offset == 0
|
||||
@bids = @bids.offset(@offset).limit(@limit).all.reverse
|
||||
else
|
||||
limit = @bid_count % @limit
|
||||
limit = @limit if limit == 0
|
||||
@bids = @bids.offset(@offset).limit(@limit).all.reverse
|
||||
end
|
||||
@s_state = 0
|
||||
end
|
||||
else
|
||||
unless @offset == 0
|
||||
|
@ -168,7 +168,7 @@ class BidsController < ApplicationController
|
|||
end
|
||||
@s_state = 1
|
||||
end
|
||||
#end
|
||||
#end
|
||||
end
|
||||
|
||||
def fork
|
||||
|
@ -176,11 +176,12 @@ class BidsController < ApplicationController
|
|||
@membership = User.current.memberships.all(:conditions => Project.visible_condition(User.current))
|
||||
@membership.each do |membership|
|
||||
if membership.project.project_type == 1
|
||||
@courses << membership.project
|
||||
@courses << membership.project
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
#将某个企业外包需求选为作业,目前此功能已放弃
|
||||
def create_fork
|
||||
@homework = Bid.new
|
||||
@homework.name = params[:bid][:name]
|
||||
|
@ -215,6 +216,7 @@ class BidsController < ApplicationController
|
|||
end
|
||||
end
|
||||
|
||||
#有两个路由链接到此方法:/bids/:id /calls/:id但是貌似这两个路由都不能访问。。方法作用有待确认
|
||||
def show
|
||||
@user = @bid.author
|
||||
@jours = @bid.journals_for_messages.where('m_parent_id IS NULL').order('created_on DESC')
|
||||
|
@ -229,12 +231,12 @@ class BidsController < ApplicationController
|
|||
layout_file = ''
|
||||
case @bid.reward_type
|
||||
when 3
|
||||
html_title(l(:label_question_student))
|
||||
layout_file = 'base_homework'
|
||||
when 1
|
||||
layout_file = 'base_bids'
|
||||
else
|
||||
layout_file = 'base_contest'
|
||||
html_title(l(:label_question_student))
|
||||
layout_file = 'base_homework'
|
||||
when 1
|
||||
layout_file = 'base_bids'
|
||||
else
|
||||
layout_file = 'base_contest'
|
||||
end
|
||||
format.html {
|
||||
render :layout => layout_file
|
||||
|
@ -242,7 +244,7 @@ class BidsController < ApplicationController
|
|||
format.api
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
def join_in_contest
|
||||
if @bid.reward_type == 2 && params[:course_password] == @bid.password
|
||||
JoinInContest.create(:user_id => User.current.id, :bid_id => @bid.id)
|
||||
|
@ -250,53 +252,44 @@ class BidsController < ApplicationController
|
|||
else
|
||||
@state = 1
|
||||
end
|
||||
|
||||
respond_to do |format|
|
||||
# format.html { redirect_to_referer_or {render :text => (watching ? 'Watcher added.' : 'Watcher removed.'), :layout => true}}
|
||||
# TO_DO
|
||||
format.js { render :partial => 'set_join', :locals => {:user => User.current, :object_id => params[:id]} }
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
def unjoin_in_contest
|
||||
|
||||
joined = JoinInContest.where('bid_id = ? and user_id = ?', @bid.id, User.current.id)
|
||||
|
||||
joined.each do |join|
|
||||
join.delete
|
||||
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, :object_id => params[:id]} }
|
||||
end
|
||||
end
|
||||
|
||||
def new_join
|
||||
# added by fq
|
||||
|
||||
def new_join
|
||||
|
||||
end
|
||||
|
||||
|
||||
# added by bai 增加了参与者和竞赛设置
|
||||
def show_participator
|
||||
render :layout => 'base_contest'
|
||||
|
||||
end
|
||||
|
||||
|
||||
#配置竞赛
|
||||
def settings
|
||||
if @bid.author.id == User.current.id
|
||||
if @bid.reward_type == 2
|
||||
@contest = Bid.find_by_reward_type(@bid.reward_type)
|
||||
render :layout => 'base_contest'
|
||||
end
|
||||
else
|
||||
render_403 :message => :notice_not_contest_setting_authorized
|
||||
end
|
||||
if @bid.author.id == User.current.id
|
||||
if @bid.reward_type == 2
|
||||
@contest = Bid.find_by_reward_type(@bid.reward_type)
|
||||
render :layout => 'base_contest'
|
||||
end
|
||||
else
|
||||
render_403 :message => :notice_not_contest_setting_authorized
|
||||
end
|
||||
end
|
||||
#end
|
||||
|
||||
# 显示课程
|
||||
# 显示课程作业,但是好像已经废弃
|
||||
def show_course
|
||||
bids = Bid.where('parent_id = ?', @bid.id)
|
||||
@courses = []
|
||||
|
@ -311,12 +304,12 @@ class BidsController < ApplicationController
|
|||
}
|
||||
elsif @bid.reward_type == 1
|
||||
format.html {
|
||||
render :layout => 'base_bids'
|
||||
}
|
||||
render :layout => 'base_bids'
|
||||
}
|
||||
else
|
||||
format.html {
|
||||
render :layout => 'base_contest'
|
||||
}
|
||||
format.html {
|
||||
render :layout => 'base_contest'
|
||||
}
|
||||
end
|
||||
format.api
|
||||
|
||||
|
@ -337,12 +330,12 @@ class BidsController < ApplicationController
|
|||
}
|
||||
elsif @bid.reward_type == 1
|
||||
format.html {
|
||||
render :layout => 'base_bids'
|
||||
}
|
||||
render :layout => 'base_bids'
|
||||
}
|
||||
else
|
||||
format.html {
|
||||
render :layout => 'base_contest'
|
||||
}
|
||||
format.html {
|
||||
render :layout => 'base_contest'
|
||||
}
|
||||
end
|
||||
format.api
|
||||
|
||||
|
@ -365,12 +358,12 @@ class BidsController < ApplicationController
|
|||
}
|
||||
elsif @bid.reward_type == 1
|
||||
format.html {
|
||||
render :layout => 'base_bids'
|
||||
}
|
||||
render :layout => 'base_bids'
|
||||
}
|
||||
else
|
||||
format.html {
|
||||
render :layout => 'base_contest'
|
||||
}
|
||||
format.html {
|
||||
render :layout => 'base_contest'
|
||||
}
|
||||
end
|
||||
format.api
|
||||
|
||||
|
@ -459,9 +452,7 @@ class BidsController < ApplicationController
|
|||
def show_courseEx
|
||||
|
||||
if (User.current.logged? && (User.current.member_of_course?(@bid.courses.first) || User.current.admin?))
|
||||
# flash[:notice] = ""
|
||||
@membership = User.current.coursememberships.all(:conditions => Course.visible_condition(User.current))
|
||||
|
||||
@user = @bid.author
|
||||
@bidding_project = @bid.biding_projects.all
|
||||
|
||||
|
@ -569,12 +560,12 @@ class BidsController < ApplicationController
|
|||
}
|
||||
elsif @bid.reward_type == 1
|
||||
format.html {
|
||||
render :layout => 'base_bids'
|
||||
}
|
||||
render :layout => 'base_bids'
|
||||
}
|
||||
else
|
||||
format.html {
|
||||
render :layout => 'base_contest'
|
||||
}
|
||||
format.html {
|
||||
render :layout => 'base_contest'
|
||||
}
|
||||
end
|
||||
format.api
|
||||
end
|
||||
|
@ -586,19 +577,19 @@ class BidsController < ApplicationController
|
|||
bid_message = params[:bid_for_save][:bid_message]
|
||||
if BidingProject.where("project_id = ? and bid_id = ?", project.id, @bid.id).size == 0
|
||||
if BidingProject.cerate_bidding(@bid.id, project.id, bid_message)
|
||||
|
||||
|
||||
# added by bai type ==1 需求,type==2 竞赛, type==3 作业
|
||||
if @bid.reward_type == 1
|
||||
flash.now[:notice] = l(:label_bidding_succeed)
|
||||
|
||||
|
||||
elsif @bid.reward_type == 2
|
||||
flash.now[:notice] = l(:label_bidding_contest_succeed)
|
||||
|
||||
|
||||
else @bid.reward_type == 3
|
||||
flash.now[:notice] = l(:label_bidding_homework_succeed)
|
||||
flash.now[:notice] = l(:label_bidding_homework_succeed)
|
||||
end
|
||||
# end
|
||||
|
||||
|
||||
end
|
||||
else
|
||||
if @bid.reward_type == 3
|
||||
|
@ -609,11 +600,11 @@ class BidsController < ApplicationController
|
|||
end
|
||||
@bidding_project = @bid.biding_projects
|
||||
respond_to do |format|
|
||||
# format.html { redirect_to_referer_or {render :text => 'Watcher added.', :layout => true}}
|
||||
# format.html
|
||||
# format.html { redirect_to_referer_or {render :text => 'Watcher added.', :layout => true}}
|
||||
# format.html
|
||||
format.html { redirect_to :back }
|
||||
format.js
|
||||
#format.api { render_api_ok }
|
||||
#format.api { render_api_ok }
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -647,7 +638,7 @@ class BidsController < ApplicationController
|
|||
@bid.set_commit(@feedback_count)
|
||||
respond_to do |format|
|
||||
format.js
|
||||
#format.api { render_api_ok }
|
||||
#format.api { render_api_ok }
|
||||
end
|
||||
|
||||
end
|
||||
|
@ -674,9 +665,9 @@ class BidsController < ApplicationController
|
|||
# @message_count = a_message.count
|
||||
|
||||
respond_to do |format|
|
||||
# format.html
|
||||
# format.html
|
||||
format.js
|
||||
#format.api { render_api_ok }
|
||||
#format.api { render_api_ok }
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -689,7 +680,7 @@ class BidsController < ApplicationController
|
|||
respond_to do |format|
|
||||
format.html { redirect_to :back }
|
||||
format.js
|
||||
#format.api { render_api_ok }
|
||||
#format.api { render_api_ok }
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -698,11 +689,11 @@ class BidsController < ApplicationController
|
|||
def new
|
||||
@jour = JournalsForMessage.find(params[:journal_id]) if params[:journal_id]
|
||||
if @jour
|
||||
user = @jour.user
|
||||
text = @jour.notes
|
||||
user = @jour.user
|
||||
text = @jour.notes
|
||||
else
|
||||
user = @bid.author
|
||||
text = @bid.description
|
||||
user = @bid.author
|
||||
text = @bid.description
|
||||
end
|
||||
# Replaces pre blocks with [...]
|
||||
text = text.to_s.strip.gsub(%r{<pre>((.|\s)*?)</pre>}m, '[...]')
|
||||
|
@ -711,7 +702,7 @@ class BidsController < ApplicationController
|
|||
@id = user.id
|
||||
rescue ActiveRecord::RecordNotFound
|
||||
render_404
|
||||
end
|
||||
end
|
||||
|
||||
##新建需求
|
||||
def new_bid
|
||||
|
@ -743,15 +734,15 @@ class BidsController < ApplicationController
|
|||
end
|
||||
end
|
||||
|
||||
# added by bai
|
||||
def update_contest
|
||||
# added by bai
|
||||
def update_contest
|
||||
@bid = Bid.find(params[:id])
|
||||
@bid.name = params[:bid][:name]
|
||||
@bid.description = params[:bid][:description]
|
||||
@bid.reward_type = 2
|
||||
@bid.budget = params[:bid][:budget]
|
||||
@bid.deadline = params[:bid][:deadline]
|
||||
@bid.password = params[:bid][:password]
|
||||
@bid.password = params[:bid][:password]
|
||||
@bid.author_id = User.current.id
|
||||
@bid.commit = 0
|
||||
if @bid.save
|
||||
|
@ -825,31 +816,31 @@ class BidsController < ApplicationController
|
|||
@course = Course.find_by_id(params[:course_id])
|
||||
@course_id = @course.id
|
||||
#respond_to do |format|
|
||||
# format.html { redirect_to new_homework_course_path(params[:course_id]),:layout => 'base_courses'}
|
||||
# format.api { render_validation_errors(@bid) }
|
||||
#end
|
||||
# format.html { redirect_to new_homework_course_path(params[:course_id]),:layout => 'base_courses'}
|
||||
# format.api { render_validation_errors(@bid) }
|
||||
#end
|
||||
render file: 'courses/new_homework', layout: 'base_courses'
|
||||
end
|
||||
end
|
||||
|
||||
# modify by nwb\
|
||||
# 编辑作业
|
||||
def edit
|
||||
@bid = Bid.find(params[:bid_id])
|
||||
if (User.current.admin?||User.current.allowed_to?(:as_teacher,@bid.courses.first))
|
||||
@course_id = params[:course_id]
|
||||
respond_to do |format|
|
||||
format.html {
|
||||
@course = Course.find(params[:course_id])
|
||||
@user= User.find(User.current.id)
|
||||
render :layout => 'base_courses'
|
||||
}
|
||||
end
|
||||
def edit
|
||||
@bid = Bid.find(params[:bid_id])
|
||||
if (User.current.admin?||User.current.allowed_to?(:as_teacher,@bid.courses.first))
|
||||
@course_id = params[:course_id]
|
||||
respond_to do |format|
|
||||
format.html {
|
||||
@course = Course.find(params[:course_id])
|
||||
@user= User.find(User.current.id)
|
||||
render :layout => 'base_courses'
|
||||
}
|
||||
end
|
||||
else
|
||||
render_403
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
def update
|
||||
@bid = Bid.find(params[:id])
|
||||
@course = @bid.courses.first#Project.find(params[:course_id])
|
||||
|
@ -858,7 +849,7 @@ class BidsController < ApplicationController
|
|||
@bid.is_evaluation = params[:bid][:is_evaluation]
|
||||
@bid.proportion = params[:bid][:proportion]
|
||||
@bid.evaluation_num = params[:bid][:evaluation_num]
|
||||
@bid.open_anonymous_evaluation = params[:bid][:open_anonymous_evaluation]
|
||||
params[:bid][:open_anonymous_evaluation] ? @bid.open_anonymous_evaluation = 1 : @bid.open_anonymous_evaluation = 0
|
||||
@bid.reward_type = 3
|
||||
@bid.deadline = params[:bid][:deadline]
|
||||
@bid.budget = 0
|
||||
|
@ -881,38 +872,38 @@ class BidsController < ApplicationController
|
|||
find_bid
|
||||
render :layout => 'base_homework'
|
||||
end
|
||||
|
||||
|
||||
def add_homework
|
||||
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 = ? or id =?',5, 10, 7)).size >0)
|
||||
# homework = HomeworkAttach.create(:bid_id => @bid.id, :user_id => User.current.id)
|
||||
# homework.save_attachments(params[:attachments] || (params[:bid] && params[:bid][:uploads]))
|
||||
|
||||
if hadcommittedhomework(User.current.id, @bid.id) == true
|
||||
@homework_flag = l(:label_bidding_homework_committed)
|
||||
else
|
||||
@homework = HomeworkAttach.new
|
||||
@homework.safe_attributes = params[:homeworkattach]
|
||||
@homework.bid_id = @bid.id
|
||||
@homework.user_id = User.current.id
|
||||
@homework.save_attachments(params[:attachments])
|
||||
|
||||
render_attachment_warning_if_needed(@homework)
|
||||
|
||||
@homework_flag = if @homework.save
|
||||
l(:label_bidding_homework_succeed)
|
||||
else
|
||||
l(:label_bidding_homework_failed)
|
||||
end
|
||||
|
||||
if @homework.attachments.empty?
|
||||
@homework.delete
|
||||
#flash[:error] = l(:no_attachmens_allowed)
|
||||
@homework_flag = l(:no_attachmens_allowed)
|
||||
# else
|
||||
end
|
||||
end
|
||||
if hadcommittedhomework(User.current.id, @bid.id) == true
|
||||
@homework_flag = l(:label_bidding_homework_committed)
|
||||
else
|
||||
@homework = HomeworkAttach.new
|
||||
@homework.safe_attributes = params[:homeworkattach]
|
||||
@homework.bid_id = @bid.id
|
||||
@homework.user_id = User.current.id
|
||||
@homework.save_attachments(params[:attachments])
|
||||
|
||||
render_attachment_warning_if_needed(@homework)
|
||||
|
||||
@homework_flag = if @homework.save
|
||||
l(:label_bidding_homework_succeed)
|
||||
else
|
||||
l(:label_bidding_homework_failed)
|
||||
end
|
||||
|
||||
if @homework.attachments.empty?
|
||||
@homework.delete
|
||||
#flash[:error] = l(:no_attachmens_allowed)
|
||||
@homework_flag = l(:no_attachmens_allowed)
|
||||
# else
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@homework_list = @bid.homeworks
|
||||
respond_to do |format|
|
||||
format.html{
|
||||
|
@ -931,7 +922,7 @@ class BidsController < ApplicationController
|
|||
@member = []
|
||||
@course.memberships.each do |member|
|
||||
unless (member.roles && Role.where('id = ? ', 3)).empty?
|
||||
@member.push member
|
||||
@member.push member
|
||||
end
|
||||
end
|
||||
if @bid.homework_type = 1
|
||||
|
@ -958,7 +949,7 @@ class BidsController < ApplicationController
|
|||
respond_to do |format|
|
||||
format.html { redirect_to :back }
|
||||
format.js
|
||||
#format.api { render_api_ok }
|
||||
#format.api { render_api_ok }
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -970,7 +961,7 @@ class BidsController < ApplicationController
|
|||
respond_to do |format|
|
||||
format.html { redirect_to :back }
|
||||
format.js
|
||||
#format.api { render_api_ok }
|
||||
#format.api { render_api_ok }
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -999,7 +990,7 @@ class BidsController < ApplicationController
|
|||
def manage
|
||||
|
||||
end
|
||||
|
||||
|
||||
# 启动匿评
|
||||
def start_anonymous_comment
|
||||
@bid = Bid.find(params[:id])
|
||||
|
@ -1031,7 +1022,7 @@ class BidsController < ApplicationController
|
|||
end
|
||||
end
|
||||
|
||||
def stop_anonymous_comment
|
||||
def stop_anonymous_comment
|
||||
@bid = Bid.find(params[:id])
|
||||
|
||||
@bid.update_column('comment_status', 2)
|
||||
|
@ -1039,7 +1030,7 @@ class BidsController < ApplicationController
|
|||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def alert_anonymous_comment
|
||||
@bid = Bid.find params[:id]
|
||||
|
@ -1060,7 +1051,7 @@ class BidsController < ApplicationController
|
|||
end
|
||||
|
||||
private
|
||||
|
||||
|
||||
def get_assigned_homeworks(homeworks, n, index)
|
||||
homeworks += homeworks
|
||||
homeworks[index + 1 .. index + n]
|
||||
|
|
|
@ -66,15 +66,28 @@ class BoardsController < ApplicationController
|
|||
'updated_on' => "COALESCE(last_replies_messages.created_on, #{Message.table_name}.created_on)"
|
||||
|
||||
@topic_count = @board.topics.count
|
||||
@topic_pages = Paginator.new @topic_count, per_page_option, params['page']
|
||||
@topics = @board.topics.
|
||||
reorder("#{Message.table_name}.sticky DESC").
|
||||
includes(:last_reply).
|
||||
limit(@topic_pages.per_page).
|
||||
offset(@topic_pages.offset).
|
||||
order(sort_clause).
|
||||
preload(:author, {:last_reply => :author}).
|
||||
all
|
||||
if @project
|
||||
@topic_pages = Paginator.new @topic_count, per_page_option, params['page']
|
||||
@topics = @board.topics.
|
||||
reorder("#{Message.table_name}.sticky DESC").
|
||||
includes(:last_reply).
|
||||
limit(@topic_pages.per_page).
|
||||
offset(@topic_pages.offset).
|
||||
order(sort_clause).
|
||||
preload(:author, {:last_reply => :author}).
|
||||
all
|
||||
elsif @course
|
||||
board_topics = @board.topics.
|
||||
reorder("#{Message.table_name}.sticky DESC").
|
||||
includes(:last_reply).
|
||||
# limit(@topic_pages.per_page).
|
||||
# offset(@topic_pages.offset).
|
||||
order(sort_clause).
|
||||
preload(:author, {:last_reply => :author}).
|
||||
all
|
||||
@topics = paginateHelper board_topics,10
|
||||
end
|
||||
|
||||
@message = Message.new(:board => @board)
|
||||
#modify by nwb
|
||||
if @project
|
||||
|
|
|
@ -33,28 +33,6 @@ class CoursesController < ApplicationController
|
|||
join = cs.join_course params,User.current
|
||||
@state = join[:state]
|
||||
course = join[:course]
|
||||
#course = Course.find_by_id params[:object_id]
|
||||
#if course
|
||||
# if course_endTime_timeout? course
|
||||
# @state = 2
|
||||
# else
|
||||
# if User.current.member_of_course?(course)
|
||||
# @state = 3
|
||||
# else
|
||||
# if params[:course_password] == course.password
|
||||
# members = []
|
||||
# members << Member.new(:role_ids => [10], :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
|
||||
# end
|
||||
#else
|
||||
# @state = 4
|
||||
#end
|
||||
else
|
||||
@state = 5 #未登录
|
||||
end
|
||||
|
@ -71,25 +49,14 @@ class CoursesController < ApplicationController
|
|||
|
||||
def unjoin
|
||||
if User.current.logged?
|
||||
#
|
||||
# @member = Member.where('course_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
|
||||
cs = CoursesService.new
|
||||
cs.exit_course params,User.current
|
||||
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 => Course.find(params[:object_id]), :object_id => params[:object_id]} }
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
def join_private_courses
|
||||
respond_to do |format|
|
||||
|
@ -119,36 +86,6 @@ class CoursesController < ApplicationController
|
|||
format.api { render_validation_errors(@course) }
|
||||
end
|
||||
end
|
||||
#@course.safe_attributes = params[:course]
|
||||
#@course.time = params[:time]
|
||||
#@course.term = params[:term]
|
||||
#@course.class_period = params[:class_period]
|
||||
#if @course.save
|
||||
# if params[:course][:is_public] == '0'
|
||||
# course_status = CourseStatus.find_by_course_id(@course.id)
|
||||
# course_status.destroy if course_status
|
||||
# elsif params[:course][:is_public] == '1'
|
||||
# course_status = CourseStatus.find_by_course_id(@course.id)
|
||||
# course_status.destroy if course_status
|
||||
# course_status = CourseStatus.create(:course_id => @course.id, :grade => 0)
|
||||
# end
|
||||
#
|
||||
# respond_to do |format|
|
||||
# format.html {
|
||||
# flash[:notice] = l(:notice_successful_update)
|
||||
# redirect_to settings_course_url(@course)
|
||||
# }
|
||||
# format.api { render_api_ok }
|
||||
# end
|
||||
#else
|
||||
# respond_to do |format|
|
||||
# format.html {
|
||||
# settings
|
||||
# render :action => 'settings'
|
||||
# }
|
||||
# format.api { render_validation_errors(@course) }
|
||||
# end
|
||||
#end
|
||||
end
|
||||
|
||||
def new_join
|
||||
|
@ -160,7 +97,6 @@ class CoursesController < ApplicationController
|
|||
def search
|
||||
courses_all = Course.all_course
|
||||
name = params[:name]
|
||||
#(redirect_to courses_url, :notice => l(:label_sumbit_empty);return) if name.blank?
|
||||
if name.blank?
|
||||
@courses = []
|
||||
@courses_all = []
|
||||
|
@ -242,22 +178,19 @@ class CoursesController < ApplicationController
|
|||
|
||||
def searchmembers
|
||||
@subPage_title = l :label_student_list
|
||||
@render_file = 'member_list'
|
||||
@canShowCode = isCourseTeacher(User.current.id,@course) && params[:role] != '1'
|
||||
@is_remote = true
|
||||
@canShowCode = User.current.allowed_to?(:as_teacher,@course) && params[:role] != '1'
|
||||
# @is_remote = true
|
||||
@score_sort_by = "desc"
|
||||
q = "#{params[:name].strip}"
|
||||
#(redirect_to stores_url, :notice => l(:label_sumbit_empty);return) if params[:name].blank?
|
||||
if params[:incourse]
|
||||
@results = searchmember_by_name(student_homework_score(0,0,0,"desc"), q)
|
||||
|
||||
results = searchmember_by_name(student_homework_score(0,0,0,"desc"), q)
|
||||
elsif params[:ingroup]
|
||||
@group = CourseGroup.find(params[:search_group_id])
|
||||
@results = searchmember_by_name(student_homework_score(@group.id,0,0,"desc"), q)
|
||||
results = searchmember_by_name(student_homework_score(@group.id,0,0,"desc"), q)
|
||||
end
|
||||
@is_remote = true
|
||||
@result_count = @results.count
|
||||
@results = paginateHelper @results, 10
|
||||
@result_count = results.count
|
||||
@results = paginateHelper results, 10
|
||||
@search_name = q
|
||||
end
|
||||
|
||||
|
@ -269,7 +202,7 @@ class CoursesController < ApplicationController
|
|||
group.course_id = @course.id
|
||||
group.save
|
||||
end
|
||||
@canShowCode = isCourseTeacher(User.current.id,@course) && params[:role] != '1'
|
||||
@canShowCode = User.current.allowed_to?(:as_teacher,@course) && params[:role] != '1'
|
||||
@is_remote = true
|
||||
|
||||
@course_groups = @course.course_groups
|
||||
|
@ -303,17 +236,26 @@ class CoursesController < ApplicationController
|
|||
|
||||
valid_attr = params[:valid]
|
||||
valid_value = params[:value]
|
||||
|
||||
faker = CourseGroup.new
|
||||
group_id = params[:group_id]
|
||||
# faker = CourseGroup.new
|
||||
|
||||
if valid_attr.eql?('name')
|
||||
faker.name = valid_value
|
||||
faker.course_id = params[:course_id]
|
||||
faker.valid?
|
||||
req[:valid] = faker.errors[:name].blank?
|
||||
req[:message] = faker.errors[:name]
|
||||
course = Course.find params[:course_id]
|
||||
group_names = course.course_groups.map{|group| group.name unless group.id.to_s == group_id}.select{|group| !group.nil?}
|
||||
if group_names.include?(valid_value)
|
||||
req[:valid] = false
|
||||
req[:message] = l(:modal_valid_unpassing)
|
||||
else
|
||||
req[:valid] = true
|
||||
req[:message] = l(:modal_valid_passing)
|
||||
end
|
||||
# faker.name = valid_value
|
||||
# faker.course_id = params[:course_id]
|
||||
# faker.valid?
|
||||
# req[:valid] = faker.errors[:name].blank?
|
||||
# req[:message] = faker.errors[:name]
|
||||
end
|
||||
req[:message] = l(:modal_valid_passing) if req[:message].blank?
|
||||
# req[:message] = l(:modal_valid_passing) if req[:message].blank?
|
||||
render :json => req
|
||||
end
|
||||
def join_group
|
||||
|
@ -341,35 +283,28 @@ class CoursesController < ApplicationController
|
|||
end
|
||||
def searchgroupmembers
|
||||
@subPage_title = l :label_student_list
|
||||
@render_file = 'member_list'
|
||||
@render_file = 'new_member_list'
|
||||
@canShowCode = isCourseTeacher(User.current.id,@course) && params[:role] != '1'
|
||||
@is_remote = true
|
||||
@score_sort_by = "desc"
|
||||
if params[:group_id] && params[:group_id] != "0"
|
||||
@group = CourseGroup.find(params[:group_id])
|
||||
|
||||
@results = student_homework_score(@group.id,0, 0,"desc")
|
||||
@results = paginateHelper @results, 10
|
||||
|
||||
|
||||
else
|
||||
page_from = params[:page].nil? ? 0 : (params[:page].to_i - 1)
|
||||
@results = student_homework_score(0,page_from, 10,"desc")
|
||||
@results = paginateHelper_for_members @results, 10
|
||||
end
|
||||
|
||||
|
||||
|
||||
end
|
||||
|
||||
|
||||
def member
|
||||
## 有角色参数的才是课程,没有的就是项目
|
||||
if (User.current.admin? || @course.is_public == 1 || (@course.is_public == 0 && User.current.member_of_course?(@course)))
|
||||
|
||||
@render_file = 'member_list'
|
||||
@render_file = 'new_member_list'
|
||||
@score_sort_by = "desc"
|
||||
@canShowCode = isCourseTeacher(User.current.id,@course) && params[:role] != '1'
|
||||
@canShowCode = User.current.allowed_to?(:as_teacher,@course) && params[:role] != '1'
|
||||
@role = params[:role].nil? ? '2':params[:role]
|
||||
@is_remote = true
|
||||
@course_groups = @course.course_groups if @course.course_groups
|
||||
|
@ -383,12 +318,9 @@ class CoursesController < ApplicationController
|
|||
@subPage_title = l :label_student_list
|
||||
page = params[:page].nil? ? 0 : (params['page'].to_i - 1)
|
||||
@all_members = student_homework_score(0,page, 10,"desc")
|
||||
|
||||
# @all_members = @course.members
|
||||
@members = paginateHelper_for_members @all_members, 10
|
||||
|
||||
|
||||
end
|
||||
|
||||
respond_to do |format|
|
||||
if params[:page]
|
||||
format.js
|
||||
|
@ -396,12 +328,9 @@ class CoursesController < ApplicationController
|
|||
format.html {render :layout => 'base_courses'}
|
||||
end
|
||||
end
|
||||
|
||||
# render :layout => 'base_courses'
|
||||
else
|
||||
render_403
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
def export_course_member_excel
|
||||
|
@ -415,20 +344,9 @@ class CoursesController < ApplicationController
|
|||
end
|
||||
|
||||
def member_score_sort
|
||||
|
||||
# @teachers= searchTeacherAndAssistant(@course)
|
||||
@canShowCode = isCourseTeacher(User.current.id,@course) && params[:role] != '1'
|
||||
# @role = params[:role]
|
||||
# @course_groups = @course.course_groups if @course.course_groups
|
||||
# @show_serch = params[:role] == '2'
|
||||
@subPage_title = l :label_student_list
|
||||
@render_file = 'member_list'
|
||||
# @results = params[:result] if params[:result]
|
||||
# unless @result.nil?
|
||||
# @results = @result.reverse
|
||||
#
|
||||
# end
|
||||
# @results = paginateHelper @results@score_sort_by = "desc"
|
||||
@render_file = 'new_member_list'
|
||||
@is_remote = true
|
||||
@score_sort_by = params[:sort_by] if params[:sort_by]
|
||||
@search_name = params[:search_name] if params[:search_name]
|
||||
|
@ -436,7 +354,6 @@ class CoursesController < ApplicationController
|
|||
if !@search_name.nil?
|
||||
if group_id == '0'
|
||||
page = params[:page].nil? ? 0 : (params['page'].to_i - 1)
|
||||
|
||||
@results = searchmember_by_name(student_homework_score(0,0,0,@score_sort_by), @search_name)
|
||||
@result_count = @results.count
|
||||
@results = paginateHelper @results, 10
|
||||
|
@ -450,7 +367,6 @@ class CoursesController < ApplicationController
|
|||
if group_id == '0'
|
||||
page = params[:page].nil? ? 0 : (params['page'].to_i - 1)
|
||||
@results = student_homework_score(0,page, 10,@score_sort_by)
|
||||
|
||||
@results = paginateHelper_for_members @results, 10
|
||||
else
|
||||
@group = CourseGroup.find(group_id)
|
||||
|
@ -458,32 +374,25 @@ class CoursesController < ApplicationController
|
|||
@results = paginateHelper @results, 10
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
# 显示每个学生的作业评分详情
|
||||
def show_member_score
|
||||
|
||||
@member_score = Member.find(params[:member_id]) if params[:member_id]
|
||||
respond_to do |format|
|
||||
format.html {render :layout => 'course_base'}
|
||||
format.js
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
def handle_course courses, activities
|
||||
course_activity_count_array=activities.values()
|
||||
|
||||
course_array=[]
|
||||
i=0;
|
||||
courses.each do |course|
|
||||
course_array[i]=course
|
||||
i=i+1
|
||||
end
|
||||
|
||||
courses=desc_sort_course_by_avtivity(course_activity_count_array, course_array)
|
||||
|
||||
return courses
|
||||
end
|
||||
|
||||
|
@ -522,57 +431,6 @@ class CoursesController < ApplicationController
|
|||
format.api { render :action => 'show', :status => :created, :location => url_for(:controller => 'courses', :action => 'show', :id => @course.id) }
|
||||
end
|
||||
end
|
||||
#if User.current.user_extensions.identity
|
||||
# @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[:course]
|
||||
# @course.tea_id = User.current.id
|
||||
# # added by bai
|
||||
# @course.term = params[:term]
|
||||
# @course.time = params[:time]
|
||||
# #@course.school_id = params[:occupation]
|
||||
# @course.school_id = User.current.user_extensions.school_id
|
||||
# @course.setup_time = params[:setup_time]
|
||||
# @course.endup_time = params[:endup_time]
|
||||
# @course.class_period = params[:class_period]
|
||||
#end
|
||||
#
|
||||
#@issue_custom_fields = IssueCustomField.sorted.all
|
||||
#@trackers = Tracker.sorted.all
|
||||
#
|
||||
#if @course.save
|
||||
# #unless User.current.admin?
|
||||
# r = Role.givable.find_by_id(Setting.new_project_user_role_id.to_i) || Role.givable.first
|
||||
# m = Member.new(:user => User.current, :roles => [r])
|
||||
# m.project_id = -1
|
||||
# course = CourseInfos.new(:user_id => User.current.id, :course_id => @course.id)
|
||||
# #user_grades = UserGrade.create(:user_id => User.current.id, :course_id => @course.id)
|
||||
# if params[:course][:is_public] == '1'
|
||||
# course_status = CourseStatus.create(:course_id => @course.id, :watchers_count => 0, :changesets_count => 0, :grade => 0, :course_type => @course_tag)
|
||||
# end
|
||||
# @course.members << m
|
||||
# @course.course_infos << course
|
||||
# #end
|
||||
# respond_to do |format|
|
||||
# format.html {
|
||||
# flash[:notice] = l(:notice_successful_create)
|
||||
# if params[:continue]
|
||||
# redirect_to new_course_url(attrs, :course => '0')
|
||||
# elsif params[:course_continue]
|
||||
# redirect_to new_course_url(:course => '1')
|
||||
# else
|
||||
# redirect_to settings_course_url(@course, :course_type => 1)
|
||||
# end
|
||||
# }
|
||||
# format.api { render :action => 'show', :status => :created, :location => url_for(:controller => 'courses', :action => 'show', :id => @course.id) }
|
||||
# end
|
||||
# else
|
||||
# #@course.destroy
|
||||
# respond_to do |format|
|
||||
# format.html { render :action => 'new', :layout => 'base' } #Added by young
|
||||
# format.api { render_validation_errors(@course) }
|
||||
# end
|
||||
# end
|
||||
end
|
||||
|
||||
def course
|
||||
|
@ -590,54 +448,28 @@ class CoursesController < ApplicationController
|
|||
|
||||
@course_count = @courses_all.count
|
||||
@course_pages = Paginator.new @course_count, per_page_option, params['page']
|
||||
|
||||
#gcm activity count
|
||||
|
||||
@course_activity_count=Hash.new
|
||||
#count initialize
|
||||
@courses_all.each do |course|
|
||||
@course_activity_count[course.id]=0
|
||||
end
|
||||
|
||||
#@course_activity_count=get_course_activity @courses_all,@course_activity_count
|
||||
#gcm end
|
||||
|
||||
|
||||
case params[:course_sort_type]
|
||||
when '0'
|
||||
@courses = @courses_all.order("created_on desc")
|
||||
@s_type = 0
|
||||
@courses = @courses.offset(@course_pages.offset).limit(@course_pages.per_page)
|
||||
|
||||
#gcm
|
||||
@course_activity_count=get_course_activity @courses,@course_activity_count
|
||||
#gcmend
|
||||
|
||||
when '1'
|
||||
@courses = @courses_all.order("course_ac_para desc")
|
||||
@s_type = 1
|
||||
@courses = @courses.offset(@course_pages.offset).limit(@course_pages.per_page)
|
||||
|
||||
#gcm
|
||||
@course_activity_count=get_course_activity @courses,@course_activity_count
|
||||
#gcmend
|
||||
|
||||
when '2'
|
||||
@courses = @courses_all.order("watchers_count desc")
|
||||
@s_type = 2
|
||||
@courses = @courses.offset(@course_pages.offset).limit(@course_pages.per_page)
|
||||
|
||||
#gcm
|
||||
@course_activity_count=get_course_activity @courses,@course_activity_count
|
||||
#gcmend
|
||||
|
||||
#gcm
|
||||
when '3'
|
||||
|
||||
#gcm
|
||||
@course_activity_count=get_course_activity @courses_all,@course_activity_count
|
||||
#gcmend
|
||||
|
||||
@courses=handle_course @courses_all,@course_activity_count
|
||||
@s_type = 3
|
||||
@courses = @courses[@course_pages.offset, @course_pages.per_page]
|
||||
|
@ -645,11 +477,7 @@ class CoursesController < ApplicationController
|
|||
@s_type = 0
|
||||
@courses = @courses_all.order("created_on desc")
|
||||
@courses = @courses.offset(@course_pages.offset).limit(@course_pages.per_page)
|
||||
|
||||
#gcm
|
||||
@course_activity_count=get_course_activity @courses,@course_activity_count
|
||||
#gcmend
|
||||
|
||||
end
|
||||
|
||||
respond_to do |format|
|
||||
|
@ -657,9 +485,6 @@ class CoursesController < ApplicationController
|
|||
render :layout => 'base'
|
||||
}
|
||||
format.api {
|
||||
# @offset, @limit = api_offset_and_limit
|
||||
# @course_count = Course.visible.count
|
||||
# @courses = Course.visible.offset(@offset).limit(@limit).order('lft').all
|
||||
}
|
||||
format.atom {
|
||||
courses = Course.visible.order('created_on DESC').limit(Setting.feeds_limit.to_i).all
|
||||
|
@ -668,20 +493,16 @@ class CoursesController < ApplicationController
|
|||
end
|
||||
end
|
||||
|
||||
|
||||
def new
|
||||
@course_type = params[:course_type] ||= params[:course]
|
||||
@issue_custom_fields = IssueCustomField.sorted.all
|
||||
@trackers = Tracker.sorted.all
|
||||
|
||||
@course = Course.new
|
||||
@course.safe_attributes = params[:course]
|
||||
month = Time.now.month
|
||||
|
||||
render :layout => 'base'
|
||||
render :layout => 'new_base'
|
||||
end
|
||||
|
||||
|
||||
def desc_sort_course_by_avtivity(activity_count, courses)
|
||||
return courses if activity_count.size<2
|
||||
(activity_count.size-2).downto(0) do |i|
|
||||
|
@ -758,22 +579,11 @@ class CoursesController < ApplicationController
|
|||
|
||||
def homework
|
||||
if @course.is_public != 0 || User.current.member_of_course?(@course) || User.current.admin?
|
||||
@offset, @limit = api_offset_and_limit({:limit => 10})
|
||||
@bids = @course.homeworks.order('deadline ASC')
|
||||
@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
|
||||
unless @offset == 0
|
||||
@bids = @bids.offset(@offset).limit(@limit).all.reverse
|
||||
else
|
||||
limit = @bid_count % @limit
|
||||
if limit == 0
|
||||
limit = 10
|
||||
end
|
||||
@bids = @bids.offset(@offset).limit(limit).all.reverse
|
||||
end
|
||||
bids = @course.homeworks.order('created_on DESC')
|
||||
bids = bids.like(params[:name]) if params[:name].present?
|
||||
@bids = paginateHelper bids,10
|
||||
@is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,@course))
|
||||
@is_student = User.current.logged? && (User.current.admin? || (User.current.member_of_course?(@course) && !@is_teacher))
|
||||
render :layout => 'base_courses'
|
||||
else
|
||||
render_403
|
||||
|
@ -785,6 +595,7 @@ class CoursesController < ApplicationController
|
|||
@homework = Bid.new
|
||||
@homework.safe_attributes = params[:bid]
|
||||
@homework.open_anonymous_evaluation = 1
|
||||
@homework.deadline = (Time.now + 3600 * 24).strftime('%Y-%m-%d')
|
||||
if (User.current.logged? && User.current.member_of_course?(Course.find params[:id] ))
|
||||
render :layout => 'base_courses'
|
||||
else
|
||||
|
@ -848,26 +659,19 @@ class CoursesController < ApplicationController
|
|||
end
|
||||
|
||||
def show
|
||||
|
||||
# try to redirect to the requested menu item
|
||||
if params[:jump] && redirect_to_course_menu_item(@course, params[:jump])
|
||||
return
|
||||
end
|
||||
|
||||
@users_by_role = @course.users_by_role
|
||||
if(User.find_by_id(CourseInfos.find_by_course_id(@course.id).try(:user_id)))
|
||||
@user = User.find_by_id(CourseInfos.find_by_course_id(@course.id).user_id)
|
||||
end
|
||||
|
||||
|
||||
@key = User.current.rss_key
|
||||
#新增内容
|
||||
@days = Setting.activity_days_default.to_i
|
||||
|
||||
if params[:from]
|
||||
begin; @date_to = params[:from].to_date + 1; rescue; end
|
||||
end
|
||||
|
||||
has = {
|
||||
"show_course_files" => true,
|
||||
"show_course_news" => true,
|
||||
|
@ -877,9 +681,7 @@ class CoursesController < ApplicationController
|
|||
"show_homeworks" => true
|
||||
}
|
||||
@date_to ||= Date.today + 1
|
||||
#
|
||||
@date_from = (@date_to - @days) > @course.created_at.to_date ? (@date_to - @days) : @course.created_at.to_date
|
||||
#@date_from = @date_to - @days-1.years
|
||||
@author = (params[:user_id].blank? ? nil : User.active.find(params[:user_id]))
|
||||
@author ||= @course.teacher
|
||||
# 决定显示所用用户或单个用户活动
|
||||
|
@ -889,13 +691,11 @@ class CoursesController < ApplicationController
|
|||
@activity.scope_select {|t| has["show_#{t}"]}
|
||||
# modify by nwb
|
||||
# 添加私密性判断
|
||||
|
||||
if User.current.member_of_course?(@course)|| User.current.admin?
|
||||
events = @activity.events(@days, @course.created_at)
|
||||
else
|
||||
events = @activity.events(@days, @course.created_at, :is_public => 1)
|
||||
end
|
||||
|
||||
# 无新动态时,显示老动态
|
||||
if events.count == 0
|
||||
if User.current.member_of_course?(@course)|| User.current.admin?
|
||||
|
@ -904,20 +704,10 @@ class CoursesController < ApplicationController
|
|||
events = @activity.events(:is_public => 1)
|
||||
end
|
||||
end
|
||||
|
||||
@offset, @limit = api_offset_and_limit({:limit => 10})
|
||||
@events_count = events.count
|
||||
@events_pages = Paginator.new @events_count, @limit, params['page']
|
||||
@offset ||= @events_pages.offset
|
||||
events = events.slice(@offset,@limit)
|
||||
|
||||
events = paginateHelper events,10
|
||||
@events_by_day = events.group_by {|event| User.current.time_to_date(event.event_datetime)}
|
||||
# documents
|
||||
@sort_by = %w(category date title author).include?(params[:sort_by]) ? params[:sort_by] : 'category'
|
||||
# 这写变量发现没有用而且拖慢速度
|
||||
#@teachers= searchTeacherAndAssistant(@course)
|
||||
#@canShowRealName = isCourseTeacher(User.current.id,@course)
|
||||
|
||||
if(User.find_by_id(CourseInfos.find_by_course_id(@course.id).try(:user_id)))
|
||||
@user = User.find_by_id(CourseInfos.find_by_course_id(@course.id).user_id)
|
||||
end
|
||||
|
@ -947,10 +737,6 @@ class CoursesController < ApplicationController
|
|||
offset = @jours.count(:conditions => ["#{JournalsForMessage.table_name}.id > ?", params[:r].to_i])
|
||||
page = 1 + offset / @limit
|
||||
end
|
||||
|
||||
#@feedback_count = @jours.count
|
||||
#@feedback_pages = Paginator.new @feedback_count, @limit, page
|
||||
#@offset ||= @feedback_pages.offset
|
||||
@jour = paginateHelper @jours,10
|
||||
@state = false
|
||||
respond_to do |format|
|
||||
|
@ -990,7 +776,6 @@ class CoursesController < ApplicationController
|
|||
end
|
||||
|
||||
private
|
||||
|
||||
def allow_join course
|
||||
if course_endTime_timeout? course
|
||||
respond_to do |format|
|
||||
|
@ -1021,38 +806,38 @@ class CoursesController < ApplicationController
|
|||
if groupid == 0
|
||||
if nums == 0
|
||||
sql_select = "SELECT members.*, SUM(homework_attaches.score) as score FROM members, homework_attaches
|
||||
WHERE members.course_id = #{@course.id} AND members.user_id in (SELECT students_for_courses.student_id FROM students_for_courses WHERE course_id = #{@course.id}) AND members.user_id = homework_attaches.user_id
|
||||
AND homework_attaches.bid_id in (SELECT bid_id FROM homework_for_courses WHERE course_id = #{@course.id}) GROUP BY members.user_id
|
||||
UNION all
|
||||
SELECT members.*, 0 as score FROM members,homework_attaches,students_for_courses WHERE members.course_id = #{@course.id} AND
|
||||
students_for_courses.course_id = #{@course.id} and members.user_id = students_for_courses.student_id AND
|
||||
members.user_id NOT IN (SELECT homework_attaches.user_id FROM homework_attaches WHERE homework_attaches.bid_id in (SELECT bid_id FROM homework_for_courses WHERE course_id = #{@course.id} )
|
||||
)
|
||||
GROUP BY members.user_id ORDER BY score #{score_sort_by}"
|
||||
WHERE members.course_id = #{@course.id} AND members.user_id in (SELECT students_for_courses.student_id FROM students_for_courses WHERE course_id = #{@course.id}) AND members.user_id = homework_attaches.user_id
|
||||
AND homework_attaches.bid_id in (SELECT bid_id FROM homework_for_courses WHERE course_id = #{@course.id}) GROUP BY members.user_id
|
||||
UNION all
|
||||
SELECT members.*, 0 as score FROM members,homework_attaches,students_for_courses WHERE members.course_id = #{@course.id} AND
|
||||
students_for_courses.course_id = #{@course.id} and members.user_id = students_for_courses.student_id AND
|
||||
members.user_id NOT IN (SELECT homework_attaches.user_id FROM homework_attaches WHERE homework_attaches.bid_id in (SELECT bid_id FROM homework_for_courses WHERE course_id = #{@course.id} )
|
||||
)
|
||||
GROUP BY members.user_id ORDER BY score #{score_sort_by}"
|
||||
else
|
||||
sql_select = "SELECT members.*, SUM(homework_attaches.score) as score FROM members, homework_attaches
|
||||
WHERE members.course_id = #{@course.id} AND members.user_id in (SELECT students_for_courses.student_id FROM students_for_courses WHERE course_id = #{@course.id}) AND members.user_id = homework_attaches.user_id
|
||||
AND homework_attaches.bid_id in (SELECT bid_id FROM homework_for_courses WHERE course_id = #{@course.id}) GROUP BY members.user_id
|
||||
UNION all
|
||||
SELECT members.*, 0 as score FROM members,homework_attaches,students_for_courses WHERE members.course_id = #{@course.id} AND
|
||||
students_for_courses.course_id = #{@course.id} and members.user_id = students_for_courses.student_id AND
|
||||
members.user_id NOT IN (SELECT homework_attaches.user_id FROM homework_attaches WHERE homework_attaches.bid_id in (SELECT bid_id FROM homework_for_courses WHERE course_id = #{@course.id} )
|
||||
)
|
||||
GROUP BY members.user_id ORDER BY score #{score_sort_by} limit #{start_from}, #{nums}"
|
||||
WHERE members.course_id = #{@course.id} AND members.user_id in (SELECT students_for_courses.student_id FROM students_for_courses WHERE course_id = #{@course.id}) AND members.user_id = homework_attaches.user_id
|
||||
AND homework_attaches.bid_id in (SELECT bid_id FROM homework_for_courses WHERE course_id = #{@course.id}) GROUP BY members.user_id
|
||||
UNION all
|
||||
SELECT members.*, 0 as score FROM members,homework_attaches,students_for_courses WHERE members.course_id = #{@course.id} AND
|
||||
students_for_courses.course_id = #{@course.id} and members.user_id = students_for_courses.student_id AND
|
||||
members.user_id NOT IN (SELECT homework_attaches.user_id FROM homework_attaches WHERE homework_attaches.bid_id in (SELECT bid_id FROM homework_for_courses WHERE course_id = #{@course.id} )
|
||||
)
|
||||
GROUP BY members.user_id ORDER BY score #{score_sort_by} limit #{start_from}, #{nums}"
|
||||
|
||||
end
|
||||
else
|
||||
sql_select = "SELECT members.*, SUM(homework_attaches.score) as score FROM members, homework_attaches
|
||||
WHERE members.course_id = #{@course.id} AND members.user_id in (SELECT students_for_courses.student_id FROM students_for_courses WHERE course_id = #{@course.id}) AND members.user_id = homework_attaches.user_id
|
||||
and members.course_group_id = #{groupid} AND homework_attaches.bid_id in (SELECT bid_id FROM homework_for_courses WHERE course_id = #{@course.id})
|
||||
GROUP BY members.user_id
|
||||
UNION all
|
||||
SELECT members.*, 0 as score FROM members,homework_attaches,students_for_courses WHERE members.course_id = #{@course.id}
|
||||
and members.course_group_id = #{groupid} AND
|
||||
students_for_courses.course_id = #{@course.id} and members.user_id = students_for_courses.student_id AND
|
||||
members.user_id NOT IN (SELECT homework_attaches.user_id FROM homework_attaches WHERE homework_attaches.bid_id in (SELECT bid_id FROM homework_for_courses WHERE course_id = #{@course.id} )
|
||||
)
|
||||
GROUP BY members.user_id ORDER BY score #{score_sort_by}"
|
||||
WHERE members.course_id = #{@course.id} AND members.user_id in (SELECT students_for_courses.student_id FROM students_for_courses WHERE course_id = #{@course.id}) AND members.user_id = homework_attaches.user_id
|
||||
and members.course_group_id = #{groupid} AND homework_attaches.bid_id in (SELECT bid_id FROM homework_for_courses WHERE course_id = #{@course.id})
|
||||
GROUP BY members.user_id
|
||||
UNION all
|
||||
SELECT members.*, 0 as score FROM members,homework_attaches,students_for_courses WHERE members.course_id = #{@course.id}
|
||||
and members.course_group_id = #{groupid} AND
|
||||
students_for_courses.course_id = #{@course.id} and members.user_id = students_for_courses.student_id AND
|
||||
members.user_id NOT IN (SELECT homework_attaches.user_id FROM homework_attaches WHERE homework_attaches.bid_id in (SELECT bid_id FROM homework_for_courses WHERE course_id = #{@course.id} )
|
||||
)
|
||||
GROUP BY members.user_id ORDER BY score #{score_sort_by}"
|
||||
end
|
||||
sql = ActiveRecord::Base.connection()
|
||||
homework_scores = Member.find_by_sql(sql_select)
|
||||
|
@ -1068,7 +853,7 @@ GROUP BY members.user_id ORDER BY score #{score_sort_by}"
|
|||
#当加入,退出分班时查询分班的学生
|
||||
def search_group_members group
|
||||
@subPage_title = l :label_student_list
|
||||
@render_file = 'member_list'
|
||||
@render_file = 'new_member_list'
|
||||
@canShowCode = isCourseTeacher(User.current.id,@course) && params[:role] != '1'
|
||||
@is_remote = true
|
||||
@score_sort_by = "desc"
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# added by fq
|
||||
class ForumsController < ApplicationController
|
||||
layout "users_base"
|
||||
|
||||
include ApplicationHelper
|
||||
# GET /forums
|
||||
# GET /forums.json
|
||||
before_filter :find_forum_if_available
|
||||
|
@ -63,6 +63,9 @@ class ForumsController < ApplicationController
|
|||
|
||||
respond_to do |format|
|
||||
if @memo.save
|
||||
ids = params[:asset_id].split(',')
|
||||
update_kindeditor_assets_owner ids ,@memo.id,1
|
||||
#end
|
||||
format.html { redirect_to (forum_memo_url(@forum, (@memo.parent_id.nil? ? @memo : @memo.parent_id))), notice: "#{l :label_memo_create_succ}" }
|
||||
format.json { render json: @memo, status: :created, location: @memo }
|
||||
else
|
||||
|
@ -163,6 +166,13 @@ class ForumsController < ApplicationController
|
|||
@forum = Forum.new(params[:forum])
|
||||
@forum.creator_id = User.current.id
|
||||
if @forum.save
|
||||
# Time 2015-03-24 17:07:05
|
||||
# Author lizanle
|
||||
# Description after save后需要进行资源记录的更新
|
||||
# owner_type = 2 对应的是 forum
|
||||
ids = params[:asset_id].split(',')
|
||||
update_kindeditor_assets_owner ids ,@forum.id,2
|
||||
#end
|
||||
respond_to do |format|
|
||||
|
||||
format.html { redirect_to @forum, notice: l(:label_forum_create_succ) }
|
||||
|
|
|
@ -59,6 +59,20 @@ class MemosController < ApplicationController
|
|||
@memo.content = @quote + @memo.content
|
||||
respond_to do |format|
|
||||
if @memo.save
|
||||
# Time 2015-03-24 14:47:05
|
||||
# Author lizanle
|
||||
# Description after save后需要进行资源记录的更新
|
||||
# owner_type = 1 对应的是 memo
|
||||
if !params[:asset_id].nil?
|
||||
ids = params[:asset_id].split(',')
|
||||
ids.each do |id|
|
||||
asset = Kindeditor::Asset.find(id.to_i)
|
||||
asset.owner_id = @memo.id
|
||||
asset.owner_type = 1
|
||||
asset.save
|
||||
end
|
||||
end
|
||||
#end
|
||||
format.html { redirect_to back_memo_url, notice: "#{l :label_memo_create_succ}" }
|
||||
format.json { render json: @memo, status: :created, location: @memo }
|
||||
else
|
||||
|
|
|
@ -44,18 +44,35 @@ class MessagesController < ApplicationController
|
|||
end
|
||||
|
||||
@reply_count = @topic.children.count
|
||||
@reply_pages = Paginator.new @reply_count, REPLIES_PER_PAGE, page
|
||||
@replies = @topic.children.
|
||||
includes(:author, :attachments, {:board => :project}).
|
||||
reorder("#{Message.table_name}.created_on DESC").
|
||||
limit(@reply_pages.per_page).
|
||||
offset(@reply_pages.offset).
|
||||
all
|
||||
# @reply_pages = Paginator.new @reply_count, REPLIES_PER_PAGE, page
|
||||
# @replies = @topic.children.
|
||||
# includes(:author, :attachments, {:board => :project}).
|
||||
# reorder("#{Message.table_name}.created_on DESC").
|
||||
# limit(@reply_pages.per_page).
|
||||
# offset(@reply_pages.offset).
|
||||
# all
|
||||
|
||||
@reply = Message.new(:subject => "RE: #{@message.subject}")
|
||||
if @course
|
||||
messages_replies = @topic.children.
|
||||
includes(:author, :attachments, {:board => :project}).
|
||||
reorder("#{Message.table_name}.created_on DESC").
|
||||
#limit(@reply_pages.per_page).
|
||||
#offset(@reply_pages.offset).
|
||||
all
|
||||
@replies = paginateHelper messages_replies,10
|
||||
@reply = Message.new(:subject => "RE: #{@message.subject}")
|
||||
render :action => "show", :layout => "base_courses"#by young
|
||||
else
|
||||
@reply_pages = Paginator.new @reply_count, REPLIES_PER_PAGE, page
|
||||
@replies = @topic.children.
|
||||
includes(:author, :attachments, {:board => :project}).
|
||||
reorder("#{Message.table_name}.created_on DESC").
|
||||
limit(@reply_pages.per_page).
|
||||
offset(@reply_pages.offset).
|
||||
all
|
||||
|
||||
@reply = Message.new(:subject => "RE: #{@message.subject}")
|
||||
render :action => "show", :layout => "base_projects"#by young
|
||||
end
|
||||
end
|
||||
|
@ -76,6 +93,13 @@ class MessagesController < ApplicationController
|
|||
layout_file = @project ? 'base_projects' : 'base_courses'
|
||||
render :action => 'new', :layout => layout_file
|
||||
end
|
||||
else
|
||||
respond_to do |format|
|
||||
format.html {
|
||||
layout_file = @project ? 'base_projects' : 'base_courses'
|
||||
render :layout => layout_file
|
||||
}
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -70,13 +70,13 @@ class NewsController < ApplicationController
|
|||
scope = @course ? @course.news.course_visible : News.course_visible
|
||||
|
||||
@news_count = scope.count
|
||||
@news_pages = Paginator.new @news_count, @limit, params['page']
|
||||
@offset ||= @news_pages.offset
|
||||
@newss = scope.all(:include => [:author, :course],
|
||||
:order => "#{News.table_name}.created_on DESC",
|
||||
:offset => @offset,
|
||||
:limit => @limit)
|
||||
|
||||
#@news_pages = Paginator.new @news_count, @limit, params['page']
|
||||
#@offset ||= scope_page.offset
|
||||
scope_order = scope.all(:include => [:author, :course],
|
||||
:order => "#{News.table_name}.created_on DESC")
|
||||
# :offset => @offset,
|
||||
# :limit => @limit)
|
||||
@newss = paginateHelper scope_order,10
|
||||
respond_to do |format|
|
||||
format.html {
|
||||
@news = News.new
|
||||
|
|
|
@ -340,7 +340,7 @@ class ProjectsController < ApplicationController
|
|||
@is_zhuce =false
|
||||
flash[:notice] = l(:notice_email_sent, :value => email)
|
||||
else
|
||||
flash[:error] = l(:notice_registed_success, :value => email)
|
||||
flash[:error] = l(:notice_registed_error, :value => email)
|
||||
@is_zhuce = true
|
||||
end
|
||||
respond_to do |format|
|
||||
|
|
|
@ -73,7 +73,7 @@ class TagsController < ApplicationController
|
|||
@issues_results,
|
||||
@bids_results,
|
||||
@forums_results,
|
||||
@attachments_results,
|
||||
@attachments_results,
|
||||
@contests_results,
|
||||
@courses_results,
|
||||
@open_source_projects_results= refresh_results(@obj_id,@obj_flag,@selected_tags)
|
||||
|
@ -109,7 +109,7 @@ class TagsController < ApplicationController
|
|||
@issues_results,
|
||||
@bids_results,
|
||||
@forums_results,
|
||||
@attachments_results,
|
||||
@attachments_results,
|
||||
@contests_results,
|
||||
@courses_results,
|
||||
@open_source_projects_results= refresh_results(@obj_id,@show_flag)
|
||||
|
@ -248,6 +248,8 @@ class TagsController < ApplicationController
|
|||
@obj = OpenSourceProject.find_by_id(@obj_id)
|
||||
when '9'
|
||||
@obj = Course.find_by_id(@obj_id)
|
||||
when '10'
|
||||
@obj = Attachment.find_by_id(@obj_id)
|
||||
else
|
||||
@obj = nil
|
||||
end
|
||||
|
@ -315,6 +317,14 @@ class TagsController < ApplicationController
|
|||
when '8'
|
||||
@obj = OpenSourceProject.find_by_id(obj_id)
|
||||
@obj_pages, @open_source_projects_results, @results_count = for_pagination(get_open_source_projects_by_tag(selected_tags))
|
||||
when '10'
|
||||
@obj = Attachment.find_by_id(obj_id)
|
||||
|
||||
# modifed by Long Jun
|
||||
# this is used to find the attachments that came from the same project and tagged with the same tag.
|
||||
#@result = get_attachments_by_project_tag(selected_tags, @obj)
|
||||
@result = get_attachments_by_tag(selected_tags)
|
||||
@obj_pages, @attachments_results, @results_count = for_pagination(@result)
|
||||
when '9' then
|
||||
@obj = Course.find_by_id(obj_id)
|
||||
@obj_pages, @courses_results, @results_count = for_pagination(get_courses_by_tag(selected_tags))
|
||||
|
@ -380,7 +390,9 @@ class TagsController < ApplicationController
|
|||
when '8'
|
||||
return 'OpenSourceProject'
|
||||
when '9'
|
||||
return 'Course'
|
||||
return 'Course'
|
||||
when '10'
|
||||
return 'Attachment'
|
||||
else
|
||||
render_error :message => e.message
|
||||
return
|
||||
|
|
|
@ -33,6 +33,35 @@ module ApplicationHelper
|
|||
extend Forwardable
|
||||
def_delegators :wiki_helper, :wikitoolbar_for, :heads_for_wiki_formatter
|
||||
|
||||
# Time 2015-03-24 15:27:29
|
||||
# Author lizanle
|
||||
# Description 从硬盘上删除对应的资源文件
|
||||
def delete_kindeditor_assets_from_disk owner_id,owner_type
|
||||
assets = Kindeditor::Asset.where(["owner_id = ? and owner_type = ?",owner_id,owner_type])
|
||||
if !assets.nil? && !assets.blank?
|
||||
assets.all.each do |asset|
|
||||
next if asset.nil?
|
||||
filepath = File.join(Rails.root,"public","files","uploads",
|
||||
asset[:created_at].to_s.gsub("+0800","").to_datetime.strftime("%Y%m").to_s,
|
||||
asset[:asset].to_s)
|
||||
File.delete(filepath) if File.exist?filepath
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# Time 2015-03-24 16:38:05
|
||||
# Author lizanle
|
||||
# Description after save后需要进行资源记录的更新
|
||||
# owner_type = 1 对应的是 memo
|
||||
def update_kindeditor_assets_owner ids,owner_id,owner_type
|
||||
ids.each do |id|
|
||||
asset = Kindeditor::Asset.find(id.to_i)
|
||||
asset.owner_id = owner_id
|
||||
asset.owner_type = owner_type
|
||||
asset.save
|
||||
end
|
||||
end
|
||||
|
||||
# Added by young
|
||||
# Define the course menu's link class
|
||||
# 不是数组的转化成数组,然后判断当前menu_item是否在给定的列表
|
||||
|
@ -95,6 +124,20 @@ module ApplicationHelper
|
|||
end
|
||||
end
|
||||
|
||||
#重载上面方法,增加样式显示
|
||||
def link_to_user_header user,canShowRealName=false,options={}
|
||||
if user.is_a?(User)
|
||||
if canShowRealName
|
||||
name = h(user.realname(options[:format]))
|
||||
else
|
||||
name = h(user.name(options[:format]))
|
||||
end
|
||||
link_to name, {:controller=> 'users', :action => 'show', id: user.id, host: Setting.user_domain}, :class => options[:class]
|
||||
else
|
||||
h(user.to_s)
|
||||
end
|
||||
end
|
||||
|
||||
# Displays a link to +issue+ with its subject.
|
||||
# Examples:
|
||||
#
|
||||
|
@ -256,7 +299,7 @@ module ApplicationHelper
|
|||
onclick = "$('##{id}').slideToggle(); "
|
||||
onclick << (options[:focus] ? "$('##{options[:focus]}').focus(); " : "this.blur(); ")
|
||||
onclick << "return false;"
|
||||
link_to(name, "#", :onclick => onclick)
|
||||
link_to(name, "#", :onclick => onclick,:class => options[:class])
|
||||
end
|
||||
|
||||
def image_to_function(name, function, html_options = {})
|
||||
|
@ -1622,6 +1665,17 @@ module ApplicationHelper
|
|||
@public_forum = Forum.find(1)
|
||||
end
|
||||
|
||||
#获取用户未过期的课程
|
||||
def get_user_course user
|
||||
courses_doing = []
|
||||
user.courses.each do |course|
|
||||
if !course_endTime_timeout?(course)
|
||||
courses_doing.push course
|
||||
end
|
||||
end
|
||||
courses_doing
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def wiki_helper
|
||||
|
@ -1847,7 +1901,7 @@ module ApplicationHelper
|
|||
|
||||
def render_dynamic_nav
|
||||
home_link = link_to l(:field_homepage), {:controller => 'welcome', :action => 'index'}
|
||||
home_link = "<li>" << home_link << "</li>"
|
||||
home_link = "<li class = 'topnav_a fl'>" << home_link << "</li>"
|
||||
# bootstrap_render_dynamic_nav
|
||||
content_tag :ul, (home_link.html_safe+bootstrap_render_dynamic_nav)
|
||||
end
|
||||
|
@ -1888,7 +1942,7 @@ module ApplicationHelper
|
|||
|
||||
content_li = ''
|
||||
nav_list.collect do |nav_item|
|
||||
content_li << content_tag(:li, nav_item)
|
||||
content_li << content_tag(:li, nav_item, :class => 'topnav_a fl')
|
||||
end
|
||||
content_li.html_safe
|
||||
end
|
||||
|
|
|
@ -34,6 +34,16 @@ module AttachmentsHelper
|
|||
:locals => {:attachments => container.attachments, :options => options, :thumbnails => (options[:thumbnails] && Setting.thumbnails_enabled?)}
|
||||
end
|
||||
end
|
||||
|
||||
def link_to_attachments_course(container, options = {})
|
||||
options.assert_valid_keys(:author, :thumbnails)
|
||||
|
||||
if container.attachments.any?
|
||||
options = {:deletable => container.attachments_deletable?, :author => true}.merge(options)
|
||||
render :partial => 'attachments/course_file_links',
|
||||
:locals => {:attachments => container.attachments, :options => options, :thumbnails => (options[:thumbnails] && Setting.thumbnails_enabled?)}
|
||||
end
|
||||
end
|
||||
|
||||
def attach_delete(project)
|
||||
if User.current.logged? && (User.current.admin? || (!Member.where('user_id = ? and project_id = ?', User.current.id, project.bid.courses.first.id).first.nil? && (Member.where('user_id = ? and project_id = ?', User.current.id, project.bid.courses.first.id).first.roles&Role.where('id = ? or id = ?', 3, 7)).size >0) || project.user_id == User.current.id)
|
||||
|
|
|
@ -25,6 +25,40 @@ module CoursesHelper
|
|||
# searchTeacherAndAssistant(project).count
|
||||
end
|
||||
|
||||
#课程模块需要展示的模块
|
||||
def course_model
|
||||
@nav_dispaly_course_all_label = 1
|
||||
@nav_dispaly_forum_label = 1
|
||||
@nav_dispaly_course_label = nil
|
||||
@nav_dispaly_store_all_label = 1
|
||||
end
|
||||
|
||||
#生成课程老师成员链接
|
||||
def course_teacher_link teacher_num
|
||||
if User.current.member_of_course?(@course)
|
||||
link_to "#{teacher_num}", course_member_path(@course, :role => 1), :class => 'info_foot_num c_blue'
|
||||
else
|
||||
content_tag 'span',teacher_num, :class => 'info_foot_num c_blue'
|
||||
end
|
||||
end
|
||||
|
||||
#生成课程学生列表连接
|
||||
def course_student_link student_num
|
||||
if (User.current.logged? && @course.open_student == 1) || (User.current.member_of_course?(@course))
|
||||
link_to "#{student_num}", course_member_path(@course, :role => 2), :class => 'info_foot_num c_blue'
|
||||
else
|
||||
content_tag 'span',student_num, :class => 'info_foot_num c_blue'
|
||||
end
|
||||
end
|
||||
|
||||
def course_poll_count
|
||||
Poll.where("polls_type = 'Course' and polls_group_id = #{@course.id}").count
|
||||
end
|
||||
|
||||
def course_feedback_count
|
||||
@course.journals_for_messages.where('m_parent_id IS NULL').count
|
||||
end
|
||||
|
||||
# 返回学生数量,即roles表中定义的Reporter
|
||||
#def studentCount project
|
||||
# searchStudent(project).count
|
||||
|
@ -624,4 +658,82 @@ module CoursesHelper
|
|||
return activities
|
||||
end
|
||||
|
||||
#获取某个课程的动态数
|
||||
def course_activity_count course
|
||||
course_activity_count=Hash.new
|
||||
course_activity_count[course.id]=0
|
||||
count = get_course_activity([course],course_activity_count)[course.id]
|
||||
count.nil? ? 0 : count
|
||||
end
|
||||
|
||||
#重启、关闭课程按钮
|
||||
def set_course_time course
|
||||
id = "finish_course_#{course.id}"
|
||||
linkPath = course_endTime_timeout?(course) ? restartcourse_course_path(course) : finishcourse_course_path(course, format: :js)
|
||||
desc = course_endTime_timeout?(course) ? l(:label_course_reload) : l(:label_course_closed)
|
||||
link_to "<span class='pr_close'></span>#{desc}".html_safe, linkPath, :remote => true, :method => :post, :id => id, :confirm => l(:label_course_closed_tips, :desc => desc), :class => "pr_join_a"
|
||||
end
|
||||
|
||||
#加入课程、退出课程按钮
|
||||
def join_in_course_header(course, user, options=[])
|
||||
if user.logged?
|
||||
joined = user.member_of_course? course
|
||||
text = joined ? ("<em class='pr_arrow'></em>".html_safe + l(:label_course_exit_student)) : ("<em class='pr_add'></em>".html_safe + l(:label_course_join_student))
|
||||
url = joined ? join_path(:object_id => course.id) : try_join_path(:object_id => course.id)
|
||||
method = joined ? 'delete' : 'post'
|
||||
if joined
|
||||
link = "<span class='pr_join_span mr5' ><em class='pr_add'></em>#{l(:label_course_join_student)}</span>" + link_to(text, url, :remote => true, :method => method, :class => "pr_join_a", :id => "#{course.id}", :confirm => l(:text_are_you_sure_out))
|
||||
else
|
||||
link = link_to(text, url, :remote => true, :method => method, :id => "#{course.id}", :class => "pr_join_a") + "<span class='pr_join_span mr5' ><em class='pr_arrow'></em>#{l(:label_course_exit_student)}</span>".html_safe
|
||||
end
|
||||
else
|
||||
link = "<span class='pr_join_span mr5' ><em class='pr_add'></em>#{l(:label_course_join_student)}</span>" +
|
||||
"<span class='pr_join_span mr5' ><em class='pr_arrow'></em>#{l(:label_course_exit_student)}</span>"
|
||||
end
|
||||
link.html_safe
|
||||
end
|
||||
|
||||
def bid_anonymous_comment bid
|
||||
if bid.open_anonymous_evaluation == 1
|
||||
if bid.homeworks.count >= 2
|
||||
case bid.comment_status
|
||||
when 0
|
||||
link = link_to '启动匿评', alert_anonymous_comment_bid_path(bid), id: "#{bid.id}_start_anonymous_comment", remote: true, disable_with: '加载中...',:class => 'fr mr10 work_edit'
|
||||
when 1
|
||||
link = link_to '关闭匿评', alert_anonymous_comment_bid_path(bid), id: "#{bid.id}_stop_anonymous_comment", remote: true,:class => 'fr mr10 work_edit'
|
||||
when 2
|
||||
link = "<span class='fr pr_join_span mr10' title='匿评结束'>匿评结束</span>".html_safe
|
||||
end
|
||||
else
|
||||
link = "<span class='fr mr10 pr_join_span ' title='学生提交作业数大于2时才可以启动匿评'>启动匿评</span>".html_safe
|
||||
end
|
||||
else
|
||||
link = "<span class='fr mr10 pr_join_span ' title='未开启匿评作业不可以启动匿评'>启动匿评</span>".html_safe
|
||||
end
|
||||
link
|
||||
end
|
||||
|
||||
def student_new_homework bid
|
||||
user_homework = cur_user_homework_for_bid bid
|
||||
if user_homework && user_homework.empty?
|
||||
link_to l(:label_commit_homework), new_exercise_book_path(bid),:class => 'fr mr10 work_edit'
|
||||
else
|
||||
"<span class='fr mr10 pr_join_span '>作业已交</span>".html_safe
|
||||
end
|
||||
end
|
||||
|
||||
def student_anonymous_comment bid
|
||||
if bid.open_anonymous_evaluation == 1
|
||||
case bid.comment_status
|
||||
when 0
|
||||
"<span class='fr mr10 pr_join_span '>未开启匿评</span>".html_safe
|
||||
when 1
|
||||
"<span class='fr mr10 pr_join_span '>正在匿评中</span>".html_safe
|
||||
when 2
|
||||
"<span class='fr mr10 pr_join_span '>匿评已结束</span>".html_safe
|
||||
end
|
||||
else
|
||||
"<span class='fr mr10 pr_join_span '>未启用匿评</span>".html_safe
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -87,7 +87,10 @@ module FilesHelper
|
|||
def visable_attachemnts attachments
|
||||
result = []
|
||||
attachments.each do |attachment|
|
||||
if attachment.is_public? || (attachment.container_type == "Course" && User.current.member_of_course?(Course.find(attachment.container_id)))|| attachment.author_id == User.current.id
|
||||
if attachment.is_public? ||
|
||||
(attachment.container_type == "Project" && User.current.member_of?(attachment.project)) ||
|
||||
(attachment.container_type == "Course" && User.current.member_of_course?(Course.find(attachment.container_id)))||
|
||||
attachment.author_id == User.current.id
|
||||
result << attachment
|
||||
end
|
||||
end
|
||||
|
|
|
@ -20,6 +20,8 @@ module TagsHelper
|
|||
@obj= Contest.find_by_id(obj_id)
|
||||
when '9'
|
||||
@obj= Course.find_by_id(obj_id)
|
||||
when '10'
|
||||
@obj = Attachment.find_by_id(obj_id)
|
||||
else
|
||||
raise Exception, '[TagsHelper] ===> tag type unknow.'
|
||||
end
|
||||
|
|
|
@ -45,6 +45,26 @@ module WatchersHelper
|
|||
|
||||
link_to text, url, :remote => true, :method => method, :class => css
|
||||
end
|
||||
|
||||
def watcher_link_with_id(objects, user, options=[])
|
||||
return '' unless user && user.logged?
|
||||
objects = Array.wrap(objects)
|
||||
|
||||
watched = objects.any? {|object| object.watched_by?(user)}
|
||||
@watch_flag = (objects.first.instance_of?(User) or objects.first.instance_of?(Project) or objects.first.instance_of?(Contest) or (objects.first.instance_of?(Bid)))
|
||||
css = options[:class]
|
||||
|
||||
text = @watch_flag ?
|
||||
(watched ? l(:button_unfollow) : l(:button_follow)) : (watched ? l(:button_unwatch) : l(:button_watch))
|
||||
|
||||
url = watch_path(
|
||||
:object_type => objects.first.class.to_s.underscore,
|
||||
:object_id => (objects.size == 1 ? objects.first.id : objects.map(&:id).sort)
|
||||
)
|
||||
method = watched ? 'delete' : 'post'
|
||||
|
||||
link_to text, url, :remote => true, :method => method, :class => css,:id=>options[:id]
|
||||
end
|
||||
|
||||
############## added by linchun
|
||||
def new_watcher_link(objects, user, options=[])
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
class Forum < ActiveRecord::Base
|
||||
include Redmine::SafeAttributes
|
||||
include ApplicationHelper
|
||||
has_many_kindeditor_assets :assets, :dependent => :destroy
|
||||
has_many :topics, :class_name => 'Memo', :conditions => "#{Memo.table_name}.parent_id IS NULL", :order => "#{Memo.table_name}.created_at DESC", :dependent => :destroy
|
||||
has_many :memos, :dependent => :destroy, conditions: "parent_id IS NULL"
|
||||
belongs_to :creator, :class_name => "User", :foreign_key => 'creator_id'
|
||||
|
@ -15,7 +17,7 @@ class Forum < ActiveRecord::Base
|
|||
validates_length_of :name, maximum: 50
|
||||
#validates_length_of :description, maximum: 255
|
||||
validates :name, :uniqueness => true
|
||||
|
||||
after_destroy :delete_kindeditor_assets
|
||||
acts_as_taggable
|
||||
scope :by_join_date, order("created_at DESC")
|
||||
#after_create :send_email
|
||||
|
@ -47,5 +49,11 @@ class Forum < ActiveRecord::Base
|
|||
["id = ?", forum_id])
|
||||
end
|
||||
|
||||
# Time 2015-03-26 15:50:54
|
||||
# Author lizanle
|
||||
# Description 删除论坛后删除对应的资源
|
||||
def delete_kindeditor_assets
|
||||
delete_kindeditor_assets_from_disk self.id,2
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -125,7 +125,7 @@ class Mailer < ActionMailer::Base
|
|||
|
||||
end
|
||||
|
||||
|
||||
# 公共讨论区发帖、回帖添加邮件发送信息
|
||||
def forum_message_added(memo)
|
||||
@memo = memo
|
||||
redmine_headers 'Memo' => memo.id
|
||||
|
@ -134,9 +134,11 @@ class Mailer < ActionMailer::Base
|
|||
@forum_url = url_for(:controller => 'forums', :action => 'show', :id => @forum.id)
|
||||
@issue_author_url = url_for(user_activities_url(@author))
|
||||
recipients ||= []
|
||||
if @forum.author.mail_notification != 'day' && @forum.author.mail_notification != 'week'
|
||||
#将帖子创建者邮箱地址加入数组
|
||||
if @forum.creator.mail_notification != 'day' && @forum.creator.mail_notification != 'week'
|
||||
recipients << @forum.creator.mail
|
||||
end
|
||||
#回复人邮箱地址加入数组
|
||||
if @author.mail_notification != 'day' && @author.mail_notification != 'week'
|
||||
recipients << @author.mail
|
||||
end
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
class Memo < ActiveRecord::Base
|
||||
include Redmine::SafeAttributes
|
||||
include UserScoreHelper
|
||||
include ApplicationHelper
|
||||
belongs_to :forum
|
||||
has_many_kindeditor_assets :assets, :dependent => :destroy
|
||||
belongs_to :author, :class_name => "User", :foreign_key => 'author_id'
|
||||
validates_presence_of :author_id, :forum_id, :subject,:content
|
||||
# 若是主题帖,则内容可以是空
|
||||
|
@ -42,9 +44,9 @@ class Memo < ActiveRecord::Base
|
|||
"parent_id",
|
||||
"replies_count"
|
||||
|
||||
after_create :add_author_as_watcher, :reset_counters! #, :sendmail#,:be_user_score -- 公共区发帖暂不计入得分
|
||||
after_create :add_author_as_watcher, :reset_counters!, :sendmail
|
||||
# after_update :update_memos_forum
|
||||
after_destroy :reset_counters!#,:down_user_score -- 公共区发帖暂不计入得分
|
||||
after_destroy :reset_counters!,:delete_kindeditor_assets#,:down_user_score -- 公共区发帖暂不计入得分
|
||||
# after_create :send_notification
|
||||
# after_save :plusParentAndForum
|
||||
# after_destroy :minusParentAndForum
|
||||
|
@ -170,4 +172,10 @@ class Memo < ActiveRecord::Base
|
|||
update_replay_for_memo(User.current,1)
|
||||
end
|
||||
|
||||
# Time 2015-03-26 15:20:24
|
||||
# Author lizanle
|
||||
# Description 从硬盘上删除资源
|
||||
def delete_kindeditor_assets
|
||||
delete_kindeditor_assets_from_disk self.id,1
|
||||
end
|
||||
end
|
||||
|
|
|
@ -239,6 +239,8 @@ class CoursesService
|
|||
course.time = params[:time]
|
||||
course.term = params[:term]
|
||||
course.class_period = params[:class_period]
|
||||
params[:course][:is_public] ? course.is_public = 1 : course.is_public = 0
|
||||
params[:course][:open_student] ? course.open_student = 1 : course.open_student = 0
|
||||
if course.save
|
||||
if params[:course][:is_public] == '0'
|
||||
course_status = CourseStatus.find_by_course_id(course.id)
|
||||
|
|
|
@ -0,0 +1,72 @@
|
|||
<div class="attachments" style="font-weight:normal;">
|
||||
<% is_float ||= false %>
|
||||
<% for attachment in attachments %>
|
||||
<p style="width: 100%;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">
|
||||
<%if is_float%>
|
||||
<div style="max-width:55%;white-space: nowrap; overflow: hidden; text-overflow: ellipsis;float: left;">
|
||||
<% end%>
|
||||
<span title="<%= attachment.filename%>" id = "attachment_">
|
||||
<% if options[:length] %>
|
||||
<%= link_to_short_attachment attachment, :class => ' link_file_board', :download => true,:length => options[:length] -%>
|
||||
<% else %>
|
||||
<%= link_to_short_attachment attachment, :class => ' link_file_board', :download => true -%>
|
||||
<% end %>
|
||||
</span>
|
||||
<%if is_float%>
|
||||
</div>
|
||||
<% end%>
|
||||
|
||||
<% if attachment.is_text? %>
|
||||
<%= link_to image_tag('magnifier.png'),
|
||||
:controller => 'attachments',
|
||||
:action => 'show',
|
||||
:id => attachment,
|
||||
:filename => attachment.filename%>
|
||||
<% end %>
|
||||
<span title="<%= attachment.description%>">
|
||||
<%= h(truncate(" - #{attachment.description}", length: options[:length] ? options[:length]:15, omission: '...')) unless attachment.description.blank? %>
|
||||
</span>
|
||||
<span class="size">(
|
||||
<%= number_to_human_size attachment.filesize %>)
|
||||
</span>
|
||||
<% if options[:deletable] %>
|
||||
<% if attachment.container_type == 'HomeworkAttach' %>
|
||||
<%= 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 delete-homework-icon',
|
||||
:remote => true,
|
||||
:title => l(:button_delete) %>
|
||||
<% else %>
|
||||
<%= link_to image_tag('delete.png'), attachment_path(attachment),
|
||||
:data => {:confirm => l(:text_are_you_sure)},
|
||||
:method => :delete,
|
||||
:class => 'delete',
|
||||
#:remote => true,
|
||||
#:id => "attachments_" + attachment.id.to_s,
|
||||
:title => l(:button_delete) %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% if options[:wrap] %>
|
||||
<br/>
|
||||
|
||||
<% end %>
|
||||
<% if options[:author] %>
|
||||
<span class="author" title="<%= attachment.author%>">
|
||||
<%= link_to h(truncate(attachment.author.name, length: 10, omission: '...')),user_path(attachment.author) %>,
|
||||
<%= format_time(attachment.created_on) %>
|
||||
</span>
|
||||
<% end %>
|
||||
</p>
|
||||
<% end %>
|
||||
<% if defined?(thumbnails) && thumbnails %>
|
||||
<% images = attachments.select(&:thumbnailable?) %>
|
||||
<% if images.any? %>
|
||||
<div class="thumbnails">
|
||||
<% images.each do |attachment| %>
|
||||
<div><%= thumbnail_tag(attachment) %></div>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
|
@ -38,7 +38,7 @@
|
|||
<span class="add_attachment">
|
||||
<%#= button_tag "浏览", :type=>"button", :onclick=>"CompatibleSend();" %>
|
||||
<!--%= link_to image_tag(),"javascript:void(0)", :onclick => "_file.click()"%-->
|
||||
<%= button_tag l(:button_browse), :type=>"button", :onclick=>"_file.click()" %>
|
||||
<%= button_tag "浏览", :type=>"button", :onclick=>"_file.click()",:class =>"sub_btn",:style => ie8? ? 'display:none' : '' %>
|
||||
<%= file_field_tag 'attachments[dummy][file]',
|
||||
:id => '_file',
|
||||
:class => 'file_selector',
|
||||
|
@ -56,7 +56,7 @@
|
|||
:file_count => l(:label_file_count),
|
||||
:delete_all_files => l(:text_are_you_sure_all)
|
||||
} %>
|
||||
<span id="upload_file_count"><%= l(:label_no_file_uploaded)%></span>
|
||||
<span id="upload_file_count" :class="c_grey"><%= l(:label_no_file_uploaded)%></span>
|
||||
(<%= l(:label_max_size) %>: <%= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>)
|
||||
</span>
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
<% if options[:length] %>
|
||||
<%= link_to_short_attachment attachment, :class => 'icon icon-attachment', :download => true,:length => options[:length] -%>
|
||||
<% else %>
|
||||
<%= link_to_short_attachment attachment, :class => 'icon icon-attachment', :download => true -%>
|
||||
<%= link_to_short_attachment attachment, :class => 'icon icon-attachment', :download => true, :length => 32 -%>
|
||||
<% end %>
|
||||
</span>
|
||||
<%if is_float%>
|
||||
|
@ -26,9 +26,7 @@
|
|||
<span title="<%= attachment.description%>">
|
||||
<%= h(truncate(" - #{attachment.description}", length: options[:length] ? options[:length]:15, omission: '...')) unless attachment.description.blank? %>
|
||||
</span>
|
||||
<span class="size">(
|
||||
<%= number_to_human_size attachment.filesize %>)
|
||||
</span>
|
||||
<span class="size">(<%= number_to_human_size attachment.filesize , :precision => 0 %>)</span>
|
||||
<% if options[:deletable] %>
|
||||
<% if attachment.container_type == 'HomeworkAttach' %>
|
||||
<%= link_to image_tag('delete.png'), {:controller => 'attachments', :action => 'delete_homework', :id => attachment.id},
|
||||
|
|
|
@ -0,0 +1,59 @@
|
|||
<div class="fl">
|
||||
<span id="attachments_fields" class="attachments_fields">
|
||||
<% if defined?(container) && container && container.saved_attachments %>
|
||||
<% container.attachments.each_with_index do |attachment, i| %>
|
||||
<span id="attachments_p<%= i %>">
|
||||
<%= text_field_tag("attachments[p#{i}][filename]", attachment.filename, :class => 'filename link_file', :readonly=>'readonly')%>
|
||||
<%= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 254, :placeholder => l(:label_optional_description), :class => 'description', :style=>"display: inline-block;") %>
|
||||
<span class="ispublic-label"><%= l(:field_is_public)%>:</span>
|
||||
<%= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public,attachment.is_public == 1 ? true : false,:class => 'is_public')%>
|
||||
<%= link_to(' '.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload') unless attachment.id.nil? %>
|
||||
<%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %>
|
||||
</span>
|
||||
<% end %>
|
||||
<% container.saved_attachments.each_with_index do |attachment, i| %>
|
||||
<span id="attachments_p<%= i %>">
|
||||
<%= text_field_tag("attachments[p#{i}][filename]", attachment.filename, :class => 'filename readonly', :readonly=>'readonly')%>
|
||||
<%= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 254, :placeholder => l(:label_optional_description), :class => 'description', :style=>"display: inline-block;") %>
|
||||
<span class="ispublic-label"><%= l(:field_is_public)%>:</span>
|
||||
<%= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public,attachment.is_public == 1 ? true : false,:class => 'is_public')%>
|
||||
<%= link_to(' '.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload') unless attachment.id.nil? %>
|
||||
<%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %>
|
||||
</span>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</span>
|
||||
<% project = project %>
|
||||
<span class="add_attachment" style="font-weight:normal;">
|
||||
<%= button_tag "文件浏览", :type=>"button", :onclick=>"_file.click()",:onmouseover => 'this.focus()',:class => 'sub_btn' %>
|
||||
<%= file_field_tag 'attachments[dummy][file]',
|
||||
:id => '_file',
|
||||
:class => 'file_selector',
|
||||
:multiple => true,
|
||||
:onchange => 'addInputFiles(this);',
|
||||
:style => 'display:none',
|
||||
:data => {
|
||||
:max_file_size => Setting.attachment_max_size.to_i.kilobytes,
|
||||
:max_file_size_message => l(:error_attachment_too_big, :max_size => number_to_human_size(Setting.attachment_max_size.to_i.kilobytes)),
|
||||
:max_concurrent_uploads => Redmine::Configuration['max_concurrent_ajax_uploads'].to_i,
|
||||
:upload_path => uploads_path(:format => 'js',:project =>project),
|
||||
:description_placeholder => l(:label_optional_description),
|
||||
:field_is_public => l(:field_is_public),
|
||||
:are_you_sure => l(:text_are_you_sure),
|
||||
:file_count => l(:label_file_count),
|
||||
:delete_all_files => l(:text_are_you_sure_all)
|
||||
} %>
|
||||
<span id="upload_file_count">
|
||||
<%= l(:label_no_file_uploaded)%>
|
||||
</span>
|
||||
(<%= l(:label_max_size) %>:
|
||||
<%= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>)
|
||||
</span>
|
||||
|
||||
<% content_for :header_tags do %>
|
||||
<%= javascript_include_tag 'attachments' %>
|
||||
<% end %>
|
||||
|
||||
|
||||
|
||||
</div>
|
|
@ -0,0 +1,27 @@
|
|||
<a href="javascript:void(0)" class="upimg fl">
|
||||
<%= image_tag(url_to_avatar(source), id: "avatar_image", :width =>"60", :height =>"60",:alt=>"上传图片")%>
|
||||
</a>
|
||||
<%#= link_to l(:button_delete_file),{:controller => :avatar,:action => :delete_image,:remote=>true,:source_type=> source.class,:source_id=>source.id},:confirm => l(:text_are_you_sure), :method => :post, :class => "upbtn fl" %>
|
||||
<a href="javascript:void(0)" class="upbtn fl">上传图片</a>
|
||||
<%= file_field_tag 'avatar[image]',
|
||||
:id => nil,
|
||||
:class => 'upload_file ',
|
||||
:size => "1",
|
||||
:multiple => false,
|
||||
:onchange => 'addInputAvatar(this);',
|
||||
:data => {
|
||||
:max_file_size => Setting.attachment_max_size.to_i.kilobytes,
|
||||
:max_file_size_message => l(:error_attachment_too_big, :max_size => number_to_human_size(Setting.attachment_max_size.to_i.kilobytes)),
|
||||
:max_concurrent_uploads => Redmine::Configuration['max_concurrent_ajax_uploads'].to_i,
|
||||
:file_type => Redmine::Configuration['pic_types'].to_s,
|
||||
:type_support_message => l(:error_pic_type),
|
||||
:upload_path => upload_avatar_path(:format => 'js'),
|
||||
:description_placeholder => nil ,# l(:label_optional_description)
|
||||
:source_type => source.class.to_s,
|
||||
:source_id => source.id.to_s
|
||||
} %>
|
||||
<!--</span>-->
|
||||
<% content_for :header_tags do %>
|
||||
<%= javascript_include_tag 'avatars' %>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
|
@ -3,18 +3,8 @@
|
|||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>开启匿评功能</title>
|
||||
<style>
|
||||
body{ font-size:12px; font-family:"微软雅黑","宋体"; background:#fff; font-style:normal;}
|
||||
div,html,img,ul,li,p,body,h1,h2,h3,h4,p,a,table,tr,td,fieldset,input,span,textarea{ margin:0; padding:0;}
|
||||
div,img,tr,td,textarea{ border:0;}
|
||||
table,tr,td{border:0; cellspacing:0; cellpadding:0;}
|
||||
ul,li{ list-style-type:none}
|
||||
.cl{ clear:both; overflow:hidden; }
|
||||
a{ text-decoration:none; }
|
||||
a:hover{ text-decoration:underline;}
|
||||
|
||||
|
||||
/* 匿名评分弹框 */
|
||||
.anonymos{width:480px;height:180px;position:fixed;z-index:100;left:50%;top:50%;margin:-215px 0 0 -300px; background:#fff; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px; box-shadow:0px 0px 8px #194a81; overflow:auto;}
|
||||
.anonymos{width:480px;height:180px;position:fixed !important;z-index:100;left:50%;top:50%;margin:-215px 0 0 -300px; background:#fff; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px; box-shadow:0px 0px 8px #194a81; overflow:auto;}
|
||||
.ni_con { width:425px; margin:25px 30px;}
|
||||
.ni_con h2{ display:block; height:40px; width:425px; text-align:center; color:#3a3a3a;}
|
||||
.ni_con p{ color:#808181; }
|
||||
|
@ -76,10 +66,10 @@
|
|||
</p>
|
||||
<% end %>
|
||||
<div class="ni_btn">
|
||||
<a href="#" class="tijiao" onclick="clickOK();" >
|
||||
<a href="javascript:" class="tijiao" onclick="clickOK();" >
|
||||
确 定
|
||||
</a>
|
||||
<a href="#" class="tijiao" onclick="clickCanel();">
|
||||
<a href="javascript:" class="tijiao" onclick="clickCanel();">
|
||||
取 消
|
||||
</a>
|
||||
</div>
|
||||
|
|
|
@ -91,7 +91,7 @@
|
|||
<% when 1 %>
|
||||
<%= link_to '关闭匿评', alert_anonymous_comment_bid_path(bid), id: "#{bid.id}_stop_anonymous_comment", remote: true %>
|
||||
<% when 2 %>
|
||||
<a href="#" style="background:#8e8e8e;">匿评结束</a>
|
||||
<a href="javascript:" style="background:#8e8e8e;">匿评结束</a>
|
||||
<% end %>
|
||||
</span>
|
||||
<%end%>
|
||||
|
@ -165,7 +165,7 @@
|
|||
<tr>
|
||||
<td colspan="2" width="580px" >
|
||||
<span class="font_description">
|
||||
<%= textilizable bid, :description %>
|
||||
<%=h sanitize(bid.description.html_safe) %>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
$('#ajax-modal').css('height','240px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
|
||||
"<a href='#' onclick='hiddent_alert_model();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
|
||||
"<a href='javascript:' onclick='hiddent_alert_model();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
|
||||
$('#ajax-modal').parent().css("top","").css("left","").css("width","511");
|
||||
$('#ajax-modal').parent().addClass("alert_praise");
|
||||
<% end %>
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
(<span id="jours_count" class="c_red f_12"><%= @jours_count %></span>)
|
||||
</li>
|
||||
<li>
|
||||
<%= link_to "作品打包下载", zipdown_assort_path(obj_class: @bid.class, obj_id: @bid, format: :json), remote: true, class: "tb_all" unless @bid.homeworks.empty? %>
|
||||
<%#= link_to "作品打包下载", zipdown_assort_path(obj_class: @bid.class, obj_id: @bid), class: "tb_all" unless @bid.homeworks.empty? %>
|
||||
</li>
|
||||
</ul>
|
||||
<% else %>
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
<tr>
|
||||
<td><%= f.text_field :reference_user_id, :style=>"display:none"%>
|
||||
<a href="javascript:void(0);" class="ping_sub" onclick = "clearMessage('bid_message_message');"><%= l(:button_clear_meassge) %></a>
|
||||
<a href="#" class="ping_sub" id="jours_submit" onclick="submit1();"><%= l(:label_responses) %></a></td>
|
||||
<a href="javascript:" class="ping_sub" id="jours_submit" onclick="submit1();"><%= l(:label_responses) %></a></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
|
|
@ -0,0 +1,46 @@
|
|||
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', :media => 'all' %>
|
||||
<%= error_messages_for 'bid' %>
|
||||
<%= hidden_field_tag 'course_id', @course.id %>
|
||||
<div class="project_r_h">
|
||||
<h2 class="project_h2"><%= l(:label_course_homework_new)%></h2>
|
||||
</div>
|
||||
<div class="hwork_new">
|
||||
<ul>
|
||||
<li class="ml45">
|
||||
<label><span class="c_red">*</span> <%= l(:field_name)%> :</label>
|
||||
<input type="text" name="bid[name]" id="bid_name" class="hwork_input" maxlength="<%= Bid::NAME_LENGTH_LIMIT%>" onkeyup="regex_bid_name();" value="<%= bid.name%>" >
|
||||
<p id="bid_name_span" class="c_red" style="padding-left: 55px;"></p>
|
||||
</li>
|
||||
<li class="ml45">
|
||||
<label class="fl" > <%= l(:field_quote)%> :</label>
|
||||
<textarea name="bid[description]" placeholder="最多3000个汉字(或6000个英文字符)" class="hwork_text fl"><%= bid.description%></textarea>
|
||||
</li>
|
||||
<div class="cl"></div>
|
||||
<li class="ml21">
|
||||
<label><span class="c_red">*</span> <%= l(:label_limit_time)%> :</label>
|
||||
<input type="text" name="bid[deadline]" id="bid_deadline" class="hwork_input02" onchange="regexDeadLine();" readonly="readonly" value="<%= bid.deadline%>" >
|
||||
<%= calendar_for('bid_deadline')%>
|
||||
</li>
|
||||
<li class=" mb5 ml30">
|
||||
<label ><%= l(:label_open_anonymous_evaluation)%> :</label>
|
||||
<input type="checkbox" name="bid[open_anonymous_evaluation]" id="bid_open_anonymous_evaluation" <%= bid.open_anonymous_evaluation == 1 ? 'checked' : ''%> >
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<li class="ml9" id="bid_evaluation_num_li" style="display: <%= bid.open_anonymous_evaluation == 1 ? 'block' : 'none'%>;">
|
||||
<label><span class="c_red">*</span> <%= l(:field_evaluation_num)%> :</label>
|
||||
<input type="text" name="bid[evaluation_num]" id="bid_evaluation_num" class="hwork_input02" onkeyup="regex_evaluation_num();" value="<%= bid.evaluation_num%>">
|
||||
<span><%= l(:label_evaluation_description)%></span>
|
||||
<p id="bid_evaluation_num_span" class="c_red" style="padding-left: 90px;"></p>
|
||||
</li>
|
||||
<li class="ml45">
|
||||
<label> <%= l(:label_attachment_plural) %> :</label>
|
||||
<%= render :partial => 'attachments/new_form', :locals => {:container => bid} %>
|
||||
</li>
|
||||
<li class=" ml90" >
|
||||
<a class="blue_btn fl c_white" onclick="submit_new_bid('<%= bid_id%>');" href="#"><%= l(:button_create)%></a>
|
||||
<%= link_to l(:button_cancel), homework_course_path(@course), :class => "blue_btn grey_btn fl c_white"%>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="cl"></div>
|
|
@ -3,6 +3,6 @@ showModal('ajax-modal', '500px');
|
|||
$('#ajax-modal').css('height','180px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
|
||||
"<a href='#' onclick='clickCanel();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
|
||||
"<a href='javascript:' onclick='clickCanel();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
|
||||
$('#ajax-modal').parent().css("top","").css("left","");
|
||||
$('#ajax-modal').parent().addClass("anonymos");
|
|
@ -1,129 +1,3 @@
|
|||
<script type="text/javascript">
|
||||
function regexName()
|
||||
{
|
||||
var name = $.trim($("#bid_name").val());
|
||||
|
||||
if(name=="")
|
||||
{
|
||||
$("#bid_name_span").text("名称不能为空");
|
||||
$("#bid_name_span").css('color','#ff0000');
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#bid_name_span").text("填写正确");
|
||||
$("#bid_name_span").css('color','#008000');
|
||||
return true;
|
||||
}
|
||||
}
|
||||
function regexDeadLine()
|
||||
{
|
||||
var deadline = $.trim($("#bid_deadline").val());
|
||||
var regex = /^\d{4}-\d{2}-\d{2}$/;
|
||||
if(deadline=="")
|
||||
{
|
||||
$("#bid_deadline_span").text("截止日期不能为空");
|
||||
$("#bid_deadline_span").css('color','#ff0000');
|
||||
return false;
|
||||
}
|
||||
else if(regex.test(deadline))
|
||||
{
|
||||
$("#bid_deadline_span").text("填写正确");
|
||||
$("#bid_deadline_span").css('color','#008000');
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#bid_deadline_span").text("截止日期格式错误");
|
||||
$("#bid_deadline_span").css('color','#ff0000');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
function regexEvaluationNum()
|
||||
{
|
||||
var evaluation_num = $.trim($("#bid_evaluation_num").val());
|
||||
var regex = /^\d+$/;
|
||||
if($("#bid_open_anonymous_evaluation").attr("checked") == "checked")
|
||||
{
|
||||
if(evaluation_num=="")
|
||||
{
|
||||
$("#bid_evaluation_num_span").text("匿评分配数量不能为空");
|
||||
$("#bid_evaluation_num_span").css('color','#ff0000');
|
||||
return false;
|
||||
}
|
||||
else if(regex.test(evaluation_num))
|
||||
{
|
||||
if(evaluation_num > 0)
|
||||
{
|
||||
$("#bid_evaluation_num_span").text("填写正确");
|
||||
$("#bid_evaluation_num_span").css('color','#008000');
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#bid_evaluation_num_span").text("匿评分配数量必须为大于0");
|
||||
$("#bid_evaluation_num_span").css('color','#ff0000');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#bid_evaluation_num_span").text("匿评分配数量只能为数字");
|
||||
$("#bid_evaluation_num_span").css('color','#ff0000');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
$(function(){
|
||||
$("#bid_open_anonymous_evaluation").click(function(){
|
||||
if($("#bid_open_anonymous_evaluation").attr("checked") == "checked")
|
||||
{
|
||||
$("#evaluation_num_p").slideDown();
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#evaluation_num_p").slideUp();
|
||||
}
|
||||
});
|
||||
});
|
||||
$(function(){
|
||||
$("#bid_open_anonymous_evaluation").click(function(){
|
||||
if($("#bid_open_anonymous_evaluation").attr("checked") == "checked")
|
||||
{
|
||||
$("#evaluation_num_p").slideDown();
|
||||
$("#open_anonymous_evaluation_span").slideUp();
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#evaluation_num_p").slideUp();
|
||||
$("#open_anonymous_evaluation_span").slideDown();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
function submitHomework(id)
|
||||
{
|
||||
if(regexDeadLine()&®exName()&®exEvaluationNum())
|
||||
{
|
||||
$("#edit_bid_" + id).submit();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<h3><%= l(:label_edit_homework) %></h3>
|
||||
|
||||
<%= labelled_form_for @bid do |f| %>
|
||||
<div class="box tabular">
|
||||
<%#= render :partial => 'homework_form', :locals => { :f => f } %>
|
||||
<%= render :partial => 'homework_form', :locals => { :f => f } %>
|
||||
<!--<input type="button" onclick="submitHomework(<%#= @bid.id%>);" value="<%#= l(:button_create)%>" class="enterprise">-->
|
||||
<a href="#" onclick="submitHomework(<%= @bid.id%>);" class="ButtonColor m3p10" >
|
||||
<%= l(:button_create)%>
|
||||
</a>
|
||||
<% end %>
|
||||
</div>
|
||||
<%= render :partial => 'new_homework_form', :locals => { :bid => @bid, :bid_id => "edit_bid_#{@bid.id}"} %>
|
||||
<% end %>
|
|
@ -1,2 +1,2 @@
|
|||
alert('关闭成功');
|
||||
$("#<%= @bid.id %>_anonymous_comment").html('<a href="#" style="background:#8e8e8e;">匿评结束</a>');
|
||||
$("#<%= @bid.id %>_anonymous_comment").html('<a href="javascript:" style="background:#8e8e8e;">匿评结束</a>');
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
<%= l(:label_message_new) %>
|
||||
</div>
|
||||
<%= form_for @message, :url => new_board_message_path(@board), :html => {:multipart => false, :id => 'message-form'} do |f| %>
|
||||
<%= render :partial => 'messages/form', :locals => {:f => f} %>
|
||||
<%= render :partial => 'messages/form_course', :locals => {:f => f} %>
|
||||
<p>
|
||||
<!--<input type="button" onclick="submitCoursesBoard();" class = "ButtonColor m3p10 h30" value="<%#= l(:button_submit)%>">-->
|
||||
<a href="#" onclick="submitCoursesBoard();"class="ButtonColor m3p10"><%= l(:button_submit)%></a>
|
||||
|
@ -26,10 +26,11 @@
|
|||
</div>
|
||||
|
||||
<!--display the board-->
|
||||
<div class="borad-title">
|
||||
<%=h @board.name %>
|
||||
<div class="project_r_h">
|
||||
<h2 class="project_h2"><%= l(:label_board_plural) %></h2>
|
||||
</div>
|
||||
|
||||
|
||||
<% if !User.current.logged?%>
|
||||
<div style="font-size: 14px;margin:20px;">
|
||||
<%= l(:label_user_login_course_board) %>
|
||||
|
@ -37,74 +38,41 @@
|
|||
<hr/>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="borad-setitle">
|
||||
<span class="borad-topic-count">
|
||||
共有
|
||||
<%=link_to @topic_count,:controller => 'boards',:action => 'index' %>
|
||||
个贴子
|
||||
</span>
|
||||
<span>
|
||||
<%= link_to l(:label_message_new),
|
||||
new_board_message_path(@board),
|
||||
:class => 'icon icon-add',
|
||||
:onclick => 'showAndScrollTo("add-message", "message_subject"); return false;' if User.current.logged? %>
|
||||
</span>
|
||||
<div class="talk_top ml15">
|
||||
<p class="fl"><%= l(:label_totle) %><span><%= @topic_count %></span><%= l(:label_course_momes_count) %></p>
|
||||
<%= link_to l(:label_message_new),
|
||||
new_board_message_path(@board),
|
||||
:class => 'problem_new_btn fl c_dorange' if User.current.logged? %>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div style="padding-top: 10px">
|
||||
<% if @topics.any? %>
|
||||
<% @topics.each do |topic| %>
|
||||
<table class="content-text-list">
|
||||
<tr>
|
||||
<td colspan="2" valign="top" width="50" ><%= link_to image_tag(url_to_avatar(topic.author), :class => "avatar"), user_path(topic.author) %></td>
|
||||
<td>
|
||||
<table width="640px" border="0">
|
||||
<tr>
|
||||
<td valign="top" width="500px" class=" <%= topic.sticky? ? 'sticky' : '' %>
|
||||
<%= topic.locked? ? 'locked' : '' %>">
|
||||
<%= link_to h(topic.subject.truncate(40,ommision:'...')), board_message_path(@board, topic),title: topic.subject.to_s %>
|
||||
</td>
|
||||
<td align="right" rowspan="3">
|
||||
<table class="borad-count">
|
||||
<tr>
|
||||
<td align="center" class="borad-count-digit">
|
||||
<%=link_to (topic.replies_count), board_message_path(@board, topic) %>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">
|
||||
回答
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" colspan="2" >
|
||||
<span class="font_lighter">
|
||||
<%= authoring topic.created_on, topic.author %>
|
||||
<br />
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="problem_main">
|
||||
<%= link_to image_tag(url_to_avatar(topic.author), :width=>"32",:height=>"32"), user_path(topic.author),:class => 'problem_pic talk_pic fl' %>
|
||||
<div class="talk_txt fl">
|
||||
<%= link_to h(topic.subject.truncate(40,ommision:'...')), board_message_path(@board, topic),title: topic.subject.to_s,:class => "problem_tit fl fb c_dblue" %>
|
||||
<% if topic.sticky? %>
|
||||
<a href="#" class="talk_up fl c_red">置顶</a>
|
||||
<% end %>
|
||||
<br/>
|
||||
<p>由<%= link_to topic.author,user_path(topic.author),:class => "problem_name" %>添加于<%= format_time(topic.created_on) %></p>
|
||||
</div>
|
||||
<%=link_to (l(:label_reply) + topic.replies_count.to_s), board_message_path(@board, topic),:class => "talk_btn fr c_white" %>
|
||||
|
||||
<div class="cl"></div>
|
||||
</div><!--讨论主类容 end-->
|
||||
<% end %>
|
||||
<div class="pagination">
|
||||
<%= pagination_links_full @topic_pages, @topic_count %>
|
||||
</div>
|
||||
<% else %>
|
||||
<p class="nodata">
|
||||
<%= l(:label_no_data) %>
|
||||
</p>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<% other_formats_links do |f| %>
|
||||
<%= f.link_to 'Atom', :url => {:key => User.current.rss_key} %>
|
||||
<% end %>
|
||||
<ul class="wlist">
|
||||
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%>
|
||||
</ul>
|
||||
<%# other_formats_links do |f| %>
|
||||
<%#= f.link_to 'Atom', :url => {:key => User.current.rss_key} %>
|
||||
<%# end %>
|
||||
|
||||
<% html_title @board.name %>
|
||||
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
<div class="st_list">
|
||||
<div class="st_search" id="search_members">
|
||||
<%= render :partial => 'searchmembers' %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
|
||||
<div class="st_addclass" id="st_groups">
|
||||
<%= render :partial => 'new_groups_name', :locals => {:course_groups => @course_groups} %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
|
||||
<div id="member_content">
|
||||
<%= render :partial => 'new_member_list', :locals => {:members => members} %>
|
||||
</div>
|
||||
</div> <!-- st_list end-->
|
||||
<div class="cl"></div>
|
|
@ -0,0 +1,23 @@
|
|||
<div class="st_list">
|
||||
<div class="st_box">
|
||||
<a href="#" class="fr fb mb5" >加入时间</a>
|
||||
<div class="cl"></div><!--st_box_top end-->
|
||||
|
||||
<% members.each do |member| %>
|
||||
<div class="st_boxlist">
|
||||
<a href="javascript:" class="st_img">
|
||||
<%= member.user.nil? ? '' : (image_tag(url_to_avatar(member.user), :width => 32, :height => 32)) %>
|
||||
</a>
|
||||
<span class="fl ml10 c_grey"><%= l(:label_username)%></span>
|
||||
<%= link_to(member.user.name, user_path(member.user),:class => "ml10 c_blue02") %>
|
||||
<span class="fr c_grey"><%= format_date(member.created_on)%></span>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<% end%>
|
||||
|
||||
<ul class="wlist">
|
||||
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%>
|
||||
</ul>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
|
@ -1,10 +1,7 @@
|
|||
<div class="dis">
|
||||
|
||||
<div class="msg_box" id='leave-message'>
|
||||
<%# reply_allow = JournalsForMessage.create_by_user? User.current %>
|
||||
|
||||
<h3>
|
||||
<%= l(:label_user_response) %>
|
||||
</h3>
|
||||
<h4><%= l(:label_leave_message) %></h4>
|
||||
|
||||
<% if !User.current.logged?%>
|
||||
<div style="font-size: 14px;margin:20px;">
|
||||
|
@ -13,20 +10,14 @@
|
|||
<hr/>
|
||||
</div>
|
||||
<% else %>
|
||||
<div style="width: 80%; margin-left:10%;">
|
||||
<%= form_for('new_form', :method => :post,
|
||||
:url => {:controller => 'words', :action => 'leave_course_message'}) do |f|%>
|
||||
<%= f.text_area 'course_message',:id => "leave_meassge", :rows => 3, :cols => 65,
|
||||
:placeholder => "#{l(:label_welcome_my_respond)}",
|
||||
:style => "resize: none; width: 98%",
|
||||
:class => 'noline',:maxlength => 250%>
|
||||
<!--<%#= submit_tag l(:button_leave_meassge), :name => nil , :class => "enterprise" , :style => "display: block; float: right; margin-right: 1%; margin-top: 1px;"%>-->
|
||||
<a href="#" onclick='$("#leave_meassge").parent().submit();' class="ButtonColor m3p10" style ="display: block; float: right; margin-right: 1%; margin-top: 1px;"> <%= l(:button_leave_meassge)%>
|
||||
</a>
|
||||
<%= f.text_area 'course_message',:id => "leave_meassge",:style => "resize: none;",
|
||||
:placeholder => "#{l(:label_welcome_my_respond)}",:maxlength => 250%>
|
||||
<a href="#" class="grey_btn fr ml10">取 消</a>
|
||||
<a href="#" onclick='$("#leave_meassge").parent().submit();' class="blue_btn fr"> <%= l(:button_leave_meassge)%></a>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
|
||||
<div id="history">
|
||||
|
@ -34,5 +25,4 @@
|
|||
</div>
|
||||
<ul class="wlist">
|
||||
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%>
|
||||
</ul>
|
||||
</div>
|
||||
</ul>
|
|
@ -1,22 +1,17 @@
|
|||
<% reply_allow = JournalsForMessage.create_by_user? User.current %>
|
||||
|
||||
<div class="ping_ctt">
|
||||
<div id="tbc_01" class="ping_dis">
|
||||
<% if journals.size > 0 %>
|
||||
<% for journal in journals %>
|
||||
<div class="ping_C" id='word_li_<%= journal.id.to_s %>'>
|
||||
<div class="ping_dispic">
|
||||
<a target="_blank" href="#">
|
||||
<%= image_tag(url_to_avatar(journal.user)) %>
|
||||
</a>
|
||||
<%= link_to image_tag(url_to_avatar(journal.user),:width => '46',:height => '46'), user_path(journal.user) %>
|
||||
</div>
|
||||
<div class="ping_discon" style="width: 85%;">
|
||||
<div class="ping_discon" style="width: 610px;">
|
||||
<div class="ping_distop">
|
||||
<!-- <a style=" font-weight:bold; color:#15bccf; margin-right:30px; background:none;" target="_blank" href="#">gugu01</a> -->
|
||||
<span>
|
||||
<%= link_to journal.user, user_path(journal.user),:style => " font-weight:bold; color:#15bccf; margin-right:30px; background:none;", :target => "_blank"%>
|
||||
<%= link_to journal.user, user_path(journal.user),:class => 'c_blue fb fl mb10', :target => "_blank"%>
|
||||
</span>
|
||||
<span style="color:#a6a6a6; margin-right:40px; margin-left:30px;">
|
||||
<span class="c_grey fr">
|
||||
<%= format_time(journal.created_on) %>
|
||||
</span>
|
||||
<div class="cl"></div>
|
||||
|
@ -26,7 +21,7 @@
|
|||
</div>
|
||||
<div class="ping_disfoot">
|
||||
<% ids = 'project_respond_form_'+ journal.id.to_s%>
|
||||
<span style="float: right">
|
||||
|
||||
<% if journal.user == User.current|| User.current.admin? || (@course && User.current.allowed_to?(:as_teacher,@course)) %>
|
||||
<%= link_to(l(:label_bid_respond_delete),
|
||||
{:controller => 'words', :action => 'destroy', :object_id => journal, :user_id => @user},
|
||||
|
@ -38,31 +33,28 @@
|
|||
{:focus => 'project_respond', :onclick => "toggleAndSettingWordsVal($('##{ids}'), $('##{ids} textarea')); $('##{ids} textarea') ;return false;"} %>
|
||||
|
||||
<% end %>
|
||||
</span>
|
||||
<span class="font_lighter" style="float: right">
|
||||
<%= l(:label_bids_published) %>
|
||||
<%= time_tag(journal.created_on).html_safe %>
|
||||
<%= l(:label_bids_published_ago) %>
|
||||
</span>
|
||||
</div>
|
||||
<div style="clear: both;"></div>
|
||||
<div class="cl"></div>
|
||||
<!--<span class="font_lighter" style="float: right">
|
||||
<#%= l(:label_bids_published) %>
|
||||
<#%= time_tag(journal.created_on).html_safe %>
|
||||
<#%= l(:label_bids_published_ago) %>
|
||||
</span>-->
|
||||
<% ids = 'project_respond_form_'+ journal.id.to_s%>
|
||||
<% if reply_allow %>
|
||||
<div id='<%= ids %>' class="respond-form">
|
||||
<%= render :partial => 'words/new_respond', :locals => {:journal => journal, :m_reply_id => journal,:show_name => true} %>
|
||||
<%= render :partial => 'words/new_respond_course', :locals => {:journal => journal, :m_reply_id => journal,:show_name => true} %>
|
||||
</div>
|
||||
<% end %>
|
||||
<div style="clear: both;"></div>
|
||||
<div>
|
||||
<%= render :partial => "words/journal_reply", :locals => {:journal => journal, :show_name => true, :allow_delete => @course && User.current.allowed_to?(:as_teacher,@course)} %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
|
||||
<%= render :partial => "words/journal_reply", :locals => {:journal => journal, :show_name => true, :allow_delete => @course && User.current.allowed_to?(:as_teacher,@course)} %>
|
||||
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -68,10 +68,10 @@
|
|||
<input class=" width190" type="password" name="course_password" id="course_password" value="" >
|
||||
</li>
|
||||
<li>
|
||||
<a href="#" class="btn" style="margin-left: 50px;" onclick="submit_form(this);">
|
||||
<a href="javascript:" class="btn" style="margin-left: 50px;" onclick="submit_form(this);">
|
||||
<%= l(:label_new_join) %>
|
||||
</a>
|
||||
<a href="#" class="btn" style="margin-left: 20px;" onclick="hideModal(this);">
|
||||
<a href="javascript:" class="btn" style="margin-left: 20px;" onclick="hideModal(this);">
|
||||
<%= l(:button_cancel)%>
|
||||
</a>
|
||||
</li>
|
||||
|
|
|
@ -1,9 +1,7 @@
|
|||
|
||||
<div style="margin-left: 15px" xmlns="http://www.w3.org/1999/html" xmlns="http://www.w3.org/1999/html">
|
||||
<div style="margin-left: 15px">
|
||||
<% if User.current.logged? && User.current.member_of_course?(@course) && @group %>
|
||||
<% if !@canShowCode %>
|
||||
<%= join_in_course_group(@course.course_groups,@group, User.current) %>
|
||||
<% end %>
|
||||
<%= join_in_course_group(@course.course_groups,@group, User.current) unless @canShowCode %>
|
||||
<span style="font-size: 12px; float: left; margin-right: 5px">
|
||||
<%= l(:label_current_group)%>:
|
||||
<%= @group.name %>
|
||||
|
@ -25,7 +23,8 @@
|
|||
<div class="st_box">
|
||||
<ul class="st_box_top" style="margin-left: 17px;">
|
||||
<% if @subPage_title == l(:label_student_list) %>
|
||||
<li class="ml358"><%= link_to '作业积分', member_score_sort_course_path(:sort_by => (@score_sort_by == "desc" ? "asc" : "desc"), :group_id => (@group ? @group.id : 0),:search_name => (@search_name ? @search_name : nil)) ,:result => members,method: 'get', remote: true%>
|
||||
<li class="ml358">
|
||||
<%= link_to '作业积分', member_score_sort_course_path(:sort_by => (@score_sort_by == "desc" ? "asc" : "desc"), :group_id => (@group ? @group.id : 0),:search_name => (@search_name ? @search_name : nil)) ,:result => members,method: 'get', remote: true%>
|
||||
<% if @score_sort_by == 'desc' %>
|
||||
<a id="pic" href="#" class= "st_down"></a>
|
||||
<% else %>
|
||||
|
@ -33,7 +32,7 @@
|
|||
<% end %>
|
||||
</li>
|
||||
<li class="ml50">
|
||||
<a href="#" >加入时间</a>
|
||||
<a href="javascript:" >加入时间</a>
|
||||
</li>
|
||||
<% else %>
|
||||
<li class="ml50">
|
||||
|
@ -41,7 +40,7 @@
|
|||
<li class="ml50" style="margin-left: 470px">
|
||||
</li>
|
||||
<li class="ml50" style="margin-left: 80%">
|
||||
<a href="#" >加入时间</a>
|
||||
<a href="javascript:" >加入时间</a>
|
||||
</li>
|
||||
<% end %>
|
||||
|
||||
|
@ -51,7 +50,7 @@
|
|||
<div class="cl"></div><!--st_box_top end-->
|
||||
<div class="st_boxlist">
|
||||
|
||||
<a href="#" class="st_img" style="float:left;">
|
||||
<a href="javascript:" class="st_img" style="float:left;">
|
||||
<%= member.user.nil? ? '' : (image_tag(url_to_avatar(member.user), :width => 40, :height => 40)) %>
|
||||
</a>
|
||||
<ul style="margin-left: 15px">
|
||||
|
|
|
@ -0,0 +1,56 @@
|
|||
<ul>
|
||||
<li style=" color:#8b8b8b;">分班:</li>
|
||||
<li class="classbox" id="course_group_0">
|
||||
<%= link_to l(:label_all), searchgroupmembers_course_path(@course,:group_id => 0), :onclick => "checkclass('course_group_0')", method: 'get', remote: true%>
|
||||
</li>
|
||||
|
||||
<% unless course_groups.nil? %>
|
||||
<% course_groups.each do |group| %>
|
||||
<% group_name = " #{ group.name}( <span class='c_red'>#{group.members.count.to_s}人</span>)".html_safe %>
|
||||
<li class="classbox" style="margin-bottom: 5px;">
|
||||
<%= link_to group_name, searchgroupmembers_course_path(@course,:group_id => group.id), method: 'get', remote: true,:onclick => "checkclass('group_name_#{group.id}')"%>
|
||||
<% if @canShowCode%>
|
||||
<% if group.members.empty?%>
|
||||
<%= link_to '', deletegroup_course_path(:group_id => group.id), :method => 'delete', :remote => true,
|
||||
:data => {confirm: l(:label_delete_group)},
|
||||
:class => 'f_1',
|
||||
:style => "width: 11px;height: 16px;margin-top:3px;margin-left:5px;background: url(/images/pic_del.gif) no-repeat 0 0;"
|
||||
%>
|
||||
<% else%>
|
||||
<a href="javascript:" onClick="alert('温馨提示:已有学生加入该班级,不能删除该班级,仅可编辑班级名称。');" style="margin-right:4px;" >
|
||||
<img src="/images/pic_del.gif" width="11" height="12" alt="删除班级" title="删除该班级" />
|
||||
</a>
|
||||
<% end%>
|
||||
<a href="javascript:void(0)" class="f_l" style="padding-left: 5px;" onclick="$('#group_name_<%= group.id %>').val('');$('#edit_group_<%= group.id %>').slideToggle();">
|
||||
<img src="/images/pic_edit.png" width="14" height="15" alt="编辑班级" />
|
||||
</a>
|
||||
<% end %>
|
||||
</li>
|
||||
<!-- 编辑分班 -->
|
||||
<li>
|
||||
<% if @canShowCode%>
|
||||
<%= form_tag(updategroupname_course_path(@course,:group_id => group.id), method: 'get', remote:true, :id => 'update_group_'+group.id.to_s) do %>
|
||||
<span id="edit_group_<%= group.id %>" style="display:none; vertical-align: middle;" class=" f_l">
|
||||
<input type="text" id="group_name_<%= group.id%>" name="group_name" size="20" class="isTxt w90 f_l" maxlength="100" />
|
||||
<input type="button" class="submit f_l" onclick="edit_group('group_name_<%= group.id%>','<%= valid_ajax_course_path%>','<%= @course.id%>','<%= group.id%>');"/>
|
||||
</span>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</li>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<% if @canShowCode %>
|
||||
<li style="margin-left:15px;margin-top: 2px;">
|
||||
<a href="javascript:void(0)" class="st_add f_l" onclick="$('#group_name').value='';$('#new_group_name').slideToggle();">+添加分班</a>
|
||||
</li>
|
||||
<li >
|
||||
<span id="new_group_name" style="display:none; vertical-align: middle;" class="ml10 f_l">
|
||||
<%= form_tag( addgroups_course_path(@course), method: 'get',:remote=>true,:id => 'add_group_name') do %>
|
||||
<input type="text" id="group_name" name="group_name" size="20" class="isTxt w90 f_l" maxlength="100" />
|
||||
<input type="button" class="submit f_l" onclick="add_group('<%= valid_ajax_course_path%>','<%= @course.id%>');"/>
|
||||
<% end %>
|
||||
</span>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
|
@ -0,0 +1,81 @@
|
|||
<!-- 加入分班 -->
|
||||
<div style="margin-left: 15px">
|
||||
<% if User.current.logged? && User.current.member_of_course?(@course) && @group %>
|
||||
<%= join_in_course_group(@course.course_groups,@group, User.current) unless @canShowCode %>
|
||||
<span style="font-size: 12px; float: left; margin-right: 5px">
|
||||
<%= l(:label_current_group)%>:
|
||||
<%= @group.name %>
|
||||
</span>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
|
||||
<% if members.any? %>
|
||||
<% if @result_count %>
|
||||
<p style="font-size: 18px;">
|
||||
<%= l(:label_search_member_count) %>
|
||||
<%= @result_count %>
|
||||
<%= l(:label_member_people) %>
|
||||
</p>
|
||||
<div class="cl"></div>
|
||||
<% end %>
|
||||
|
||||
<div class="st_box">
|
||||
<ul class="st_box_top">
|
||||
<li class="ml50" style="padding-right: 5px;"><a href="">姓名</a></li>
|
||||
<li class="ml10" style="padding-right: 15px;"><a href="">学号</a></li>
|
||||
<li class="ml358">
|
||||
<%= link_to '作业积分', member_score_sort_course_path(:sort_by => (@score_sort_by == "desc" ? "asc" : "desc"), :group_id => (@group ? @group.id : 0),:search_name => (@search_name ? @search_name : nil)) ,:result => members,method: 'get', remote: true%>
|
||||
<% if @score_sort_by == 'desc' %>
|
||||
<a id="pic" href="javascript:" class= "st_down"></a>
|
||||
<% else %>
|
||||
<a id="pic" href="javascript:" class= "st_up"></a>
|
||||
<% end %>
|
||||
</li>
|
||||
<li class="ml50"><a href="#" >加入时间</a></li>
|
||||
</ul>
|
||||
<div class="cl"></div><!--st_box_top end-->
|
||||
|
||||
<% members.each do |member| %>
|
||||
<div class="st_boxlist">
|
||||
<a href="javascript:" class="st_img">
|
||||
<%= member.user.nil? ? '' : (image_tag(url_to_avatar(member.user), :width => 32, :height => 32)) %>
|
||||
</a>
|
||||
<ul>
|
||||
<% if @canShowCode %>
|
||||
<li>
|
||||
<% if member.user.show_name == ''%>
|
||||
<%= link_to("#{l(:label_bidding_user_studentname)}:<span >#{member.user.name}</span>".html_safe,user_path(member.user)) %>
|
||||
<% else%>
|
||||
<%= link_to("#{l(:label_bidding_user_studentname)}:<span >#{member.user.show_name}</span>".html_safe,user_path(member.user)) %>
|
||||
<%end%>
|
||||
</li>
|
||||
<% else %>
|
||||
<li><%= link_to("#{l(:label_bidding_user_studentname)}:<span >#{member.user.name}</span>".html_safe, user_path(member.user)) %></li>
|
||||
<% end %>
|
||||
<br/>
|
||||
<% unless member.user.user_extensions.student_id == ''%>
|
||||
<li><%= link_to("#{l(:label_bidding_user_studentcode)}:<span >#{member.user.user_extensions.student_id}</span>".html_safe,user_path(member.user)) %></li>
|
||||
<% end%>
|
||||
</ul>
|
||||
<%= link_to format("%0.2f",member.score.nil? ? 0 : member.score.to_s), {
|
||||
:action => 'show_member_score',
|
||||
:member_id => member.id,
|
||||
:remote => true},
|
||||
:class => 'ml258 c_red' %>
|
||||
<span class="ml65 c_grey"><%= format_date(member.created_on)%></span>
|
||||
<%= call_hook(:view_projects_settings_members_table_row, { :course => @course, :member => member}) %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<% end; reset_cycle %>
|
||||
</div>
|
||||
|
||||
<ul class="wlist">
|
||||
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => @is_remote, :flag => true%>
|
||||
</ul>
|
||||
<% else%>
|
||||
<p class="nodata">
|
||||
<%= l(:label_no_data) %>
|
||||
</p>
|
||||
<% end%>
|
||||
|
|
@ -1,12 +1,11 @@
|
|||
<% if @subPage_title && @subPage_title == l(:label_student_list)%>
|
||||
<%= form_tag( searchmembers_course_path(@course), method: 'get',:class => "f_l",:style => "margin-left: 5px; ",:remote=>true) do %>
|
||||
<%= text_field_tag 'name', params[:name], name: "name", :class => 'f_1', :style => "height:15px; float: left;"%>
|
||||
<% if @group %>
|
||||
<%= hidden_field "search_group_id", params[:search_group_id],:value => "#{@group.id}", name: 'search_group_id' %>
|
||||
<%= submit_tag l(:label_search_member), :name => "ingroup",:class => "f_2", :style => "float: left "%>
|
||||
<% else %>
|
||||
<%= submit_tag l(:label_search_member),:style => "float: left", :name => 'incourse',:onclick => "checkclass('group_name_0')",:class => "f_2"%>
|
||||
<% end %>
|
||||
<%= form_tag( searchmembers_course_path(@course), method: 'get',:class => "f_l",:remote=>true,:id => "search_student") do %>
|
||||
<%= text_field_tag 'name', params[:name], name: "name", :class => 'st_search_input', :placeholder => '输入学生姓名、学号进行搜索'%>
|
||||
<% if @group %>
|
||||
<%= hidden_field "search_group_id", params[:search_group_id],:value => "#{@group.id}", name: 'search_group_id' %>
|
||||
<input type="hidden" name="ingroup">
|
||||
<% else %>
|
||||
<input type="hidden" name="incourse">
|
||||
<% end %>
|
||||
<%= link_to l(:label_export_excel), export_course_member_excel_course_path(@course,:format => 'xls'),:class=>'xls'%>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<a href="javascript:" class="f_l" onclick="$('#search_student').submit();">搜索</a>
|
||||
<%= link_to l(:label_export_excel), export_course_member_excel_course_path(@course,:format => 'xls'),:class=>'xls'%>
|
|
@ -1 +1 @@
|
|||
$("#st_groups").html("<%= escape_javascript( render :partial => 'groups_name', locals: {:course_groups => @course_groups})%>");
|
||||
$("#st_groups").html("<%= escape_javascript( render :partial => 'new_groups_name', locals: {:course_groups => @course_groups})%>");
|
|
@ -1 +1 @@
|
|||
$("#st_groups").html("<%= escape_javascript( render :partial => 'groups_name', locals: {:course_groups => @course_groups})%>");
|
||||
$("#st_groups").html("<%= escape_javascript( render :partial => 'new_groups_name', locals: {:course_groups => @course_groups})%>");
|
|
@ -1,5 +1,9 @@
|
|||
<% reply_allow = JournalsForMessage.create_by_user? User.current %>
|
||||
<%= stylesheet_link_tag 'css', :media => 'all' %>
|
||||
<!-- <#%= stylesheet_link_tag 'css', :media => 'all' %> -->
|
||||
<div class="project_r_h">
|
||||
<h2 class="project_h2"><%= l(:label_contest_userresponse) %></h2>
|
||||
</div>
|
||||
|
||||
|
||||
<%= render :partial => 'courses_jours',
|
||||
:locals => { :contest => @contest, :journals => @jour, :state => false}
|
||||
|
@ -9,7 +13,7 @@
|
|||
<script>
|
||||
var W3CDOM = document.createElement && document.getElementsByTagName;
|
||||
|
||||
window.onload = setMaxLength;
|
||||
//window.onload = setMaxLength;
|
||||
|
||||
function setMaxLength() {
|
||||
if (!W3CDOM) return;
|
||||
|
@ -21,7 +25,7 @@ function setMaxLength() {
|
|||
}
|
||||
function setMaxLengthItem(textarea){
|
||||
if (textarea.getAttribute('maxlength')) {
|
||||
var counter = document.createElement('div');
|
||||
var counter = document.createElement('span');
|
||||
counter.className = 'counter';
|
||||
var counterClone = counter.cloneNode(true);
|
||||
counterClone.innerHTML = '<span>0</span>/'+textarea.getAttribute('maxlength');
|
||||
|
|
|
@ -1,10 +1,6 @@
|
|||
<% if @save_flag %>
|
||||
<% if Rails.env.development? %>
|
||||
console.debug('课程修改成功:结束时间改为<%=Course.find_by_extra(@course.extra).try(:endup_time)%>');
|
||||
<% end %>
|
||||
$('#content-title-top-div').html("<%= j(render partial: 'users/my_course_ex', :locals => {:memberships => @memberships,:user=>@user,
|
||||
:memberships_doing=>@memberships_doing,:memberships_done=>@memberships_done} )%>");
|
||||
$('#finish_course_<%=@course.id%>').replaceWith("<%= j(render partial: 'courses/set_course_time', :locals => {:course => @course} )%>");
|
||||
$('#finish_course_<%=@course.id%>').replaceWith("<%= escape_javascript(set_course_time(@course_prefs))%>");
|
||||
// alert("关闭成功");
|
||||
<% else %>
|
||||
alert('权限不足,设置失败,请在论坛提交问题,等待管理员处理。');
|
||||
<% end %>
|
||||
|
|
|
@ -1,63 +1,62 @@
|
|||
<style type="text/css">
|
||||
#attachments_fields input.description {
|
||||
width: auto;
|
||||
}
|
||||
</style>
|
||||
<%= javascript_include_tag 'attachments' %>
|
||||
<!-- fq -->
|
||||
<div class="content-title-top">
|
||||
<% if User.current.logged? && (User.current.admin? || (!Member.where('user_id = ? and course_id = ?', User.current.id, @course.id).first.nil? && (Member.where('user_id = ? and course_id = ?', User.current.id, @course.id).first.roles&Role.where(id: [3, 4, 7, 9] )).size >0))%>
|
||||
<%= link_to(l(:label_course_homework_new), {:controller => 'courses', :action => 'new_homework'}, :class => 'icon icon-add') %>
|
||||
<% else %>
|
||||
<span class="font_lighter">
|
||||
<%= l(:label_coursejoin_tip) %>
|
||||
</span>
|
||||
<% end %>
|
||||
<div class="project_r_h">
|
||||
<h2 class="project_h2">
|
||||
<%= l(:label_homework)%>
|
||||
</h2>
|
||||
</div>
|
||||
<div id="bid-show">
|
||||
<%= render :partial => 'bids/bid_homework_show', :locals => {:bids => @bids, :bid_pages => @bid_pages} %>
|
||||
<div class="talk_top">
|
||||
<p class="fl">
|
||||
<%= l(:label_totle)%><span><%= @obj_count%></span><%= l(:label_homework_count)%>
|
||||
</p>
|
||||
<%= link_to( l(:label_course_homework_new), new_homework_course_path(@course), :class => 'problem_new_btn fl c_dorange') if @is_teacher %>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
|
||||
<div id="OpenWindow">
|
||||
<div id="signup-ct">
|
||||
<div id="OpenWindow-header">
|
||||
<h1> 课程: <%= @course.name%> </h1>
|
||||
<p id='bid-desc'> 上传作业 </p>
|
||||
<a href="javascript:void(0);" class="modal_close"></a>
|
||||
<% @bids.each do |bid|%>
|
||||
<div class="problem_main">
|
||||
<%= link_to(image_tag(url_to_avatar(bid.author), :width => "42", :height => "42"), user_path(bid.author), :class => "problem_pic fl") %>
|
||||
<div class="problem_txt fl mt5">
|
||||
<%= link_to(bid.author.lastname+bid.author.firstname, user_path(bid.author),:class => 'problem_name fl') %>
|
||||
<span class="fl"> <%= l(:label_user_create_project_homework) %>:</span>
|
||||
<%= link_to(bid.name, course_for_bid_path(bid), :class => 'problem_tit fl fb c_dblue') %>
|
||||
<div class="cl mb5"></div>
|
||||
<p class="fl "><%= l(:lebel_homework_commit)%> ( <%= link_to bid.homeworks.count, course_for_bid_path(bid.id), :class => 'c_red'%> )</p>
|
||||
<% if @is_teacher%>
|
||||
<%= bid_anonymous_comment(bid)%>
|
||||
<%= link_to(l(:button_edit),edit_bid_path(:course_id =>@course.id, :bid_id => bid.id), :class => "fr mr10 work_edit") %>
|
||||
<% elsif @is_student%>
|
||||
<%= student_anonymous_comment bid %>
|
||||
<%= student_new_homework bid %>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
<script>
|
||||
$(function(){if($("#bid_description_<%= bid.id%>_content").height()>38){$("#bid_show_more_des_button<%= bid.id%>").show();}});
|
||||
</script>
|
||||
<div id="bid_description_<%= bid.id%>" class="news_description mt5">
|
||||
<div id="bid_description_<%= bid.id%>_content">
|
||||
<%= textilizable bid, :description %>
|
||||
</div>
|
||||
</div>
|
||||
<div id="OpenWindow-content">
|
||||
|
||||
<div class="news_foot c_red" id="bid_show_more_des_button<%= bid.id%>" onclick="bid_show_more_des(<%= bid.id%>);" style="cursor:pointer;display: none;">
|
||||
<%= l(:button_more)%>...
|
||||
<span class="g-arr-down"></span>
|
||||
</div>
|
||||
<span class="fl"><%= l(:label_end_time)%>:<%= bid.deadline%></span>
|
||||
<% if betweentime(bid.deadline) < 0 %>
|
||||
<span class='fr mr10 c_red '>
|
||||
<%= l(:label_commit_limit)%>
|
||||
</span>
|
||||
<% else %>
|
||||
<script type="text/javascript">
|
||||
window.setInterval(function(){show_bid_dead_line(<%= bid.deadline.year%>,<%= bid.deadline.month%>,<%= bid.deadline.day + 1%>,"bid_deadline_<%= bid.id%>");},1000)
|
||||
</script>
|
||||
<div id="bid_deadline_<%= bid.id%>">
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$("a[rel*=leanModal]").leanModal({
|
||||
top:100,
|
||||
closeButton: ".modal_close"
|
||||
});
|
||||
<% end%>
|
||||
|
||||
function showSubH(/* ... */){
|
||||
var id, name, numargs = arguments.length;
|
||||
|
||||
id = arguments[0];
|
||||
name = arguments[1];
|
||||
|
||||
$("#OpenWindow").find("#bid-desc").html('作业名: '+name);
|
||||
|
||||
post_url = '/bids/' + id + '/homework_ajax_modal.js'
|
||||
function deal_post (data, textStatus, xhr) {
|
||||
if(textStatus == 'success'){
|
||||
eval(data);
|
||||
}
|
||||
if(textStatus != 'success'){
|
||||
$('#OpenWindow-content').html('<span class=\"font_color_orange\" > ' + textStatus + ' <\/span>\n');
|
||||
}
|
||||
}
|
||||
function deal_error (argument) {
|
||||
$('#OpenWindow-content').html('<strong>Network Error</strong><span class=\"font_color_orange\" > <br/>http_status:' + argument.status + '<br/>statusText:' + argument.statusText + ' <\/span>\n');
|
||||
}
|
||||
$.post(post_url,{}, deal_post).error(deal_error);
|
||||
}
|
||||
</script>
|
||||
|
||||
<% html_title(l(:label_homework)) -%>
|
||||
<ul class="wlist">
|
||||
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%>
|
||||
</ul>
|
||||
<div class="cl"></div>
|
|
@ -1,2 +1,2 @@
|
|||
$("#st_groups").html("<%= escape_javascript( render :partial => 'groups_name', locals: {:course_groups => @course_groups})%>");
|
||||
$("#st_groups").html("<%= escape_javascript( render :partial => 'new_groups_name', locals: {:course_groups => @course_groups})%>");
|
||||
$("#member_content").html("<%= escape_javascript( render :partial => @render_file, :locals => {:members => @results})%>");
|
|
@ -3,7 +3,7 @@ showModal('ajax-modal', '510px');
|
|||
$('#ajax-modal').css('height','330px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<span style='float: right;cursor:pointer;padding-left: 513px;'>" +
|
||||
"<a href='#' onclick='hidden_join_course_form();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
|
||||
"<a href='javascript:' onclick='hidden_join_course_form();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
|
||||
$('#ajax-modal').parent().removeClass("alert_praise");
|
||||
$('#ajax-modal').parent().css("top","").css("left","");
|
||||
$('#ajax-modal').parent().addClass("alert_box");
|
||||
|
|
|
@ -1,81 +1,9 @@
|
|||
<script type="text/javascript">
|
||||
function check_groupname() {
|
||||
var $group_name = $('#group_name');
|
||||
|
||||
|
||||
$.get(
|
||||
'<%=valid_ajax_course_path%>',
|
||||
{ valid: "name",
|
||||
value: document.getElementById('group_name').value,
|
||||
course_id: <%= @course.id %> },
|
||||
function (data) {
|
||||
if (!data.valid) {
|
||||
alert(data.message);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
<script type=" text/javascript" charset="utf-8">
|
||||
function validate_groupname(value1) {
|
||||
|
||||
if(value1.length > 20) {
|
||||
alert('<%= l(:label_limit_groupname) %>');
|
||||
}
|
||||
}
|
||||
function checkclass(value) {
|
||||
|
||||
for(var i = 0; i < document.getElementsByName("check_group_name").length; i++) {
|
||||
if(document.getElementsByName("check_group_name")[i].id == value) {
|
||||
document.getElementById(value).className = "selected";
|
||||
}
|
||||
else {
|
||||
document.getElementsByName("check_group_name")[i].className = "classbox";
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
function validate_groupname_null(value1) {
|
||||
value1 = value1.trim();
|
||||
if(value1.length == 0 ) {
|
||||
alert('<%= l(:label_limit_groupname_null) %>');
|
||||
}
|
||||
}
|
||||
function validate_update(name) {
|
||||
value1 = document.getElementById(name).value;
|
||||
validate_groupname(value1);
|
||||
|
||||
}
|
||||
function validate_add_group() {
|
||||
|
||||
check_groupname();
|
||||
|
||||
|
||||
}
|
||||
</script>
|
||||
<%= stylesheet_link_tag 'course_group', :media => 'all' %>
|
||||
<script type="text/javascript" src="javascripts/jquery-1.8.3-ui-1.9.2-ujs-2.0.3.js"></script>
|
||||
<div class="st_list" id="member_of_course">
|
||||
<div class="st_search" style="margin-left: 14px" >
|
||||
<span class="f_l"><%= @subPage_title %></span>
|
||||
<span id = "search_members">
|
||||
<%= render :partial => 'searchmembers' %>
|
||||
</span>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<% if @subPage_title == l(:label_student_list) %>
|
||||
<div class="st_addclass" id = "st_groups">
|
||||
<%= render :partial => 'groups_name', :locals => {:course_groups => @course_groups} %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="cl"></div>
|
||||
|
||||
<div class="member_content" id = "member_content">
|
||||
<%= error_messages_for 'member' %>
|
||||
<%= render :partial => @render_file, :locals => {:members => @members} %>
|
||||
</div>
|
||||
<div class="project_r_h">
|
||||
<h2 class="project_h2"><%= @subPage_title%></h2>
|
||||
</div>
|
||||
<% if @subPage_title == l(:label_student_list)%>
|
||||
<%= render :partial => 'course_student', :locals => {:members => @members} %>
|
||||
<% else%>
|
||||
<%= render :partial => 'course_teacher', :locals => {:members => @members} %>
|
||||
<% end%>
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/**
|
||||
* Created by Administrator on 2014/12/3.
|
||||
*/
|
||||
$("#member_content").html("<%= escape_javascript( render :partial => @render_file, :locals => {:members => @results})%>");
|
||||
$("#member_content").html("<%= escape_javascript( render :partial => "new_member_list", :locals => {:members => @results})%>");
|
|
@ -1,16 +1,56 @@
|
|||
<% @nav_dispaly_course_all_label = 1
|
||||
@nav_dispaly_forum_label = 1
|
||||
@nav_dispaly_course_label = nil
|
||||
@nav_dispaly_store_all_label = 1 %>
|
||||
<h3><%=l(:label_course_new)%></h3>
|
||||
<%= labelled_form_for @course do |f| %>
|
||||
<div class="box tabular">
|
||||
<%= render :partial => 'course_form', :locals => { :f => f } %>
|
||||
<span style="padding-left: 60px; margin-left: 36px">
|
||||
<%= submit_tag l(:button_create), :class => "enterprise"%>
|
||||
</span>
|
||||
<!-- <%#= submit_tag l(:button_create_and_continue), :name => 'course_continue' %> -->
|
||||
<%= javascript_tag "$('#course_name').focus();" %>
|
||||
</div>
|
||||
<% end %>
|
||||
<% html_title(l(:label_course_new)) -%>
|
||||
<div class="project_r_h02">
|
||||
<h2 class="project_h2"><%= l(:permission_new_course)%></h2>
|
||||
</div>
|
||||
<div class="hwork_new">
|
||||
<ul>
|
||||
<%= labelled_form_for @course do |f| %>
|
||||
<li class="ml45">
|
||||
<label><span class="c_red">*</span> <%= l(:label_tags_course_name)%> :</label>
|
||||
<input type="text" name="course[name]" id="course_name" class="courses_input" maxlength="100" onkeyup="regex_course_name();">
|
||||
<span class="c_red" id="course_name_notice" style="display: none;">课程名称不能为空</span>
|
||||
</li>
|
||||
<div class="cl"></div>
|
||||
<li class="ml45">
|
||||
<label><span class="c_red">*</span> <%= l(:label_class_period)%> :</label>
|
||||
<input type="text" name="class_period" id="class_period" class="hwork_input02" onkeyup="regex_course_class_period();" maxlength="6">
|
||||
<span class="c_red" id="course_class_period_notice" style="display: none;"></span>
|
||||
</li>
|
||||
<div class="cl"></div>
|
||||
<li class="ml45 mb10">
|
||||
<label><span class="c_red">*</span> <%= l(:label_course_term)%> :</label>
|
||||
<%= select_tag :time,options_for_select(course_time_option(@course.time),@course.time), {} %>
|
||||
<%= select_tag :term,options_for_select(course_term_option,@course.term || cur_course_term),{} %>
|
||||
</li>
|
||||
<div class="cl"></div>
|
||||
<li class="ml45 mb10">
|
||||
<label><span class="c_red">*</span> <%= l(:label_new_course_password)%> :</label>
|
||||
<input type="text" name="course[password]" id="course_course_password" class="hwork_input02" >
|
||||
<div class="cl"></div>
|
||||
<span class=" ml80 c_orange">学生或其他成员申请加入课程时候需要使用该口令,该口令可以由老师在课堂上公布。</span>
|
||||
</li>
|
||||
<li class="ml45">
|
||||
<label class="fl" > <%= l(:label_new_course_description)%> :</label>
|
||||
<textarea name="course[description]" placeholder="最多3000个汉字(或6000个英文字符)" class="courses_text fl" ></textarea>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<li class=" mb5 ml80">
|
||||
<label >公开 :</label>
|
||||
<input checked="checked" id="course_is_public" name="course[is_public]" type="checkbox" value="1">
|
||||
<span class="c_grey">(打钩为公开,不打钩则不公开,若不公开,仅课程成员可见该课程。)</span>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<li class=" mb5 ml30">
|
||||
<label >学生列表公开 :</label>
|
||||
<input id="course_open_student" name="course[open_student]" type="checkbox" value="1">
|
||||
<span class="c_grey">(打钩为"学生列表公开",不打钩为不公开,若不公开,则课程外部人员看不到学生列表)</span>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<li class=" ml90" >
|
||||
<a href="javascript:void(0)" class="blue_btn fl c_white" onclick="submit_new_course();" >提交</a>
|
||||
<a href="javascript:history.back()" target="_blank" class="blue_btn grey_btn fl c_white">取消</a>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<% end%>
|
||||
</ul>
|
||||
</div><!--talknew end-->
|
||||
<div class="cl"></div>
|
|
@ -1,115 +1,3 @@
|
|||
<script type="text/javascript">
|
||||
function regexName()
|
||||
{
|
||||
var name = $.trim($("#bid_name").val());
|
||||
|
||||
if(name=="")
|
||||
{
|
||||
$("#bid_name_span").text("名称不能为空");
|
||||
$("#bid_name_span").css('color','#ff0000');
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#bid_name_span").text("填写正确");
|
||||
$("#bid_name_span").css('color','#008000');
|
||||
return true;
|
||||
}
|
||||
}
|
||||
function regexDeadLine()
|
||||
{
|
||||
var deadline = $.trim($("#bid_deadline").val());
|
||||
var regex = /^\d{4}-\d{2}-\d{2}$/;
|
||||
if(deadline=="")
|
||||
{
|
||||
$("#bid_deadline_span").text("截止日期不能为空");
|
||||
$("#bid_deadline_span").css('color','#ff0000');
|
||||
return false;
|
||||
}
|
||||
else if(regex.test(deadline))
|
||||
{
|
||||
$("#bid_deadline_span").text("填写正确");
|
||||
$("#bid_deadline_span").css('color','#008000');
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#bid_deadline_span").text("截止日期格式错误");
|
||||
$("#bid_deadline_span").css('color','#ff0000');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
function regexEvaluationNum()
|
||||
{
|
||||
var evaluation_num = $.trim($("#bid_evaluation_num").val());
|
||||
var regex = /^\d+$/;
|
||||
if($("#bid_open_anonymous_evaluation").attr("checked") == "checked")
|
||||
{
|
||||
if(evaluation_num=="")
|
||||
{
|
||||
$("#bid_evaluation_num_span").text("匿评分配数量不能为空");
|
||||
$("#bid_evaluation_num_span").css('color','#ff0000');
|
||||
return false;
|
||||
}
|
||||
else if(regex.test(evaluation_num))
|
||||
{
|
||||
if(evaluation_num > 0)
|
||||
{
|
||||
$("#bid_evaluation_num_span").text("填写正确");
|
||||
$("#bid_evaluation_num_span").css('color','#008000');
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#bid_evaluation_num_span").text("匿评分配数量必须为大于0");
|
||||
$("#bid_evaluation_num_span").css('color','#ff0000');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#bid_evaluation_num_span").text("匿评分配数量只能为数字");
|
||||
$("#bid_evaluation_num_span").css('color','#ff0000');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
$(function(){
|
||||
$("#bid_open_anonymous_evaluation").click(function(){
|
||||
if($("#bid_open_anonymous_evaluation").attr("checked") == "checked")
|
||||
{
|
||||
$("#evaluation_num_p").slideDown();
|
||||
$("#open_anonymous_evaluation_span").slideUp();
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#evaluation_num_p").slideUp();
|
||||
$("#open_anonymous_evaluation_span").slideDown();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
function submitHomework()
|
||||
{
|
||||
if(regexDeadLine()&®exName()&®exEvaluationNum())
|
||||
{
|
||||
$("#new_bid").submit();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<h3><%=l(:label_course_new_homework)%></h3>
|
||||
|
||||
<%= labelled_form_for @homework, :url => {:controller => 'bids', :action => 'create_homework',:course_id => "#{params[:id] || params[:course_id]}"} do |f| %>
|
||||
<div class="box tabular">
|
||||
<%= render :partial => 'homework_form', :locals => { :f => f } %>
|
||||
<!--<input type="button" onclick="submitHomework();" value="<%#= l(:button_create)%>" class="enterprise">-->
|
||||
<a href="#" onclick="submitHomework();"class="ButtonColor m3p10"><%= l(:button_create)%></a>
|
||||
<%= javascript_tag "$('#bid_name').focus();" %>
|
||||
<% end %>
|
||||
</div>
|
||||
<%= render :partial => 'bids/new_homework_form', :locals => { :bid => @homework,:bid_id => "new_bid" } %>
|
||||
<% end %>
|
|
@ -1,4 +1,4 @@
|
|||
/**
|
||||
* Created by Administrator on 2014/12/2.
|
||||
*/
|
||||
$("#member_content").html("<%= escape_javascript( render :partial => @render_file, :locals => {:members => @results})%>");
|
||||
$("#member_content").html("<%= escape_javascript( render :partial => 'new_member_list', :locals => {:members => @results})%>");
|
|
@ -1,3 +1,60 @@
|
|||
<h3><%=l(:label_settings)%></h3>
|
||||
<%= render_tabs course_settings_tabs %>
|
||||
<% html_title(l(:label_settings)) -%>
|
||||
<div class="project_r_h">
|
||||
<h2 class="project_h2"><%= l(:label_course_modify_settings)%></h2>
|
||||
</div>
|
||||
<div class="hwork_new">
|
||||
<ul>
|
||||
<%= labelled_form_for @course do |f| %>
|
||||
<li class="ml45 mb10">
|
||||
<%= render :partial => "avatar/new_avatar_form", :locals => {source: @course} %>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<li class="ml45">
|
||||
<label><span class="c_red">*</span> <%= l(:label_tags_course_name)%> :</label>
|
||||
<input type="text" name="course[name]" id="course_name" class="courses_input" maxlength="100" onkeyup="regex_course_name();" value="<%= @course.name%>">
|
||||
<span class="c_red" id="course_name_notice" style="display: none;">课程名称不能为空</span>
|
||||
</li>
|
||||
<div class="cl"></div>
|
||||
<li class="ml45">
|
||||
<label><span class="c_red">*</span> <%= l(:label_class_period)%> :</label>
|
||||
<input type="text" name="class_period" id="class_period" class="hwork_input02" onkeyup="regex_course_class_period();" maxlength="6" value="<%= @course.class_period%>">
|
||||
<span class="c_red" id="course_class_period_notice" style="display: none;"></span>
|
||||
</li>
|
||||
<div class="cl"></div>
|
||||
<li class="ml45 mb10">
|
||||
<label><span class="c_red">*</span> <%= l(:label_course_term)%> :</label>
|
||||
<%= select_tag :time,options_for_select(course_time_option(@course.time),@course.time), {} %>
|
||||
<%= select_tag :term,options_for_select(course_term_option,@course.term || cur_course_term),{} %>
|
||||
</li>
|
||||
<div class="cl"></div>
|
||||
<li class="ml45 mb10">
|
||||
<label><span class="c_red">*</span> <%= l(:label_new_course_password)%> :</label>
|
||||
<input type="text" name="course[password]" id="course_course_password" class="hwork_input02" value="<%= @course.password%>">
|
||||
<div class="cl"></div>
|
||||
<span class=" ml80 c_orange">学生或其他成员申请加入课程时候需要使用该口令,该口令可以由老师在课堂上公布。</span>
|
||||
</li>
|
||||
<li class="ml45">
|
||||
<label class="fl" > <%= l(:label_new_course_description)%> :</label>
|
||||
<textarea name="course[description]" placeholder="最多3000个汉字(或6000个英文字符)" class="courses_text fl" maxlength="6000"><%= @course.description%></textarea>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<li class=" mb5 ml80">
|
||||
<label >公开 :</label>
|
||||
<input <%= @course.is_public == 1 ? 'checked' : ''%> id="course_is_public" name="course[is_public]" type="checkbox">
|
||||
<span class="c_grey">(打钩为公开,不打钩则不公开,若不公开,仅课程成员可见该课程。)</span>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<li class=" mb5 ml30">
|
||||
<label >学生列表公开 :</label>
|
||||
<input <%= @course.open_student == 1 ? 'checked' : ''%> id="course_open_student" name="course[open_student]" type="checkbox" style="margin-left: 1px;"/>
|
||||
<span class="c_grey">(打钩为"学生列表公开",不打钩为不公开,若不公开,则课程外部人员看不到学生列表)</span>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<li class=" ml90" >
|
||||
<a href="javascript:void(0)" class="blue_btn fl c_white" onclick="submit_edit_course(<%= @course.id%>);" >提交</a>
|
||||
<%= link_to l(:button_cancel), course_path(@course), :class => "blue_btn grey_btn fl c_white" %>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div><!--talknew end-->
|
||||
<div class="cl"></div>
|
|
@ -1,143 +1,50 @@
|
|||
<div class="project_r_h">
|
||||
<h2 class="project_h2"><%= l(:label_activity)%></h2>
|
||||
</div>
|
||||
|
||||
<% if @events_by_day != nil && @events_by_day.size >0 %>
|
||||
<div class="content-title-top-avtive">
|
||||
<p class="subtitle">
|
||||
</p>
|
||||
|
||||
<% @events_by_day.keys.sort.reverse.each do |day| %>
|
||||
<div>
|
||||
<% sort_activity_events(@events_by_day[day]).each do |e, in_group| -%>
|
||||
<div>
|
||||
<table class="underline-evreycontent" style="font-size: 14px;">
|
||||
<tr>
|
||||
<td valign="top" width="50">
|
||||
<%= image_tag(url_to_avatar(e.event_author), :class => "avatar") %>
|
||||
</td>
|
||||
<td>
|
||||
<table width="580px" border="0" style="width: 100%;table-layout: fixed">
|
||||
<tr>
|
||||
<td colspan="2" valign="top" style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;">
|
||||
<strong>
|
||||
<%= h(e.event_title) if @course.nil? || (e.course != nil && @course.id != e.course.id) %>
|
||||
</strong>
|
||||
<span class="font_lighter">
|
||||
<% if @canShowRealName %>
|
||||
<%= link_to_user(e.event_author) if e.respond_to?(:event_author) %>
|
||||
(<%= link_to_user(e.event_author, @canShowRealName) if e.respond_to?(:event_author) %>)
|
||||
<% else %>
|
||||
<%= link_to_user(e.event_author) if e.respond_to?(:event_author) %>
|
||||
<% end %>
|
||||
<%= l(:label_new_activity) %>
|
||||
</span>
|
||||
<%= link_to "#{eventToLanguageCourse(e.event_type, @course)}: "<< format_activity_title(e.event_title), (e.event_type.eql?("attachment")&&e.container.kind_of?(Course)) ? course_files_path(e.container) : e.event_url%>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" width="580px">
|
||||
<p class="info-break">
|
||||
<%= e.event_description %>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left">
|
||||
<span class="font_lighter">
|
||||
<%= l :label_activity_time %>
|
||||
:
|
||||
<%= format_activity_day(day) %>
|
||||
<%= format_time(e.event_datetime, false) %>
|
||||
</span>
|
||||
</td>
|
||||
<% if e.event_type == "issue" %>
|
||||
<td align="right">
|
||||
<span>
|
||||
<%= link_to l(:label_find_all_comments), issue_path(e.id) %>
|
||||
</span>
|
||||
<span class="font_lighter">
|
||||
<%= l(:label_comments_count, :count => e.journals.count) %>
|
||||
</span>
|
||||
</td>
|
||||
<% end %>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end -%>
|
||||
<% if (@events_pages.page == @events_pages.last_page) %>
|
||||
<div class="font_description">
|
||||
<table width="660">
|
||||
<tr>
|
||||
<td>
|
||||
<%= image_tag(url_to_avatar(@user), :class => "avatar") %>
|
||||
</td>
|
||||
<td colspan="2">
|
||||
<table width="580">
|
||||
<tr>
|
||||
<td>
|
||||
<% if @canShowRealName %>
|
||||
(<%= link_to_user(@user, @canShowRealName) %>)
|
||||
<% else %>
|
||||
<%= link_to_user(@user)%>
|
||||
<% end %>
|
||||
|
||||
<%= l(:label_user_create_project) %>
|
||||
<%= link_to @course.name %>
|
||||
<strong> !</strong>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="font_lighter" >
|
||||
<%= l :label_create_time %>:
|
||||
<%= format_time(@course.created_at) %>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<%else%>
|
||||
<div class="font_description">
|
||||
<table width="660">
|
||||
<tr>
|
||||
<td>
|
||||
<%= image_tag(url_to_avatar(@user), :class => "avatar") %>
|
||||
</td>
|
||||
<td colspan="2">
|
||||
<table width="580">
|
||||
<tr>
|
||||
<td>
|
||||
<% if @canShowRealName %>
|
||||
(<%= link_to_user(@user, @canShowRealName) %>)
|
||||
<% else %>
|
||||
<%= link_to_user(@user)%>
|
||||
<% end %>
|
||||
<%= l(:label_user_create_project) %>
|
||||
<%= link_to @course.name %>
|
||||
<strong> !</strong>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="font_lighter" style="float: right">
|
||||
<%= l :label_create_time %>:
|
||||
<%= format_time(@course.created_at) %>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
|
||||
<div class="pagination">
|
||||
<ul>
|
||||
<%= pagination_links_full @events_pages %>
|
||||
</ul>
|
||||
</div>
|
||||
<% html_title(l(:label_course_overview)) -%>
|
||||
<% @events_by_day.keys.sort.reverse.each do |day| %>
|
||||
<% sort_activity_events(@events_by_day[day]).each do |e, in_group| -%>
|
||||
<div class="problem_main">
|
||||
<a class="problem_pic fl">
|
||||
<%= image_tag(url_to_avatar(e.event_author), :width => "42", :height => "42") %>
|
||||
</a>
|
||||
<div class="problem_txt fl mt5">
|
||||
<%= link_to_user_header(e.event_author,false,:class => 'problem_name c_orange fl') if e.respond_to?(:event_author) %>
|
||||
<%= link_to_user_header("(#{e.event_author})", @canShowRealName,:class => 'problem_name c_orange fl') if @canShowRealName && e.respond_to?(:event_author) %>
|
||||
<span class="fl"> <%= l(:label_new_activity) %>:</span>
|
||||
<%= link_to "#{eventToLanguageCourse(e.event_type, @course)}: "<< format_activity_title(e.event_title), (e.event_type.eql?("attachment")&&e.container.kind_of?(Course)) ? course_files_path(e.container) : e.event_url,:class => "problem_tit c_dblue fl fb"%>
|
||||
<br />
|
||||
<p class="mt5 break_word"><%= e.event_description %>
|
||||
<br />
|
||||
<%= l :label_activity_time %> : <%= format_activity_day(day) %><%= format_time(e.event_datetime, false) %>
|
||||
</p>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div><!--课程动态 end-->
|
||||
<% end%>
|
||||
<% end%>
|
||||
<% end%>
|
||||
|
||||
<div class="problem_main">
|
||||
<a class="problem_pic fl">
|
||||
<%= image_tag(url_to_avatar(@user), :width => "42", :height => "42") %>
|
||||
</a>
|
||||
<div class="problem_txt fl mt5">
|
||||
<%= link_to_user_header(@user,false,:class => 'problem_name c_orange fl') %>
|
||||
<%= link_to_user_header("(#{@user})", @canShowRealName,:class => 'problem_name c_orange fl') if @canShowRealName %>
|
||||
<span class="fl"> <%= l(:label_user_create_project) %>:</span>
|
||||
<%= link_to @course.name,course_path(@course),:class => "problem_tit c_dblue fl fb"%>
|
||||
<br />
|
||||
<p class="mt5">
|
||||
<br />
|
||||
<%= l :label_create_time %>: : <%= format_time(@course.created_at) %>
|
||||
</p>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div><!--课程动态 end-->
|
||||
|
||||
<ul class="wlist">
|
||||
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%>
|
||||
</ul>
|
||||
<div class="cl"></div>
|
|
@ -1,2 +1,2 @@
|
|||
$("#st_groups").html("<%= escape_javascript( render :partial => 'groups_name', locals: {:course_groups => @course_groups})%>");
|
||||
$("#st_groups").html("<%= escape_javascript( render :partial => 'new_groups_name', locals: {:course_groups => @course_groups})%>");
|
||||
$("#member_content").html("<%= escape_javascript( render :partial => @render_file, :locals => {:members => @results})%>");
|
|
@ -1,4 +1,4 @@
|
|||
/**
|
||||
* Created by Administrator on 2014/12/3.
|
||||
*/
|
||||
$("#st_groups").html("<%= escape_javascript( render :partial => 'groups_name', locals: {:course_groups => @course_groups})%>");
|
||||
$("#st_groups").html("<%= escape_javascript( render :partial => 'new_groups_name', locals: {:course_groups => @course_groups})%>");
|
|
@ -22,7 +22,7 @@
|
|||
</span>
|
||||
</div>
|
||||
|
||||
<button name="button" class="f_l ml10" onclick="_file.click()" onmouseover="this.focus()" type="button" style="<%= ie8? ? 'display:none' : '' %>; width:20%; height:26%;"><%= l(:label_browse)%></button>
|
||||
<button name="button" class="sub_btn" onclick="_file.click()" onmouseover="this.focus()" type="button"><%= l(:label_browse)%></button>
|
||||
<%= file_field_tag 'attachments[dummy][file]',
|
||||
:id => '_file',
|
||||
:class => 'file_selector',
|
||||
|
@ -41,10 +41,9 @@
|
|||
:delete_all_files => l(:text_are_you_sure_all)
|
||||
} %>
|
||||
<!--<input type="submit" name="" value="上传文件" class="f_l ml10" style="width:80px; height:26px;">-->
|
||||
<label class="f_l ml10 c_grey" style=" margin-top: 3px;">
|
||||
|
||||
<span id="upload_file_count">
|
||||
<%= l(:label_no_file_uploaded)%>
|
||||
</span>
|
||||
(<%= l(:label_max_size) %>:
|
||||
<%= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>)
|
||||
</label>
|
|
@ -2,15 +2,16 @@
|
|||
<% sufixtypes = @course.contenttypes %>
|
||||
|
||||
|
||||
<%= stylesheet_link_tag 'resource', :media => 'all' %>
|
||||
<!--<%#= stylesheet_link_tag 'resource', :media => 'all' %> -->
|
||||
<script>
|
||||
function show_upload()
|
||||
{
|
||||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'upload_show',:locals => {:course => @course}) %>');
|
||||
showModal('ajax-modal', '513px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<span style='float: right;cursor:pointer;padding-left: 513px;'><a href='javascript:void(0)' onclick='closeModal()'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
|
||||
$('#ajax-modal').parent().css("top","5").css("left","511");
|
||||
$('#ajax-modal').before("<span style='float: right;cursor:pointer;padding-left: 513px;'><a href='javascript:void(0)' onclick='closeModal()'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>")
|
||||
$('#ajax-modal').parent().css("top","").css("left","");
|
||||
$('#ajax-modal').parent().addClass("popbox_polls");
|
||||
}
|
||||
|
||||
function closeModal()
|
||||
|
@ -47,8 +48,8 @@
|
|||
<%= submit_tag "课内搜索", :class => "re_schbtn b_lblue",:name => "incourse",:id => "incourse", :onmouseover => "presscss('incourse')",:onmouseout =>"buttoncss()" %>
|
||||
<%= submit_tag "全站搜索", :class => "re_schbtn b_lblue",:name => "insite",:id => "insite",:onmouseover => "presscss('insite')",:onmouseout =>"buttoncss()" %>
|
||||
<% end %>
|
||||
<% if is_course_teacher(User.current,@course) %>
|
||||
<a href="javascript:void(0)" class="re_fabu f_r b_lblue" onclick="show_upload()">上传资源</a>
|
||||
<% if is_course_teacher(User.current,@course) %> <!-- show_window('light','fade','20%','35%')-->
|
||||
<a href="javascript:void(0)" class="re_fabu f_r b_lblue" onclick="show_upload();">上传资源</a>
|
||||
<% end %>
|
||||
</div><!---re_top end-->
|
||||
<div class="cl"></div>
|
||||
|
@ -58,6 +59,5 @@
|
|||
</div><!---re_con end-->
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<% html_title(l(:label_attachment_plural)) -%>
|
|
@ -45,8 +45,8 @@
|
|||
</div>
|
||||
<div class="cl"></div>
|
||||
<div class="tag_h">
|
||||
<%= render :partial => 'tags/tag_new', :locals => {:obj => file, :object_flag => "6"} %>
|
||||
<%= render :partial => 'tags/tag_add', :locals => {:obj => file, :object_flag => "6"} %>
|
||||
<%= render :partial => 'tags/tag_new', :locals => {:obj => file, :object_flag => "10"} %>
|
||||
<%= render :partial => 'tags/tag_add', :locals => {:obj => file, :object_flag => "10"} %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div><!---re_con_box end-->
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
id: "relation_file_form" do %>
|
||||
<%= hidden_field_tag(:file_id, file.id) %>
|
||||
<%= content_tag('div', courses_check_box_tags('courses[course][]', User.current.courses,course,file), :id => 'courses')%>
|
||||
<a id="submit_quote" href="javascript:void(0)" class="upload_btn" onclick="submit_quote();">引 用</a><a href="javascript:void(0)" class="upload_btn upload_btn_grey" onclick="closeModal();">取 消</a>
|
||||
<a id="submit_quote" href="javascript:void(0)" class="blue_btn fl c_white" onclick="submit_quote();">引 用</a><a href="javascript:void(0)" class="blue_btn grey_btn fl c_white" onclick="closeModal();">取 消</a>
|
||||
<% end -%>
|
||||
</div>
|
||||
<% end %>
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
<div id="popbox_upload" style="margin-top: -30px;margin-left: -20px;margin-right: -10px;">
|
||||
|
||||
<div id="popbox_upload" class="box_h3 mb10" style="margin-top: -30px">
|
||||
<div class="upload_con">
|
||||
<h2><%= l(:label_upload_files)%></h2>
|
||||
<div class="upload_box">
|
||||
|
@ -9,8 +10,8 @@
|
|||
<!-- <label style="margin-top:3px;"><#%= l(:label_file_upload)%></label> -->
|
||||
<%= render :partial => 'attachement_list',:locals => {:course => course} %>
|
||||
<div class="cl"></div>
|
||||
<a id="submit_resource" href="javascript:void(0);" class="upload_btn" onclick="submit_resource();"><%= l(:button_confirm)%></a>
|
||||
<a href="javascript:void(0);" class="upload_btn upload_btn_grey" onclick="closeModal();"><%= l(:button_cancel)%></a>
|
||||
<a href="javascript:void(0);" class=" fr grey_btn mr40" onclick="closeModal();"><%= l(:button_cancel)%></a>
|
||||
<a id="submit_resource" href="javascript:void(0);" class="blue_btn fr" onclick="submit_resource();"><%= l(:button_confirm)%></a>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -31,4 +31,5 @@ closeModal();
|
|||
$("#resource_list").html('<%= j(render partial: "course_file" ,locals: {course: @course}) %>');
|
||||
<%end%>
|
||||
<% end %>
|
||||
$(document).ready(img_thumbnails);
|
||||
|
||||
|
|
|
@ -7,4 +7,5 @@
|
|||
showModal('ajax-modal', '513px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<span style='float: right;cursor:pointer;padding-left: 513px;'><a href='javascript:void(0)' onclick='closeModal()'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
|
||||
$('#ajax-modal').parent().css("top","5").css("left","511");
|
||||
$('#ajax-modal').parent().css("top","").css("left","");
|
||||
$('#ajax-modal').parent().addClass("popbox_polls");
|
|
@ -1,49 +1,51 @@
|
|||
<!-- added by fq -->
|
||||
<!-- %= form_for(@forum) do |f| % -->
|
||||
<div id="share_new" style = "width: 500px; margin:0 auto; " >
|
||||
<%= labelled_form_for(@forum) do |f| %>
|
||||
<% if @forum.errors.any? %>
|
||||
<!--<div id="error_explanation">
|
||||
<h2><#%= pluralize(@forum.errors.count, "error") %> prohibited this forum from being saved:</h2>
|
||||
|
||||
<ul>
|
||||
<#% @forum.errors.full_messages.each do |msg| %>
|
||||
<li><#%= msg %></li>
|
||||
<#% end %>
|
||||
</ul>
|
||||
</div> -->
|
||||
<% end %>
|
||||
<div style="width: 120%;">
|
||||
<div class="field">
|
||||
<%= f.text_field :name, :required => true, :style => 'width: 100%;', :class => 'create-share', :maxlength => 50%>
|
||||
</div>
|
||||
<div>
|
||||
<% if User.current.logged? && User.current.admin? %>
|
||||
<% if @forum.safe_attribute? 'sticky' %>
|
||||
<%= f.check_box :sticky %>
|
||||
<%= label_tag 'message_sticky', l(:label_board_sticky) %>
|
||||
<% end %>
|
||||
<% if @forum.safe_attribute? 'locked' %>
|
||||
<%= f.check_box :locked %>
|
||||
<%= label_tag 'message_locked', l(:label_board_locked) %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
<div>
|
||||
<script src="http://<%= Setting.host_name%>/javascripts/ckeditor/ckeditor.js?1404953555" type="text/javascript"></script>
|
||||
<p style="max-width:680px">
|
||||
<%= f.text_area :description, :required => true, :id => 'editor01' %>
|
||||
</p>
|
||||
<script type="text/javascript">var ckeditor=CKEDITOR.replace('editor01');</script>
|
||||
|
||||
<p style="color: #ff0000">
|
||||
(<%= l(:label_forums_max_length) %>)
|
||||
</p>
|
||||
</div>
|
||||
<div class="actions" style=" padding-top: 10px; float:right">
|
||||
<%= submit_tag l(:button_submit) %>
|
||||
<%= link_to l(:button_back), forums_path ,:style => 'font-size: 14px; padding: 0px 3px;' %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<!-- added by fq -->
|
||||
<!-- %= form_for(@forum) do |f| % -->
|
||||
|
||||
<div id="share_new" style = "width: 500px; margin:0 auto; " >
|
||||
<%= labelled_form_for(@forum) do |f| %>
|
||||
<% if @forum.errors.any? %>
|
||||
<!--<div id="error_explanation">
|
||||
<h2><#%= pluralize(@forum.errors.count, "error") %> prohibited this forum from being saved:</h2>
|
||||
|
||||
<ul>
|
||||
<#% @forum.errors.full_messages.each do |msg| %>
|
||||
<li><#%= msg %></li>
|
||||
<#% end %>
|
||||
</ul>
|
||||
</div> -->
|
||||
<% end %>
|
||||
<div style="width: 120%;">
|
||||
<div class="field">
|
||||
<%= f.text_field :name, :required => true, :style => 'width: 100%;', :class => 'create-share', :maxlength => 50%>
|
||||
</div>
|
||||
<div>
|
||||
<% if User.current.logged? && User.current.admin? %>
|
||||
<% if @forum.safe_attribute? 'sticky' %>
|
||||
<%= f.check_box :sticky %>
|
||||
<%= label_tag 'message_sticky', l(:label_board_sticky) %>
|
||||
<% end %>
|
||||
<% if @forum.safe_attribute? 'locked' %>
|
||||
<%= f.check_box :locked %>
|
||||
<%= label_tag 'message_locked', l(:label_board_locked) %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
<div>
|
||||
|
||||
<%= hidden_field_tag :asset_id,params[:asset_id],:required => false,:style => 'display:none' %>
|
||||
<p style="max-width:680px">
|
||||
<%= f.kindeditor :description, :required => true %>
|
||||
</p>
|
||||
<!-- <script type="text/javascript">var ckeditor=CKEDITOR.replace('editor01');</script> -->
|
||||
|
||||
<p style="color: #ff0000">
|
||||
(<%= l(:label_forums_max_length) %>)
|
||||
</p>
|
||||
</div>
|
||||
<div class="actions" style=" padding-top: 10px; float:right">
|
||||
<%= submit_tag l(:button_submit) %>
|
||||
<%= link_to l(:button_back), forums_path ,:style => 'font-size: 14px; padding: 0px 3px;' %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
|
@ -0,0 +1,49 @@
|
|||
<!-- added by fq -->
|
||||
<!-- %= form_for(@forum) do |f| % -->
|
||||
|
||||
<div id="share_new" style = "width: 500px; margin:0 auto; " >
|
||||
<%= labelled_form_for(@forum) do |f| %>
|
||||
<% if @forum.errors.any? %>
|
||||
<!--<div id="error_explanation">
|
||||
<h2><#%= pluralize(@forum.errors.count, "error") %> prohibited this forum from being saved:</h2>
|
||||
|
||||
<ul>
|
||||
<#% @forum.errors.full_messages.each do |msg| %>
|
||||
<li><#%= msg %></li>
|
||||
<#% end %>
|
||||
</ul>
|
||||
</div> -->
|
||||
<% end %>
|
||||
<div style="width: 120%;">
|
||||
<div class="field">
|
||||
<%= f.text_field :name, :required => true, :style => 'width: 100%;', :class => 'create-share', :maxlength => 50%>
|
||||
</div>
|
||||
<div>
|
||||
<% if User.current.logged? && User.current.admin? %>
|
||||
<% if @forum.safe_attribute? 'sticky' %>
|
||||
<%= f.check_box :sticky %>
|
||||
<%= label_tag 'message_sticky', l(:label_board_sticky) %>
|
||||
<% end %>
|
||||
<% if @forum.safe_attribute? 'locked' %>
|
||||
<%= f.check_box :locked %>
|
||||
<%= label_tag 'message_locked', l(:label_board_locked) %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
<div>
|
||||
<p style="max-width:680px">
|
||||
<%= f.kindeditor :description, :required => true,:owner_id => @forum.id,:owner_type => 2 %>
|
||||
</p>
|
||||
<!-- <script type="text/javascript">var ckeditor=CKEDITOR.replace('editor01');</script> -->
|
||||
|
||||
<p style="color: #ff0000">
|
||||
(<%= l(:label_forums_max_length) %>)
|
||||
</p>
|
||||
</div>
|
||||
<div class="actions" style=" padding-top: 10px; float:right">
|
||||
<%= submit_tag l(:button_submit) %>
|
||||
<%= link_to l(:button_back), forums_path ,:style => 'font-size: 14px; padding: 0px 3px;' %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
|
@ -1,4 +1,4 @@
|
|||
<!-- added by fq -->
|
||||
<h1>编辑讨论区</h1>
|
||||
|
||||
<%= render 'form' %>
|
||||
<%= javascript_include_tag "/assets/kindeditor/kindeditor" %>
|
||||
<%= render 'form_edit_mode' %>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<% @nav_dispaly_forum_label = 1%>
|
||||
<!-- added by fq -->
|
||||
<h1 style="margin-top: 2%; margin-left: 49%"><%= l :label_forum_new %></h1>
|
||||
|
||||
<%= render 'form' %>
|
||||
<%= javascript_include_tag "/assets/kindeditor/kindeditor" %>
|
||||
<%= render 'form_create_mode' %>
|
||||
|
||||
<%#= link_to l(:button_back), forums_path %>
|
||||
|
|
|
@ -6,13 +6,14 @@
|
|||
<% if User.current.logged? %>
|
||||
<%= labelled_form_for(@memo, :url => create_memo_forum_path(@forum), :html => {:multipart => true} ) do |f| %>
|
||||
<div class="actions" style="max-width:680px">
|
||||
<%= hidden_field_tag :asset_id,params[:asset_id],:required => false,:style => 'display:none' %>
|
||||
<p>
|
||||
<%= f.text_field :subject, :required => true, :maxlength => 50%>
|
||||
</p>
|
||||
<p style="max-width:680px">
|
||||
<%= f.text_area :content, :required => true, :id => 'editor02' %>
|
||||
<%= f.kindeditor :content, :required => true %>
|
||||
</p>
|
||||
<script type="text/javascript">var ckeditor=CKEDITOR.replace('editor02');</script>
|
||||
<!--<script type="text/javascript">var ckeditor=CKEDITOR.replace('editor02');</script>-->
|
||||
<p style="color: #ff0000">
|
||||
(<%= l(:label_memos_max_length) %>)
|
||||
</p>
|
||||
|
|
|
@ -53,7 +53,7 @@
|
|||
:maxlength => 250 %>
|
||||
<%= f.text_field :reference_user_id, :style=>"display:none"%>
|
||||
<div style="float:right">
|
||||
<a href="#" class="ping_sub1" id="jours_submit" onclick="submit_jours(<%= @is_teacher%>);">
|
||||
<a href="javascript:" class="ping_sub1" id="jours_submit" onclick="submit_jours(<%= @is_teacher%>);">
|
||||
<%= l(:label_confirmation) %>
|
||||
</a>
|
||||
</div>
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
</span>
|
||||
</li>
|
||||
<li class="wdown">
|
||||
<%= link_to "(#{homework.attachments.count.to_s}个附件)", zipdown_download_user_homework_path(:homework => homework)%>
|
||||
<%#= link_to "(#{homework.attachments.count.to_s}个附件)", "javascript:"%>
|
||||
</li>
|
||||
<li class="wscore">
|
||||
<% unless is_student_batch_homework %>
|
||||
|
|
|
@ -61,7 +61,7 @@
|
|||
<%= render_new_members_for_homework(members) %>
|
||||
</div>
|
||||
<p style="padding-left: 20px;">
|
||||
<a href="#" class="tijiao" id='member-add-submit' onclick="submit_homework_user();">
|
||||
<a href="javascript:" class="tijiao" id='member-add-submit' onclick="submit_homework_user();">
|
||||
<%= l(:button_add) %>
|
||||
</a>
|
||||
</p>
|
||||
|
|
|
@ -11,8 +11,8 @@
|
|||
<h2><img src="/images/bid/pic_top.jpg" width="188" height="37" alt="匿名评价" /></h2>
|
||||
<p> 据说雷锋做完好事是从来不留名的呢,我们这次评分也不留名!!!但是,但是,您给的分数一定要公正哦,老天爷看不到,我们的系统可是清楚得很!</p>
|
||||
<p style="margin-bottom:15px;"> 别怪我没告诉你,系统分配给你的作品不评价可是要扣分的哈!</p>
|
||||
<a href="#" class="tijiao" style="margin-left:100px;" onclick="hideModal(this)">匿名评分</a>
|
||||
<a href="#" style="color:#15bccf; margin-top:20px; display:block;" onclick="hideModal(this)">冒着扣分的危险残忍拒绝</a>
|
||||
<a href="javascript:" class="tijiao" style="margin-left:100px;" onclick="hideModal(this)">匿名评分</a>
|
||||
<a href="javascript:" style="color:#15bccf; margin-top:20px; display:block;" onclick="hideModal(this)">冒着扣分的危险残忍拒绝</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<span><a href="#" id="star05" onclick="ChoseStars(5)" style="background-position:<%= start_score>=5 ? '-24px 0px;':'-2px 0'%>"></a></span>
|
||||
<span><a href="#" id="star04" onclick="ChoseStars(4)" style="background-position:<%= start_score>=4 ? '-24px 0px;':'-2px 0'%>"></a></span>
|
||||
<span><a href="#" id="star03" onclick="ChoseStars(3)" style="background-position:<%= start_score>=3 ? '-24px 0px;':'-2px 0'%>"></a></span>
|
||||
<span><a href="#" id="star02" onclick="ChoseStars(2)" style="background-position:<%= start_score>=2 ? '-24px 0px;':'-2px 0'%>"></a></span>
|
||||
<span><a href="#" id="star01" onclick="ChoseStars(1)" style="background-position:<%= start_score>=1 ? '-24px 0px;':'-2px 0'%>"></a></span>
|
||||
<span><a href="javascript:" id="star05" onclick="ChoseStars(5)" style="background-position:<%= start_score>=5 ? '-24px 0px;':'-2px 0'%>"></a></span>
|
||||
<span><a href="javascript:" id="star04" onclick="ChoseStars(4)" style="background-position:<%= start_score>=4 ? '-24px 0px;':'-2px 0'%>"></a></span>
|
||||
<span><a href="javascript:" id="star03" onclick="ChoseStars(3)" style="background-position:<%= start_score>=3 ? '-24px 0px;':'-2px 0'%>"></a></span>
|
||||
<span><a href="javascript:" id="star02" onclick="ChoseStars(2)" style="background-position:<%= start_score>=2 ? '-24px 0px;':'-2px 0'%>"></a></span>
|
||||
<span><a href="javascript:" id="star01" onclick="ChoseStars(1)" style="background-position:<%= start_score>=1 ? '-24px 0px;':'-2px 0'%>"></a></span>
|
||||
<input type="hidden" value="<%= start_score%>" id="stars_value" name="stars_value"/>
|
|
@ -1,5 +1,5 @@
|
|||
<span><a href="#" id="star05" style="background-position:<%= start_score>=1 ? '-24px 0px;':'-2px 0'%>"></a></span>
|
||||
<span><a href="#" id="star04" style="background-position:<%= start_score>=2 ? '-24px 0px;':'-2px 0'%>"></a></span>
|
||||
<span><a href="#" id="star03" style="background-position:<%= start_score>=3 ? '-24px 0px;':'-2px 0'%>"></a></span>
|
||||
<span><a href="#" id="star02" style="background-position:<%= start_score>=4 ? '-24px 0px;':'-2px 0'%>"></a></span>
|
||||
<span><a href="#" id="star01" style="background-position:<%= start_score>=5 ? '-24px 0px;':'-2px 0'%>"></a></span>
|
||||
<span><a href="javascript:" id="star05" style="background-position:<%= start_score>=1 ? '-24px 0px;':'-2px 0'%>"></a></span>
|
||||
<span><a href="javascript:" id="star04" style="background-position:<%= start_score>=2 ? '-24px 0px;':'-2px 0'%>"></a></span>
|
||||
<span><a href="javascript:" id="star03" style="background-position:<%= start_score>=3 ? '-24px 0px;':'-2px 0'%>"></a></span>
|
||||
<span><a href="javascript:" id="star02" style="background-position:<%= start_score>=4 ? '-24px 0px;':'-2px 0'%>"></a></span>
|
||||
<span><a href="javascript:" id="star01" style="background-position:<%= start_score>=5 ? '-24px 0px;':'-2px 0'%>"></a></span>
|
|
@ -107,7 +107,7 @@
|
|||
<span style="float: left;">
|
||||
|
||||
</span>
|
||||
<a href="#" class="tijiao" onclick="submit_homework_form();">
|
||||
<a href="javascript:" class="tijiao" onclick="submit_homework_form();">
|
||||
<%= l(:label_button_ok) %>
|
||||
</a>
|
||||
<a href="javascript:history.back()" class="tijiao">取 消</a>
|
||||
|
|
|
@ -103,7 +103,7 @@
|
|||
<span style="float: left;">
|
||||
|
||||
</span>
|
||||
<a href="#" class="tijiao" onclick="submit_homework_form();">
|
||||
<a href="javascript:" class="tijiao" onclick="submit_homework_form();">
|
||||
<%= l(:label_button_ok) %>
|
||||
</a>
|
||||
<a href="javascript:history.back()" class="tijiao">取 消</a>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<div class="project_r_h">
|
||||
<h2 class="project_h2">问题跟踪</h2>
|
||||
<h2 class="project_h2"><%= l(:label_issue_tracking) %></h2>
|
||||
</div>
|
||||
<div class="problem_top">
|
||||
<% unless @project.enabled_modules.where("name = 'issue_tracking'").empty? %>
|
||||
|
@ -12,7 +12,7 @@
|
|||
:onclick => '$("#custom_query").slideToggle(400); ' if true || User.current.logged? %>
|
||||
</span>
|
||||
<% end %>
|
||||
<span class="problem_p fr">问题总数:<span><%= @project.issues.count %></span> 未解决:<span><%= @project.issues.where('status_id in (1,2,4,6)').count %></span></span>
|
||||
<span class="problem_p fr"><%= l(:label_issues_sum) %>:<span><%= @project.issues.count %></span> <%= l(:lable_issues_undo) %> <span><%= @project.issues.where('status_id in (1,2,4,6)').count %></span></span>
|
||||
</div>
|
||||
<div class="contextual">
|
||||
<% if !@query.new_record? && @query.editable_by?(User.current) %>
|
||||
|
|
|
@ -85,13 +85,13 @@
|
|||
show_btn.css('width', 25);
|
||||
|
||||
}
|
||||
//close???
|
||||
//close
|
||||
closeBtn.bind("click",function(){
|
||||
sideContent.animate({width: '0px'},"fast");
|
||||
show_btn.stop(true, true).delay(300).animate({ width: '25px'},"fast");
|
||||
cookiesave('minStatue','true','','','');
|
||||
});
|
||||
//show???
|
||||
//show
|
||||
show_btn.bind("click",function() {
|
||||
$(this).animate({width: '0px'},"fast");
|
||||
sideContent.stop(true, true).delay(200).animate({ width: '154px'},"fast");
|
||||
|
@ -110,7 +110,7 @@ $(function(){
|
|||
myTips("<%= l(:label_feedback_success) %>","success");
|
||||
});
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
function f_submit()
|
||||
{
|
||||
|
@ -121,15 +121,15 @@ function cookiesave(n, v, mins, dn, path)
|
|||
{
|
||||
if(n)
|
||||
{
|
||||
|
||||
|
||||
if(!mins) mins = 365 * 24 * 60;
|
||||
if(!path) path = "/";
|
||||
var date = new Date();
|
||||
|
||||
|
||||
date.setTime(date.getTime() + (mins * 60 * 1000));
|
||||
|
||||
|
||||
var expires = "; expires=" + date.toGMTString();
|
||||
|
||||
|
||||
if(dn) dn = "domain=" + dn + "; ";
|
||||
document.cookie = n + "=" + v + expires + "; " + dn + "path=" + path;
|
||||
|
||||
|
@ -167,11 +167,11 @@ function cookieget(n)
|
|||
<% get_memo %>
|
||||
<%= form_for(@new_memo, :url => create_feedback_forum_path(@public_forum)) do |f| %>
|
||||
<%= f.text_area :subject, :class => "opnionText", :placeholder => l(:label_feedback_tips) %>
|
||||
<%= f.hidden_field :content, :required => true , :value => l(:label_feedback_value) %>
|
||||
<%= f.hidden_field :content,:id => 'hidden', :required => true , :value => l(:label_feedback_value) %>
|
||||
<%#= f.submit :value => l(:label_memo_create), :class => "opnionButton", :id => "button1" %>
|
||||
<a href="javascript:void(0);" class="opnionButton" style=" color:#fff;" id="" onclick="f_submit();"><%= l(:label_submit)%></a>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="msgserver">
|
||||
<a href="http://user.trustie.net/users/12/user_newfeedback" style="color: #15BCCF;"><%= l(:label_technical_support) %>黄井泉</a>
|
||||
<a href="http://user.trustie.net/users/34/user_newfeedback" style="color: #15BCCF;"><%= l(:label_technical_support) %>白 羽</a>
|
||||
|
|
|
@ -22,14 +22,26 @@
|
|||
</p>
|
||||
<div id="logo_link">
|
||||
<% if @companies.nil? || @companies.count == 0 %>
|
||||
<span class="footer_logo_link"><%= link_to image_tag('/images/footer_logo/nudt.png',:size=>'100x30',:alt=>l(:label_co_organizer_NUDT)),"http://www.nudt.edu.cn/special.asp?classid=12", :target => "_blank" %></span>
|
||||
<span class="footer_logo_link"><%= link_to image_tag('/images/footer_logo/peking_eecs.png',:size=>'100x30',:alt=>l(:label_co_organizer_EECS)), "http://eecs.pku.edu.cn", :target => "_blank" %></span>
|
||||
<span class="footer_logo_link"><%= link_to image_tag('/images/footer_logo/buaa_scse.png',:size=>'100x30',:alt=>l(:label_co_organizer_BHU)), "http://scse.buaa.edu.cn/", :target => "_blank" %></span>
|
||||
<span class="footer_logo_link"><%= link_to image_tag('/images/footer_logo/iscas.png',:size=>'100x30',:alt=>l(:label_co_organizer_CAS)), "http://www.iscas.ac.cn", :target => "_blank" %></span>
|
||||
<span class="footer_logo_link"><%= link_to image_tag('/images/footer_logo/inforbus.png',:size=>'100x30',:alt=>l(:label_co_organizer_InforS)), "http://www.inforbus.com", :target => "_blank" %></span>
|
||||
<span class="footer_logo_link">
|
||||
<%= link_to image_tag('/images/footer_logo/nudt.png',:size=>'100x30',:alt=>l(:label_co_organizer_NUDT)),"http://www.nudt.edu.cn/special.asp?classid=12", :target => "_blank" %>
|
||||
</span>
|
||||
<span class="footer_logo_link">
|
||||
<%= link_to image_tag('/images/footer_logo/peking_eecs.png',:size=>'100x30',:alt=>l(:label_co_organizer_EECS)), "http://eecs.pku.edu.cn", :target => "_blank" %>
|
||||
</span>
|
||||
<span class="footer_logo_link">
|
||||
<%= link_to image_tag('/images/footer_logo/buaa_scse.png',:size=>'100x30',:alt=>l(:label_co_organizer_BHU)), "http://scse.buaa.edu.cn/", :target => "_blank" %>
|
||||
</span>
|
||||
<span class="footer_logo_link">
|
||||
<%= link_to image_tag('/images/footer_logo/iscas.png',:size=>'100x30',:alt=>l(:label_co_organizer_CAS)), "http://www.iscas.ac.cn", :target => "_blank" %>
|
||||
</span>
|
||||
<span class="footer_logo_link">
|
||||
<%= link_to image_tag('/images/footer_logo/inforbus.png',:size=>'100x30',:alt=>l(:label_co_organizer_InforS)), "http://www.inforbus.com", :target => "_blank" %>
|
||||
</span>
|
||||
<% else %>
|
||||
<% @companies && @companies.each do |company| %>
|
||||
<span class="footer_logo_link"><%= link_to image_tag(url_to_avatar(company),:size=>"100x30",:alt=>company.name),company.url, :target => "_blank" %></span>
|
||||
<span class="footer_logo_link">
|
||||
<%= link_to image_tag(url_to_avatar(company),:size=>"100x30",:alt=>company.name),company.url, :target => "_blank" %>
|
||||
</span>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
|
|
@ -1,32 +1,3 @@
|
|||
<%
|
||||
request.headers['REQUEST_URI'] = "" if request.headers['REQUEST_URI'].nil?
|
||||
realUrl = request.original_url
|
||||
if (realUrl.match(/.*forge\.trustie\.net\/*/))
|
||||
#@nav_dispaly_project_label = 1
|
||||
#@nav_dispaly_forum_label = 1
|
||||
elsif (realUrl.match(/.*course\.trustie\.net\/*/))
|
||||
#@nav_dispaly_course_all_label = 1
|
||||
#@nav_dispaly_forum_label = 1
|
||||
#@nav_dispaly_course_label = nil
|
||||
#@nav_dispaly_store_all_label = 1
|
||||
elsif (realUrl.match(/.*user\.trustie\.net\/*/))
|
||||
#@nav_dispaly_home_path_label = 1
|
||||
#@nav_dispaly_main_course_label = 1
|
||||
#@nav_dispaly_main_project_label = 1
|
||||
#@nav_dispaly_main_contest_label = 1
|
||||
elsif (realUrl.match(/.*contest\.trustie\.net\/*/))
|
||||
#@nav_dispaly_contest_label = 1
|
||||
#@nav_dispaly_store_all_label = 1
|
||||
else
|
||||
#@nav_dispaly_project_all_label = 1
|
||||
#@nav_dispaly_course_all_label = 1
|
||||
#@nav_dispaly_forum_label = 1
|
||||
#@nav_dispaly_bid_label = 1
|
||||
#@nav_dispaly_contest_label = 1
|
||||
#@nav_dispaly_store_all_label = 1
|
||||
#@nav_dispaly_user_label = 1
|
||||
end
|
||||
%>
|
||||
<%= render :partial => "layouts/base_feedback" %>
|
||||
<div id="top-menu" style="background-color: #15bccf;height:40px;margin-top: 10px;margin-bottom: 10px;">
|
||||
<div class="welcome_logo">
|
||||
|
@ -66,12 +37,8 @@
|
|||
</ul>
|
||||
</div>
|
||||
<% end -%>
|
||||
<%#= render_menu :top_menu if User.current.logged? || !Setting.login_required? -%>
|
||||
<%= render_dynamic_nav if User.current.logged? || !Setting.login_required? -%>
|
||||
<%# 自建导航条在base页面中以 (@nav_dispaly......) 开头变量设定, 全局搜索即可发现 %>
|
||||
</div>
|
||||
<div style="border-top:solid 1px #C6E9F1;width:940px;margin-left:auto;margin-right:auto;margin-bottom: 0px;margin-top: -10px;"></div>
|
||||
<div style="clear:left;"></div>
|
||||
|
||||
<script type="text/javascript">
|
||||
function setMessageCount () {
|
||||
|
|
|
@ -0,0 +1,38 @@
|
|||
<%= javascript_include_tag "feedback" %>
|
||||
|
||||
<div class="scrollsidebar" id="scrollsidebar">
|
||||
<div class="side_content">
|
||||
<div class="side_list">
|
||||
<div class="side_title">
|
||||
<a title="<%= l(:button_hide) %>" class="close_btn">
|
||||
<span>
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="side_center">
|
||||
<div class="custom_service">
|
||||
<% get_memo %>
|
||||
<%= form_for(@new_memo, :url => create_feedback_forum_path(@public_forum)) do |f| %>
|
||||
<%= f.text_area :subject, :class => "opnionText", :placeholder => l(:label_feedback_tips) %>
|
||||
<%= f.hidden_field :content, :required => true , :value => l(:label_feedback_value) %>
|
||||
<a href="javascript:void(0);" class="opnionButton" style=" color:#fff;" id="" onclick="f_submit();">
|
||||
<%= l(:label_submit)%>
|
||||
</a>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="msgserver">
|
||||
<a href="http://user.trustie.net/users/12/user_newfeedback" target="_blank">
|
||||
<%= l(:label_technical_support) %>
|
||||
黄井泉
|
||||
</a>
|
||||
<a href="http://user.trustie.net/users/34/user_newfeedback" target="_blank">
|
||||
<%= l(:label_technical_support) %>
|
||||
白 羽
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="side_bottom"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="show_btn"><span>在线客服</span></div>
|
||||
</div>
|
|
@ -0,0 +1,29 @@
|
|||
<div id="Footer">
|
||||
<ul class="copyright">
|
||||
<li class="fl mr10"><%= l(:label_hosted_organization)%><a href="http://www.nudt.edu.cn/ArticleShow.asp?ID=47" class=" ml10 c_dblue " target="_blank"><%= l(:label_hosted_by)%></a></li>
|
||||
<li><a href="http://www.nudt.edu.cn/ArticleShow.asp?ID=41" class="fl c_dblue mr30" target="_blank"><%= l(:label_sponsor)%></a></li>
|
||||
<li class="fl mr30"><%= l(:label_rights_reserved)%> </li>
|
||||
<li><a href="http://forge.trustie.net/projects/2/member" class="fl c_dblue mr30" target="_blank"><%= l(:label_contact_us)%></a></li>
|
||||
<li><a href="http://www.miibeian.gov.cn/" class="fl c_dblue" target="_blank"><%= l(:label_license)%></a></li>
|
||||
</ul>
|
||||
|
||||
<div class="cl"></div>
|
||||
<ul class="footlogo">
|
||||
<li class="fl mr20">
|
||||
<%= link_to image_tag('/images/footer_logo/nudt.png',:style => "width:90px;height:30px;",:alt=>l(:label_co_organizer_NUDT)),"http://www.nudt.edu.cn/special.asp?classid=12", :target => "_blank"%>
|
||||
</li>
|
||||
<li class="fl mr20">
|
||||
<%= link_to image_tag('/images/footer_logo/peking_eecs.png',:style => "width:90px;height:30px;",:alt=>l(:label_co_organizer_EECS)), "http://eecs.pku.edu.cn", :target => "_blank"%>
|
||||
</li>
|
||||
<li class="fl mr20">
|
||||
<%= link_to image_tag('/images/footer_logo/buaa_scse.png',:style => "width:90px;height:30px;",:alt=>l(:label_co_organizer_BHU)), "http://scse.buaa.edu.cn/", :target => "_blank"%>
|
||||
</li>
|
||||
<li class="fl mr20">
|
||||
<%= link_to image_tag('/images/footer_logo/iscas.png',:style => "width:90px;height:30px;",:alt=>l(:label_co_organizer_CAS)), "http://www.iscas.ac.cn", :target => "_blank"%>
|
||||
</li>
|
||||
<li class="fl mr20">
|
||||
<%= link_to image_tag('/images/footer_logo/inforbus.png',:style => "width:90px;height:30px;",:alt=>l(:label_co_organizer_InforS)), "http://www.inforbus.com", :target => "_blank" %>
|
||||
</li>
|
||||
</ul>
|
||||
</div><!--Footer end-->
|
||||
<div class="cl"></div>
|
|
@ -0,0 +1,61 @@
|
|||
<div id="Header" >
|
||||
<!-- logo -->
|
||||
<div class="logo fl" >
|
||||
<a href="#" target="_blank">
|
||||
<%=link_to image_tag("/images/logo.png",weight:"35px", height: "30px")%>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<!-- 导航栏 -->
|
||||
<div id="TopNav" class="fl">
|
||||
<%= render_dynamic_nav if User.current.logged? || !Setting.login_required? -%>
|
||||
</div>
|
||||
|
||||
<div id="TopUser" class="fr">
|
||||
<div id="menu">
|
||||
<ul class="menu">
|
||||
<!--右侧登录、登出、注册按钮-->
|
||||
<% if User.current.logged? -%>
|
||||
|
||||
<li id="current_user_li">
|
||||
<%= link_to_user_header(User.current,false,:class =>'parent')%>
|
||||
<ul id="user_sub_menu">
|
||||
<% unless User.current.projects.empty? %>
|
||||
<li id="my_projects_li">
|
||||
<%= link_to l(:label_my_projects), {:controller => 'users', :action => 'user_projects', id: User.current.id, host: Setting.project_domain}, :class => "parent" %>
|
||||
<ul id="my_projects_ul">
|
||||
<% User.current.projects.each do |project| %>
|
||||
<li title="<%=project.name%>">
|
||||
<%= link_to project.name, {:controller => 'projects', :action => 'show',id: project.id, host: Setting.project_domain } %>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</li>
|
||||
<% end %>
|
||||
|
||||
<% if @show_course == 1 && User.current.user_extensions && [UserExtensions::TEACHER, UserExtensions::STUDENT].include?(User.current.user_extensions.identity) %>
|
||||
<% user_course = get_user_course User.current%>
|
||||
<% unless user_course.empty? %>
|
||||
<li id="my_courses_li">
|
||||
<%=link_to l(:label_my_course), {:controller => 'users', :action => 'user_courses', id: User.current.id}, :class => "parent" %>
|
||||
<ul id="my_courses_ul">
|
||||
<% user_course.each do |course| %>
|
||||
<li title="<%=course.name%>">
|
||||
<%= link_to course.name, {:controller => 'courses',:action => 'show',:id => course.id} %>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</li>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<li>
|
||||
<%=link_to l(:label_user_edit), {:controller => 'my', :action=> 'account', host: Setting.user_domain}%>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<% end -%>
|
||||
<%= header_render_menu :account_menu -%>
|
||||
</ul>
|
||||
</div><!--topuser_nav end-->
|
||||
</div>
|
||||
</div>
|
|
@ -0,0 +1,95 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>升级浏览器</title>
|
||||
<script src="jquery-1.8.3-ui-1.9.2-ujs-2.0.3.js" type="text/javascript"></script>
|
||||
<style type="text/css">
|
||||
body{ font-size:12px; font-family:"微软雅黑","宋体"; background: #F2F2F2; font-style:normal;}
|
||||
.update{ border-bottom:1px solid #d7d7d7; color:#fea254; text-align:center; width:100%; font-size:10px; height:30px; background:#fdffd9; padding:2px 0;z-index:1000;}
|
||||
a.green_btn{ padding:2px 10px; background:#3caf3f; font-size:12px;color:#fff;-moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px;}
|
||||
a:hover.green_btn{ background:#289c2b;}
|
||||
a.update_close_btn{ background:url(images/floatbox/img_floatbox.png) -20px -35px no-repeat; display:block; width:16px; height:16px; float:right; margin:7px 5px 0 0;}
|
||||
a:hover.update_close_btn{ background:url(images/floatbox/img_floatbox.png) -20px -63px no-repeat;}
|
||||
</style>
|
||||
<script type="text/javascript" src="/javascripts/jquery.min.js"></script>
|
||||
<script type="text/javascript">
|
||||
//升级提示关闭
|
||||
function close_window(){
|
||||
$('#light').slideUp(400);
|
||||
cookiesave('closeStatue','true','','','');
|
||||
}
|
||||
|
||||
function cookiesave(n, v, mins, dn, path)
|
||||
{
|
||||
if(n)
|
||||
{
|
||||
|
||||
if(!mins) mins = 24 * 60;
|
||||
if(!path) path = "/";
|
||||
var date = new Date();
|
||||
|
||||
date.setTime(date.getTime() + (mins * 60 * 1000));
|
||||
|
||||
var expires = "; expires=" + date.toGMTString();
|
||||
|
||||
if(dn) dn = "domain=" + dn + "; ";
|
||||
document.cookie = n + "=" + v + expires + "; " + dn + "path=" + path;
|
||||
|
||||
}
|
||||
}
|
||||
function cookieget(n)
|
||||
{
|
||||
var name = n + "=";
|
||||
var ca = document.cookie.split(';');
|
||||
for(var i=0;i<ca.length;i++) {
|
||||
var c = ca[i];
|
||||
while (c.charAt(0)==' ') c = c.substring(1,c.length);
|
||||
if (c.indexOf(name) == 0){
|
||||
return c.substring(name.length,c.length);}
|
||||
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
$(document).ready(function(){
|
||||
var closeStatue = false;
|
||||
var u = window.navigator.userAgent.toLocaleLowerCase(),
|
||||
msie = /(msie) ([\d.]+)/,
|
||||
chrome = /(chrome)\/([\d.]+)/,
|
||||
firefox = /(firefox)\/([\d.]+)/,
|
||||
safari = /(safari)\/([\d.]+)/,
|
||||
opera = /(opera)\/([\d.]+)/,
|
||||
ie11 = /(trident)\/([\d.]+)/,
|
||||
b = u.match(msie)||u.match(chrome)||u.match(firefox)||u.match(safari)||u.match(opera)||u.match(ie11);
|
||||
var browser = b[1];
|
||||
var version = parseInt(b[2]);
|
||||
if (b == null) {
|
||||
return { browser : "", version : "0" };
|
||||
}
|
||||
//test firefox
|
||||
if (browser == "firefox"&& cookieget('closeStatue') == false) {
|
||||
/* $("#update_info").html("您当前使用的是"+browser+"浏览器。"+"主版本号为:"+version); */
|
||||
cookiesave('closeStatue','true','','','');
|
||||
}
|
||||
if (browser == "msie" && version<= 8 && cookieget('closeStatue') == false) {
|
||||
cookiesave('closeStatue','false','','','');
|
||||
|
||||
}
|
||||
// test IE11
|
||||
if (browser == "trident" && version<= 7 && cookieget('closeStatue') == false) {
|
||||
/* return true; */
|
||||
cookiesave('closeStatue','true','','','');
|
||||
}
|
||||
if( cookieget('closeStatue') == 'false' )
|
||||
{
|
||||
$("#update_info").append("<div class='update' id='light'><span style='font-size: 14px;line-height:2.2;' id='browser_info'>您当前使用的是IE8浏览器或IE低版本浏览器,建议升级您的浏览器。</span><a href='#' onClick='close_window();' class='update_close_btn' ></a><div class='cl'></div></div>");
|
||||
}
|
||||
})
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body style=" height:1500px;">
|
||||
<div id="update_info"></div>
|
||||
</body>
|
||||
</html>
|
|
@ -3,6 +3,7 @@
|
|||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title><%=h html_title %></title>
|
||||
<%= render :partial => "layouts/point_browser" %>
|
||||
<meta name="description" content="<%= Redmine::Info.app_name %>" />
|
||||
<meta name="keywords" content="issue,bug,tracker" />
|
||||
<%= csrf_meta_tag %>
|
||||
|
|
|
@ -1,9 +1,7 @@
|
|||
<% @nav_dispaly_course_all_label = 1
|
||||
@nav_dispaly_forum_label = 1
|
||||
@nav_dispaly_course_label = nil
|
||||
@nav_dispaly_store_all_label = 1 %>
|
||||
<% course_model %>
|
||||
<% teacher_num = teacherCount(@course) %>
|
||||
<% student_num = studentCount(@course) %>
|
||||
<% is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,@course)) %>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
|
@ -15,353 +13,183 @@
|
|||
<meta name="keywords" content="issue,bug,tracker"/>
|
||||
<%= csrf_meta_tag %>
|
||||
<%= favicon %>
|
||||
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'application', 'nyan', :media => 'all' %>
|
||||
<%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %>
|
||||
<%= javascript_heads %>
|
||||
<%= javascript_include_tag "jquery.leanModal.min" %>
|
||||
<%= heads_for_theme %>
|
||||
<%= call_hook :view_layouts_base_html_head %>
|
||||
<%= stylesheet_link_tag 'public', 'leftside', 'courses'%>
|
||||
<%= javascript_include_tag "course","header" %>
|
||||
<!-- 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">
|
||||
<!--added by huang-->
|
||||
<div class="top-content">
|
||||
<table>
|
||||
<tr>
|
||||
<td class="info_font" style="width: 240px;" rowspan="2">
|
||||
<a href="http://<%= Setting.host_course%>" style="color: #15bccf;">
|
||||
<body>
|
||||
<div id="Container">
|
||||
<%= render :partial => 'layouts/new_header' %>
|
||||
<div class="cl"></div>
|
||||
|
||||
<div id="TopBar">
|
||||
<div class="topbar_info02 fl">
|
||||
<h2>
|
||||
<a href="http://<%= Setting.host_course%>" target="_blank" class="c_blue">
|
||||
<%= l(:label_courses_community)%>
|
||||
</a>
|
||||
</td>
|
||||
<td style="color: #15bccf">
|
||||
<strong>
|
||||
<%= l(:label_user_location) %> :
|
||||
</strong>
|
||||
</td>
|
||||
<td rowspan="2" width="250px">
|
||||
<div class="top-content-search">
|
||||
<script type="text/javascript">
|
||||
function regexName()
|
||||
{
|
||||
var name = $.trim($("#name").val());
|
||||
if(name.length == 0)
|
||||
{
|
||||
$("#project_name_span").text("<%= l(:label_search_conditions_not_null) %>");
|
||||
$("#project_name_span").css('color','#ff0000');
|
||||
$("#project_name_span").focus();
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#project_name_span").text("");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
function submitSerch()
|
||||
{
|
||||
if(regexName()){$("#course_search_form").submit();}
|
||||
}
|
||||
</script>
|
||||
<%= form_tag({:controller => 'courses', :action => 'search'},:id => "course_search_form", :method => :get) do %>
|
||||
<%= text_field_tag 'name', params[:name], :size => 20, :style => "float:left" %>
|
||||
<a href="#" onclick="submitSerch();" class="ButtonColor m3p10" style="float:left;padding-top: 3px; margin: 0px;padding-bottom:0px;" >
|
||||
<%= l(:label_search)%>
|
||||
</a>
|
||||
<br />
|
||||
<span id="project_name_span" style="float: left"></span>
|
||||
<%#= submit_tag l(:label_search), :class => "ButtonColor m3p10", :name => nil, :style => "float:left;padding-top: 3px; margin: 0px;padding-bottom:0px;" %>
|
||||
</h2>
|
||||
<p>
|
||||
<%= l(:label_user_location) %> :
|
||||
<%= link_to l(:field_homepage), home_path %>
|
||||
>
|
||||
<a href="http://<%= Setting.host_course%>">
|
||||
<%=l(:label_courses_management_platform)%>
|
||||
</a>
|
||||
>
|
||||
<%= link_to @course.name, nil %>
|
||||
</p>
|
||||
</div>
|
||||
<div class="search fl">
|
||||
<%= form_tag({:controller => 'courses', :action => 'search'},:id => "course_search_form", :method => :get, :class => "search_form") do %>
|
||||
<%= text_field_tag 'name', params[:name], :placeholder => "课程名称", :class => "search_text fl", :onkeyup => "regexName('#{l(:label_search_conditions_not_null)}');" %>
|
||||
<a href="#" onclick="submitSerch('<%= l(:label_search_conditions_not_null) %>');" class="search_btn fl f14 c_white" >
|
||||
<%= l(:label_search)%>
|
||||
</a>
|
||||
<br />
|
||||
<span id="project_name_span" style="float: left"></span>
|
||||
<% end %>
|
||||
</div>
|
||||
</div><!--TopBar end-->
|
||||
<div class="cl"></div>
|
||||
<div id="content">
|
||||
<div id="LSide" class="fl">
|
||||
<div class="project_info">
|
||||
<div class="pr_info_logo fl mr10 mb5">
|
||||
<!--<a href="#"><img src="images/courses/pic_courses.jpg" width="60" height="60" alt="logo" /></a>-->
|
||||
<% if get_avatar?(@course) %>
|
||||
<%= image_tag(url_to_avatar(@course), :width => "60", :height => "60") %>
|
||||
<% else %>
|
||||
<%= link_to image_tag('../images/avatars/course/course.jpg', :width => "60", :height => "60"), course_path(@course) %>
|
||||
<% end %>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<div class="pr_info_id fl mb5 f14">
|
||||
ID:<%= @course.id%>
|
||||
</div>
|
||||
<div class="pr_info_join fl">
|
||||
<% if is_teacher%>
|
||||
<%= link_to "<span class='pr_setting'></span>#{l(:button_configure)}".html_safe, {:controller => 'courses', :action => 'settings', :id => @course}, :class => "pr_join_a" %>
|
||||
<%= set_course_time @course%>
|
||||
<%= link_to "<span class='pr_copy'></span>#{l(:button_copy)}".html_safe, copy_course_course_path(@course.id), :class => "pr_join_a" %>
|
||||
<% else%>
|
||||
<%= join_in_course_header(@course, User.current) %>
|
||||
<% end%>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
|
||||
<td>
|
||||
<p class="top-content-list">
|
||||
<%= link_to l(:field_homepage), home_path %>
|
||||
>
|
||||
<a href="http://<%= Setting.host_course%>" class="link_other_item">
|
||||
<%=l(:label_courses_management_platform)%>
|
||||
<div >
|
||||
<a class="pr_info_name fl c_dark fb" href="courses/<%= @course.id%>" target="_blank">
|
||||
<%= @course.name %>
|
||||
<% if @course.is_public == 0%>
|
||||
<span class="img_private ">
|
||||
<%= l(:field_is_private)%>
|
||||
</span>
|
||||
<% end %>
|
||||
</a>
|
||||
>
|
||||
<%= link_to @course.name, nil %>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<!-- end -->
|
||||
<!--course page-->
|
||||
<div id="sidebar">
|
||||
<div class="spaceleft">
|
||||
<!--informations-->
|
||||
<div class="inf_user_image">
|
||||
<table>
|
||||
<tr>
|
||||
<td valign="top">
|
||||
<% if get_avatar?(@course) %>
|
||||
<%= image_tag(url_to_avatar(@course), :class => "avatar2") %>
|
||||
<% else %>
|
||||
<%= link_to image_tag('../images/avatars/course/course.jpg', :class => "avatar2"), course_path(@course) %>
|
||||
<% end %>
|
||||
<td>
|
||||
<table>
|
||||
<tr>
|
||||
<td class="info-course">
|
||||
<%= link_to @course.name,course_path(@course) %>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">
|
||||
<div id="join_in_course">
|
||||
<% if User.current.logged? %>
|
||||
<% if User.current.allowed_to?(:as_teacher,@course) %>
|
||||
<%= link_to l(:button_configure), {:controller => 'courses', :action => 'settings', :id => @course} %>
|
||||
<%= render :partial => 'courses/set_course_time', :locals => {:course => @course} %>
|
||||
<% else %>
|
||||
<%= join_in_course(@course, User.current) %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!--parameter-->
|
||||
<div class="user_fans">
|
||||
|
||||
<table width="240" border="0">
|
||||
<tr align="center" width="80px">
|
||||
<% files_count = @course.attachments.count %>
|
||||
|
||||
<td class="font_index">
|
||||
<!-- 1 教师; 2 学生;0 全部-->
|
||||
<% if User.current.member_of_course?(@course) %>
|
||||
<%= link_to "#{teacher_num}", course_member_path(@course, :role => 1), :course => '1' %>
|
||||
<% else %>
|
||||
<span>
|
||||
<%= teacher_num %>
|
||||
</span>
|
||||
<% end%>
|
||||
</td>
|
||||
<td class="font_index">
|
||||
<% if (User.current.logged? && @course.open_student == 1) || (User.current.member_of_course?(@course)) %>
|
||||
<%= link_to "#{student_num}", course_member_path(@course, :role => 2), :course => '1' %>
|
||||
<% else %>
|
||||
<span>
|
||||
<%= student_num %>
|
||||
</span>
|
||||
<% end %>
|
||||
</td>
|
||||
<td class="font_index">
|
||||
<%= link_to files_count, course_files_path(@course) %>
|
||||
</td>
|
||||
<tr class="font_aram">
|
||||
<td align="center" width="80px" id="teacherCount">
|
||||
<%= l(:label_x_base_courses_teacher, :count => teacher_num) %>
|
||||
</td>
|
||||
<td align="center" width="80px" id="studentCount">
|
||||
<%= l(:label_x_base_courses_student, :count => student_num) %>
|
||||
</td>
|
||||
<td align="center" width="80px">
|
||||
<%= l(:label_x_course_data, :count => files_count) %>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="user_underline"></div>
|
||||
</div>
|
||||
<!--info-->
|
||||
|
||||
<div class="inf_user_context">
|
||||
<table>
|
||||
|
||||
<!-- addedby bai 教师姓名加超链接、加入开课时间、结课时间与课时 -->
|
||||
<tr>
|
||||
<td valign="top" style="padding-left: 8px; width:62px">
|
||||
<%= l(:label_main_teacher) %> :
|
||||
</td>
|
||||
<td class="font_lighter_sidebar">
|
||||
<%= link_to(@course.teacher.lastname+@course.teacher.firstname, user_path(@course.teacher)) %>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="hidden">
|
||||
<td valign="top" style="padding-left: 8px;">
|
||||
<%= l(:label_setup_time) %> :
|
||||
</td>
|
||||
<td class="font_lighter_sidebar">
|
||||
<%= @course.setup_time %>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr class="hidden">
|
||||
<td valign="top" style="padding-left: 8px;">
|
||||
<%= l(:label_endup_time) %> :
|
||||
</td>
|
||||
<td class="font_lighter_sidebar">
|
||||
<%= @course.endup_time %>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td valign="top" style="padding-left: 8px;">
|
||||
<%= l(:label_class_period) %> :
|
||||
</td>
|
||||
<td class="font_lighter_sidebar">
|
||||
<%= @course.class_period %>
|
||||
<%= l(:label_class_hour) %>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td valign="top" style="padding-left: 8px;">
|
||||
<%= l(:label_main_term) %> :
|
||||
</td>
|
||||
<td class="font_lighter_sidebar">
|
||||
<%= @course.time %>
|
||||
<%= get_course_term_locales @course %>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- end -->
|
||||
|
||||
<% unless @course.teacher.user_extensions.nil? || @course.teacher.user_extensions.school.nil? %>
|
||||
<tr>
|
||||
<td valign="top" style="padding-left: 8px;">
|
||||
<%= l(:label_course_organizers) %> :
|
||||
</td>
|
||||
<td class="font_lighter_sidebar">
|
||||
<% if @course.school %>
|
||||
<a href="http://<%= Setting.host_course%>/?school_id=<%= @course.school.id%>">
|
||||
<%= @course.school %>
|
||||
</a>
|
||||
<% else%>
|
||||
|
||||
<% end %>
|
||||
</td>
|
||||
</tr>
|
||||
<% else %>
|
||||
<tr>
|
||||
<td valign="top" style="padding-left: 8px;">
|
||||
<%= l(:label_course_organizers) %> :
|
||||
</td>
|
||||
<td class="font_lighter_sidebar">
|
||||
<%= l(:field_course_un) %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</table>
|
||||
</div>
|
||||
<div class="user_underline"></div>
|
||||
<!--description-->
|
||||
<div class="inf_user_context">
|
||||
<div class="font_title_left">
|
||||
<%= l(:label_new_course_description) %>
|
||||
</div>
|
||||
<div style="padding-bottom: 8px">
|
||||
<% if @course.description && !@course.description.blank? %>
|
||||
<div class="font_lighter_sidebar" style="word-break:break-all; word-wrap:break-word;">
|
||||
<%= textilizable @course.description %>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="font_lighter_sidebar">
|
||||
<%= l(:label_course_description_no) %>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="created_on_course" style="padding-left: 10px;">
|
||||
<strong style="color: #068d9c">
|
||||
<%= l(:label_create_time) %>:
|
||||
</strong>
|
||||
<%= format_time(@course.created_at) %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<div class="pr_info_foot ">
|
||||
<%= l(:label_account_identity_teacher)%>(<%= course_teacher_link teacher_num %>)
|
||||
<span>| </span>
|
||||
<%= l(:label_account_identity_student)%>(<%= course_student_link student_num %>)
|
||||
<span>| </span>
|
||||
<%= l(:project_module_attachments)%>(<%= link_to @course.attachments.count, course_files_path(@course), :class => 'info_foot_num c_blue' %>)</div>
|
||||
<div class="cl"></div>
|
||||
</div><!--课程信息 end-->
|
||||
<div class="info_box">
|
||||
<ul>
|
||||
<li><%= l(:label_main_teacher)%> : <%= link_to(@course.teacher.lastname+@course.teacher.firstname, user_path(@course.teacher), :class => 'c_dblue') %></li>
|
||||
<li><%= l(:label_class_period)%> : <span ><%= @course.class_period %> <%= l(:label_class_hour) %></span></li>
|
||||
<li><%= l(:label_main_term)%> : <span><%= @course.time %> <%= @course.term %></span></li>
|
||||
<% if @course.school%>
|
||||
<li><%= l(:label_course_organizers)%> : <a href="http://<%= Setting.host_course%>/?school_id=<%= @course.school.id%>" target="_blank" class="c_dblue"><%= @course.school%></a></li>
|
||||
<% end%>
|
||||
</ul>
|
||||
</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 => @course, :object_flag => "9"} %>
|
||||
<div class="subNavBox">
|
||||
<div class="subNav">
|
||||
<%= link_to l(:label_activity), course_path(@course), :class => "f14 c_blue02" %>
|
||||
<!--暂时不显示课程动态数,优化后在显示-->
|
||||
<%= link_to "(#{course_activity_count @course})", course_path(@course), :class => "subnav_num c_orange"%>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="user_underline"></div>
|
||||
|
||||
<style type="text/css">
|
||||
.polls_btn{ height:33px;border-top:0 solid #15bed1; border-bottom:1px solid #15bed1;border-right:1px solid #cee6e6; width:224px; padding:7px 0 0 15px; }
|
||||
.polls_btn a{font-size:14px; color:#444444;font-weight:bold;}
|
||||
.polls_btn span{ color:#15bed1; font-size:12px; font-weight:normal;}
|
||||
.polls_btn a{ float:left;}
|
||||
.polls_n{float: left;background: #ff5d31;color: #fff;width: 32px;padding-left: 2px;height: 7px;padding-bottom: 5px;padding-top: 3px;margin-top: -4px;margin-left: 3px; }
|
||||
.polls_n p{ margin-top:-4px;}
|
||||
.cl{ clear:both; overflow:hidden; }
|
||||
</style>
|
||||
<div class="polls_btn">
|
||||
<!--<a href="#">问卷调查<span >(12)</span></a>-->
|
||||
<%= link_to l(:label_poll), poll_index_path(:polls_type => "Course", :polls_group_id => @course.id)%>
|
||||
<div class="polls_n">
|
||||
<p>NEW</p>
|
||||
</div>
|
||||
<div class="subNav">
|
||||
<%= link_to l(:label_homework), homework_course_path(@course), :class => "f14 c_blue02"%>
|
||||
<%= link_to "(#{@course.homeworks.count})", homework_course_path(@course), :class => "subnav_num c_orange"%>
|
||||
<%= link_to( "+#{l(:label_course_homework_new)}", new_homework_course_path(@course), :class => 'subnav_green c_white') if is_teacher %>
|
||||
</div>
|
||||
<div class="subNav">
|
||||
<%= link_to l(:label_course_news), course_news_index_path(@course), :class => "f14 c_blue02" %>
|
||||
<%= link_to "(#{@course.news.count})", course_news_index_path(@course), :class => "subnav_num c_orange"%>
|
||||
<%= link_to( "+#{l(:label_course_news_new)}", new_course_news_path(@course), :class => 'subnav_green c_white') if is_teacher %>
|
||||
</div>
|
||||
<div class="subNav">
|
||||
<%= link_to l(:label_course_file), course_files_path(@course), :class => "f14 c_blue02" %><%= link_to "(#{@course.attachments.count})", course_files_path(@course), :class => "subnav_num c_orange" %><%= link_to( "+#{l(:label_upload_files)}", course_files_path(@course), :class => 'subnav_green ml95 c_white') if is_teacher %>
|
||||
</div>
|
||||
<div class="subNav">
|
||||
<%= link_to l(:label_course_board), course_boards_path(@course), :class => "f14 c_blue02" %>
|
||||
<%= link_to "(#{@course.boards[0].topics.count})", course_boards_path(@course), :class => "subnav_num c_orange" %>
|
||||
<%= link_to( "+#{l(:label_message_new)}", new_board_message_path(@course.boards[0]), :class => 'subnav_green ml95 c_white') if User.current.member_of_course?(@course) %>
|
||||
</div>
|
||||
<div class="subNav">
|
||||
<%= link_to l(:label_course_feedback), course_feedback_path(@course), :class => "f14 c_blue02" %>
|
||||
<%= link_to "(#{course_feedback_count})", course_feedback_path(@course), :class => "subnav_num c_orange" %>
|
||||
</div>
|
||||
<div class="subNav">
|
||||
<%= link_to l(:label_poll), poll_index_path(:polls_type => "Course", :polls_group_id => @course.id), :class => " f14 c_blue02"%>
|
||||
<%= link_to "(#{course_poll_count})", poll_index_path(:polls_type => "Course", :polls_group_id => @course.id), :class => "subnav_num c_orange" %>
|
||||
<%= link_to( "+#{l(:label_new_poll)}", new_poll_path(:polls_type => "Course",:polls_group_id => @course.id), :class => 'subnav_green c_white') if is_teacher %>
|
||||
</div>
|
||||
</div><!--项目侧导航 end-->
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="content">
|
||||
<div class="tabs_new">
|
||||
<ul>
|
||||
<li>
|
||||
<%= link_to l(:label_course_overview), course_path(@course), :class => link_class(:overview) %>
|
||||
</li>
|
||||
<li>
|
||||
<%= link_to l(:label_homework), homework_course_path(@course), :class => link_class([:homework,:new_homework,:edit]), :course_type => 1 %>
|
||||
</li>
|
||||
<li>
|
||||
<%= link_to l(:label_course_file), course_files_path(@course), :class => link_class(:files) %>
|
||||
</li>
|
||||
<li>
|
||||
<%= link_to l(:label_course_news), course_news_index_path(@course), :class => link_class(:news) %>
|
||||
</li>
|
||||
<li>
|
||||
<%= link_to l(:label_course_board), {:controller => 'boards', :action => 'index', :course_id => @course}, :class => link_class(:boards) %>
|
||||
</li>
|
||||
<li>
|
||||
<%= link_to l(:label_course_feedback), course_feedback_path(@course), :class => link_class(:feedback) %>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<%= render_flash_messages %>
|
||||
<%= yield %>
|
||||
<%= call_hook :view_layouts_base_content %>
|
||||
<div style="clear:both;"></div>
|
||||
<!--gcm-->
|
||||
<div class="project_intro">
|
||||
<div id="course_description" class="course_description">
|
||||
<h4 ><%= l(:label_course_brief_introduction)%>:</h4>
|
||||
<div id="course_description_content">
|
||||
<%= textilizable(@course.description) if @course.description && !@course.description.blank? %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="lg-foot" id="lg-foot" onclick="show_more_msg();">
|
||||
<%= l(:label_expend_information)%>
|
||||
<span class="g-arr-down">
|
||||
<img src="/images/jiantou.jpg" width="12" height="6" />
|
||||
</span>
|
||||
</div>
|
||||
</div><!--项目简介 end-->
|
||||
<div class="project_Label">
|
||||
<h4 class="mb5" ><%= l(:label_tag)%>:</h4>
|
||||
<div class="tag_h" >
|
||||
<%= render :partial => 'tags/new_tag', :locals => {:obj => @course, :object_flag => "9"} %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div><!--项目标签 end-->
|
||||
</div><!--LSide end-->
|
||||
|
||||
</div>
|
||||
<!--gcm move it mistakenly-->
|
||||
<%= render :partial => 'layouts/base_footer' %>
|
||||
</div>
|
||||
<div id="RSide" class="fl">
|
||||
<%= render_flash_messages %>
|
||||
<%= yield %>
|
||||
<%= call_hook :view_layouts_base_content %>
|
||||
</div>
|
||||
|
||||
<div style="clear:both;"></div>
|
||||
|
||||
</div><!--Content end-->
|
||||
<div class="cl"></div>
|
||||
|
||||
<%= render :partial => 'layouts/new_footer' %>
|
||||
<div class="cl"></div>
|
||||
</div><!--Container end-->
|
||||
<%= render :partial => 'layouts/new_feedback' %>
|
||||
<div id="ajax-indicator" style="display:none;">
|
||||
<span>
|
||||
<%= l(:label_loading) %>
|
||||
</span>
|
||||
<span><%= l(:label_loading) %></span>
|
||||
</div>
|
||||
<div id="ajax-modal" style="display:none;"></div>
|
||||
</div>
|
||||
</div>
|
||||
<%= call_hook :view_layouts_base_body_bottom %>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
|
@ -12,11 +12,12 @@
|
|||
<meta name="keywords" content="issue,bug,tracker" />
|
||||
<%= csrf_meta_tag %>
|
||||
<%= favicon %>
|
||||
<%= javascript_include_tag "/assets/kindeditor/kindeditor" %>
|
||||
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'application', 'nyan', :media => 'all' %>
|
||||
<%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %>
|
||||
<%= javascript_heads %>
|
||||
<%= heads_for_theme %>
|
||||
<%= javascript_include_tag "ckeditor/ckeditor.js" %>
|
||||
|
||||
<%= call_hook :view_layouts_base_html_head %>
|
||||
<%= yield :header_tags -%>
|
||||
</head>
|
||||
|
@ -52,7 +53,7 @@
|
|||
<div class="sidebar-forums">
|
||||
<div class="forums-line">
|
||||
<div class="forums-title"><%= @forum.name %></div>
|
||||
<div class="forums-description"><%= textAreailizable @forum.description %></div>
|
||||
<div class="forums-description"><%= @forum.description %></div>
|
||||
</div>
|
||||
<!--informations-->
|
||||
<div class="formus-first-title" >创建人信息</div>
|
||||
|
|
|
@ -178,7 +178,7 @@
|
|||
</tr>
|
||||
<tr>
|
||||
<td valign="top" colspan="2">
|
||||
<% options = {:author => true,:deletable => (@bid.author.id == User.current.id || User.current.admin? ? true : false),:wrap => true,:length => 7} %>
|
||||
<% options = {:author => true,:deletable => (@bid.author.id == User.current.id || User.current.admin? ? true : false),:wrap => true,:length => 15} %>
|
||||
<%= render :partial => 'attachments/links', :locals => {:attachments => @bid.attachments, :options => options} %>
|
||||
</td>
|
||||
</tr>
|
||||
|
|
|
@ -84,7 +84,7 @@
|
|||
<div class="sidebar-forums">
|
||||
<div class="forums-line">
|
||||
<div class="forums-title"><%= @forum.name %></div>
|
||||
<div class="forums-description"><%= textAreailizable @forum.description %></div>
|
||||
<div class="forums-description"><%= @forum.description %></div>
|
||||
</div>
|
||||
<!--informations-->
|
||||
<div class="formus-first-title" >创建人信息</div>
|
||||
|
|
|
@ -0,0 +1,49 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="<%= current_language %>">
|
||||
<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" />
|
||||
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'application', 'nyan', :media => 'all' %>
|
||||
<%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %>
|
||||
<%= javascript_include_tag "jquery.leanModal.min" %>
|
||||
<%= javascript_include_tag 'seems_rateable/jRating', 'seems_rateable/rateable'%>
|
||||
|
||||
<%= csrf_meta_tag %>
|
||||
<%= favicon %>
|
||||
<%= 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="nosidebar">
|
||||
<div id="content_">
|
||||
<%= render_flash_messages %>
|
||||
<%= yield %>
|
||||
<%= call_hook :view_layouts_base_content %>
|
||||
<div style="clear:both;"></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>
|
||||
</div>
|
||||
<%= call_hook :view_layouts_base_body_bottom %>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,45 @@
|
|||
<% course_model %>
|
||||
<!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 %>
|
||||
<%= javascript_heads %>
|
||||
<%= heads_for_theme %>
|
||||
<%= call_hook :view_layouts_base_html_head %>
|
||||
<%= stylesheet_link_tag 'public', 'leftside', 'courses'%>
|
||||
<%= javascript_include_tag "course","header" %>
|
||||
<!-- page specific tags -->
|
||||
<%= yield :header_tags -%>
|
||||
</head>
|
||||
<!--add by huang-->
|
||||
<body>
|
||||
<div id="Container">
|
||||
<%= render :partial => 'layouts/new_header' %>
|
||||
<div class="cl"></div>
|
||||
|
||||
<div id="content02" >
|
||||
<%= render_flash_messages %>
|
||||
<%= yield %>
|
||||
<%= call_hook :view_layouts_base_content %>
|
||||
</div><!--Content end-->
|
||||
<div class="cl"></div>
|
||||
|
||||
<%= render :partial => 'layouts/new_footer' %>
|
||||
<div class="cl"></div>
|
||||
</div><!--Container end-->
|
||||
<%= render :partial => 'layouts/new_feedback' %>
|
||||
<div id="ajax-indicator" style="display:none;">
|
||||
<span><%= l(:label_loading) %></span>
|
||||
</div>
|
||||
<div id="ajax-modal" style="display:none;"></div>
|
||||
<%= call_hook :view_layouts_base_body_bottom %>
|
||||
</body>
|
||||
|
||||
</html>
|
|
@ -3,12 +3,12 @@
|
|||
<%= f.hidden_field :forum_id, :required => true, value: @memo.forum_id %>
|
||||
<%= f.hidden_field :parent_id, :required => true, value: @memo.id %>
|
||||
<div id="message_quote" class="wiki"></div>
|
||||
|
||||
<%= hidden_field_tag :asset_id,params[:asset_id],:required => false,:style => 'display:none' %>
|
||||
<%= hidden_field_tag :quote,"",:required => false,:style => 'display:none' %>
|
||||
<%= label_tag(l(:label_reply_plural)) %>:
|
||||
<!-- <p> < %= f.text_area :content, :required => true, :size => "75%", :resize => "none", id: 'editor01' %> </p> -->
|
||||
<%= f.text_area :content, :cols => 80, :rows => 15, :class => 'wiki-edit', :id => 'editor01', :value => @content %>
|
||||
<script type="text/javascript">var ckeditor=CKEDITOR.replace('editor01');</script>
|
||||
<%= f.kindeditor :content, :cols => 80, :rows => 15, :value => @content %>
|
||||
<!--<script type="text/javascript">var ckeditor=CKEDITOR.replace('editor01');</script> -->
|
||||
<p>
|
||||
<%= l(:label_attachment_plural) %>
|
||||
<br />
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
<%= labelled_form_for(@memo, :url => forum_memos_path) do |f| %>
|
||||
|
||||
<div class="actions" style="max-width:680px">
|
||||
<%= hidden_field_tag :asset_id,params[:asset_id],:required => false,:style => 'display:none' %>
|
||||
<p><%= f.text_field :subject, :required => true, :size => 95 %></p>
|
||||
<p style="max-width:680px"><%= f.text_area :content, :required => true, :id => 'editor01' %></p>
|
||||
<script type="text/javascript">var ckeditor=CKEDITOR.replace('editor01');</script>
|
||||
<p style="max-width:680px"><%= f.kindeditor :content, :required => true %></p>
|
||||
<!--<script type="text/javascript">var ckeditor=CKEDITOR.replace('editor01');</script> -->
|
||||
<br/>
|
||||
|
||||
<p>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<!-- <h1>New memo</h1> -->
|
||||
<% @replying = !@memo.parent.nil? %>
|
||||
|
||||
<%= javascript_include_tag "/assets/kindeditor/kindeditor" %>
|
||||
<h3><%=l(:label_memo_edit)%></h3>
|
||||
<%= labelled_form_for(@memo, :url => forum_memo_path(@memo.forum_id, @memo)) do |f| %>
|
||||
<% if @memo.errors.any? %>
|
||||
|
@ -40,9 +40,9 @@
|
|||
</p>
|
||||
<% end %>
|
||||
<p>
|
||||
<%= f.text_area :content, :required => true, :size => 80, id: 'editor01' %>
|
||||
<%= f.kindeditor :content, :required => true, :size => 80,:owner_id => @memo.id,:owner_type => 1 %>
|
||||
</p>
|
||||
<script type="text/javascript">var ckeditor=CKEDITOR.replace('editor01');</script>
|
||||
<!-- <script type="text/javascript">var ckeditor=CKEDITOR.replace('editor01');</script> -->
|
||||
<p>
|
||||
<%= l(:label_attachment_plural) %>
|
||||
<br />
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
@nav_dispaly_main_contest_label = 1 %>
|
||||
<% @nav_dispaly_forum_label = 1%>
|
||||
<!-- <h1>New memo</h1> -->
|
||||
<%= javascript_include_tag "ckeditor/ckeditor.js" %>
|
||||
<%= javascript_include_tag "/assets/kindeditor/kindeditor" %>
|
||||
<div class="top-content">
|
||||
<table>
|
||||
<tr>
|
||||
|
|
|
@ -4,10 +4,11 @@
|
|||
margin-bottom: 13px;
|
||||
}
|
||||
</style>
|
||||
<%= javascript_include_tag "/assets/kindeditor/kindeditor" %>
|
||||
<div class="lz">
|
||||
<!-- 在这里添加赞和踩-->
|
||||
<span id="praise_tread" style="float: right"> <%= render :partial => "/praise_tread/praise_tread",:locals => {:obj => @memo,:show_flag => true,:user_id =>User.current.id,:horizontal => true}%> </span>
|
||||
<div class="lz-left">
|
||||
<div class="lz-left">
|
||||
<div>
|
||||
<%= link_to image_tag(url_to_avatar(@memo.author), :class => "avatar"), user_path(@memo.author) %>
|
||||
</div>
|
||||
|
@ -30,7 +31,7 @@
|
|||
:remote => true,
|
||||
:method => 'get',
|
||||
:title => l(:button_quote)
|
||||
)if !@memo.locked? && User.current.logged? %>
|
||||
)if !@memo.locked? && User.current.logged? %>
|
||||
|
||||
<%= link_to(
|
||||
#image_tag('edit.png'),
|
||||
|
@ -64,7 +65,7 @@
|
|||
</div>
|
||||
<div class="memo-content" id="memo-content_div">
|
||||
<%= textAreailizable(@memo,:content) %>
|
||||
<p>
|
||||
<p>
|
||||
<% if @memo.attachments.any?%>
|
||||
<% options = {:author => true, :deletable => @memo.deleted_attach_able_by?(User.current) } %>
|
||||
<%= render :partial => 'attachments/links', :locals => {:attachments => @memo.attachments, :options => options, :is_float => true} %>
|
||||
|
@ -100,7 +101,7 @@
|
|||
:method => 'get',
|
||||
:title => l(:button_quote)
|
||||
)if !@memo.locked? && User.current.logged? %>
|
||||
|
||||
|
||||
<%= link_to(
|
||||
#image_tag('edit.png'),
|
||||
l(:button_edit),
|
||||
|
@ -120,7 +121,7 @@
|
|||
:method => :delete,
|
||||
:data => {:confirm => l(:text_are_you_sure)},
|
||||
:title => l(:button_delete)
|
||||
) if reply.destroyable_by?(User.current) %>
|
||||
) if reply.destroyable_by?(User.current) %>
|
||||
|
||||
</div>
|
||||
<br/>
|
||||
|
@ -146,7 +147,7 @@
|
|||
<%= authoring reply.created_at, reply.author %>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</table>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="pagination">
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue