Merge branch 'szzh' into dev_hjq

Conflicts:
	app/helpers/application_helper.rb
	app/helpers/files_helper.rb
	app/helpers/members_helper.rb
	app/models/journals_for_message.rb
	app/models/mailer.rb
	app/models/user.rb
	app/views/attachments/_form.html.erb
	app/views/bids/_new_homework_form.html.erb
	app/views/boards/_project_show.html.erb
	app/views/courses/_courses_jours.html.erb
	app/views/courses/feedback.html.erb
	app/views/courses/new_homework.html.erb
	app/views/courses/settings.html.erb
	app/views/issues/_list.html.erb
	app/views/issues/new.html.erb
	app/views/messages/_project_show.html.erb
	app/views/messages/edit.html.erb
	app/views/news/_project_news.html.erb
	app/views/projects/invite_members.html.erb
	app/views/projects/settings/_modules.html.erb
	app/views/projects/show.html.erb
	config/configuration.yml
	config/locales/zh.yml
	db/schema.rb
	public/assets/kindeditor/kindeditor.js
	public/javascripts/course.js
	public/stylesheets/courses.css
	public/stylesheets/public.css
This commit is contained in:
huang 2015-04-16 10:26:03 +08:00
commit 95c5e6ac83
189 changed files with 1679 additions and 1250 deletions

3
.gitignore vendored
View File

@ -23,3 +23,6 @@
public/api_doc/
/.metadata
vendor/cache
/files
/public/images/avatars
/public/files

View File

@ -26,7 +26,7 @@ module Mobile
present :data, {token: key.access_token, user: api_user}, using: Entities::Auth
present :status, 0
else
raise 'Unauthorized.'
raise "无效的用户名或密码"
end
end

View File

@ -80,7 +80,7 @@ module Mobile
end
post do
cs_params = {
memo: {:subject => params[:subject],:content => '该贴来自手机App意见反馈'},
memo: {:subject => '该贴来自手机App意见反馈' ,:content => params[:subject]},
}
cs = CommentService.new
memo,message = cs.create_feedback cs_params, current_user

View File

@ -80,6 +80,10 @@ module Mobile
class_period: params[:class_period]
}
course = ::Course.find(params[:course_id])
# 如果没有传密码过来,那就把原来的密码给上,不然会不更新
if params[:password].nil? || params[:password].blank?
cs_params[:course][:password] = course[:password]
end
cs.edit_course_authorize(current_user,course)
course = cs.edit_course(cs_params, course,current_user)
present :data, course, with: Mobile::Entities::Course

View File

@ -14,7 +14,7 @@ module Mobile
us = UsersService.new
user = us.register params.merge(:password_confirmation => params[:password],
:should_confirmation_password => true)
raise "register failed #{user.errors.full_messages}" if user.new_record?
raise "该邮箱已经被注册过了" if user.new_record?
present :data, user, with: Mobile::Entities::User
present :status, 0

View File

@ -58,6 +58,7 @@ module Mobile
end
course_expose :current_user_is_member
course_expose :current_user_is_teacher
course_expose :work_unit
end
end
end

View File

@ -15,13 +15,13 @@ module Mobile
when :img_url
url_to_avatar(u)
when :gender
u.user_extensions.gender.nil? ? 0 : u.user_extensions.gender
u.nil? || u.user_extensions.nil? || u.user_extensions.gender.nil? ? 0 : u.user_extensions.gender
when :work_unit
get_user_work_unit u
when :location
get_user_location u
when :brief_introduction
u.user_extensions.brief_introduction
u.nil? || u.user_extensions.nil? ? "" : u.user_extensions.brief_introduction
end
end
end

View File

@ -490,7 +490,7 @@ class BidsController < ApplicationController
(SELECT stars FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND is_teacher_score = 1 AND stars IS NOT NULL ORDER BY updated_at DESC limit 0,1) AS t_score,
(SELECT AVG(stars) FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND is_teacher_score = 0) AS s_score
FROM homework_attaches WHERE bid_id = #{@bid.id} ORDER BY s_score DESC,created_at ASC) AS table1
WHERE table1.t_score IS NULL")
WHERE table1.t_score IS NULL OR table1.t_score = 0")
@not_batch_homework = true
@cur_type = 1
else
@ -1035,11 +1035,12 @@ class BidsController < ApplicationController
def alert_anonymous_comment
@bid = Bid.find params[:id]
@course = @bid.courses.first
@cur_size = 0
@totle_size = 0
if @bid.comment_status == 0
@totle_size = searchStudent(@course).size
@cur_size = @bid.homeworks.size
elsif @bid.comment_status == 1
@totle_size = 0
@bid.homeworks.map { |homework| @totle_size += homework.homework_evaluations.count}
@cur_size = 0
@bid.homeworks.map { |homework| @cur_size += homework.rates(:quality).where("seems_rateable_rates.is_teacher_score = 0").count}

View File

@ -27,7 +27,7 @@ class CommentsController < ApplicationController
raise Unauthorized unless @news.commentable?
@comment = Comment.new
@comment.safe_attributes = params[:comment]
@project ? @comment.comments = params[:comment][:comments] : @comment.comments = params[:comment]
@comment.author = User.current
if @news.comments << @comment
if params[:asset_id]

View File

@ -1,5 +1,5 @@
class CoursesController < ApplicationController
layout 'base_courses'
# layout 'base_courses'
include CoursesHelper
include ActivitiesHelper
helper :activities
@ -73,6 +73,7 @@ class CoursesController < ApplicationController
if @course.errors.full_messages.count <= 0
respond_to do |format|
format.html {
# render :layout => 'base_courses'
flash[:notice] = l(:notice_successful_update)
redirect_to settings_course_url(@course)
}
@ -82,7 +83,7 @@ class CoursesController < ApplicationController
respond_to do |format|
format.html {
settings
render :action => 'settings'
redirect_to settings_course_url(@course)
}
format.api { render_validation_errors(@course) }
end
@ -407,6 +408,10 @@ class CoursesController < ApplicationController
@roles = Role.givable.all[3..5]
@members = @course.member_principals.includes(:roles, :principal).all.sort
respond_to do |format|
format.html { render :layout => 'base_courses' }
format.api { render_validation_errors(@course) }
end
else
render_403
end
@ -424,6 +429,7 @@ class CoursesController < ApplicationController
else
respond_to do |format|
format.html {
# render :layout => 'base_courses'
flash[:notice] = l(:notice_successful_create)
if params[:continue]
redirect_to new_course_url(attrs, :course => '0')
@ -681,9 +687,10 @@ class CoursesController < ApplicationController
"show_course_files" => true,
"show_course_news" => true,
"show_course_messages" => true,
"show_course_journals_for_messages" => true,
#"show_course_journals_for_messages" => true,
"show_bids" => true,
"show_homeworks" => true
"show_homeworks" => true,
#"show_polls" => true
}
@date_to ||= Date.today + 1
@date_from = (@date_to - @days) > @course.created_at.to_date ? (@date_to - @days) : @course.created_at.to_date
@ -737,7 +744,7 @@ class CoursesController < ApplicationController
@user = User.find_by_id(CourseInfos.find_by_course_id(@course.id).user_id)
end
sorted_events = sort_activity_events_course(events);
sorted_events = sort_activity_events_course(events)
events = paginateHelper sorted_events,10
@events_by_day = events.group_by {|event| User.current.time_to_date(event.event_datetime)}
# documents

View File

@ -23,7 +23,7 @@ class FilesController < ApplicationController
before_filter :auth_login1, :only => [:index]
before_filter :logged_user_by_apptoken,:only => [:index]
before_filter :find_project_by_project_id#, :except => [:getattachtype]
before_filter :authorize, :except => [:getattachtype,:quote_resource_show,:search,:search_project,:quote_resource_show_project]
before_filter :authorize, :except => [:getattachtype,:quote_resource_show,:search,:search_project,:quote_resource_show_project,:search_tag_attachment]
helper :sort
include SortHelper
@ -51,6 +51,7 @@ class FilesController < ApplicationController
@sort = ""
@order = ""
@is_remote = true
@q = params[:name].strip
if params[:sort]
order_by = params[:sort].split(":")
@sort = order_by[0]
@ -60,19 +61,26 @@ class FilesController < ApplicationController
sort = "#{@sort} #{@order}"
end
# show_attachments [@course]
begin
q = "%#{params[:name].strip}%"
#(redirect_to stores_url, :notice => l(:label_sumbit_empty);return) if params[:name].blank?
if params[:insite]
@result = find_public_attache q,sort
@result = visable_attachemnts_insite @result,@course
@searched_attach = paginateHelper @result,10
if q == "%%"
@result = []
@searched_attach = paginateHelper @result,10
else
@result = find_public_attache q,sort
@result = visable_attachemnts_insite @result,@course
@searched_attach = paginateHelper @result,10
end
else
@result = find_course_attache q,@course,sort
@result = visable_attachemnts @result
@searched_attach = paginateHelper @result,10
@tag_list = attachment_tag_list @result
end
#rescue Exception => e
# #render 'stores'
# redirect_to search_course_files_url
@ -273,6 +281,8 @@ class FilesController < ApplicationController
show_attachments @containers
@tag_list = attachment_tag_list @all_attachments
render :layout => 'base_courses'
end
@ -346,6 +356,27 @@ class FilesController < ApplicationController
Mailer.run.attachments_added(attachments[:files])
end
if params[:course_attachment_type] && params[:course_attachment_type] != "5"
case params[:course_attachment_type]
when "1"
tag_name = l(:label_courseware)
when "2"
tag_name = l(:label_software)
when "3"
tag_name = l(:label_media)
when "4"
tag_name = l(:label_code)
else
tag_name = ""
end
if !attachments.empty? && attachments[:files] && tag_name != ""
attachments[:files].each do |attachment|
attachment.tag_list.add(tag_name)
attachment.save
end
end
end
# TODO: 临时用 nyan
sort_init 'created_on', 'desc'
sort_update 'created_on' => "#{Attachment.table_name}.created_on",
@ -489,8 +520,31 @@ class FilesController < ApplicationController
format.html
end
end
end
#查找指定TAG的按条件过滤的资源列表只有课程内搜索有此功能
def search_tag_attachment
@q,@tag_name,@order = params[:q],params[:tag_name]
@is_remote = true
if params[:sort]
order_by = params[:sort].split(":")
@sort = order_by[0]
if order_by.count > 1
@order = order_by[1]
end
sort = "#{@sort} #{@order}"
end
q = "%#{@q.strip}%"
@result = find_course_attache q,@course,sort
@result = visable_attachemnts @result
@result = @result.select{|attachment| attachment.tag_list.include?(@tag_name)}
@searched_attach = paginateHelper @result,10
@tag_list = attachment_tag_list @result
respond_to do |format|
format.js
# format.html
end
end
end

View File

@ -22,6 +22,7 @@ class HomeworkAttachController < ApplicationController
#获取未批作业列表
def get_not_batch_homework
@not_batch_homework = true
@search_name = params[:name]
sort, direction = params[:sort] || "s_socre", params[:direction] || "desc"
get_not_batch_homework_list sort,direction, @bid.id
@cur_page = params[:page] || 1
@ -39,6 +40,7 @@ class HomeworkAttachController < ApplicationController
#获取已评作业列表
def get_batch_homeworks
@search_name = params[:name]
sort, direction = params[:sort] || "s_socre", params[:direction] || "desc"
@is_batch_homeworks = true
if sort == 't_socre'
@ -49,11 +51,12 @@ class HomeworkAttachController < ApplicationController
order_by = "created_at #{direction}"
end
all_homework_list = HomeworkAttach.eager_load(:attachments,:user,:rate_averages).find_by_sql("SELECT * FROM (SELECT homework_attaches.*,
(SELECT stars FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND is_teacher_score = 1 AND stars IS NOT NULL ORDER BY updated_at DESC limit 0,1) AS t_score,
(SELECT stars FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND is_teacher_score = 1 AND stars IS NOT NULL AND stars > 0 ORDER BY updated_at DESC limit 0,1) AS t_score,
(SELECT AVG(stars) FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND is_teacher_score = 0) AS s_score
FROM homework_attaches WHERE bid_id = #{@bid.id}
ORDER BY #{order_by}) AS table1
WHERE table1.t_score IS NOT NULL")
all_homework_list = search_homework_member(all_homework_list,@search_name.to_s.downcase) if @search_name
@cur_page = params[:page] || 1
@cur_type = 2
@homework_list = paginateHelper all_homework_list,10
@ -72,6 +75,7 @@ class HomeworkAttachController < ApplicationController
#获取所有作业列表
def get_homeworks
@is_all_homeworks = true
@search_name = params[:name]
sort, direction = params[:sort] || "s_socre", params[:direction] || "desc"
if sort == 't_socre'
order_by = "t_score #{direction}"
@ -85,6 +89,8 @@ class HomeworkAttachController < ApplicationController
(SELECT AVG(stars) FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND is_teacher_score = 0) AS s_score
FROM homework_attaches WHERE bid_id = #{@bid.id}
ORDER BY #{order_by}")
all_homework_list = search_homework_member(all_homework_list,@search_name.to_s.downcase) if @search_name
@cur_page = params[:page] || 1
@cur_type = 3
@homework_list = paginateHelper all_homework_list,10
@ -477,7 +483,7 @@ class HomeworkAttachController < ApplicationController
get_not_batch_homework_list params[:cur_sort] || "s_socre",params[:cur_direction] || "desc",@homework.bid_id
elsif @cur_type == "2" #老师已批列表
@result_homework = HomeworkAttach.find_by_sql("SELECT homework_attaches.*,
(SELECT stars FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND is_teacher_score = 1 AND stars IS NOT NULL ORDER BY updated_at DESC limit 0,1) AS t_score,
(SELECT stars FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND is_teacher_score = 1 AND stars IS NOT NULL AND stars > 0 ORDER BY updated_at DESC limit 0,1) AS t_score,
(SELECT AVG(stars) FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND is_teacher_score = 0) AS s_score
FROM homework_attaches WHERE id = #{@homework.id}").first
elsif @cur_type == "3" #全部作业列表
@ -538,6 +544,14 @@ class HomeworkAttachController < ApplicationController
end
private
#根据条件过滤作业结果
def search_homework_member homeworks,name
select_homework = homeworks.select{ |homework|
homework.user[:login].to_s.downcase.include?(name) || homework.user.user_extensions[:student_id].to_s.downcase.include?(name) || (homework.user[:lastname].to_s.downcase + homework.user[:firstname].to_s.downcase).include?(name)
}
select_homework
end
#验证是否显示课程
def can_show_course
@first_page = FirstPage.find_by_page_type('project')
@ -596,7 +610,8 @@ class HomeworkAttachController < ApplicationController
(SELECT AVG(stars) FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND is_teacher_score = 0) AS s_score
FROM homework_attaches WHERE bid_id = #{bid_id}
ORDER BY #{order_by}) AS table1
WHERE table1.t_score IS NULL")
WHERE table1.t_score IS NULL OR table1.t_score = 0 ")
@all_homework_list = search_homework_member(@all_homework_list,@search_name.to_s.downcase) if @search_name
@homework_list = paginateHelper @all_homework_list,10
end

View File

@ -192,16 +192,7 @@ class MessagesController < ApplicationController
@content = "> #{ll(Setting.default_language, :text_user_wrote, @message.author)}\n> "
@temp = Message.new
#@temp.content = "> #{ll(Setting.default_language, :text_user_wrote, @message.author)}> "
@content << @message.content.to_s.strip.gsub(%r{<pre>((.|\s)*?)</pre>}m, '[...]').gsub(/(\r?\n|\r\n?)/, "\n> ") + "\n\n"
@content_html = textilizable(@content)
@temp.content = @content_html
#@content = "#{ll(Setting.default_language, :text_user_wrote, @message.author)} <br/> &nbsp; "
#@content << @message.content.to_s.strip.gsub(%r{<pre>((.|\s)*?)</pre>}m, '[...]').gsub(/(\r?\n|\r\n?)/, "\n") + "</blockquote>\n\n<br/>"
#@content = "<blockquote>" << @content
#@temp = Message.new
#@temp.content = @content
@temp.content = "<blockquote>#{ll(Setting.default_language, :text_user_wrote, @message.author)} <br/>#{@message.content.html_safe}</blockquote>".html_safe
end
def preview

View File

@ -29,6 +29,9 @@ class SettingsController < ApplicationController
end
def edit
hidden_non_project = Setting.find_by_name("hidden_non_project")
@text = (hidden_non_project && hidden_non_project.value == "0") ? l(:label_show_non_project) : l(:label_hidden_non_project)
@notifiables = Redmine::Notifiable.all
if request.post? && params[:settings] && params[:settings].is_a?(Hash)
settings = (params[:settings] || {}).dup.symbolize_keys
@ -70,4 +73,20 @@ class SettingsController < ApplicationController
rescue Redmine::PluginNotFound
render_404
end
#隐藏/显示非项目信息
def hidden_non_project
@notifiable = Setting.find_by_name("hidden_non_project")
if @notifiable
@notifiable.value == "1" ? @notifiable.value = 0 : @notifiable.value = 1
@notifiable.save
else
@notifiable = Setting.new()
@notifiable.name = "hidden_non_project"
@notifiable.value = 0
@notifiable.save
end
redirect_to settings_url
end
end

View File

@ -438,13 +438,84 @@ class UsersController < ApplicationController
# Description 所有动态
where_condition = nil;
# where_condition = "act_type <> 'JournalsForMessage'"
user_ids = []
if @user == User.current
watcher = User.watched_by(@user)
watcher.push(User.current)
activity = Activity.where(where_condition).where('user_id in (?)', watcher).order('id desc')
user_ids = watcher.map{|x| x.id}
else
activity = Activity.where(where_condition).where('user_id = ?', @user.id).order('id desc')
user_ids << @user.id
end
activity = Activity.where(where_condition).where(user_id: user_ids).order('id desc')
permission = !User.current.admin?
if permission
#Issue
act_ids = activity.where(act_type: 'Issue').select('act_id').map{|x| x.act_id}
project_ids = Issue.where(id: act_ids).select('distinct project_id').map{|x| x.project_id}
p_ids = []
Project.where(id: project_ids).each do |x|
p_ids << x.id unless x.visible?(User.current)
end
ids = []
ids << Issue.where(id: act_ids, project_id: p_ids).map{|x| x.id}
#Bid
act_ids = activity.where(act_type: 'Bid').select('act_id').map{|x| x.act_id}
course_ids = HomeworkForCourse.where(bid_id: act_ids).select('distinct course_id').map{|x| x.course_id}
c_ids = []
Course.where(id: course_ids).each do |x|
c_ids << x.id unless x.is_public !=0 && User.current.member_of_course?(x)
end
ids << HomeworkForCourse.where(bid_id: act_ids, course_id: c_ids).map{|x| x.id}
#Journal
act_ids = activity.where(act_type: 'Journal').select('act_id').map{|x| x.act_id}
project_ids = Journal.where(id:act_ids, journalized_type: 'Project').select('distinct journalized_id').map{|x| x.journalized_id}
p_ids = []
Project.where(id: project_ids).each do |x|
p_ids << x.id unless x.visible?(User.current)
end
ids << Journal.where(id: act_ids, journalized_id: p_ids, journalized_type: 'Project').map{|x| x.id}
#News
act_ids = activity.where(act_type: 'News').select('act_id').map{|x| x.act_id}
project_ids = News.where(id: act_ids).select('distinct project_id').map{|x| x.project_id}
p_ids = []
Project.where(id: project_ids).each do |x|
p_ids << x.id unless x.visible?(User.current)
end
ids << News.where(id: act_ids, project_id: p_ids).map{|x| x.id}
project_ids = News.where(id: act_ids).select('distinct course_id').map{|x| x.course_id}
c_ids = []
Course.where(id: project_ids).each do |x|
c_ids << x.id unless x.is_public !=0 && User.current.member_of_course?(x)
end
ids << News.where(id: act_ids, course_id: p_ids).map{|x| x.id}
#Message
act_ids = activity.where(act_type: 'Message').select('act_id').map{|x| x.act_id}
board_ids = Message.where(id: act_ids).select('distinct board_id').map{|x| x.board_id}
project_ids = Board.where(id: board_ids).select('distinct project_id').map{|x| x.project_id}
p_ids = []
Project.where(id: project_ids).each do |x|
p_ids << x.id unless x.visible?(User.current)
end
ids << Message.where(id: act_ids, board_id: p_ids).map{|x| x.id}
project_ids = Board.where(id: board_ids).select('distinct course_id').map{|x| x.course_id}
c_ids = []
Course.where(id: project_ids).each do |x|
c_ids << x.id unless x.is_public !=0 && User.current.member_of_course?(x)
end
ids << Message.where(id: act_ids, board_id: c_ids).map{|x| x.id}
logger.debug "filter ids #{ids}"
activity = activity.where('act_id not in (?)', ids.flatten ).order('id desc') unless ids.flatten.empty?
end
# activity = activity.reject { |e|
# e.act.nil? ||
# (!User.current.admin? && !e.act.nil?
@ -454,14 +525,11 @@ class UsersController < ApplicationController
# (e.act_type == "News" && ((!e.act.project.nil? && !e.act.project.visible?(User.current)) || (!e.act.course.nil? && e.act.course.is_public == 0 && !User.current.member_of_course?(e.act.course)))) ||
# (e.act_type == "Message" && !e.act.board.nil? && ((!e.act.board.project.nil? && !e.act.board.project.visible?(User.current)) || (!e.act.board.course.nil? && e.act.board.course.is_public == 0 && !User.current.member_of_course?(e.act.board.course))))))
# }
#
@activity_count = activity.count
@activity_pages = Paginator.new @activity_count, pre_count, params['page']
@activity = activity.slice(@activity_pages.offset,@activity_pages.per_page)
# @activity = @activity.reject { |e|
# ((e.act_type=="Issue") && ( !e.act.visible?(User.current))) ||
# ((e.act_type == "Journal") && (!e.act.project.visible?(User.current))) ||
# ((e.act_type == "Bid") && ((!User.current.member_of_course?(e.act.courses.first) || !User.current.admin?)))
# }
@state = 0
end

View File

@ -150,9 +150,10 @@ module ApplicationHelper
def link_to_user_header user,canShowRealName=false,options={}
if user.is_a?(User)
if canShowRealName
name = h(user.realname(options[:format]))
name = user.show_name
name = user.login if name == ""
else
name = h(user.name(options[:format]))
name = user.login
end
link_to name, {:controller=> 'users', :action => 'show', id: user.id, host: Setting.user_domain}, :class => options[:class]
else
@ -343,7 +344,7 @@ module ApplicationHelper
onclick = "$('##{id}').slideToggle(); "
onclick << (options[:focus] ? "$('##{options[:focus]}').focus(); " : "this.blur(); ")
onclick << "return false;"
link_to(name, "#", :onclick => onclick,:class => options[:class])
link_to(name, "javascript:void(0)", :onclick => onclick,:class => options[:class])
end
def image_to_function(name, function, html_options = {})
@ -2040,6 +2041,8 @@ module ApplicationHelper
end
def bootstrap_render_dynamic_nav
hidden_non_project = Setting.find_by_name("hidden_non_project")
visiable = !(hidden_non_project && hidden_non_project.value == "0")
main_course_link = link_to l(:label_course_practice), {:controller => 'welcome', :action => 'index', :host => Setting.course_domain}
main_project_link = link_to l(:label_project_deposit), {:controller => 'welcome', :action => 'index', :host => Setting.project_domain}
@ -2059,23 +2062,23 @@ module ApplicationHelper
#@nav_dispaly_project_label
nav_list = Array.new
nav_list.push(school_all_school_link) if @nav_dispaly_course_all_label && @show_course == 1
nav_list.push(school_all_school_link) if @nav_dispaly_course_all_label && @show_course == 1 && visiable
# nav_list.push(course_all_course_link) if @nav_dispaly_course_all_label && @show_course == 1
nav_list.push(course_teacher_all_link) if @nav_dispaly_teacher_all_label && @show_course == 1
nav_list.push(course_teacher_all_link) if @nav_dispaly_teacher_all_label && @show_course == 1 && visiable
nav_list.push(main_project_link) if @nav_dispaly_main_project_label
nav_list.push(main_course_link) if @nav_dispaly_main_course_label && @show_course == 1
nav_list.push(main_contest_link) if @nav_dispaly_main_contest_label && @show_contest == 1
nav_list.push(main_course_link) if @nav_dispaly_main_course_label && @show_course == 1 && visiable
nav_list.push(main_contest_link) if @nav_dispaly_main_contest_label && @show_contest == 1 && visiable
nav_list.push(courses_link) if @nav_dispaly_course_label && @show_course == 1
nav_list.push(courses_link) if @nav_dispaly_course_label && @show_course == 1 && visiable
nav_list.push(project_new_link) if @nav_dispaly_project_label
# nav_list.push(project_mine_link) if @nav_dispaly_main_project_label
# nav_list.push(projects_link) if @nav_dispaly_project_label
#nav_list.push(users_link) if @nav_dispaly_user_label
# nav_list.push(contest_link) if @nav_dispaly_contest_label && @show_contest == 1
nav_list.push(bids_link) if @nav_dispaly_bid_label
nav_list.push(forum_link) if @nav_dispaly_forum_label
nav_list.push(stores_link) if @nav_dispaly_store_all_label
nav_list.push(bids_link) if @nav_dispaly_bid_label && visiable
nav_list.push(forum_link) if @nav_dispaly_forum_label && visiable
nav_list.push(stores_link) if @nav_dispaly_store_all_label && visiable
content_li = ''
nav_list.collect do |nav_item|

View File

@ -20,7 +20,7 @@ module CoursesHelper
# 返回教师数量即roles表中定义的Manager
def teacherCount project
project.members.count - studentCount(project).to_i
project ? project.members.count - studentCount(project).to_i : 0
# or
# searchTeacherAndAssistant(project).count
end
@ -52,7 +52,7 @@ module CoursesHelper
end
def course_poll_count
Poll.where("polls_type = 'Course' and polls_group_id = #{@course.id}").count
Poll.where("polls_type = 'Course' and polls_group_id = #{@course.id} and polls_status in (2,3)").count
end
def course_feedback_count
@ -152,7 +152,7 @@ module CoursesHelper
# 学生人数计算
# add by nwb
def studentCount course
course.student.count.to_s#course.student.count
course ? course.student.count.to_s : 0#course.student.count
end
#课程成员数计算
@ -233,10 +233,10 @@ module CoursesHelper
#searchPeopleByRoles(project, StudentRoles)
mems = []
if name != ""
name = name.to_s.downcase
members.each do |m|
username = m.user[:lastname].to_s + m.user[:firstname].to_s
if(m.user[:login].to_s.include?(name) || m.user.user_extensions[:student_id].to_s.include?(name) || username.include?(name))
username = m.user[:lastname].to_s.downcase + m.user[:firstname].to_s.downcase
if(m.user[:login].to_s.downcase.include?(name) || m.user.user_extensions[:student_id].to_s.downcase.include?(name) || username.include?(name))
mems << m
end
end
@ -632,48 +632,73 @@ module CoursesHelper
#获取课程动态
def get_course_activity courses, activities
@course_ids=activities.keys()
@bid_ids = []
days = Setting.activity_days_default.to_i
date_to ||= Date.today + 1
date_from = date_to - days-1.years
#原来课程动态计算当期时间前(一年+一月)的动态
# date_to ||= Date.today + 1
# #date_from = date_to - days-1.years
date_from = @course.created_at.to_date-days
#file_count
Attachment.where(container_id: @course_ids, container_type: Course).where("created_on>?", date_from).each do |attachment|
if attachment.is_public? || User.current.member_of_course?(@course) || User.current.admin?
activities[attachment.container_id]+=1
else
activities[attachment.container_id]
end
end
#message_count
#Board.where(course_id: @course_ids).each do |board|
# activities[board.course_id]+=board.messages.where("updated_on>?", date_from).count
#end
#message_count
Board.where(course_id: @course_ids).each do |board|
# activities[board.course_id]+=1
activities[board.course_id]+=board.messages.where("updated_on>?", date_from).count
countmessage = 0
# 课程人员退出课程后,之前在讨论区回帖不计入课程动态统计
board.messages.where("updated_on>?", date_from).each do |message|
if message.author.member_of_course?(@course)
countmessage+=1
end
end
activities[board.course_id]+=countmessage
end
#news
News.where(course_id: @course_ids).where("created_on>?",date_from).each do |news|
if news.author.member_of_course?(@course)
activities[news.course_id]+=1
end
end
#feedbackc_count
JournalsForMessage.where(jour_id: @course_ids, jour_type: Course).each do |jourformess|
activities[jourformess.jour_id]+=1
end
#feedback_count 留言目前有问题留待下一步处理
#JournalsForMessage.where(jour_id: @course_ids, jour_type: Course).each do |jourformess|
# activities[jourformess.jour_id]+=1
#end
#homework_count
#HomeworkForCourse.where(course_id: @course_ids).each do |homework|
# @bid_ids<<homework.bid_id
# activities[homework.bid_id]+=Bid.where(id: @bid_ids).where("created_on>?",date_from).count
#end
HomeworkForCourse.where(course_id: @course_ids).each do |homework|
countbid=0
# @bid_ids<<homework.bid_id
Bid.where(id: homework.bid_id).where("created_on>?",date_from).each do |bid|
countbid+=1
end
activities[homework.course_id]+=countbid
end
#@bid_ids.each do |bid_id|
# activities[] +=Bid.where(id: bid_id ).where("created_on>?",date_from).count
#end
#poll_count
#Poll.where(polls_group_id: @course_ids, polls_type: Course, polls_status: 2||3).where("published_at>?",date_from).each do |poll|
# activities[poll.polls_group_id]+=1
#end
#end
# 动态数 + 1 ( 某某创建了该课程 )
# activities.each_pair { |key, value| activities[key] = value + 1 }
activities.each_pair { |key, value| activities[key] = value + 1 }
return activities
end
@ -757,9 +782,10 @@ module CoursesHelper
end
def visable_attachemnts_incourse course
return[] unless course
result = []
course.attachments.each do |attachment|
if attachment.is_public? || User.current.member_of_course?(course)
if attachment.is_public? || User.current.member_of_course?(course) || User.current.admin?
result << attachment
end
end

View File

@ -120,6 +120,20 @@ module FilesHelper
result
end
def attachment_tag_list attachments
tag_list = Hash.new
attachments.each do |attachment|
attachment.tag_list.map{|tag| tag_list.has_key?(tag) ? tag_list[tag] = tag_list[tag] + 1 : tag_list[tag] = 1}
end
tag_list.sort {|a,b| b[1]<=>a[1]}
end
def get_attachments_by_tag attachments,tag
attachments.each do |attachment|
attachment.tag_list.include?(tag)
end
end
def visable_attachemnts_insite attachments,obj
result = []
if obj.is_a?(Course)

View File

@ -44,7 +44,11 @@ module MembersHelper
# add by nwb
# 课程可添加的成员列表
def render_principals_for_new_course_members(course)
scope = Principal.active.sorted.not_member_of_course(course).like(params[:q])
if params[:q] && params[:q] != ""
scope = Principal.active.sorted.not_member_of_course(course).like(params[:q])
else
scope = []
end
principals = paginateHelper scope,10
s = content_tag('ul', project_member_check_box_tags_ex('membership[user_ids][]', principals), :class => 'mb5', :id => 'principals')

View File

@ -278,4 +278,29 @@ module UsersHelper
end
}
end
#获取用户留言相关的连接
def user_jour_feed_back_url active
if active.act_type == "JournalsForMessage"
jour = JournalsForMessage.find active.act_id
if jour
case jour.jour_type
when "Principal"
link_to(l(:label_goto), user_newfeedback_user_path(jour.jour_id))
when "Project"
link_to(l(:label_goto), project_feedback_path(jour.jour_id))
when "Bid"
link_to(l(:label_goto), course_for_bid_path(jour.jour_id))
when "Course"
link_to(l(:label_goto), course_feedback_path(jour.jour_id))
when "Contest"
link_to(l(:label_goto), show_contest_contest_path(jour.jour_id))
when "Softapplication"
link_to(l(:label_goto), softapplication_path(jour.jour_id))
when "HomeworkAttach"
link_to(l(:label_goto), course_for_bid_path(jour.jour_id))
end
end
end
end
end

View File

@ -49,6 +49,7 @@ class JournalsForMessage < ActiveRecord::Base
acts_as_activity_provider :type => 'course_journals_for_messages',
:author_key => :user_id,
:permission => :view_course_journals_for_messages,
:timestamp => "#{self.table_name}.updated_on",
:find_options => {:include => :course }

View File

@ -66,8 +66,8 @@ class Mailer < ActionMailer::Base
subject = "[ #{user.show_name} : #{l(:label_day_mail)}]"
@subject = " #{user.show_name} : #{date_to} #{l(:label_day_mail)}"
date_from = "#{date_from} 23:59:59"
date_to = "#{date_to} 23:59:59"
date_from = "#{date_from} 17:59:59"
date_to = "#{date_to} 17:59:59"
# 生成token用于直接点击登录
@user = user
@ -122,11 +122,11 @@ class Mailer < ActionMailer::Base
end
end
# 查询user在课程中发布的通知项目中发的新闻
@course_news = News.find_by_sql("select DISTINCT n.* from news n
@course_news = (course_ids && !course_ids.empty?) ? News.find_by_sql("select DISTINCT n.* from news n
where n.course_id in (#{course_ids})
and (created_on between '#{date_from}' and '#{date_to}') order by created_on desc")
@project_news = News.find_by_sql("select DISTINCT n.* from news n where n.project_id in (#{project_ids})
and (created_on between '#{date_from}' and '#{date_to}') order by created_on desc")
and (created_on between '#{date_from}' and '#{date_to}') order by created_on desc") : []
@project_news = (project_ids && !project_ids.empty?) ? News.find_by_sql("select DISTINCT n.* from news n where n.project_id in (#{project_ids})
and (created_on between '#{date_from}' and '#{date_to}') order by created_on desc") : []
# 查询user在课程及个人中留言
@course_journal_messages = JournalsForMessage.find_by_sql("select DISTINCT * from journals_for_messages where
@ -775,9 +775,9 @@ class Mailer < ActionMailer::Base
end
end
elsif reps.is_a? String
u = User.find_by_mail(r)
u = User.find_by_mail(reps)
if u && u.mail_notification == 'all'
r_reps << r
r_reps << reps
end
end
r_reps

View File

@ -6,4 +6,23 @@ class Poll < ActiveRecord::Base
has_many :poll_questions, :dependent => :destroy,:order => "#{PollQuestion.table_name}.question_number"
has_many :poll_users, :dependent => :destroy
has_many :users, :through => :poll_users #该文件被哪些用户提交答案过
# 添加课程的poll动态
# has_many :acts, :class_name => 'Activity', :as => :act, :dependent => :destroy
# after_create :act_as_activity
# acts_as_event :title => Proc.new {|o| "#{l(:label_my_message)} ##{o.id}: #{o.name}" },
# :description => :description,
# :author => :author,
# :url => Proc.new {|o| {:controller => 'poll', :action => 'show', :id => o.id}}
# acts_as_activity_provider :type => 'polls',
# :permission => :view_course_polls,
#:find_options => {:include => [:course, :author]},
#:timestamp => "#{self.table_name}.published_at",
# :author_key => :author_id
# def act_as_activity
# self.acts << Activity.new(:user_id => self.user_id)
# end
end

View File

@ -42,7 +42,8 @@ class Principal < ActiveRecord::Base
where({})
else
pattern = "%#{q}%"
sql = %w(login firstname lastname mail).map {|column| "LOWER(#{table_name}.#{column}) LIKE LOWER(:p)"}.join(" OR ")
# sql = %w(login firstname lastname mail).map {|column| "LOWER(#{table_name}.#{column}) LIKE LOWER(:p)"}.join(" OR ")
sql= "LOWER(concat(lastname,firstname)) LIKE LOWER(:p) or LOWER(login) LIKE LOWER(:p) or LOWER(mail) LIKE LOWER(:p)"
params = {:p => pattern}
if q =~ /^(.+)\s+(.+)$/
a, b = "#{$1}%", "#{$2}%"

View File

@ -766,7 +766,7 @@ class User < Principal
# * nil with options[:global] set : check if user has at least one role allowed for this action,
# or falls back to Non Member / Anonymous permissions depending if the user is logged
def allowed_to?(action, context, options={}, &block)
if context && context.is_a?(Project)
if Project === context
return false unless context.allows_to?(action)
# Admin users are authorized for anything else
return true if admin?
@ -779,7 +779,7 @@ class User < Principal
(block_given? ? yield(role, self) : true)
}
#添加课程相关的权限判断
elsif context && context.is_a?(Course)
elsif Course === context
return false unless context.allows_to?(action)
# Admin users are authorized for anything else
return true if admin?

View File

@ -161,10 +161,15 @@ class CoursesService
#显示课程
def show_course(params,current_user)
course = Course.find(params[:id])
if course.school
work_unit = course.school.name
else
work_unit = get_user_work_unit course.teacher
end
unless (course.is_public == 1 || current_user.member_of_course?(course) || current_user.admin?)
raise '403'
end
{:course => course,:img_url => url_to_avatar(course),:current_user_is_member => current_user.member_of_course?(course),:current_user_is_teacher => is_course_teacher(current_user,course)}
{:course => course,:work_unit => work_unit, :img_url => url_to_avatar(course),:current_user_is_member => current_user.member_of_course?(course),:current_user_is_teacher => is_course_teacher(current_user,course)}
end
#创建课程
@ -340,7 +345,7 @@ class CoursesService
def course_dynamic(params,current_user)
@user = User.find(params[:id])
if !current_user.admin? && !@user.active?
if current_user.nil? && !current_user.admin? && !@user.active?
raise '404'
return
end
@ -429,7 +434,7 @@ class CoursesService
many_times = course.homeworks.index(bid) + 1
name = bid.name
homework_count = bid.homeworks.count #已提交的作业数量
student_questions_count = bid.commit.nil? ? 0 : bid.commit
student_questions_count = bid.journals_for_messages.where('m_parent_id IS NULL').count
description = bid.description
#if is_course_teacher(User.current, course) && @bid.open_anonymous_evaluation == 1 && @bid.homeworks.count >= 2
state = bid.comment_status
@ -449,7 +454,7 @@ class CoursesService
many_times = course.homeworks.index(bid) + 1
name = bid.name
homework_count = bid.homeworks.count #已提交的作业数量
student_questions_count = bid.commit.nil? ? 0 : bid.commit
student_questions_count = bid.journals_for_messages.where('m_parent_id IS NULL').count
description = bid.description
#if is_course_teacher(User.current, course) && @bid.open_anonymous_evaluation == 1 && @bid.homeworks.count >= 2
state = bid.comment_status

View File

@ -192,20 +192,22 @@ class UsersService
#raise @current_user.errors.full_message
#return @current_user
else
raise 'wrong password'
raise l(:notice_account_wrong_password,:locale => 'zh')
end
@current_user
end
#搜索用户
def search_user params
@status = params[:status] || 1
status = params[:status] || 1
has = {
"show_changesets" => true
}
scope = User.logged.status(@status)
@search_by = params[:search_by] ? params[:search_by] : "0"
scope = scope.like(params[:name],@search_by) if params[:name].present?
scope = User.logged.status(status)
watcher = User.watched_by(params[:user_id])
watcher.push(params[:user_id])
search_by = params[:search_by] ? params[:search_by] : "0"
scope = scope.where("id not in (?)",watcher).like(params[:name],search_by) if params[:name].present?
scope
end

View File

@ -1,11 +1,11 @@
<% if @status == 0%>
alert("您申请的项目不存在");
alert("<%= l('project.join.tips.notexist') %>");
<% elsif @status == 1%>
alert("请勿重复申请加入该项目");
alert("<%= l('project.join.tips.repeat') %>");
<% elsif @status == 2%>
alert("申请成功");
alert("<%= l('project.join.tips.success') %>");
<% elsif @status == 3%>
alert("您已加入该项目");
alert("<%= l('project.join.tips.has') %>");
<%else%>
alert("申请失败");
alert("<%= l('project.join.tips.fail') %>");
<%end%>

View File

@ -32,9 +32,6 @@
%>
<%#= render :partial => 'tags/tag', :locals => {:obj => attachment, :object_flag => "6"} %>
<%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %>
</span>
<% end %>
<% end %>
</span>
<script type='text/javascript'>

View File

@ -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 "浏览", :type=>"button", :onclick=>"_file.click()",:class =>"sub_btn",:style => ie8? ? 'display:none' : '' %>
<%= button_tag "#{l(:button_browse)}", :type=>"button", :onclick=>"_file.click()",:class =>"sub_btn",:style => ie8? ? 'display:none' : '' %>
<%= file_field_tag 'attachments[dummy][file]',
:id => '_file',
:class => 'file_selector',

View File

@ -25,13 +25,13 @@
</span>
<% project = project %>
<span class="add_attachment" style="font-weight:normal;">
<%= button_tag "文件浏览", :type=>"button", :onclick=>"_file.click()",:onmouseover => 'this.focus()',:class => 'sub_btn' %>
<%= button_tag l(:button_browse), :type=>"button", :onclick=>"_file.click()",:onmouseover => 'this.focus()',:class => 'sub_btn', :style => ie8? ? 'display:none' : '' %>
<%= file_field_tag 'attachments[dummy][file]',
:id => '_file',
:class => 'file_selector',
:class => ie8? ? '' : 'file_selector',
:multiple => true,
:onchange => 'addInputFiles(this);',
:style => 'display:none',
:style => ie8? ? '' : '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)),

View File

@ -58,54 +58,17 @@
function hidden_homework_atert_form(cur_page,cur_type)
{
hideModal($("#popbox"));
// 评了分的则刷新列表
// switch (cur_type)
// {
// case 1:
// $.ajax({
// type: "GET",
// url: "<%#= get_not_batch_homework_homework_attach_index_path(:bid_id => @bid.id)%>&page=" + cur_page,
// data: 'text',
// success: function (data) {
//
// }
// });
// break;
// case 2:
// $.ajax({
// type: "GET",
// url: "<%#= get_batch_homeworks_homework_attach_index_path(:bid_id => @bid.id)%>&page=" + cur_page,
// data: 'text',
// success: function (data) {
//
// }
// });
// break;
// case 3:
// $.ajax({
// type: "GET",
// url: "<%#= get_homeworks_homework_attach_index_path(:bid_id => @bid.id)%>&page=" + cur_page,
// data: 'text',
// success: function (data) {
//
// }
// });
// break;
// case 4:
// $.ajax({
// type: "GET",
// url: "<%#= get_student_batch_homework_homework_attach_index_path(:bid_id => @bid.id)%>&page=" + cur_page,
// data: 'text',
// success: function (data) {
//
// }
// });
// break;
// case 5:
// break;
// default :
// break;
// }
}
function search_homework_member(url)
{
$.get(
url,
{ name: $.trim($("#homework_member_search").val()) },
function (data) {
}
);
}
</script>
</div>

View File

@ -70,7 +70,7 @@
<div class="upload_box_" >
<h2 class="upload_box_tit">下载文件包太大,分成多个下载包</h2>
<ul class="upload_box_ul" >
<li><span class="upload_box_span" >1.</span> <a href="#">前20名学生的作业</a><span class="c_grey">&nbsp;&nbsp;共200M</span> </li>
<li><span class="upload_box_span" >1.</span> <a href="javascript:void(0)">前20名学生的作业</a><span class="c_grey">&nbsp;&nbsp;共200M</span> </li>
</ul>
<div class="cl"></div>
</div>

View File

@ -11,7 +11,7 @@
<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">
<li class="ml45 mb10">
<label class="fl" >&nbsp;&nbsp;<%= l(:field_quote)%>&nbsp;&nbsp;</label>
<!--<textarea name="bid[description]" placeholder="最多3000个汉字(或6000个英文字符)" class="hwork_text fl"></textarea>-->
<% if edit_mode %>
@ -45,7 +45,7 @@
<div class="cl"></div>
</li>
<li class=" ml90" >
<a class="blue_btn fl c_white" onclick="submit_new_bid('<%= bid_id%>');" href="#"><%= l(:button_create)%></a>
<a class="blue_btn fl c_white" onclick="submit_new_bid('<%= bid_id%>');" href="javascript:void(0)"><%= 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>

View File

@ -1,4 +1,4 @@
<%= javascript_include_tag "/assets/kindeditor/kindeditor" %>
<%= labelled_form_for @bid do |f| %>
<%= labelled_form_for @bid,:html => { :multipart => true } do |f| %>
<%= render :partial => 'new_homework_form', :locals => { :bid => @bid, :bid_id => "edit_bid_#{@bid.id}",:f=>f,:edit_mode => true} %>
<% end %>

View File

@ -1,9 +1,8 @@
<% if @statue == 1%>
alert('启动成功');
$("#<%= @bid.id %>_start_anonymous_comment").remove();
$("#<%= @bid.id %>_anonymous_comment").append('<%= link_to "关闭匿评", alert_anonymous_comment_bid_path(@bid), remote: true, id:"#{@bid.id}_stop_anonymous_comment" %>');
$("#<%= @bid.id %>_start_anonymous_comment").replaceWith('<%= escape_javascript(link_to "关闭匿评", alert_anonymous_comment_bid_path(@bid), remote: true, id:"#{@bid.id}_stop_anonymous_comment",:class => "fr mr10 work_edit")%>');
<% elsif @statue == 2 %>
alert('启动失败\n作业总数大于等于2份时才能启动匿评');
<% elsif @statue == 3%>
alert("已开启匿评,请务重复开启");
<% end %>
<% end %>

View File

@ -1,2 +1,2 @@
alert('关闭成功');
$("#<%= @bid.id %>_anonymous_comment").html('<a href="javascript:" style="background:#8e8e8e;">匿评结束</a>');
$("#<%= @bid.id %>_stop_anonymous_comment").replaceWith('<a class="fr pr_join_span mr10 span_wping_background" title="匿评结束">匿评结束</a>');

View File

@ -1,13 +1,7 @@
<script type="text/javascript">
function submitCoursesBoard()
{
if(regexSubject()&&regexContent()){$("#message-form").submit();}
}
</script>
<div id="add-message" class="add_frame" style="display:none;">
<% if User.current.logged? %>
<h3>
<%= link_to h(@board.name), course_board_path(@course, @board) %> &#187;
<%= link_to h(@board.name), course_board_path(@course, @board) %>
<%= l(:label_message_new) %>
</h3>
<div class="add_frame_header" >
@ -16,9 +10,8 @@
<%= form_for @message, :url => new_board_message_path(@board), :html => {:multipart => false, :id => 'message-form'} do |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>
<%= link_to l(:button_cancel), "#", :onclick => '$("#add-message").hide(); return false;' ,:class => 'ButtonColor m3p10' %>
<a href="javascript:void(0)" onclick="submitCoursesBoard();"class="ButtonColor m3p10"><%= l(:button_submit)%></a>
<%= link_to l(:button_cancel), "javascript:void(0)", :onclick => '$("#add-message").hide(); return false;' ,:class => 'ButtonColor m3p10' %>
</p>
<% end %>
<div id="preview" class="wiki"></div>
@ -39,7 +32,11 @@
</div>
<% end %>
<div class="talk_top ml15">
<p class="fl"><%= l(:label_totle) %><span><%= @topic_count %></span><%= l(:label_course_momes_count) %></p>
<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? %>
@ -52,7 +49,7 @@
<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>
<a href="javascript:void(0)" class="talk_up fr c_red">置顶</a>
<% end %>
<br/>
<p>由<%= link_to topic.author,user_path(topic.author),:class => "problem_name" %>添加于<%= format_time(topic.created_on) %></p>

View File

@ -12,6 +12,9 @@
</div>
<div id="add-message" class="talk_new ml15" style="display:<%= !@flag.nil?&&@flag=='true' ? '' : 'none' %>;">
<% if User.current.logged? %>
<div class="project_r_h">
<h2 class="project_h2"><%= l(:project_module_boards_post) %></h2>
</div>
<%= form_for @message, :url => new_board_message_path(@board), :html => {:multipart => true, :id => 'message-form'} do |f| %>
<%= render :partial => 'messages/form_project', :locals => {:f => f} %>
<p>
@ -38,10 +41,20 @@
<% end %>
<!-- 内容显示部分 -->
<div class="project_right">
<div class="project_r_h">
<h2 class="project_h2">
<% if User.current.language == "zh"%>
<%= h @board.name %>
<% else %>
<%= l(:project_module_boards) %>
<% end %>
</h2>
</div>
<div class="talk_top">
<div class="fl">项目讨论区共有<span><%= @topic_count %></span>个帖子 </div>
<% if @project.enabled_modules.where("name = 'boards'").count > 0 && User.current.member_of?(@project) %>
<span><%= link_to l(:label_message_new), new_board_message_path(@board),
<div class="fl"><span><%= l(:label_project_board_count , :count => @topic_count)%></span></div>
<% if @project.enabled_modules.where("name = 'boards'").count > 0 && User.current.member_of?(@project) %>
<span><%= link_to l(:project_module_boards_post), new_board_message_path(@board),
:class => 'problem_new_btn fl c_dorange',
:onclick => 'showAndScrollTo("add-message", "message_subject"); return false;' if User.current.logged? %></span>
<% end %>
@ -53,14 +66,18 @@
<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), board_message_path(@board, topic), title:topic.subject.to_s, :class =>"problem_tit fl" %>
<% if topic.sticky? %>
<span class="talk_up fl c_red">置顶</span>
<% end %>
<br/>
<p>由<%= link_to topic.author, user_path(topic.author), :class =>"problem_name c_orange" %>添加于<%= format_time topic.created_on %></p>
<div>
<span><%= link_to h(topic.subject), board_message_path(@board, topic), title:topic.subject.to_s, :class =>"problem_tit fl" %></span>
<% if topic.sticky? %>
<span class="talk_up" style="float:right;"><%= l(:label_board_sticky)%></span>
<% end %>
</div>
<div class="problem_line">
<span><%= l(:label_post_by)%><%= link_to topic.author, user_path(topic.author), :class =>"problem_name" %></span>
&nbsp;<span><%= l(:label_post_by_time)%><%= format_time topic.created_on %></span>
</div>
</div>
<%=link_to (l(:label_reply) + topic.replies_count.to_s), board_message_path(@board, topic),:class => "talk_btn fr c_white" %>
<span class="talk_btn fr"><%= link_to (l(:label_short_reply) + " "+topic.replies_count.to_s), board_message_path(@board, topic), :style =>"color:#fff;line-height: 18px;" %></span>
<div class="cl"></div>
</div><!--讨论主类容 end-->
<% end %>

View File

@ -1,6 +1,6 @@
<div class="st_list">
<div class="st_box">
<a href="#" class="fr fb mb5" >加入时间</a>
<a href="javascript:void(0)" class="fr fb mb5" >加入时间</a>
<div class="cl"></div><!--st_box_top end-->
<% members.each do |member| %>

View File

@ -12,11 +12,13 @@
<% else %>
<%= form_for('new_form', :method => :post,
:url => {:controller => 'words', :action => 'leave_course_message'},:html => {:id=>'leave_message_form'}) do |f|%>
<%= hidden_field_tag :asset_id,params[:asset_id],:required => false,:style => 'display:none' %>
<%= f.kindeditor 'course_message',:editor_id => 'leave_message_editor',:input_html=>{:id => "leave_meassge",:style => "resize: none;",
:placeholder => "#{l(:label_welcome_my_respond)}",:maxlength => 250}%>
<a href="#" class="grey_btn fr ml10">取&nbsp;&nbsp;消</a>
<a href="#" onclick='leave_message_editor.sync();$("#leave_message_form").submit();' class="blue_btn fr"> <%= l(:button_leave_meassge)%></a>
<%= hidden_field_tag :asset_id,params[:asset_id],:required => false,:style => 'display:none' %>
<%= f.kindeditor 'course_message',:height => '140px;',:editor_id => 'leave_message_editor',:input_html=>{:id => "leave_meassge",:style => "resize: none;",
:placeholder => "#{l(:label_welcome_my_respond)}",:maxlength => 250}%>
<a href="javascript:void(0)" class="grey_btn fr ml10 mt10">取&nbsp;&nbsp;消</a>
<a href="javascript:void(0)" onclick='leave_message_editor.sync();$("#leave_message_form").submit();' class="blue_btn fr mt10">
<%= l(:button_leave_meassge)%>
</a>
<% end %>
<% end %>
</div>

View File

@ -5,7 +5,7 @@
<div class="ping_dispic">
<%= link_to image_tag(url_to_avatar(journal.user),:width => '46',:height => '46'), user_path(journal.user) %>
</div>
<div class="ping_discon" style="width: 610px;">
<div class="ping_discon upload_img" 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>
@ -16,7 +16,7 @@
</span>
<div class="cl"></div>
<p>
<%= textilizable journal.notes%>
<%= journal.notes.html_safe %>
</p>
</div>
<div class="ping_disfoot">
@ -35,11 +35,6 @@
<% end %>
</div>
<div class="cl"></div>
<!--<span class="font_lighter" style="float: right">
<#%= l(:label_bids_published) %>&nbsp;
<#%= time_tag(journal.created_on).html_safe %>&nbsp;
<#%= l(:label_bids_published_ago) %>
</span>-->
<% ids = 'project_respond_form_'+ journal.id.to_s%>
<% if reply_allow %>
<div id='<%= ids %>' class="respond-form">

View File

@ -1,6 +1,6 @@
<% @members.each do |member| %>
<li >
<%= link_to_user_header member.principal,false,:class => "w150 c_orange fl" %>
<%= link_to_user_header member.principal,true,:class => "w150 c_orange fl" %>
<span class="w150 fl">
<%= h member.roles.sort.collect(&:to_s).join(', ') %>
<%= form_for(member, {:as => :membership, :remote => true, :url => membership_path(member),

View File

@ -26,9 +26,9 @@
<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>
<a id="pic" href="javascript:void(0)" class= "st_down"></a>
<% else %>
<a id="pic" href="#" class= "st_up"></a>
<a id="pic" href="javascript:void(0)" class= "st_up"></a>
<% end %>
</li>
<li class="ml50">

View File

@ -4,7 +4,7 @@
<div class="st_boxlist">
<% next if member.new_record? %>
<a href="#" class="st_img" style="float:left;"> <%= member.user.nil? ? '' : (image_tag(url_to_avatar(member.user), :width => 40, :height => 40)) %></a>
<a href="javascript:void(0)" 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">
<% if @canShowCode %>
<% if member.user.show_name == '' && member.user.user_extensions.student_id == '' %>

View File

@ -32,7 +32,7 @@
<a id="pic" href="javascript:" class= "st_up"></a>
<% end %>
</li>
<li class="ml50"><a href="#" >加入时间</a></li>
<li class="ml50"><a href="javascript:void(0)" >加入时间</a></li>
</ul>
<div class="cl"></div><!--st_box_top end-->

View File

@ -9,42 +9,4 @@
:locals => { :contest => @contest, :journals => @jour, :state => false}
%>
<% html_title(l(:label_user_response)) -%>
<script>
var W3CDOM = document.createElement && document.getElementsByTagName;
//window.onload = setMaxLength;
function setMaxLength() {
if (!W3CDOM) return;
var textareas = document.getElementsByTagName('textarea');
for (var i=0;i<textareas.length;i++) {
var textarea = textareas[i];
setMaxLengthItem(textareas[i]);
}
}
function setMaxLengthItem(textarea){
if (textarea.getAttribute('maxlength')) {
var counter = document.createElement('span');
counter.className = 'counter';
var counterClone = counter.cloneNode(true);
counterClone.innerHTML = '<span>0</span>/'+textarea.getAttribute('maxlength');
textarea.parentNode.insertBefore(counterClone,textarea.nextSibling);
textarea.relatedElement = counterClone.getElementsByTagName('span')[0];
textarea.onkeyup = textarea.onchange = checkMaxLength;
textarea.onkeyup();
}
}
function checkMaxLength() {
var maxLength = this.getAttribute('maxlength');
var currentLength = this.value.length;
if (currentLength > maxLength)
this.relatedElement.className = 'toomuch';
else
this.relatedElement.className = '';
this.relatedElement.firstChild.nodeValue = currentLength;
}
</script>
<% html_title(l(:label_course_feedback)) -%>

View File

@ -31,8 +31,8 @@
$(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">
<%= textAreailizable bid, :description %>
<div id="bid_description_<%= bid.id%>_content" class="upload_img">
<%= bid.description.html_safe %>
</div>
</div>
<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;">

View File

@ -1,16 +1,3 @@
<script src="/jquery.min.js"></script>
<script type="text/javascript" src="/javascripts/iPass.packed.js"></script>
<script type="text/javascript">
$(document).ready(function(){
// to enable iPass plugin
$("input[type=password]").iPass();
// for the demo
$("#psw_btn").click(function() {
alert("密码: "+$("#course_course_password").val());
})
});
</script>
<div class="project_r_h02">
<h2 class="project_h2"><%= l(:permission_new_course)%></h2>
</div>
@ -37,8 +24,9 @@
<div class="cl"></div>
<li class="ml45 mb10">
<label><span class="c_red">*</span>&nbsp;<%= l(:label_new_course_password)%>&nbsp;&nbsp;</label>
<input type="password" name="course[password]" id="course_course_password" class="hwork_input02" >
<a id="psw_btn" class="">显示明码</a>
<input type="text" style="display: none;">
<input type="password" name="course[password]" id="course_course_password" class="hwork_input02">
<a id="psw_btn" href="javascript:void(0)">显示明码</a>
<div class="cl"></div>
<span class=" ml80 c_orange">学生或其他成员申请加入课程时候需要使用该口令,该口令可以由老师在课堂上公布。</span>
</li>

View File

@ -1,4 +1,4 @@
<%= javascript_include_tag "/assets/kindeditor/kindeditor" %>
<%= labelled_form_for @homework, :url => {:controller => 'bids', :action => 'create_homework',:course_id => "#{params[:id] || params[:course_id]}"} do |f| %>
<%= labelled_form_for @homework, :html => { :multipart => true }, :url => {:controller => 'bids', :action => 'create_homework',:course_id => "#{params[:id] || params[:course_id]}"} do |f| %>
<%= render :partial => 'bids/new_homework_form', :locals => { :bid => @homework,:bid_id => "new_bid",:f => f,:edit_mode => false } %>
<% end %>

View File

@ -39,7 +39,8 @@
<div class="cl"></div>
<li class="ml45 mb10">
<label><span class="c_red">*</span>&nbsp;<%= l(:label_new_course_password)%>&nbsp;&nbsp;</label>
<input type="text" name="course[password]" id="course_course_password" class="hwork_input02" value="<%= @course.password%>">
<input type="password" name="course[password]" id="course_course_password" class="hwork_input02" value="<%= @course.password%>">
<a id="psw_btn" href="javascript:void(0)">显示明码</a>
<div class="cl"></div>
<span class=" ml80 c_orange">学生或其他成员申请加入课程时候需要使用该口令,该口令可以由老师在课堂上公布。</span>
</li>

View File

@ -9,14 +9,15 @@
<a class="problem_pic fl">
<%= image_tag(url_to_avatar(e.event_author), :width => "42", :height => "42") %>
</a>
<div class="problem_txt fl mt5">
<div class="problem_txt fl mt5 upload_img">
<%= 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"> &nbsp;</span>
<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"%>
<%= 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_type.eql?("bid") ? homework_course_path(@course) : e.event_url),:class => "problem_tit c_dblue fl fb"%>
<br />
<p class="mt5 break_word"><%= e.event_description %>
<p class="mt5 break_word"><%= e.event_description.html_safe %>
<br />
<%= l :label_activity_time %> <%= format_activity_day(day) %>&nbsp;<%= format_time(e.event_datetime, false) %>
</p>

View File

@ -22,10 +22,10 @@
</span>
</div>
<button name="button" class="sub_btn" onclick="_file.click()" onmouseover="this.focus()" type="button"><%= l(:label_browse)%></button>
<button name="button" class="sub_btn" onclick="_file.click()" onmouseover="this.focus()" style="<%= ie8? ? 'display:none' : ''%>" type="button" ><%= l(:label_browse) %></button>
<%= file_field_tag 'attachments[dummy][file]',
:id => '_file',
:class => 'file_selector',
:class => ie8? ? '':'file_selector',
:multiple => true,
:onchange => 'addInputFiles(this);',
:style => ie8? ? '': 'display:none',

View File

@ -1,15 +1,26 @@
<% attachmenttypes = @course.attachmenttypes %>
<% sufixtypes = @course.contenttypes %>
<!--<%#= stylesheet_link_tag 'resource', :media => 'all' %> -->
<script>
function show_upload()
function show_upload(obj)
{
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'upload_show',:locals => {:course => @course}) %>');
switch(obj)
{
case 1:
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'upload_show',:locals => {:course => @course,:course_attachment_type => 1}) %>');
break;
case 2:
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'upload_show',:locals => {:course => @course,:course_attachment_type => 2}) %>');
break;
case 3:
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'upload_show',:locals => {:course => @course,:course_attachment_type => 3}) %>');
break;
case 4:
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'upload_show',:locals => {:course => @course,:course_attachment_type => 4}) %>');
break;
default:
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'upload_show',:locals => {:course => @course,:course_attachment_type => 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').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");
}
@ -37,7 +48,6 @@
$('#incourse').attr("class", "re_schbtn b_lblue");
$('#insite').attr("class", "re_schbtn b_lblue");
}
</script>
<div class="container">
@ -49,7 +59,15 @@
<%= submit_tag "全站搜索", :class => "re_schbtn b_lblue",:name => "insite",:id => "insite",:onmouseover => "presscss('insite')",:onmouseout =>"buttoncss()" %>
<% end %>
<% 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>
<!--<a href="javascript:void(0)" class="re_fabu f_r b_lblue" onclick="show_upload();">上传资源</a>-->
<p class="c_grey fr mt10 mr5">
上传:
<a href="javascript:void(0);" class=" c_dblue" onclick="show_upload(1);">课件</a>&nbsp;|&nbsp;
<a href="javascript:void(0);" class=" c_dblue" onclick="show_upload(2);">软件</a>&nbsp;|&nbsp;
<a href="javascript:void(0);" class=" c_dblue" onclick="show_upload(3);">媒体</a>&nbsp;|&nbsp;
<a href="javascript:void(0);" class=" c_dblue" onclick="show_upload(4);">代码</a>&nbsp;|&nbsp;
<a href="javascript:void(0);" class=" c_dblue" onclick="show_upload(5);">其他</a>
</p>
<% end %>
</div><!---re_top end-->
<div class="cl"></div>

View File

@ -14,8 +14,18 @@
</p>
</div>
<div class="cl"></div>
<div class="files_tag">
<% unless @tag_list.nil?%>
<% @tag_list.each do |k,v|%>
<a href="javascript:void(0);" class="files_tag_icon" onclick="search_tag_attachment('<%= search_tag_attachment_course_files_path(@course)%>','<%= k%>','<%= @q%>','<%= course.id%>');"><%= k%><span class="c_red"><%= v%></span></a>
<% end%>
<% end%>
</div>
<div class="cl"></div>
<div class="for_img_thumbnails">
<% curse_attachments.sort.reverse.each do |file| %>
<% curse_attachments.each do |file| %>
<% if file.is_public? || User.current.member_of_course?(course) %>
<div class="re_con_box">
<div class="">
@ -46,8 +56,8 @@
</div>
<div class="cl"></div>
<div class="tag_h">
<%= render :partial => 'tags/tag_new', :locals => {:obj => file, :object_flag => "10"} %>
<%= render :partial => 'tags/tag_add', :locals => {:obj => file, :object_flag => "10"} %>
<%= render :partial => 'tags/tag_new', :locals => {:obj => file, :object_flag => "6"} %>
<%= render :partial => 'tags/tag_add', :locals => {:obj => file, :object_flag => "6"} %>
</div>
<div class="cl"></div>
</div><!---re_con_box end-->

View File

@ -7,7 +7,7 @@
<div id="network_issue" style="color: red; display: none;"><%= l(:label_file_upload_error_messages)%></div>
<%= form_tag(course_files_path(course), :multipart => true,:remote => !ie8?,:name=>"upload_form") do %>
<!-- <label style="margin-top:3px;"><#%= l(:label_file_upload)%></label> -->
<input type="hidden" name="course_attachment_type" value="<%= course_attachment_type%>">
<%= render :partial => 'attachement_list',:locals => {:course => course} %>
<div class="cl"></div>
<a href="javascript:void(0);" class=" fr grey_btn mr40" onclick="closeModal();"><%= l(:button_cancel)%></a>

View File

@ -0,0 +1 @@
$("#course_list").html("<%= escape_javascript(render :partial => 'course_list',:locals => {course: @course,all_attachments: @result,sort:@sort,order:@order,curse_attachments:@searched_attach})%>");

View File

@ -1,10 +1,10 @@
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'upload_show',:locals => {}) %>');
showModal('ajax-modal', '513px');
$('#ajax-modal').css('height','569px');
$('#ajax-modal').siblings().remove();
//$('#ajax-modal').before("<span style='float: right;cursor:pointer;padding-left: 513px;'>" +
// "<a href='#' onclick='hidden_homework_atert_form("+
// <#%= @cur_page%> + "," + <#%= @cur_type%> +
// ");'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
$('#ajax-modal').parent().css("top","").css("left","");
$('#ajax-modal').parent().addClass("alert_box");
//$('#ajax-modal').html('<%#= escape_javascript(render :partial => 'upload_show',:locals => {}) %>');
//showModal('ajax-modal', '513px');
//$('#ajax-modal').css('height','569px');
//$('#ajax-modal').siblings().remove();
////$('#ajax-modal').before("<span style='float: right;cursor:pointer;padding-left: 513px;'>" +
//// "<a href='#' onclick='hidden_homework_atert_form("+
// // <#%= @cur_page%> + "," + <#%= @cur_type%> +
//// ");'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
//$('#ajax-modal').parent().css("top","").css("left","");
//$('#ajax-modal').parent().addClass("alert_box");

View File

@ -16,7 +16,7 @@
</td>
</tr>
<tr>
<td style="word-break: break-all;word-wrap: break-word;">
<td style="word-break: break-all;word-wrap: break-word;" class="upload_img">
<p>
<%= textAreailizable forum.description%>
</p>

View File

@ -26,7 +26,10 @@
<tr>
<td align="left" colspan="2" ><span class="font_lighter"><%= authoring topic.created_at, topic.author %>
<span class="font_description2">
最后回复:<%=link_to_user topic.last_reply.try(:author) %>
<% author = topic.last_reply.try(:author)%>
<% if author%>
最后回复:<%=link_to_user author %>
<% end%>
</span>
<br />
</span></td>

View File

@ -5,7 +5,7 @@
<% 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></div>
<div class="ping_dispic"><a target="_blank" href="javascript:void(0)"><%= image_tag(url_to_avatar(journal.user)) %></a></div>
<div class="ping_discon" style="width: 85%;">
<div class="ping_distop">
<!-- <a style=" font-weight:bold; color:#15bccf; margin-right:30px; background:none;" target="_blank" href="#">gugu01</a> -->

View File

@ -11,9 +11,17 @@
(<font color="#CC0000">
<%= homework_count%>
</font>)
<%
url= get_batch_homeworks_homework_attach_index_path(:bid_id => @bid.id) if is_batch_homeworks
url= get_not_batch_homework_homework_attach_index_path(:bid_id => @bid.id) if not_batch_homework
url= get_homeworks_homework_attach_index_path(:bid_id => @bid.id) if is_all_homeworks
%>
<%= link_to l(:label_export_excel), get_batch_homeworks_homework_attach_index_path(:bid_id => @bid.id,:format => 'xls'),:class=>'xls' if is_batch_homeworks%>
<%= link_to l(:label_export_excel), get_not_batch_homework_homework_attach_index_path(:bid_id => @bid.id,:format => 'xls'),:class=>'xls' if not_batch_homework%>
<%= link_to l(:label_export_excel), get_homeworks_homework_attach_index_path(:bid_id => @bid.id,:format => 'xls'),:class=>'xls' if is_all_homeworks%>
<input type="text" id="homework_member_search" placeholder="昵称、学号、姓名搜索" class="min_search ml10" value="<%= @search_name%>" >
<a href="javascript:void(0)" class="member_search" onclick="search_homework_member('<%= url%>');">搜索</a>
</span>
<span class="fr">
按&nbsp;

View File

@ -28,7 +28,7 @@
}
else
{
$("#homework_attach_name_span").text("填写正确");
$("#homework_attach_name_span").text("<%= l(:label_field_correct)%>");
$("#homework_attach_name_span").css('color','#008000');
return true;
}

View File

@ -56,6 +56,7 @@
<div class="N_con">
<%= form_for(HomeworkAttach.new, :method => :post,
:name => 'new_form',
:html => { :multipart => true },
:url => {:controller => 'homework_attach',
:action => 'create',
:user_id => User.current.id,

View File

@ -9,7 +9,7 @@
:onclick => '$("#custom_query").slideToggle(400); ' if true || User.current.logged? %>
</span>
<% end %>
<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>
<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) %>

View File

@ -1,5 +1,5 @@
<div class="project_r_h" xmlns="http://www.w3.org/1999/html">
<h2 class="project_h2">问题跟踪</h2>
<h2 class="project_h2"><%= l(:label_issue_new) %></h2>
</div>
<%= call_hook(:view_issues_new_top, {:issue => @issue}) %>

View File

@ -1,5 +1,5 @@
<div class="project_r_h">
<h2 class="project_h2"><%= l(:label_issue_plural) %></h2>
<h2 class="project_h2"><%= l(:label_issue_edit) %></h2>
</div>
<% html_title "#{@issue.tracker.name} #{@issue.source_from}'#'#{@issue.project_index}: #{@issue.subject}" %>
<div class="pro_page_box">

View File

@ -173,7 +173,6 @@ function cookieget(n)
<% 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) %>白&nbsp;&nbsp;&nbsp;羽</a>
</div>
</div>

View File

@ -11,8 +11,10 @@
<ul style="padding:0 0; margin:0 0;display:inline;">
<li style="padding:0 0; margin:0 0;display:inline;border-bottom: 0;" class="loggedas_li">
<%=link_to_user(User.current)%>
<% hidden_non_project = Setting.find_by_name("hidden_non_project")
visiable = hidden_non_project && hidden_non_project.value == "0"%>
<ul class="sub_menu">
<% if @show_course == 1 %>
<% if @show_course == 1 && !visiable %>
<% if User.current.user_extensions && [UserExtensions::TEACHER, UserExtensions::STUDENT].include?(User.current.user_extensions.identity) -%>
<% hasCourse=false %>
<% User.current.courses.each do |course| %>

View File

@ -21,10 +21,6 @@
<% 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) %>
白&nbsp;&nbsp;&nbsp;羽

View File

@ -43,13 +43,13 @@
<%=l(:label_courses_management_platform)%>
</a>
>
<%= link_to @course.name, nil %>
<%= link_to @course.name, course_path(@course) %>
</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 => l(:label_course_name), :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" >
<a href="javascript:void(0)" onclick="submitSerch('<%= l(:label_search_conditions_not_null) %>');" class="search_btn fl f14 c_white" >
<%= l(:label_search)%>
</a>
<br />
@ -80,7 +80,7 @@
<div class="cl"></div>
<div >
<a class="pr_info_name fl c_dark fb" href="courses/<%= @course.id%>" target="_blank">
<a class="pr_info_name fl c_dark fb" href="http://<%= Setting.host_course%>/courses/<%= @course.id%>" target="_blank">
<%= @course.name %>
<% if @course.is_public == 0%>
<span class="img_private ">

View File

@ -53,7 +53,7 @@
<div class="sidebar-forums">
<div class="forums-line">
<div class="forums-title"><%= @forum.name %></div>
<div class="forums-description"><%= @forum.description %></div>
<div class="forums-description upload_img"><%= @forum.description.html_safe %></div>
</div>
<!--informations-->
<div class="formus-first-title" >创建人信息</div>

View File

@ -32,8 +32,13 @@
padding-left: 5px !important;
padding-right: 5px !important;
line-height: 1.9;
float: left;
}
.span_wping a:hover{ background-color:#03a1b3;}
.span_wping_background{background: #CCC !important;}
.font_lighter_sidebar img{max-width: 100%}
/*上传图片处理*/
.upload_img img{max-width: 100%;}
</style>
</head>
<body class="<%= h body_css_classes %>">
@ -119,7 +124,7 @@
<!--count-->
<div class="inf_user_image">
<table>
<table style="width: 100%;">
<% if (User.current.admin?||User.current.allowed_to?(:as_teacher,course)) %>
<tr>
<td valign="top" style="padding-left: 8px; font-size: 15px" colspan="2">
@ -131,7 +136,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:void(0)" style="background:#8e8e8e;">匿评结束</a>
<% end %>
</span>
<%end%>
@ -148,8 +153,8 @@
</tr>
<tr>
<td class="font_lighter_sidebar" colspan="2" style="padding-left: 8px;" title="<%= @bid.description %>">
<%= textilizable truncate(@bid.description, length: 200, omission: '...') %>
<td class="font_lighter_sidebar" colspan="2" style="padding-left: 8px;">
<div class="upload_img" style="width: 210px;"><%= @bid.description.html_safe %></div>
</td>
</tr>

View File

@ -84,7 +84,7 @@
<div class="sidebar-forums">
<div class="forums-line">
<div class="forums-title"><%= @forum.name %></div>
<div class="forums-description"><%= @forum.description %></div>
<div class="forums-description upload_img"><%= @forum.description.html_safe %></div>
</div>
<!--informations-->
<div class="formus-first-title" >创建人信息</div>

View File

@ -145,6 +145,7 @@
<%= f.text_area 'user_introduction', :rows => 3,
:cols => 65,
:placeholder => "#{l(:label_my_brief_introduction)}",
:maxlength => 200,
:style => "resize: none;",
:class => 'noline'%>
</td>
@ -172,7 +173,7 @@
<table style="font-family:'微软雅黑'" width="240">
<tr>
<td style=" float: right" width="70px">
<span style="float: right"> <%= l(:label_user_joinin) %></span>
<span style="float: right"> <%= l(:label_user_join) %></span>
</td>
<td class="font_lighter_sidebar" style="padding-left: 0px" width="170px">
<%= format_time(@user.created_on) %>

View File

@ -1,4 +1,4 @@
//ckeditor.setData("<%= raw escape_javascript(@content) %>");
$('#message_quote').html("<%= raw escape_javascript(@temp.content) %>");
$('#message_quote').html("<%= raw escape_javascript(@temp.content.html_safe) %>");
$('#quote').val("<%= raw escape_javascript(@content) %>");
showAndScrollTo("new_memo", "cke_editor01");

View File

@ -64,7 +64,7 @@
<%=h @memo.subject %>
</div>
<div class="memo-content" id="memo-content_div">
<%= textAreailizable(@memo,:content) %>
<%= @memo.content.html_safe %>
<p>
<% if @memo.attachments.any?%>
<% options = {:author => true, :deletable => @memo.deleted_attach_able_by?(User.current) } %>

View File

@ -6,7 +6,7 @@
<ul>
<%= form_for @message, :url => {:action => 'new'}, :html => {:multipart => true, :id => 'message-form'} do |f| %>
<%= render :partial => 'form_course', :locals => {:f => f,:is_new => true} %>
<a href="#" onclick="submitCoursesBoard();"class="blue_btn fl c_white"><%= l(:button_submit)%></a>
<a href="javascript:void(0)" onclick="submitCoursesBoard();"class="blue_btn fl c_white"><%= l(:button_submit)%></a>
<%#= preview_link({:controller => 'messages', :action => 'preview', :board_id => @board}, 'message-form' ,target='preview',{:class => 'blue_btn grey_btn fl c_white'} )%>
<%= link_to l(:button_cancel), course_boards_path(@course), :class => "blue_btn grey_btn fl c_white"%>
<% end %>

View File

@ -1,47 +1,22 @@
<script type="text/javascript">
// var flag = false;
// jQuery(document).ready(function($) {
// transpotUrl('#content');
// });
// function submit_message_replay()
// {
// regexContent();//onkeyup传给kindeditor用不上了所以只能放在这里
// if(flag)
// {
// message_content_editor.sync();//提交内容之前要sync不然服务器端取不到值
// $("#message_form").submit();
// }
// }
// function regexContent()
// {
// var content = message_content_editor.html();//$.trim($("#message_content").val());
// if(content.length ==0)
// {
// $("#message_content_span").text("<%= l(:label_reply_empty) %>");
// $("#message_content_span").css('color','#ff0000');
// flag = false;
// }
// else
// {
// $("#message_content_span").text("<%= l(:label_field_correct) %>");
// $("#message_content_span").css('color','#008000');
// flag = true;
// }
// }
</script>
<div class="project_r_h">
<h2 class="project_h2"><%= l(:label_board) %></h2>
<h2 class="project_h2">
<%= l(:label_board) %>
</h2>
</div>
<div class="problem_main">
<div class="ping_dispic"><%= link_to image_tag(url_to_avatar(@topic.author),:width => '46',:height => '46'), user_path(@topic.author) %></div>
<div class="talk_txt fl">
<p class="problem_tit fl fb" ><%= link_to @topic.subject, course_boards_path(@topic.course),title: @topic.subject.to_s %></p>
<br/>
<p>由<%= link_to_user_header @topic.author,false,:class=> 'problem_name' %> 添加于<%= format_time(@topic.created_on) %></p>
<div class="ping_dispic">
<%= link_to image_tag(url_to_avatar(@topic.author),:width => '46',:height => '46'), user_path(@topic.author) %>
</div>
<div class="talk_txt fl">
<p class="problem_tit fl fb" >
<%= link_to @topic.subject, course_boards_path(@topic.course),title: @topic.subject.to_s %>
</p>
<br/>
<p>
由<%= link_to_user_header @topic.author,false,:class=> 'problem_name' %>
添加于<%= format_time(@topic.created_on) %>
</p>
</div>
<!-- <a class="talk_edit fr">删除</a><a class="talk_edit fr">编辑</a><a class="talk_edit fr">置顶</a> -->
<%#= watcher_link(@topic, User.current) %>
<%= link_to(
l(:button_edit),
{:action => 'edit', :id => @topic},
@ -55,12 +30,12 @@
:class => 'talk_edit fr'
) if @message.course_destroyable_by?(User.current) %>
<div class="cl"></div>
<div class="talk_info mb10"><%= textAreailizable(@topic, :content) %></div>
<div class="talk_info mb10 upload_img"><%= @topic.content.html_safe %></div>
<div class="talk_info mb10"><%= link_to_attachments_course @topic, :author => false %></div>
<!-- <a href="#" class=" link_file ml60">附件爱覅俄方if.zip(27.5kB)</a>-->
<div class="cl"></div>
<% if User.current.logged? %>
<%= toggle_link l(:button_reply), "reply", :focus => 'message_content',:class => 'talk_edit fr' %>
<%= toggle_link l(:button_reply), "reply", :focus => 'message_subject',:class => 'talk_edit fr' %>
<% else %>
<%= link_to l(:button_reply), signin_path,:class => 'talk_edit fr' %>
<% end %>
@ -79,7 +54,7 @@
<div class="ping_C mb10" id="<%= "message-#{message.id}" %>">
<div class="ping_dispic"><%= link_to image_tag(url_to_avatar(message.author), :width => '46',:height => '46'), user_path(message.author) %></div>
<div class="ping_discon">
<div class="ping_distop">
<div class="ping_distop upload_img">
<%= link_to_user_header message.author,false,:class => 'c_blue fb fl mb10 ' %>
<span class="c_grey fr"><%= format_time(message.created_on) %></span>
<div class="cl"></div>
@ -118,11 +93,11 @@
<div id="reply" style="display:none;">
<%= form_for @reply, :as => :reply, :url => {:action => 'reply', :id => @topic}, :html => {:multipart => true, :id => 'message_form'} do |f| %>
<%= render :partial => 'form_course', :locals => {:f => f, :replying => true} %>
<%= link_to l(:button_submit),"#",:onclick => 'course_board_submit_message_replay();' ,:class => "blue_btn fl c_white" ,:style=>"margin-left: 50px;"%>
<%= link_to l(:button_submit),"javascript:void(0)",:onclick => 'course_board_submit_message_replay();' ,:class => "blue_btn fl c_white" ,:style=>"margin-left: 50px;"%>
<% end %>
<div id="preview" class="wiki"></div>
</div>
<% end %>
<div class="cl"></div>
<ul class="wlist">
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%>
</ul>

View File

@ -27,7 +27,10 @@
</li>
<li>
<div id="message_quote" class="wiki" style="width: 100%;word-break: break-all;word-wrap: break-word;"></div>
<label class="fl" ><span class="c_red">*</span>&nbsp;<%= l(:field_description) %>&nbsp;&nbsp;</label>
<label class="fl" >
<span class="c_red">*</span>&nbsp;
<%= l(:field_description) %>&nbsp;&nbsp;
</label>
<%= text_area :quote,:quote,:style => 'display:none' %>
<%= hidden_field_tag :asset_id,params[:asset_id],:required => false,:style => 'display:none' %>
<% if replying %>
@ -41,7 +44,7 @@
<%= f.kindeditor :content, :editor_id => 'message_content_editor',
:owner_id => @message.nil? ? 0: @message.id,
:owner_type => OwnerTypeHelper::MESSAGE,
:width => '91%',
:width => '90%',
:height => 300,
:class => 'talk_text fl',
:input_html => { :id => 'message_content',
@ -53,8 +56,8 @@
</li>
<div class="cl"></div>
<li>
<label class="fl">&nbsp;&nbsp;<%= l(:label_attachment_plural) %>&nbsp;&nbsp;</label>
<div class="fl">
<label class="fl mt10">&nbsp;&nbsp;<%= l(:label_attachment_plural) %>&nbsp;&nbsp;</label>
<div class="fl mt10">
<%= render :partial => 'attachments/form_course', :locals => {:container => @message,:isReply => @isReply} %>
</div>
</li>

View File

@ -33,7 +33,7 @@
} do |f| %>
<%= render :partial => 'form_course',
:locals => {:f => f, :replying => !@message.parent.nil?} %>
<a href="#" onclick="submitCoursesBoard();"class="blue_btn fl c_white"><%= l(:button_submit)%></a>
<a href="javascript:void(0)" onclick="submitCoursesBoard();"class="blue_btn fl c_white"><%= l(:button_submit)%></a>
<%= link_to l(:button_cancel), board_message_url(@message.board, @message.root, :r => (@message.parent_id && @message.id)), :class => "blue_btn grey_btn fl c_white" %>
<% end %>

View File

@ -1,7 +1,7 @@
$('#message_subject').val("<%= raw escape_javascript(@subject) %>");
$('#message_quote').html("<%= raw escape_javascript(@temp.content) %>");
$('#message_quote').html("<%= raw escape_javascript(@temp.content.html_safe) %>");
//$('#message_content').val("<#%= raw escape_javascript(@content) %>");
$('#quote_quote').html("<%= raw escape_javascript(@content) %>");
$('#quote_quote').html("<%= raw escape_javascript(@temp.content.html_safe) %>");
showAndScrollTo("reply", "message_content");
$('#message_content').scrollTop = $('#message_content').scrollHeight - $('#message_content').clientHeight;

View File

@ -4,7 +4,7 @@
<input type="text" name="news[title]" class="hwork_input" id="news_title" size="60" onkeyup="regexTitle();" maxlength="60" placeholder="60个字符以内" value="<%= is_new ? '' : @news.title %>">
<p id="title_notice_span" class="ml55"></p>
</li>
<li class="ml45">
<li class="ml45 mb10">
<% if is_new %>
<%= hidden_field_tag :asset_id,params[:asset_id],:required => false,:style => 'display:none' %>
<label class="fl" ><span class="c_red">*</span>&nbsp;<%= l(:field_description) %>&nbsp;&nbsp;</label>

View File

@ -2,42 +2,23 @@
btn_tips = l(:label_news_notice)
label_tips = l(:label_course_news)
%>
<div class="project_r_h">
<h2 class="project_h2"><%= label_tips %></h2>
</div>
<div class="talk_top">
<p class="fl"><%= l(:label_total_news) %><span><%= @news_count %></span><%= l(:label_course_news_count) %></p>
<p class="fl">
<%= l(:label_total_news) %>
<span><%= @news_count %></span>
<%= l(:label_course_news_count) %>
</p>
<% if @course && User.current.allowed_to?(:manage_news, @course) %>
<%= link_to(btn_tips,new_course_news_path(@course),
:class => 'problem_new_btn fl c_dorange')%>
<%= link_to(btn_tips,new_course_news_path(@course),:class => 'problem_new_btn fl c_dorange')%>
<div class="cl"></div>
<% end %>
<div class="cl"></div>
</div>
<!-- <%# if @course && User.current.allowed_to?(:manage_news, @course) %>
<%#= link_to(btn_tips, new_course_news_path(@course),
:class => 'icon icon-add',
:onclick => 'showAndScrollTo("add-news", "news_title"); return false;') %>
<div id="add-news" class="add_frame" style="display:none;">
<%#= labelled_form_for @news, :url => course_news_index_path(@course),
:html => {:id => 'news-form', :multipart => true} do |f| %>
<%#= render :partial => 'news/course_form', :locals => {:f => f, :is_new => true} %>
<%#= link_to l(:button_create), "#", :onclick => 'submitNews();', :onmouseover => 'submitFocus(this);', :class => 'ButtonColor m3p10' %>
<%#= preview_link preview_news_path, 'news-form', target='preview', {:class => 'whiteButton m3p10'} %>
<%#= link_to l(:button_cancel), "#", :onclick => '$("#add-news").hide()', :class => 'ButtonColor m3p10' %>
<%# end if @course %>
<div id="preview" class="wiki"></div>
</div>
<%# end %>-->
<div>
<% if @newss.empty? %>
<p class="nodata">
@ -45,14 +26,24 @@
</p>
<% else %>
<% @newss.each do |news| %>
<div class="problem_main">
<div class="problem_main upload_img">
<%= link_to image_tag(url_to_avatar(news.author),:width => 42,:height => 42), user_path(news.author), :class => "problem_pic fl" %>
<div class="problem_txt fl mt5">
<%= link_to_user_header(news.author,false,{:class=> 'problem_name c_orange fl'}) if news.respond_to?(:author) %>
<span class="fl"> <%= l(:label_release_news) %></span><%= link_to h(news.title), news_path(news),:class => 'problem_tit fl fb c_dblue' %><br />
<span class="fl">
<%= l(:label_release_news) %>
</span>
<%= link_to h(news.title), news_path(news),:class => 'problem_tit fl fb c_dblue' %>
<br />
<div class="cl mb5"></div>
<p id="news_description_<%= news.id %>" class="news_description mt5"><%= textAreailizable news.description %><br /> <%= l(:label_create_time) %> <%= format_time(news.created_on) %></p>
<div class="news_foot" style="display: none;" onclick="news_show_more_des(<%= news.id %>);" id="news_foot_<%= news.id %>"><%= l(:label_expend_information) %> <span class="g-arr-down"><img src="/images/jiantou.jpg" width="12" height="6" /></span></div>
<p id="news_description_<%= news.id %>" class="news_description mt5">
<%= news.description.html_safe %>
</p>
<div class="news_foot c_red" style="cursor:pointer;display: none;" onclick="news_show_more_des(<%= news.id %>);" id="news_foot_<%= news.id %>">
<%= l(:button_more)%>...
<span class="g-arr-down"></span>
</div>
<span class="fl"><%= l(:label_create_time)%><%= format_time(news.created_on)%></span>
</div>
<div class="cl"></div>
</div><!--problem_main end-->
@ -62,41 +53,11 @@
</div>
<!--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 => {:course_id => @course, :key => User.current.rss_key} %>
<%# end %>
<% content_for :header_tags do %>
<%= auto_discovery_link_tag(:atom, params.merge({:format => 'atom', :page => nil, :key => User.current.rss_key})) %>
<%= stylesheet_link_tag 'scm' %>
<% end %>
<% html_title(l(:label_course_news)) -%>
</div>
<script type='text/javascript'>
$(document).ready(function ($) {
$('.content-text-list').each(function () {
$(this).find('.delete_icon').hide();
$(this).mouseenter(function (event) {
$(this).find('.delete_icon').show();
});
$(this).mouseleave(function (event) {
$(this).find('.delete_icon').hide();
});
});
});
$(function(){
$('.news_description').each(function () {
if($(this).height() >= 38)
{
$('#news_foot_'+$(this).attr('id').replace('news_description_','')).css("display","block");
}
}
)
});
</script>
<ul class="wlist">
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%>
</ul>
<% content_for :header_tags do %>
<%= auto_discovery_link_tag(:atom, params.merge({:format => 'atom', :page => nil, :key => User.current.rss_key})) %>
<%= stylesheet_link_tag 'scm' %>
<% end %>
<% html_title(l(:label_course_news)) -%>

View File

@ -1,63 +1,7 @@
<script type="text/javascript">
function regexTitle()
{
var name = $("#news_title").val();
if(name.length ==0)
{
$("#title_notice_span").text("标题不能为空");
$("#title_notice_span").css('color','#ff0000');
$("#title_notice_span").focus();
return false;
}
else if(name.length <= 60)
{
$("#title_notice_span").text("填写正确");
$("#title_notice_span").css('color','#008000');
return true;
}
else
{
$("#title_notice_span").text("标题超过60个字符");
$("#title_notice_span").css('color','#ff0000');
$("#title_notice_span").focus();
return false;
}
}
function regexDescription()
{
var name = $("#news_description").val();
if(name.length ==0)
{
$("#description_notice_span").text("描述不能为空");
$("#description_notice_span").css('color','#ff0000');
$("#description_notice_span").focus();
return false;
}
else
{
$("#description_notice_span").text("填写正确");
$("#description_notice_span").css('color','#008000');
return true;
}
}
function submitNews()
{
news_description_editor.sync();
if(regexTitle() && regexDescription())
{
$("#news-form").submit();
}
}
function submitComment()
{
comment_editor.sync();
$("#add_comment_form").submit();
}
<script>
function clearMessage()
{
$("#comment_comments").val("");
$("#news_comment").html("<%= escape_javascript(hidden_field_tag :asset_id,params[:asset_id],:required => false,:style => 'display:none') %><%= escape_javascript(kindeditor_tag :comment, '',:height=>'100',:editor_id =>'comment_editor', :placeholder=>"最多250个字")%>");
}
</script>
<%= javascript_include_tag "/assets/kindeditor/kindeditor" %>
@ -77,8 +21,9 @@
<div class="problem_main">
<%= link_to image_tag(url_to_avatar(@news.author),:width => 42,:height => 42), user_path(@news.author), :class => "problem_pic fl" %>
<div class="problem_txt fl mt5">
<h4 class="r_txt_tit mb5"> <%=h @news.title %></h4>
<%#= watcher_link(@news, User.current) %>
<h4 class="r_txt_tit mb5">
<%=h @news.title %>
</h4>
<%= link_to(l(:button_edit),
edit_news_path(@news),
:class => 'talk_edit fr',
@ -86,7 +31,11 @@
:onclick => '$("#edit-news").show(); return false;') if User.current.allowed_to?(:manage_news, @course) %>
<%= delete_link(news_path(@news),:class => 'talk_edit fr') if User.current.allowed_to?(:manage_news, @course) %>
<div class="cl"></div>
<div class="mb5"><%= textAreailizable(@news, :description) %><br /> <%= l(:label_create_time) %> <%= format_time(@news.created_on) %></div>
<div class="mb5 upload_img">
<%= @news.description.html_safe %>
<br />
<%= l(:label_create_time) %> <%= format_time(@news.created_on) %>
</div>
<%= link_to_attachments_course @news %>
<!--<a href="#" class=" link_file">附件爱覅俄方if.zip(27.5kB)</a> -->
</div>
@ -97,14 +46,17 @@
<div class="msg_box">
<h4><%= l(:label_comment_add) %></h4>
<%= form_tag({:controller => 'comments', :action => 'create', :id => @news}, :id => "add_comment_form") do %>
<div class="box" >
<div class="box" id="news_comment">
<%= hidden_field_tag :asset_id,params[:asset_id],:required => false,:style => 'display:none' %>
<%= kindeditor_tag :comment, '',:height=>'100',:editor_id =>'comment_editor', :placeholder=>"最多250个字"%>
</div>
<p>
<a href="#" class="grey_btn fr ml10" onclick="clearMessage();"><%= l(:label_cancel_with_space) %></a>
<a href="#" class="blue_btn fr" onclick="submitComment();"><%= l(:label_comment_with_space) %></a>
<p class="mt10">
<a href="javascript:void(0)" class="grey_btn fr ml10" onclick="clearMessage();">
<%= l(:label_cancel_with_space) %>
</a>
<a href="javascript:void(0)" class="blue_btn fr" onclick="submitComment();">
<%= l(:label_comment_with_space) %>
</a>
</p>
<% end %>
</div>
@ -116,13 +68,17 @@
<div class="ping_C mb10">
<div class="ping_dispic"><%= link_to image_tag(url_to_avatar(comment.author),:width => 42,:height => 42), user_path(comment.author)%></div>
<div class="ping_discon">
<div class="ping_distop">
<%= link_to_user_header(comment.author,false,:class => 'c_blue fb fl mb10 ') if comment.respond_to?(:author) %><span class="c_grey fr"><%= format_time(comment.created_on) %></span>
<div class="ping_distop upload_img">
<%= link_to_user_header(comment.author,false,:class => 'c_blue fb fl mb10 ') if comment.respond_to?(:author) %>
<span class="c_grey fr">
<%= format_time(comment.created_on) %>
</span>
<div class="cl"></div>
<p><%= textAreailizable(comment.comments) %></p>
<p><%= comment.comments.html_safe %></p>
</div>
<div class="ping_disfoot"><%= link_to_if_authorized_course image_tag('delete.png'), {:controller => 'comments', :action => 'destroy', :id => @news, :comment_id => comment},
:data => {:confirm => l(:text_are_you_sure)}, :method => :delete, :title => l(:button_delete) %>
<div class="ping_disfoot">
<%= link_to_if_authorized_course image_tag('delete.png'), {:controller => 'comments', :action => 'destroy', :id => @news, :comment_id => comment},
:data => {:confirm => l(:text_are_you_sure)}, :method => :delete, :title => l(:button_delete) %>
</div>
</div>

View File

@ -7,7 +7,7 @@
<%= f.text_field :title, :required => true, :size => 60, :style => "width:488px;", :onkeyup => "regexTitle();" %>
</p>
<P>
<span id="title_notice_span">(60个字符以内)</span>
<span id="title_notice_span"><%= l(:label_news_title_tips)%></span>
</P>
<!-- <p style="margin-left:-10px;"><%#= f.text_area :summary, :cols => 60, :rows => 2, :style => "width:490px;margin-left:10px;" %></p> -->
<p>

View File

@ -7,20 +7,20 @@
var name = $("#news_title").val();
if(name.length ==0)
{
$("#title_notice_span").text("标题不能为空");
$("#title_notice_span").text("<%= l(:label_title_blank)%>");
$("#title_notice_span").css('color','#ff0000');
$("#title_notice_span").focus();
return false;
}
else if(name.length <= 60)
{
$("#title_notice_span").text("填写正确");
$("#title_notice_span").text("<%= l(:label_field_correct)%>");
$("#title_notice_span").css('color','#008000');
return true;
}
else
{
$("#title_notice_span").text("标题超过60个字符");
$("#title_notice_span").text("<%= l(:label_title_long)%>");
$("#title_notice_span").css('color','#ff0000');
$("#title_notice_span").focus();
return false;
@ -37,14 +37,14 @@
var name = $("#news_description").val();
if(name.length ==0)
{
$("#description_notice_span").text("描述不能为空");
$("#description_notice_span").text("<%= l(:label_descripition_blank)%>");
$("#description_notice_span").css('color','#ff0000');
$("#description_notice_span").focus();
return false;
}
else
{
$("#description_notice_span").text("填写正确");
$("#description_notice_span").text("<%= l(:label_field_correct)%>");
$("#description_notice_span").css('color','#008000');
return true;
}

View File

@ -64,6 +64,7 @@
<% cond = Project.visible_condition(User.current) + "AND projects.project_type = 1" %>
<% memberships = user.memberships.all(:conditions => cond) %>
<%= l(:label_x_course_contribute_to, :count => memberships.count) %>
<%= "" unless user_courses.empty? %>
<% for member in memberships %>
<%= link_to_project(member.project) %><%= (user.memberships.last == member) ? '' : '' %>
<% end %>

View File

@ -48,7 +48,7 @@
<div class="C" >
<div class="C_top">
<h2><%= l('project.join.title')%></h2>
<p><%= l('project.join.description')%></p>
<p style="width: 385px"><%= l('project.join.description')%></p>
</div>
<div class="C_form">
<%= form_tag({:controller => 'applied_project',
@ -64,7 +64,7 @@
<input class=" width190" name="project_id" id="project_id" type="text" value="" >
<input type="text" style="display: none"/>
</li>
<li class="mB5"><%= l('project.join.id.tips')%></li>
<li class="mB5" style="width: 260px"><%= l('project.join.id.tips')%></li>
<li>
<a href="#" class="btn" style="margin-left: 50px;" onclick="submit_form(this);">
<%= l(:label_apply_project) %>

View File

@ -36,7 +36,7 @@
&nbsp; <%= format_activity_day(day) %> <%= format_time(e.event_datetime, false) %></span>
<% if e.event_type == "issue" %>
<div class="" style="display:inline-block;position:absolute; right:2%;">
<span> <%= link_to l(:label_find_all_comments), issue_path(e) %> </span><span class="font_lighter"><%= l(:label_comments_count, :count => e.journals.count) %></span>
<span> <%= link_to l(:label_find_all_comments), issue_path(e) if e.journals.count!= 0%> </span><span class="font_lighter"><%= l(:label_comments_count, :count => e.journals.count) %></span>
</div>
<% end %>
</div>

View File

@ -1,5 +1,5 @@
<div class="project_r_h">
<h2 class="project_h2">用户反馈</h2>
<h2 class="project_h2"><%= l(:label_project_tool_response)%></h2>
</div>
<% reply_allow = JournalsForMessage.create_by_user? User.current %>
<%#= stylesheet_link_tag 'css', :media => 'all' %>

View File

@ -7,7 +7,7 @@
<div>
<h3><strong><%= l(:label_tags_search_result) %></strong></h3>
<div align="right">
<%= l(:label_tags_numbers) %>
<%= l(:label_tags_numbers) %>
<%= l(:label_issue_plural) %>(<%= @issues_tags_num %>) |
<%= l(:label_project_plural) %>(<%= @projects_tags_num %>) |
<%= l(:label_user_plural) %>(<%= @users_tags_num %>) |

View File

@ -19,7 +19,7 @@
<%= form_for(@member, {:as => :membership, :url => project_memberships_path(@project), :method => :post}) do |f| %>
<div class="invi_search">
<input hidden="hidden" value="true" name="flag">
<input id="principal_search" class="invi_search_input fl" type="text" placeholder="请输入用户名称来搜索好友">
<input id="principal_search" class="invi_search_input fl" type="text" placeholder=<%= l(:label_invite_trustie_user_tips) %>>
<a class="invi_search_btn fl" onclick="observeSearchfield('principal_search', null, '#{ escape_javascript autocomplete_project_memberships_path(@project, :format => 'js',:flag => true) }')">搜索</a>
<%= javascript_tag "observeSearchfield('principal_search', null, '#{ escape_javascript autocomplete_project_memberships_path(@project, :format => 'js',:flag => true) }')" %>
<div class="cl"></div>

View File

@ -140,7 +140,7 @@
<%= call_hook(:view_repositories_show_contextual, { :repository => @repository, :project => @project }) %>
<div class="project_r_h">
<h2 class="project_h2">版本库</h2>
<h2 class="project_h2"><%=l(:project_module_repository)%></h2>
</div>
<!--修订、统计-->
<div class="contextual" style="padding-right: 10px;">
@ -159,7 +159,7 @@
<% end %>
</div>
<p style=" word-wrap: break-word; word-break: break-all">
(<%= l(:label_all_revisions) %><%= @repositories.sort.collect {|repo|
(<%= l(:label_all_revisions) %><%= @repositories.sort.collect {|repo|
link_to h(repo.name),
{:controller => 'repositories', :action => 'show',
:id => @project, :repository_id => repo.identifier_param, :rev => nil, :path => nil},

View File

@ -1,4 +1,6 @@
<h3><%= l(:label_settings) %></h3>
<h3 style="float: left;"><%=l(:label_settings)%></h3>
<%= link_to @text,settings_hidden_non_project_path,:id => "hidden_non_project",:style => "float: right;margin-right: 60px;margin-top: 9px;"%>
<div class="clear"></div>
<%= render_tabs administration_settings_tabs %>

View File

@ -0,0 +1,5 @@
<% if @notifiable.value == "0"%>
$("#hidden_non_project").replaceWith("<%= escape_javascript(link_to '显示非项目信息',settings_hidden_non_project_path,:id => 'hidden_non_project',:style => 'float: right;margin-right: 60px;margin-top: 9px;', :remote => true)%>");
<% else%>
$("#hidden_non_project").replaceWith("<%= escape_javascript(link_to '隐藏非项目信息',settings_hidden_non_project_path,:id => 'hidden_non_project',:style => 'float: right;margin-right: 60px;margin-top: 9px;', :remote => true)%>");
<% end%>

View File

@ -24,19 +24,19 @@
&nbsp;&nbsp;
<%= file.description %>
<div class="c9 gray-color">
<%= l('attachment.category')%>
<%= l('attachment.category')%>
<%=result_come_from file%>
</div>
<span class="gray blue-color">
<%= l('attachment.download_num')%>
<%= l('attachment.download_num')%>
<%= file.downloads%>|
<%= l('attachment.size')%>
<%= l('attachment.size')%>
<%= number_to_human_size(file.filesize) %>|
<%= l('attachment.sharer')%>
<%= l('attachment.sharer')%>
<a class="gray" >
<%= link_to file.author, user_path(file.author), target: "_blank" unless file.author.blank? %>
</a>|
<%= l('attachment.upload_time')%>
<%= l('attachment.upload_time')%>
<%= format_time(file.created_on) %>
</span>
<div style="display: none"></div>

View File

@ -3,7 +3,7 @@
<hr />
<% issues_results.each do |issue| %>
<p class="font_description2">
<strong><%= l(:label_tags_issue) %><%= link_to "#{issue.subject}",:controller => "issues",:action => "show",:id => issue.id %></strong>
<strong><%= l(:label_tags_issue) %><%= link_to "#{issue.subject}",:controller => "issues",:action => "show",:id => issue.id %></strong>
<br />
<strong><%= l(:label_tags_issue_description) %></strong><%= textilizable issue.description %>
</p>

View File

@ -4,7 +4,7 @@
<% projects_results.each do |prj| %>
<div>
<p class="font_description2">
<strong><%= l(:label_tags_project_name) %><%= link_to "#{prj.name}",:controller => "open_source_projects",:action => "show",:id => prj.id %></strong>
<strong><%= l(:label_tags_project_name) %><%= link_to "#{prj.name}",:controller => "open_source_projects",:action => "show",:id => prj.id %></strong>
<br />
<strong><%= l(:label_tags_project_description) %></strong><%= textilizable prj.short_description %>
</p>

View File

@ -2,13 +2,13 @@
:class => "yellowBtn f_l",
:onclick=>"$('#add_tag_#{obj.id}').slideToggle();" if User.current.logged? %> <!-- $('#put-tag-form-#{obj.class}-#{obj.id}').toggle(); readmore(this); -->
<%= form_for "tag_for_save",:remote=>true,:url => save_tag_path,
:update => "tags_show",
:complete => '$("#put-tag-form").hide();' do |f| %>
<span id="add_tag_<%= obj.id %>" style="display:none; vertical-align: middle;" class="ml10 f_l">
<%= f.text_field :name ,:id => "tags_name_#{obj.id}",:size=>"28",:require=>true,:maxlength => Setting.tags_max_length,:minlength=>Setting.tags_min_length,:class => "isTxt w90 f_l" %>
<%= f.text_field :object_id,:value=> obj.id,:style=>"display:none"%>
<%= f.text_field :object_flag,:value=> object_flag,:style=>"display:none"%>
<%= f.submit "",:class => "submit f_l" %>
</span>
<% end %>
<%= form_for "tag_for_save",:remote=>true,:url => save_tag_path,
:update => "tags_show",
:complete => '$("#put-tag-form").hide();' do |f| %>
<span id="add_tag_<%= obj.id %>" style="display:none; vertical-align: middle;" class="ml10 f_l">
<%= f.text_field :name ,:id => "tags_name_#{obj.id}",:size=>"28",:require=>true,:maxlength => Setting.tags_max_length,:minlength=>Setting.tags_min_length,:class => "isTxt w90 f_l" %>
<%= f.text_field :object_id,:value=> obj.id,:style=>"display:none"%>
<%= f.text_field :object_flag,:value=> object_flag,:style=>"display:none"%>
<%= f.submit "",:class => "submit f_l" %>
</span>
<% end %>

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