Merge remote-tracking branch 'origin/dev_hjq' into dev_hjq

This commit is contained in:
lizanle 2015-04-16 10:51:09 +08:00
commit 86b05b8e6a
219 changed files with 2941 additions and 2180 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

@ -323,6 +323,7 @@ class ProjectsController < ApplicationController
@member ||= @project.members.new
@trackers = Tracker.sorted.all
@wiki ||= @project.wiki
@select_tab = params[:tab]
end
def send_mail_to_member

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

@ -81,7 +81,7 @@ module ApplicationHelper
def authorize_for(controller, action)
User.current.allowed_to?({:controller => controller, :action => action}, @project)
end
# add by nwb
def authorize_for_course(controller, action)
User.current.allowed_to?({:controller => controller, :action => action}, @course)
@ -128,6 +128,15 @@ module ApplicationHelper
end
end
def link_to_isuue_user(user, options={})
if user.is_a?(User)
name = h(user.name(options[:format]))
link_to name, {:controller=> 'users', :action => 'show', id: user.id, host: Setting.user_domain}, :class => "pro_info_p"
else
h(user.to_s)
end
end
def link_to_settings_user(user, options={})
if user.is_a?(User)
name = h(user.name(options[:format]))
@ -141,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
@ -178,6 +188,28 @@ module ApplicationHelper
s
end
def link_to_issue_version(issue, options={})
title = nil
subject = nil
text = options[:tracker] == false ? "##{issue.id}" : "#{issue.tracker} ##{issue.id}"
if options[:subject] == false
title = truncate(issue.subject, :length => 60)
else
subject = issue.subject
if options[:truncate]
subject = truncate(subject, :length => 60)
end
end
if issue.status_id == 5
s = link_to text, issue_path(issue), :class => "text_line_s", :title => title
else
s = link_to text, issue_path(issue), :class => "c_blue", :title => title
end
s << h(": #{subject}") if subject
s = h("#{issue.project} - ") + s if options[:project]
s
end
# Generates a link to an attachment.
# Options:
# * :text - Link text (default to attachment filename)
@ -201,7 +233,7 @@ module ApplicationHelper
route_method = options.delete(:download) ? :download_named_attachment_path : :named_attachment_path
html_options = options.slice!(:only_path)
url = send(route_method, attachment, attachment.filename, options)
url << "?token=#{token}" unless token.nil?
url << "?token=#{token}" unless token.nil?
link_to text, url, html_options
end
@ -226,18 +258,18 @@ module ApplicationHelper
h(text),
{:controller => 'repositories', :action => 'revision', :id => repository.project, :repository_id => repository.identifier_param, :rev => rev},
:title => l(:label_revision_id, format_revision(revision))
)
)
end
# Generates a link to a message
def link_to_message(message, options={}, html_options = nil)
link_to(
truncate(message.subject, :length => 60),
board_message_path(message.board_id, message.parent_id || message.id, {
:r => (message.parent_id && message.id),
:anchor => (message.parent_id ? "message-#{message.id}" : nil)
}.merge(options)),
html_options
truncate(message.subject, :length => 60),
board_message_path(message.board_id, message.parent_id || message.id, {
:r => (message.parent_id && message.id),
:anchor => (message.parent_id ? "message-#{message.id}" : nil)
}.merge(options)),
html_options
)
end
@ -289,8 +321,8 @@ module ApplicationHelper
def thumbnail_tag(attachment)
link_to image_tag(thumbnail_path(attachment)),
named_attachment_path(attachment, attachment.filename),
:title => attachment.filename
named_attachment_path(attachment, attachment.filename),
:title => attachment.filename
end
# 图片缩略图链接
@ -312,15 +344,15 @@ 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 = {})
html_options.symbolize_keys!
tag(:input, html_options.merge({
:type => "image", :src => image_path(name),
:onclick => (html_options[:onclick] ? "#{html_options[:onclick]}; " : "") + "#{function};"
}))
:type => "image", :src => image_path(name),
:onclick => (html_options[:onclick] ? "#{html_options[:onclick]}; " : "") + "#{function};"
}))
end
def format_activity_title(text)
@ -354,7 +386,7 @@ module ApplicationHelper
# The given collection may be a subset of the whole project tree
# (eg. some intermediate nodes are private and can not be seen)
#Modified by nie.
def render_project_nested_lists(projects)
def render_project_nested_lists(projects)
s = ''
if projects.any?
ancestors = []
@ -383,9 +415,9 @@ module ApplicationHelper
if project.try(:project_type) == Project::ProjectType_project
unless User.current.member_of?(@project)
s << "<span style = 'float: right;'>"
s << watcher_link(@project, User.current)#, ['whiteButton'])
s << "</span>"
s << "<span style = 'float: right;'>"
s << watcher_link(@project, User.current)#, ['whiteButton'])
s << "</span>"
end
s << (render :partial => 'projects/project', :locals => {:project => project}).to_s
else
@ -398,7 +430,7 @@ module ApplicationHelper
@project = original_project
end
s.html_safe
end
end
def render_course_nested_lists(courses)
s = ''
@ -433,7 +465,7 @@ module ApplicationHelper
end
#added by young
#added by young
def render_project_nested_lists_new(projects)
s = ''
if projects.any?
@ -462,7 +494,7 @@ module ApplicationHelper
end
s.html_safe
end
#end
#end
def render_page_hierarchy(pages, node=nil, options={})
content = ''
if pages[node]
@ -511,8 +543,8 @@ module ApplicationHelper
projects = User.current.memberships.collect(&:project).compact.select(&:active?).uniq
if projects.any?
options =
("<option value=''>#{ l(:label_jump_to_a_project) }</option>" +
'<option value="" disabled="disabled">---</option>').html_safe
("<option value=''>#{ l(:label_jump_to_a_project) }</option>" +
'<option value="" disabled="disabled">---</option>').html_safe
options << project_tree_options_for_select(projects, :selected => @project) do |p|
{ :value => project_path(:id => p, :jump => current_menu_item) }
@ -702,24 +734,24 @@ module ApplicationHelper
link_to(image_tag('2uparrow.png', :alt => l(:label_sort_highest)),
url.merge({"#{name}[move_to]" => 'highest'}),
:method => method, :title => l(:label_sort_highest)) +
link_to(image_tag('1uparrow.png', :alt => l(:label_sort_higher)),
url.merge({"#{name}[move_to]" => 'higher'}),
:method => method, :title => l(:label_sort_higher)) +
link_to(image_tag('1downarrow.png', :alt => l(:label_sort_lower)),
url.merge({"#{name}[move_to]" => 'lower'}),
:method => method, :title => l(:label_sort_lower)) +
link_to(image_tag('2downarrow.png', :alt => l(:label_sort_lowest)),
url.merge({"#{name}[move_to]" => 'lowest'}),
:method => method, :title => l(:label_sort_lowest))
link_to(image_tag('1uparrow.png', :alt => l(:label_sort_higher)),
url.merge({"#{name}[move_to]" => 'higher'}),
:method => method, :title => l(:label_sort_higher)) +
link_to(image_tag('1downarrow.png', :alt => l(:label_sort_lower)),
url.merge({"#{name}[move_to]" => 'lower'}),
:method => method, :title => l(:label_sort_lower)) +
link_to(image_tag('2downarrow.png', :alt => l(:label_sort_lowest)),
url.merge({"#{name}[move_to]" => 'lowest'}),
:method => method, :title => l(:label_sort_lowest))
end
def breadcrumb(*args)
elements = args.flatten
elements.any? ? content_tag('p', (args.join(" \xc2\xbb ") + " \xc2\xbb ").html_safe, :class => 'breadcrumb') : nil
elements.any? ? content_tag('p', (args.join(" \xc2\xbb ") + " \xc2\xbb ").html_safe, :class => 'wiki_con_tit"') : nil
end
def other_formats_links(&block)
concat('<p class="other-formats">'.html_safe + l(:label_export_to))
concat('<p class="other-formats fl">'.html_safe + l(:label_export_to))
yield Redmine::Views::OtherFormatsBuilder.new(self)
concat('</p>'.html_safe)
end
@ -794,15 +826,15 @@ module ApplicationHelper
def textilizable(*args)
options = args.last.is_a?(Hash) ? args.pop : {}
case args.size
when 1
obj = options[:object]
text = args.shift
when 2
obj = args.shift
attr = args.shift
text = obj.send(attr).to_s
else
raise ArgumentError, 'invalid arguments to textilizable'
when 1
obj = options[:object]
text = args.shift
when 2
obj = args.shift
attr = args.shift
text = obj.send(attr).to_s
else
raise ArgumentError, 'invalid arguments to textilizable'
end
return '' if text.blank?
project = options[:project] || @project || (obj && obj.respond_to?(:project) ? obj.project : nil)
@ -958,18 +990,18 @@ module ApplicationHelper
# check if page exists
wiki_page = link_project.wiki.find_page(page)
url = if anchor.present? && wiki_page.present? && (obj.is_a?(WikiContent) || obj.is_a?(WikiContent::Version)) && obj.page == wiki_page
"##{anchor}"
else
case options[:wiki_links]
when :local; "#{page.present? ? Wiki.titleize(page) : ''}.html" + (anchor.present? ? "##{anchor}" : '')
when :anchor; "##{page.present? ? Wiki.titleize(page) : title}" + (anchor.present? ? "_#{anchor}" : '') # used for single-file wiki export
else
wiki_page_id = page.present? ? Wiki.titleize(page) : nil
parent = wiki_page.nil? && obj.is_a?(WikiContent) && obj.page && project == link_project ? obj.page.title : nil
url_for(:only_path => only_path, :controller => 'wiki', :action => 'show', :project_id => link_project,
:id => wiki_page_id, :version => nil, :anchor => anchor, :parent => parent)
end
end
"##{anchor}"
else
case options[:wiki_links]
when :local; "#{page.present? ? Wiki.titleize(page) : ''}.html" + (anchor.present? ? "##{anchor}" : '')
when :anchor; "##{page.present? ? Wiki.titleize(page) : title}" + (anchor.present? ? "_#{anchor}" : '') # used for single-file wiki export
else
wiki_page_id = page.present? ? Wiki.titleize(page) : nil
parent = wiki_page.nil? && obj.is_a?(WikiContent) && obj.page && project == link_project ? obj.page.title : nil
url_for(:only_path => only_path, :controller => 'wiki', :action => 'show', :project_id => link_project,
:id => wiki_page_id, :version => nil, :anchor => anchor, :parent => parent)
end
end
link_to(title.present? ? title.html_safe : h(page), url, :class => ('wiki-page' + (wiki_page ? '' : ' new')))
else
# project or wiki doesn't exist
@ -1044,110 +1076,110 @@ module ApplicationHelper
# project.changesets.visible raises an SQL error because of a double join on repositories
if repository && (changeset = Changeset.visible.find_by_repository_id_and_revision(repository.id, identifier))
link = link_to(h("#{project_prefix}#{repo_prefix}r#{identifier}"), {:only_path => only_path, :controller => 'repositories', :action => 'revision', :id => project, :repository_id => repository.identifier_param, :rev => changeset.revision},
:class => 'changeset',
:title => truncate_single_line(changeset.comments, :length => 100))
:class => 'changeset',
:title => truncate_single_line(changeset.comments, :length => 100))
end
end
elsif sep == '#'
oid = identifier.to_i
case prefix
when nil
if oid.to_s == identifier && issue = Issue.visible.find_by_id(oid, :include => :status)
anchor = comment_id ? "note-#{comment_id}" : nil
link = link_to("##{oid}", {:only_path => only_path, :controller => 'issues', :action => 'show', :id => oid, :anchor => anchor},
:class => issue.css_classes,
:title => "#{truncate(issue.subject, :length => 100)} (#{issue.status.name})")
end
when 'document'
if document = Document.visible.find_by_id(oid)
link = link_to h(document.title), {:only_path => only_path, :controller => 'documents', :action => 'show', :id => document},
:class => 'document'
end
when 'version'
if version = Version.visible.find_by_id(oid)
link = link_to h(version.name), {:only_path => only_path, :controller => 'versions', :action => 'show', :id => version},
:class => 'version'
end
when 'message'
if message = Message.visible.find_by_id(oid, :include => :parent)
link = link_to_message(message, {:only_path => only_path}, :class => 'message')
end
when 'forum'
if board = Board.visible.find_by_id(oid)
link = link_to h(board.name), {:only_path => only_path, :controller => 'boards', :action => 'show', :id => board, :project_id => board.project},
:class => 'board'
end
when 'news'
if news = News.visible.find_by_id(oid)
link = link_to h(news.title), {:only_path => only_path, :controller => 'news', :action => 'show', :id => news},
:class => 'news'
end
when 'project'
if p = Project.visible.find_by_id(oid)
link = link_to_project(p, {:only_path => only_path}, :class => 'project')
end
when nil
if oid.to_s == identifier && issue = Issue.visible.find_by_id(oid, :include => :status)
anchor = comment_id ? "note-#{comment_id}" : nil
link = link_to("##{oid}", {:only_path => only_path, :controller => 'issues', :action => 'show', :id => oid, :anchor => anchor},
:class => issue.css_classes,
:title => "#{truncate(issue.subject, :length => 100)} (#{issue.status.name})")
end
when 'document'
if document = Document.visible.find_by_id(oid)
link = link_to h(document.title), {:only_path => only_path, :controller => 'documents', :action => 'show', :id => document},
:class => 'document'
end
when 'version'
if version = Version.visible.find_by_id(oid)
link = link_to h(version.name), {:only_path => only_path, :controller => 'versions', :action => 'show', :id => version},
:class => 'version'
end
when 'message'
if message = Message.visible.find_by_id(oid, :include => :parent)
link = link_to_message(message, {:only_path => only_path}, :class => 'message')
end
when 'forum'
if board = Board.visible.find_by_id(oid)
link = link_to h(board.name), {:only_path => only_path, :controller => 'boards', :action => 'show', :id => board, :project_id => board.project},
:class => 'board'
end
when 'news'
if news = News.visible.find_by_id(oid)
link = link_to h(news.title), {:only_path => only_path, :controller => 'news', :action => 'show', :id => news},
:class => 'news'
end
when 'project'
if p = Project.visible.find_by_id(oid)
link = link_to_project(p, {:only_path => only_path}, :class => 'project')
end
end
elsif sep == ':'
# removes the double quotes if any
name = identifier.gsub(%r{^"(.*)"$}, "\\1")
case prefix
when 'document'
if project && document = project.documents.visible.find_by_title(name)
link = link_to h(document.title), {:only_path => only_path, :controller => 'documents', :action => 'show', :id => document},
:class => 'document'
end
when 'version'
if project && version = project.versions.visible.find_by_name(name)
link = link_to h(version.name), {:only_path => only_path, :controller => 'versions', :action => 'show', :id => version},
:class => 'version'
end
when 'forum'
if project && board = project.boards.visible.find_by_name(name)
link = link_to h(board.name), {:only_path => only_path, :controller => 'boards', :action => 'show', :id => board, :project_id => board.project},
:class => 'board'
end
when 'news'
if project && news = project.news.visible.find_by_title(name)
link = link_to h(news.title), {:only_path => only_path, :controller => 'news', :action => 'show', :id => news},
:class => 'news'
end
when 'commit', 'source', 'export'
if project
repository = nil
if name =~ %r{^(([a-z0-9\-_]+)\|)(.+)$}
repo_prefix, repo_identifier, name = $1, $2, $3
repository = project.repositories.detect {|repo| repo.identifier == repo_identifier}
else
repository = project.repository
when 'document'
if project && document = project.documents.visible.find_by_title(name)
link = link_to h(document.title), {:only_path => only_path, :controller => 'documents', :action => 'show', :id => document},
:class => 'document'
end
if prefix == 'commit'
if repository && (changeset = Changeset.visible.where("repository_id = ? AND scmid LIKE ?", repository.id, "#{name}%").first)
link = link_to h("#{project_prefix}#{repo_prefix}#{name}"), {:only_path => only_path, :controller => 'repositories', :action => 'revision', :id => project, :repository_id => repository.identifier_param, :rev => changeset.identifier},
:class => 'changeset',
:title => truncate_single_line(changeset.comments, :length => 100)
end
else
if repository && User.current.allowed_to?(:browse_repository, project)
name =~ %r{^[/\\]*(.*?)(@([^/\\@]+?))?(#(L\d+))?$}
path, rev, anchor = $1, $3, $5
link = link_to h("#{project_prefix}#{prefix}:#{repo_prefix}#{name}"), {:controller => 'repositories', :action => (prefix == 'export' ? 'raw' : 'entry'), :id => project, :repository_id => repository.identifier_param,
:path => to_path_param(path),
:rev => rev,
:anchor => anchor},
:class => (prefix == 'export' ? 'source download' : 'source')
end
when 'version'
if project && version = project.versions.visible.find_by_name(name)
link = link_to h(version.name), {:only_path => only_path, :controller => 'versions', :action => 'show', :id => version},
:class => 'version'
end
when 'forum'
if project && board = project.boards.visible.find_by_name(name)
link = link_to h(board.name), {:only_path => only_path, :controller => 'boards', :action => 'show', :id => board, :project_id => board.project},
:class => 'board'
end
when 'news'
if project && news = project.news.visible.find_by_title(name)
link = link_to h(news.title), {:only_path => only_path, :controller => 'news', :action => 'show', :id => news},
:class => 'news'
end
when 'commit', 'source', 'export'
if project
repository = nil
if name =~ %r{^(([a-z0-9\-_]+)\|)(.+)$}
repo_prefix, repo_identifier, name = $1, $2, $3
repository = project.repositories.detect {|repo| repo.identifier == repo_identifier}
else
repository = project.repository
end
if prefix == 'commit'
if repository && (changeset = Changeset.visible.where("repository_id = ? AND scmid LIKE ?", repository.id, "#{name}%").first)
link = link_to h("#{project_prefix}#{repo_prefix}#{name}"), {:only_path => only_path, :controller => 'repositories', :action => 'revision', :id => project, :repository_id => repository.identifier_param, :rev => changeset.identifier},
:class => 'changeset',
:title => truncate_single_line(changeset.comments, :length => 100)
end
else
if repository && User.current.allowed_to?(:browse_repository, project)
name =~ %r{^[/\\]*(.*?)(@([^/\\@]+?))?(#(L\d+))?$}
path, rev, anchor = $1, $3, $5
link = link_to h("#{project_prefix}#{prefix}:#{repo_prefix}#{name}"), {:controller => 'repositories', :action => (prefix == 'export' ? 'raw' : 'entry'), :id => project, :repository_id => repository.identifier_param,
:path => to_path_param(path),
:rev => rev,
:anchor => anchor},
:class => (prefix == 'export' ? 'source download' : 'source')
end
end
repo_prefix = nil
end
when 'attachment'
attachments = options[:attachments] || (obj && obj.respond_to?(:attachments) ? obj.attachments : nil)
if attachments && attachment = Attachment.latest_attach(attachments, name)
link = link_to_attachment(attachment, :only_path => only_path, :download => true, :class => 'attachment')
end
when 'project'
if p = Project.visible.where("identifier = :s OR LOWER(name) = :s", :s => name.downcase).first
link = link_to_project(p, {:only_path => only_path}, :class => 'project')
end
repo_prefix = nil
end
when 'attachment'
attachments = options[:attachments] || (obj && obj.respond_to?(:attachments) ? obj.attachments : nil)
if attachments && attachment = Attachment.latest_attach(attachments, name)
link = link_to_attachment(attachment, :only_path => only_path, :download => true, :class => 'attachment')
end
when 'project'
if p = Project.visible.where("identifier = :s OR LOWER(name) = :s", :s => name.downcase).first
link = link_to_project(p, {:only_path => only_path}, :class => 'project')
end
end
end
end
@ -1164,9 +1196,9 @@ module ApplicationHelper
@current_section += 1
if @current_section > 1
content_tag('div',
link_to(image_tag('edit.png'), options[:edit_section_links].merge(:section => @current_section)),
:class => 'contextual',
:title => l(:button_edit_section)) + heading.html_safe
link_to(image_tag('edit.png'), options[:edit_section_links].merge(:section => @current_section)),
:class => 'contextual',
:title => l(:button_edit_section)) + heading.html_safe
else
heading
end
@ -1285,10 +1317,10 @@ module ApplicationHelper
# Same as Rails' simple_format helper without using paragraphs
def simple_format_without_paragraph(text)
text.to_s.
gsub(/\r\n?/, "\n"). # \r\n and \r -> \n
gsub(/\n\n+/, "<br /><br />"). # 2+ newline -> 2 br
gsub(/([^\n]\n)(?=[^\n])/, '\1<br />'). # 1 newline -> br
html_safe
gsub(/\r\n?/, "\n"). # \r\n and \r -> \n
gsub(/\n\n+/, "<br /><br />"). # 2+ newline -> 2 br
gsub(/([^\n]\n)(?=[^\n])/, '\1<br />'). # 1 newline -> br
html_safe
end
def wiki_simple_format_without_paragraph(text)
@ -1303,7 +1335,7 @@ module ApplicationHelper
end
def lang_options_for_select(blank=true)
{ 'Chinese简体中文 '=> 'zh', :English => :en}
{ 'Chinese简体中文 '=> 'zh', :English => :en}
end
def label_tag_for(name, option_tags = nil, options = {})
@ -1378,6 +1410,16 @@ module ApplicationHelper
link_to l(:button_delete), url, options
end
def delete_link_version(url, options={})
options = {
:method => :delete,
:data => {:confirm => l(:text_are_you_sure)},
:class => 'c_purple'
}.merge(options)
link_to l(:button_delete), url, options
end
def delete_new_link(url, options={})
@ -1395,7 +1437,7 @@ module ApplicationHelper
:href => "#",
:onclick => %|submitPreview("#{escape_javascript url_for(url)}", "#{escape_javascript form}", "#{escape_javascript target}"); return false;|,
:accesskey => accesskey(:preview)
}.merge(options)
}.merge(options)
end
def link_to_function(name, function, html_options={})
@ -1422,7 +1464,7 @@ module ApplicationHelper
def check_all_links(form_name)
link_to_function(l(:button_check_all), "checkAll('#{form_name}', true)") + "&nbsp;&nbsp;".html_safe + " | "+ "&nbsp;&nbsp;".html_safe +
link_to_function(l(:button_uncheck_all), "checkAll('#{form_name}', false)")
link_to_function(l(:button_uncheck_all), "checkAll('#{form_name}', false)")
end
def progress_bar(pcts, options={})
@ -1433,12 +1475,12 @@ module ApplicationHelper
width = options[:width] || '100px;'
legend = options[:legend] || ''
content_tag('table',
content_tag('tr',
(pcts[0] > 0 ? content_tag('td', '', :style => "width: #{pcts[0]}%;", :class => 'closed') : ''.html_safe) +
(pcts[1] > 0 ? content_tag('td', '', :style => "width: #{pcts[1]}%;", :class => 'done') : ''.html_safe) +
(pcts[2] > 0 ? content_tag('td', '', :style => "width: #{pcts[2]}%;", :class => 'todo') : ''.html_safe)
), :class => 'progress', :style => "width: #{width};").html_safe +
content_tag('p', legend, :class => 'percent').html_safe
content_tag('tr',
(pcts[0] > 0 ? content_tag('td', '', :style => "width: #{pcts[0]}%;", :class => 'closed') : ''.html_safe) +
(pcts[1] > 0 ? content_tag('td', '', :style => "width: #{pcts[1]}%;", :class => 'done') : ''.html_safe) +
(pcts[2] > 0 ? content_tag('td', '', :style => "width: #{pcts[2]}%;", :class => 'todo') : ''.html_safe)
), :class => 'progress', :style => "width: #{width};").html_safe +
content_tag('p', legend, :class => 'percent').html_safe
end
def checked_image(checked=true)
@ -1451,7 +1493,7 @@ module ApplicationHelper
unless @context_menu_included
content_for :header_tags do
javascript_include_tag('context_menu') +
stylesheet_link_tag('context_menu')
stylesheet_link_tag('context_menu')
end
if l(:direction) == 'rtl'
content_for :header_tags do
@ -1482,7 +1524,7 @@ module ApplicationHelper
tags = javascript_tag(
"var datepickerOptions={dateFormat: 'yy-mm-dd', firstDay: #{start_of_week}, " +
"showOn: 'button', buttonImageOnly: true, buttonImage: '" +
path_to_image('/images/calendar.png') +
path_to_image('/images/public_icon.png') +
"', showButtonPanel: true, showWeek: true, showOtherMonths: true, selectOtherMonths: true};")
jquery_locale = l('jquery.locale', :default => current_language.to_s)
unless jquery_locale == 'en'
@ -1504,7 +1546,7 @@ module ApplicationHelper
tags = javascript_tag(
"var datepickerOptions={dateFormat: 'yy-mm-dd',minDate: new Date(), firstDay: #{start_of_week}, " +
"showOn: 'button', buttonImageOnly: true, buttonImage: '" +
path_to_image('/images/calendar.png') +
path_to_image('/images/public_icon.png') +
"', showButtonPanel: true, showWeek: true, showOtherMonths: true, selectOtherMonths: true, onClose: function(dateText, inst) {TimeClose(dateText,inst);}, beforeShow : function(input){TimeBeforeShow(input);} };")
jquery_locale = l('jquery.locale', :default => current_language.to_s)
unless jquery_locale == 'en'
@ -1710,7 +1752,7 @@ module ApplicationHelper
end
s
end
def get_memo
@new_memo = Memo.new
#@new_memo.subject = "有什么想说的,尽管来咆哮吧~~"
@ -1797,11 +1839,11 @@ module ApplicationHelper
html << (content_tag "span", l(:label_no_current_watchers))
end
for user in User.watched_by(obj.id)
html << (link_to image_tag(url_to_avatar(user), :class => "avatar"), user_path(user), :class => "avatar", :title => "#{user.name}")
count = count + 1
if count >= 12
break
end
html << (link_to image_tag(url_to_avatar(user), :class => "avatar"), user_path(user), :class => "avatar", :title => "#{user.name}")
count = count + 1
if count >= 12
break
end
end
html.html_safe
end
@ -1827,13 +1869,13 @@ module ApplicationHelper
html.html_safe
end
def show_bid_fans_picture(obj)
def show_bid_fans_picture(obj)
html = ''
if obj.watcher_users.count == 0
html << (content_tag "span", l(:label_project_no_follow))
else
obj.watcher_users.take(12).each do |user|
html << (link_to image_tag(url_to_avatar(user), :class => "avatar"), user_path(user), :class => "avatar", :title => user.name)
html << (link_to image_tag(url_to_avatar(user), :class => "avatar"), user_path(user), :class => "avatar", :title => user.name)
end
end
html.html_safe
@ -1868,7 +1910,7 @@ module ApplicationHelper
html.html_safe
end
def show_contest_project(contest)
def show_contest_project(contest)
html = ''
if contest.projects.where('is_public = 1').count == 0
html << (content_tag "p", l(:label_no_bid_project), :class => "font_lighter")
@ -1880,7 +1922,7 @@ module ApplicationHelper
html.html_safe
end
def show_contest_softapplication(contest)
def show_contest_softapplication(contest)
html = ''
if contest.softapplications.where('is_public = 1').count == 0
html << (content_tag "p", l(:label_no_contest_softapplication), :class => "font_lighter")
@ -1892,17 +1934,17 @@ module ApplicationHelper
html.html_safe
end
def show_contest_fans_picture(obj)
def show_contest_fans_picture(obj)
html = ''
if obj.watcher_users.count == 0
html << (content_tag "span", l(:label_project_no_follow))
else
obj.watcher_users.take(12).each do |user|
html << (link_to image_tag(url_to_avatar(user), :class => "avatar"), user_path(user), :class => "avatar", :title => user.name)
html << (link_to image_tag(url_to_avatar(user), :class => "avatar"), user_path(user), :class => "avatar", :title => user.name)
end
end
html.html_safe
end
end
#display fans picture
def show_more_fans?(obj)
@ -1919,13 +1961,13 @@ module ApplicationHelper
html << (content_tag "span", l(:label_no_current_fans))
else
obj.watcher_users.take(12).each do |user|
html << (link_to image_tag(url_to_avatar(user), :class => "avatar"), user_path(user), :class => "avatar", :title => user.name)
html << (link_to image_tag(url_to_avatar(user), :class => "avatar"), user_path(user), :class => "avatar", :title => user.name)
end
end
html.html_safe
end
# added by bai
# added by bai
def show_more_participate?(obj)
if obj.join_in_contests.count > 12
return true
@ -1934,18 +1976,18 @@ module ApplicationHelper
end
end
def show_participate_picture(obj)
def show_participate_picture(obj)
html = ''
count = 0
if obj.join_in_contests.count == 0
html << (content_tag "span", l(:label_no_current_participate))
end
for temp in obj.join_in_contests
html << (link_to image_tag(url_to_avatar(temp.user), :class => "avatar"), user_path(temp.user), :class => "avatar", :title => "#{temp.user.name}")
count = count + 1
if count >= 12
break
end
html << (link_to image_tag(url_to_avatar(temp.user), :class => "avatar"), user_path(temp.user), :class => "avatar", :title => "#{temp.user.name}")
count = count + 1
if count >= 12
break
end
end
html.html_safe
end
@ -1954,14 +1996,14 @@ module ApplicationHelper
# add by huang
def show_watcher_list(user)
html = ''
count = 0
html = ''
count = 0
for user in User.watched_by(user.id)
html << (link_to image_tag(url_to_avatar(user), :class => "avatar"), user_path(user), :class => "avatar", :title => "#{user.name}")
count = count + 1
if count >= 12
break
end
html << (link_to image_tag(url_to_avatar(user), :class => "avatar"), user_path(user), :class => "avatar", :title => "#{user.name}")
count = count + 1
if count >= 12
break
end
end
html.html_safe
end
@ -1979,14 +2021,14 @@ module ApplicationHelper
return true if bid.nil?
case bid.homework_type
when Bid::HomeworkFile
attaches = HomeworkAttach.where(bid_id: curb)
attaches.map(&:user_id).include? cur
when Bid::HomeworkProject
attaches = BidingProject.where(user_id: User.current, bid_id: bid)
attaches.count > 0 # > 0 则有提交记录
else
true
when Bid::HomeworkFile
attaches = HomeworkAttach.where(bid_id: curb)
attaches.map(&:user_id).include? cur
when Bid::HomeworkProject
attaches = BidingProject.where(user_id: User.current, bid_id: bid)
attaches.count > 0 # > 0 则有提交记录
else
true
end
end
@ -1999,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}
@ -2018,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|
@ -2048,12 +2092,12 @@ module ApplicationHelper
end
# def hadcommittedforcontest(curu)
# message = JournalsForMessage.find_by_sql("select * from journals_for_messages where jour_type = 'Softapplication' ")
# message.each do |createmessage|
# if createmessage.user_id == curu
# return true
# end
# end
# message = JournalsForMessage.find_by_sql("select * from journals_for_messages where jour_type = 'Softapplication' ")
# message.each do |createmessage|
# if createmessage.user_id == curu
# return true
# end
# end
# end
def footer_logo(ul_class=nil, li_class=nil)
@ -2073,63 +2117,63 @@ module ApplicationHelper
def sort_homework_path(bid, sort, direction)
case self.action_name
when 'show_courseEx'
get_not_batch_homework_homework_attach_index_path(bid_id: bid.id, sort: sort, direction: 'asc')
when 'get_not_batch_homework'
get_not_batch_homework_homework_attach_index_path(bid_id: bid.id, sort: sort, direction: direction)
when 'get_batch_homeworks'
get_batch_homeworks_homework_attach_index_path(bid_id: bid.id, sort: sort, direction: direction)
when 'get_homeworks'
get_homeworks_homework_attach_index_path(bid_id: bid.id, sort: sort, direction: direction)
else
'#'
when 'show_courseEx'
get_not_batch_homework_homework_attach_index_path(bid_id: bid.id, sort: sort, direction: 'asc')
when 'get_not_batch_homework'
get_not_batch_homework_homework_attach_index_path(bid_id: bid.id, sort: sort, direction: direction)
when 'get_batch_homeworks'
get_batch_homeworks_homework_attach_index_path(bid_id: bid.id, sort: sort, direction: direction)
when 'get_homeworks'
get_homeworks_homework_attach_index_path(bid_id: bid.id, sort: sort, direction: direction)
else
'#'
end
end
def anonymous_comment_link(bid, course)
link = case bid.comment_status
when 0
confirm_info = "开启匿评后学生将不能对作业进行提交、修改、删除等操作\n"
confirm_info += anonymous_comment_notice(bid,course)
confirm_info += '是否确定开启匿评?'
link_to '启动匿评', start_anonymous_comment_bid_path(bid), id: "#{bid.id}_start_anonymous_comment", remote: true, :confirm => confirm_info, disable_with: '加载中...'
when 1
confirm_info = "关闭匿评后所有同学将不能继续进行匿评,且将公开已提交作业列表\n"
confirm_info += anonymous_comment_notice(bid,course)
confirm_info += '是否确定关闭匿评?'
link_to '关闭匿评', stop_anonymous_comment_bid_path(bid), id: "#{bid.id}_stop_anonymous_comment", remote: true, :confirm => confirm_info
when 2
'匿评结束'
end
when 0
confirm_info = "开启匿评后学生将不能对作业进行提交、修改、删除等操作\n"
confirm_info += anonymous_comment_notice(bid,course)
confirm_info += '是否确定开启匿评?'
link_to '启动匿评', start_anonymous_comment_bid_path(bid), id: "#{bid.id}_start_anonymous_comment", remote: true, :confirm => confirm_info, disable_with: '加载中...'
when 1
confirm_info = "关闭匿评后所有同学将不能继续进行匿评,且将公开已提交作业列表\n"
confirm_info += anonymous_comment_notice(bid,course)
confirm_info += '是否确定关闭匿评?'
link_to '关闭匿评', stop_anonymous_comment_bid_path(bid), id: "#{bid.id}_stop_anonymous_comment", remote: true, :confirm => confirm_info
when 2
'匿评结束'
end
content_tag('span', link, id: "#{bid.id}_anonymous_comment")
end
def anonymous_comment_notice(bid, course)
case bid.comment_status
when 0
@student_size ||= searchStudent(course).size
@homework_size = bid.homeworks.size
percent = @homework_size.to_f / (@student_size == 0 ? 1 : @student_size)
confirm_info = "目前#{@student_size}个学生,总共提交了#{@homework_size}份作业,占#{number_to_percentage(percent * 100, precision: 1)}\n"
when 1
@homework_evaluations = 0
bid.homeworks.map { |homework| @homework_evaluations += homework.homework_evaluations.count}
teachers = "("
teacher_members = searchTeacherAndAssistant(course)
teacher_members.each do |member|
if member == teacher_members.last
teachers += member.user_id.to_s + ")"
else
teachers += member.user_id.to_s + ","
end
end
@has_evaluations = 0
bid.homeworks.map { |homework| @has_evaluations += homework.rates(:quality).where("seems_rateable_rates.rater_id not in #{teachers}").count}
case bid.comment_status
when 0
@student_size ||= searchStudent(course).size
@homework_size = bid.homeworks.size
percent = @homework_size.to_f / (@student_size == 0 ? 1 : @student_size)
confirm_info = "目前#{@student_size}个学生,总共提交了#{@homework_size}份作业,占#{number_to_percentage(percent * 100, precision: 1)}\n"
when 1
@homework_evaluations = 0
bid.homeworks.map { |homework| @homework_evaluations += homework.homework_evaluations.count}
teachers = "("
teacher_members = searchTeacherAndAssistant(course)
teacher_members.each do |member|
if member == teacher_members.last
teachers += member.user_id.to_s + ")"
else
teachers += member.user_id.to_s + ","
end
end
@has_evaluations = 0
bid.homeworks.map { |homework| @has_evaluations += homework.rates(:quality).where("seems_rateable_rates.rater_id not in #{teachers}").count}
percent = @has_evaluations.to_f / (@homework_evaluations == 0 ? 1 : @homework_evaluations)
confirm_info = "目前总共分配了#{@homework_evaluations}份匿评作业,已评价#{@has_evaluations}份作业,占#{number_to_percentage(percent * 100, precision: 1)}\n"
end
confirm_info
percent = @has_evaluations.to_f / (@homework_evaluations == 0 ? 1 : @homework_evaluations)
confirm_info = "目前总共分配了#{@homework_evaluations}份匿评作业,已评价#{@has_evaluations}份作业,占#{number_to_percentage(percent * 100, precision: 1)}\n"
end
confirm_info
end
def get_technical_title user

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

@ -73,6 +73,35 @@ module JournalsHelper
content_tag('div', content.html_safe, :id => "journal-#{journal.id}-notes", :class => css_classes ,:style => "width:580px")
end
# 缺陷回复内容、引用内容
# Redo:后面需要统一扩展
def render_notes_issue (issue, journal, options={})
content = ''
editable = User.current.logged? && (User.current.allowed_to?(:edit_issue_notes, issue.project) || (journal.user == User.current && User.current.allowed_to?(:edit_own_issue_notes, issue.project)))
destroyable = User.current.logged? && ((journal.user == User.current) || (issue.author_id == User.current.id) || (User.current.admin == 1))
links = []
if !journal.notes.blank?
links << link_to(l(:button_quote),
{:controller => 'journals', :action => 'new', :id => issue.id, :journal_id => journal},
:remote => true,
:method => 'post',
:title => l(:button_quote)) if options[:reply_links]
links << link_to_in_place_notes_editor(l(:button_edit), "journal-#{journal.id}-notes",
{ :controller => 'journals', :action => 'edit', :id => journal, :format => 'js' },
:title => l(:button_edit)) if editable
#Added by young
if destroyable
links << link_to(l(:button_delete), { :controller => 'journals', :action => 'destroy', :id => journal, :format => 'js' },
:title => l(:button_delete))
end
end
#content << content_tag('div', links.join(' ').html_safe, :class => 'contextual', :style => 'margin-top:-25px;') unless links.empty?
content << textilizable(journal, :notes)
css_classes = "wiki"
css_classes << " editable" if editable
content_tag('div', content.html_safe, :id => "journal-#{journal.id}-notes", :class => css_classes ,:style => "width:510px")
end
def link_to_in_place_notes_editor(text, field_id, url, options={})
onclick = "$.ajax({url: '#{url_for(url)}', type: 'get'}); return false;"
link_to text, '#', options.merge(:onclick => onclick)

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

@ -24,6 +24,11 @@ module ProjectsHelper
link_to_if version.visible?, format_version_name(version), { :controller => 'versions', :action => 'show', :id => version }, :class => "c_blue02"
end
def link_to_version_show(version, options = {})
return '' unless version && version.is_a?(Version)
link_to_if version.visible?, format_version_name(version), { :controller => 'versions', :action => 'show', :id => version }, :class => " f16 fb c_dblue "
end
def project_settings_tabs
tabs = [{:name => 'info', :action => :edit_project, :partial => 'projects/edit', :label => :label_information_plural},
{:name => 'modules', :action => :select_project_modules, :partial => 'projects/settings/modules', :label => :label_module_plural},

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

@ -42,7 +42,28 @@ module WatchersHelper
:object_id => (objects.size == 1 ? objects.first.id : objects.map(&:id).sort)
)
method = watched ? 'delete' : 'post'
link_to text, url, :remote => true, :method => method, :class => css
end
def watcher_link_issue(objects, user, options=[])
return '' unless user && user.logged?
objects = Array.wrap(objects)
watched = objects.any? {|object| object.watched_by?(user)}
@watch_flag = (objects.first.instance_of?(User) or objects.first.instance_of?(Project) or objects.first.instance_of?(Contest) or (objects.first.instance_of?(Bid)))
css = @watch_flag ? ([watcher_css(objects), watched ? 'talk_edit ' : 'talk_edit '].join(' ') << options[0].to_s) :
([watcher_css(objects), watched ? 'talk_edit fr ' : 'talk_edit fr '].join(' ') << options[0].to_s)
text = @watch_flag ?
(watched ? l(:button_unfollow) : l(:button_follow)) : (watched ? l(:button_unwatch) : l(:button_watch))
url = watch_path(
:object_type => objects.first.class.to_s.underscore,
:object_id => (objects.size == 1 ? objects.first.id : objects.map(&:id).sort)
)
method = watched ? 'delete' : 'post'
link_to text, url, :remote => true, :method => method, :class => css
end
@ -267,11 +288,23 @@ module WatchersHelper
# 缺陷跟踪者列表复选框生成
def watchers_checkboxes(object, users, checked=nil)
if users.nil?
else
# tag = check_box_tag 'issue[watcher_user_ids][]', user.id, c, :id => nil
# content_tag 'label', "#{tag} #{h(user)}".html_safe,
# :id => "issue_watcher_user_ids_#{user.id}",
# :class => "floating"
users.map do |user|
c = checked.nil? ? object.watched_by?(user) : checked
s = content_tag(:ul,
content_tag(:li, "#{check_box_tag 'issue[watcher_user_ids][]', user.id, c, :id => nil } #{h link_to user.userInfo, user_path( user.id)}".html_safe,
:id=>"issue_watcher_user_ids_#{user.id}",:style=>"float: left;width: 175px;margin: 0px 20px 10px 0px; overflow: hidden; line-height:1.6em;" ),
:class => "mb10 ml80")
end.join.html_safe
# scope = users.sort
# watchers = paginateHelper scope,10
# s = content_tag('ul', issue_watcher_check_box_tags_ex('issue[watcher_user_ids][]', watchers), :class => 'mb10 ml80')
@ -279,10 +312,6 @@ module WatchersHelper
# link_to text, watchers_autocomplete_for_user_path(@users, parameters.merge(:q => params[:q],:format => 'js',:flag => 'ture')), :remote => true
# }
# s + content_tag('ul', links,:class => 'wlist', :style =>"float:left;margin-top:0px;")
users.map do |user|
c = checked.nil? ? object.watched_by?(user) : checked
end.join.html_safe
s = content_tag('ul', issue_watcher_check_box_tags_ex('issue[watcher_user_ids][]', users), :class => 'mb10 ml80')
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

@ -1,11 +1,12 @@
<div class="fl">
<span id="attachments_fields" xmlns="http://www.w3.org/1999/html">
<% if defined?(container) && container && container.saved_attachments %>
<% container.attachments.each_with_index do |attachment, i| %>
<span id="attachments_p<%= i %>" class="attachment">
<%= text_field_tag("attachments[p#{i}][filename]", attachment.filename, :class => 'filename readonly', :readonly=>'readonly')%>
<%= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 254, :placeholder => l(:label_optional_description), :class => 'description', :style=>"display: inline-block;") %>
<span class="ispublic-label"><%= l(:field_is_public)%>:</span>
<%= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public,attachment.is_public == 1 ? true : false,:class => 'is_public')%>
<%= text_field_tag("attachments[p#{i}][filename]", attachment.filename, :class => 'filename readonly', :readonly => 'readonly') %>
<%= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 254, :placeholder => l(:label_optional_description), :class => 'description', :style => "display: inline-block;") %>
<span class="ispublic-label"><%= l(:field_is_public) %>:</span>
<%= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public, attachment.is_public == 1 ? true : false, :class => 'is_public') %>
<%= if attachment.id.nil?
#待补充代码
else
@ -17,64 +18,61 @@
<%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %>
</span>
<% end %>
<% container.saved_attachments.each_with_index do |attachment, i| %>
<% container.saved_attachments.each_with_index do |attachment, i| %>
<span id="attachments_p<%= i %>" class="attachment">
<%= text_field_tag("attachments[p#{i}][filename]", attachment.filename, :class => 'filename readonly', :readonly=>'readonly')%>
<%= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 254, :placeholder => l(:label_optional_description), :class => 'description', :style=>"display: inline-block;") %>
<span class="ispublic-label"><%= l(:field_is_public)%>:</span>
<%= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public,attachment.is_public == 1 ? true : false,:class => 'is_public')%>
<%= text_field_tag("attachments[p#{i}][filename]", attachment.filename, :class => 'filename readonly', :readonly => 'readonly') %>
<%= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 254, :placeholder => l(:label_optional_description), :class => 'description', :style => "display: inline-block;") %>
<span class="ispublic-label"><%= l(:field_is_public) %>:</span>
<%= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public, attachment.is_public == 1 ? true : false, :class => 'is_public') %>
<%= if attachment.id.nil?
#待补充代码
else
link_to('&nbsp;'.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload')
end
#待补充代码
else
link_to('&nbsp;'.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload')
end
%>
<%#= 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'>
// function CompatibleSend()
// {
// var obj=document.getElementById("_file");
// var file= $(obj).clone();
// file.click();
// }
</script>
<% project = project %>
<span class="add_attachment" style="font-weight:normal;">
<script type='text/javascript'>
// function CompatibleSend()
// {
// var obj=document.getElementById("_file");
// var file= $(obj).clone();
// file.click();
// }
</script>
<% project = project %>
<span class="add_attachment" style="font-weight:normal;">
<%#= button_tag "浏览", :type=>"button", :onclick=>"CompatibleSend();" %>
<!--%= link_to image_tag(),"javascript:void(0)", :onclick => "_file.click()"%-->
<%= button_tag "文件浏览",:class => 'sub_btn', :type=>"button", :onclick=>"_file.click()",:onmouseover => 'this.focus()', :style => ie8? ? 'display:none' : '' %>
<%= button_tag "文件浏览", :type=>"button", :onclick=>"$('#_file').click();",:onmouseover => 'this.focus()',:class => 'sub_btn' %>
<%= file_field_tag 'attachments[dummy][file]',
:id => '_file',
:class => 'file_selector',
:multiple => true,
:onchange => 'addInputFiles(this);',
:style => 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)),
:max_concurrent_uploads => Redmine::Configuration['max_concurrent_ajax_uploads'].to_i,
:upload_path => uploads_path(:format => 'js',:project =>project),
:description_placeholder => l(:label_optional_description),
:field_is_public => l(:field_is_public),
:are_you_sure => l(:text_are_you_sure),
:file_count => l(:label_file_count),
:delete_all_files => l(:text_are_you_sure_all)
} %>
:id => '_file',
:class => 'file_selector',
:multiple => true,
:onchange => 'addInputFiles(this);',
: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)),
:max_concurrent_uploads => Redmine::Configuration['max_concurrent_ajax_uploads'].to_i,
:upload_path => uploads_path(:format => 'js', :project => project),
:description_placeholder => l(:label_optional_description),
:field_is_public => l(:field_is_public),
:are_you_sure => l(:text_are_you_sure),
:file_count => l(:label_file_count),
:delete_all_files => l(:text_are_you_sure_all)
} %>
<span id="upload_file_count">
<%= l(:label_no_file_uploaded)%>
<%= l(:label_no_file_uploaded) %>
</span>
(<%= l(:label_max_size) %>:
<%= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>)
</span>
<% content_for :header_tags do %>
<%= javascript_include_tag 'attachments' %>
<% end %>
<% content_for :header_tags do %>
<%= javascript_include_tag 'attachments' %>
<% end %>
</div>

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 %>
@ -23,9 +23,10 @@
</li>
<div class="cl"></div>
<li class="ml21">
<label><span class="c_red">*</span>&nbsp;<%= l(:label_limit_time)%>&nbsp;&nbsp;</label>
<input type="text" name="bid[deadline]" id="bid_deadline" class="hwork_input02" onchange="regexDeadLine();" readonly="readonly" value="<%= bid.deadline%>" >
<label class="fl"><span class="c_red">*</span>&nbsp;<%= l(:label_limit_time)%>&nbsp;&nbsp;</label>
<input type="text" name="bid[deadline]" id="bid_deadline" class="hwork_input02 fl" onchange="regexDeadLine();" readonly="readonly" value="<%= bid.deadline%>" >
<%= calendar_for('bid_deadline')%>
<div class="cl"></div>
</li>
<li class=" mb5 ml30">
<label ><%= l(:label_open_anonymous_evaluation)%>&nbsp;&nbsp;</label>
@ -44,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

@ -1,11 +1,10 @@
<!--added by huang-->
<%#= watcher_link(@issue, User.current) %>
<%= watcher_link_issue(@issue, User.current) %>
<%#= link_to l(:button_copy), project_copy_issue_path(@project, @issue), :class => 'icon icon-copy' if User.current.allowed_to?(:add_issues, @project) %>
<%= link_to l(:button_delete), issue_path(@issue.id), :data => {:confirm => issues_destroy_confirmation_message(@issue)}, :method => :delete, :class => 'talk_edit fr' if User.current.allowed_to?(:delete_issues, @project) %>
<% if (@issue.author == User.current) || (User.current.admin?) %>
<%= link_to l(:button_edit), edit_issue_path(@issue), :onclick => 'showAndScrollTo("update", "issue_notes"); return false;', :class => 'talk_edit fr', :accesskey => accesskey(:edit) if @issue.editable? %>
<%= link_to l(:button_edit), edit_issue_path(@issue), :onclick => 'showAndScrollTo("all_attributes", "issue_notes"); return false;', :class => 'talk_edit fr', :accesskey => accesskey(:edit) if @issue.editable? %>
<% else %>
<%= link_to l(:label_user_newfeedback), edit_issue_path(@issue), :onclick => 'showAndScrollTo("update", "issue_notes"); return false;', :class => 'talk_edit fr', :accesskey => accesskey(:edit) if @issue.editable? %>
<% end %>

View File

@ -1,53 +1,53 @@
<%= labelled_fields_for :issue, @issue do |f| %>
<div class="newpro_box">
<fieldset class="collapsible" >
<legend onclick="toggleFieldset(this);" ><strong><%= l(:label_change_properties) %></strong></legend>
<ul class="fl" >
<fieldset class="collapsible">
<legend onclick="toggleFieldset(this);"><strong><%= l(:label_change_properties) %></strong></legend>
<ul class="fl">
<li>
<label class="label"><span class="c_red f12">*</span><%= l(:field_status) %></label>
<% if @issue.safe_attribute?('status_id') && @allowed_statuses.present? %>
<%= f.select :status_id,
(@allowed_statuses.collect {|p| [p.name, p.id]}),
{ :onchange => "updateIssueFrom('#{escape_javascript project_issue_form_path(@project, :id => @issue, :format => 'js')}')" , :no_label => true},
:class => "w150" %>
(@allowed_statuses.collect { |p| [p.name, p.id] }),
{:onchange => "updateIssueFrom('#{escape_javascript project_issue_form_path(@project, :id => @issue, :format => 'js')}')", :no_label => true},
:class => "w150" %>
<% else %>
<%= h(@issue.status.name) %>
<% end %>
</li>
<div class="cl"></div>
<li>
<label class="label" ><span class="c_red f12">*</span><%= l(:field_priority) %></label>
<label class="label"><span class="c_red f12">*</span><%= l(:field_priority) %></label>
<% if @issue.safe_attribute? 'priority_id' %>
<%= f.select :priority_id,
(@priorities.collect {|p| [p.name, p.id]}),
{:required => true, :no_label => true}, :disabled => !@issue.leaf?,
:class => "w150" %>
(@priorities.collect { |p| [p.name, p.id] }),
{:required => true, :no_label => true}, :disabled => !@issue.leaf?,
:class => "w150" %>
<% end %>
</li>
<div class="cl"></div>
<li>
<li>
<label class="label" ><%= l(:field_assigned_to) %></label>
<label class="label"><%= l(:field_assigned_to) %></label>
<% if @issue.safe_attribute? 'assigned_to_id' %>
<%= f.select :assigned_to_id, principals_options_for_select(@issue.assignable_users, @issue.assigned_to),
{:required => @issue.required_attribute?('assigned_to_id'), :no_label => true} ,
:class => "w150" %>
<%= f.select :assigned_to_id, principals_options_for_select(@issue.assignable_users, @issue.assigned_to),
{:required => @issue.required_attribute?('assigned_to_id'), :no_label => true},
:class => "w150" %>
<% end %>
</li>
<div class="cl"></div>
<li>
<label class="label" ><%= l(:field_fixed_version) %></label>
<label class="label"><%= l(:field_fixed_version) %></label>
<% if @issue.safe_attribute?('fixed_version_id') && @issue.assignable_versions.any? %>
<%= f.select :fixed_version_id, version_options_for_select(@issue.assignable_versions, @issue.fixed_version),
{:include_blank => true, :required => @issue.required_attribute?('fixed_version_id'), :no_label => true},
:class => "w150" %>
<%#= link_to(image_tag('add.png', :style => 'vertical-align: middle;'),
{:include_blank => true, :required => @issue.required_attribute?('fixed_version_id'), :no_label => true},
:class => "w150" %>
<%#= link_to(image_tag('add.png', :style => 'vertical-align: middle;'),
new_project_version_path(@issue.project),
:remote => true,
:method => 'get',
:title => l(:label_version_new),
:tabindex => 200) if User.current.allowed_to?(:manage_versions, @issue.project) %>
<a href="javascript:viod(0)" class="pic_add mt5 ml5" ></a>
<a href="javascript:viod(0)" class="pic_add mt5 ml5"></a>
<% end %>
</li>
<div class="cl"></div>
@ -55,44 +55,44 @@
</ul>
<ul class="fl ml90">
<li>
<label class="label02" ><%= l(:field_start_date) %></label>
<label class="label02"><%= l(:field_start_date) %></label>
<% if @issue.safe_attribute? 'start_date' %>
<%= f.text_field :start_date,
:size => 22,
:disabled => !@issue.leaf?,
:no_label=> true,
:no_label => true,
:required => @issue.required_attribute?('start_date') %>
<%= calendar_for('issue_start_date','start_date') if @issue.leaf? %>
<% end %>
<%= calendar_for('issue_start_date', 'start_date') if @issue.leaf? %>
<% end %>
</li>
<div class="cl"></div>
<li>
<label class="label02" ><%= l(:field_due_date) %></label>
<label class="label02"><%= l(:field_due_date) %></label>
<% if @issue.safe_attribute? 'due_date' %>
<%= f.text_field :due_date, :size => 22,
:disabled => !@issue.leaf?,
:no_label=> true,
:no_label => true,
:required => @issue.required_attribute?('due_date') %>
<%= calendar_for('issue_due_date','start_date') if @issue.leaf? %>
<% end %>
<%= calendar_for('issue_due_date', 'start_date') if @issue.leaf? %>
<% end %>
</li>
<div class="cl"></div>
<li>
<label class="label02" ><%= l(:field_estimated_hours) %></label>
<label class="label02"><%= l(:field_estimated_hours) %></label>
<% if @issue.safe_attribute? 'estimated_hours' %>
<%= f.text_field :estimated_hours, :size => 22,
:disabled => !@issue.leaf?,
:no_label=> true,
:no_label => true,
:required => @issue.required_attribute?('estimated_hours') %>
<span class="mt3 ml5"><%= l(:field_hours) %></span>
<% end %>
</li>
<div class="cl"></div>
<li><label class="label02" >&nbsp;% 完成&nbsp;&nbsp;:&nbsp;</label>
<li><label class="label02">&nbsp;% 完成&nbsp;&nbsp;:&nbsp;</label>
<% if @issue.safe_attribute?('done_ratio') && @issue.leaf? && Issue.use_field_for_done_ratio? %>
<%= f.select :done_ratio, ((0..10).to_a.collect {|r| ["#{r*10} %", r*10] }),
{:required => @issue.required_attribute?('done_ratio'), :no_label=> true ,:onchange => "PrecentChange(this.value)"},
:class => "w150" %>
<%= f.select :done_ratio, ((0..10).to_a.collect { |r| ["#{r*10} %", r*10] }),
{:required => @issue.required_attribute?('done_ratio'), :no_label => true, :onchange => "PrecentChange(this.value)"},
:class => "w150" %>
<% end %>
</li>
<div class="cl"></div>
@ -100,68 +100,65 @@
</fieldset>
</div><!--newpro_box end-->
<script type="text/javascript">
// window.onload=function(){
// var img=$("#issue_due_date").next("img");
// img.attr("onclick","SetMinValue();");
// }
function TimeClose(dateText, inst) {
if(inst.id=="issue_start_date"){
time=dateText;
}
}
var time=new Date();
function TimeBeforeShow(input){
if(input.id=="issue_due_date"){
//var minDate = $(input).datepicker('option', 'minDate');
var tempdata=$("#issue_start_date").attr("value");
<script type="text/javascript">
// window.onload=function(){
// var img=$("#issue_due_date").next("img");
// img.attr("onclick","SetMinValue();");
// }
function TimeClose(dateText, inst) {
if (inst.id == "issue_start_date") {
time = dateText;
}
}
var time = new Date();
function TimeBeforeShow(input) {
if (input.id == "issue_due_date") {
//var minDate = $(input).datepicker('option', 'minDate');
var tempdata = $("#issue_start_date").attr("value");
$(input).datepicker('option', 'minDate',new Date(tempdata.replace(/-/g, "/")));
//$('.selector').datepicker('option', 'minDate', '12/25/2012');
}
}
$(input).datepicker('option', 'minDate', new Date(tempdata.replace(/-/g, "/")));
//$('.selector').datepicker('option', 'minDate', '12/25/2012');
}
}
function SetMinValue(){
/// var tempdata=$("#issue_start_date").attr("value");
//$('.selector').datepicker('option', 'minDate', '12/25/2012');
//alert(tempdata);
//$("#issue_due_date").datepicker({
// minDate: new Date(2014,08,23)
//var datepickerOptions=
//{dateFormat: 'yy-mm-dd',minDate: new Date(2014,08,23), showOn: 'button', buttonImageOnly: true, buttonImage: "path_to_image('/images/calendar.png')", showButtonPanel: true, showWeek: true, showOtherMonths: true, selectOtherMonths: true};
//alert( $('.issue_due_date').length);
//$('.selector')[1].datepicker('option', 'minDate', new Date(2014, 0 - 8, 23));
//$("#issue_due_date").datepicker(datepickerOptions);
//$("##{issue_due_date}").datepicker(datepickerOptions);
//$("#issue_due_date").datepicker(
// {dateFormat: 'yy-mm-dd',minDate: new Date(2014,08,23), showOn: 'button', buttonImageOnly: true, buttonImage: "path_to_image('/images/calendar.png')", showButtonPanel: true, showWeek: true, showOtherMonths: true, selectOtherMonths: true}
//)
//});
}
function PrecentChange(obj){
var _v= obj;
if(_v==100)
{
//var select=$("select[id='issue_status_id']");
$("select[id='issue_status_id']").find("option[value='3']").attr("selected","selected");
}
else if(_v==0)
{
//alert(1);
$("select[id='issue_status_id']").find("option[value='1']").attr("selected","selected");
}
else if(_v!=100&&_v!=0)
{
// alert(2);
$("select[id='issue_status_id']").find("option[value='2']").attr("selected","selected");
}
}
</script>
function SetMinValue() {
/// var tempdata=$("#issue_start_date").attr("value");
//$('.selector').datepicker('option', 'minDate', '12/25/2012');
//alert(tempdata);
//$("#issue_due_date").datepicker({
// minDate: new Date(2014,08,23)
//var datepickerOptions=
//{dateFormat: 'yy-mm-dd',minDate: new Date(2014,08,23), showOn: 'button', buttonImageOnly: true, buttonImage: "path_to_image('/images/calendar.png')", showButtonPanel: true, showWeek: true, showOtherMonths: true, selectOtherMonths: true};
//alert( $('.issue_due_date').length);
//$('.selector')[1].datepicker('option', 'minDate', new Date(2014, 0 - 8, 23));
//$("#issue_due_date").datepicker(datepickerOptions);
//$("##{issue_due_date}").datepicker(datepickerOptions);
//$("#issue_due_date").datepicker(
// {dateFormat: 'yy-mm-dd',minDate: new Date(2014,08,23), showOn: 'button', buttonImageOnly: true, buttonImage: "path_to_image('/images/calendar.png')", showButtonPanel: true, showWeek: true, showOtherMonths: true, selectOtherMonths: true}
//)
//});
}
function PrecentChange(obj) {
var _v = obj;
if (_v == 100) {
//var select=$("select[id='issue_status_id']");
$("select[id='issue_status_id']").find("option[value='3']").attr("selected", "selected");
}
else if (_v == 0) {
//alert(1);
$("select[id='issue_status_id']").find("option[value='1']").attr("selected", "selected");
}
else if (_v != 100 && _v != 0) {
// alert(2);
$("select[id='issue_status_id']").find("option[value='2']").attr("selected", "selected");
}
}
</script>
<% if @issue.safe_attribute? 'custom_field_values' %>
<%= render :partial => 'issues/form_custom_fields' %>
<% end %>
<% if @issue.safe_attribute? 'custom_field_values' %>
<%= render :partial => 'issues/form_custom_fields' %>
<% end %>
<% end %>

View File

@ -1,47 +1,37 @@
<%= labelled_form_for @issue, :html => {:id => 'issue-form', :multipart => true} do |f| %>
<%= error_messages_for 'issue', 'time_entry' %>
<%= render :partial => 'conflict' if @conflict %>
<!--编辑的整个属性-->
<% if @edit_allowed || !@allowed_statuses.empty? %>
<div id="all_attributes">
<%= render :partial => 'form', :locals => {:f => f} %>
<div id="all_attributes" style="display:none;">
<%= render :partial => 'form', :locals => {:f => f} %>
</div>
<% end %><!--end-->
<div class="ping_C mb10"> </div>
<!--<fieldset><legend><%#= l(:field_notes) %></legend>-->
<!--回复框-->
<% if @journals.present? %>
<div id="history">
<%= render :partial => 'history', :locals => { :issue => @issue, :journals => @journals } %>
</div>
<% end %>
<%= f.text_area :notes, :style =>"width:99%;", :rows => "5", :no_label => true %>
<fieldset><legend><%= l(:field_notes) %></legend>
<%= f.text_area :notes, :cols => 60, :rows => 10, :class => 'wiki-edit', :no_label => true %>
<%= wikitoolbar_for 'issue_notes' %>
<% if @issue.safe_attribute? 'private_notes' %>
<label for="issue_private_notes"><%= f.check_box :private_notes, :no_label => true %> <%= l(:field_private_notes) %></label>
<% end %>
<!--<%# if @issue.safe_attribute? 'private_notes' %>-->
<!--<label for="issue_private_notes"><%#= f.check_box :private_notes, :no_label => true %> <%#= l(:field_private_notes) %></label>-->
<!--<%# end %>-->
<%= call_hook(:view_issues_edit_notes_bottom, { :issue => @issue, :notes => @notes, :form => f }) %>
</fieldset>
<!--</fieldset>-->
<fieldset><legend><%= l(:label_attachment_plural) %></legend>
<p><%= render :partial => 'attachments/form', :locals => {:container => @issue} %></p>
</fieldset>
<div class="box tabular" >
<p id="watchers_form">
<label style="font-size: 15px;"><%= l(:label_issue_watchers) %></label>
<span id="watchers_inputs" style="font-size: 15px;">
<%= watchers_checkboxes(@issue, @available_watchers) %>
</span>
<span class="search_for_watchers" style="font-size: 15px;">
<%= link_to l(:label_search_for_watchers),
{:controller => 'watchers', :action => 'new', :project_id => @issue.project},
:remote => true,
:method => 'get' %>
</span>
</p>
</div>
</div>
<!--<fieldset><legend><%#= l(:label_attachment_plural) %></legend>-->
<p style="padding-top: 5px;"><%= render :partial => 'attachments/form', :locals => {:container => @issue} %>
<!--</fieldset>-->
<div class="cl"></div>
<%= f.hidden_field :lock_version %>
<%= hidden_field_tag 'last_journal_id', params[:last_journal_id] || @issue.last_journal_id %>
<%= hidden_field_tag 'reference_user_id', params[:reference_user_id]%>
<%= submit_tag l(:button_submit) %>
<%= preview_link preview_edit_issue_path(:project_id => @project, :id => @issue), 'issue-form' %>
<% end %>
<div id="preview" class="wiki"></div>

View File

@ -1,80 +1,74 @@
<script type="text/javascript">
$(document).ready(function(){
$("#issue_project_id").css("width","100%");
$("#issue_project_id").css("overflow ","hidden");
// $(".jstEditor").css("margin-left ","80px");
//issue_project_id
});
</script>
<div class="newpro_box">
<%= labelled_fields_for :issue, @issue do |f| %>
<%= call_hook(:view_issues_form_details_top, { :issue => @issue, :form => f }) %>
<ul>
<li>
<% if @issue.safe_attribute? 'tracker_id' %>
<label class="label"><span class="c_red f12">*</span>&nbsp;跟踪&nbsp;&nbsp;:&nbsp;</label>
<%= f.select :tracker_id,
@issue.project.trackers.collect {|t| [t.name, t.id]},
{:required => true, :no_label => true},
:onchange => "updateIssueFrom('#{escape_javascript project_issue_form_path(@project, :id => @issue, :format => 'js')}')",
:class=> "w150"
%>
<% end %>
</li>
<li>
<% if @issue.safe_attribute? 'is_private' %>
<%= f.check_box :is_private, :no_label => true ,:class=> "ml30"%><label class="fl ml5 mt3" for="issue_is_private" id="issue_is_private_label"><%= l(:field_is_private) %></label>
<% end %>
</li>
<div class="cl"></div>
<!--<li>-->
<!--<%# if @issue.safe_attribute? 'project_id' %>-->
<%#= f.select :project_id, project_tree_options_for_select(@issue.allowed_target_projects, :selected => @issue.project), {:required => true},
<%= labelled_fields_for :issue, @issue do |f| %>
<%= call_hook(:view_issues_form_details_top, {:issue => @issue, :form => f}) %>
<div class="newpro_box">
<ul>
<li>
<% if @issue.safe_attribute? 'tracker_id' %>
<label class="label"><span class="c_red f12">*</span>&nbsp;跟踪&nbsp;&nbsp;:&nbsp;</label>
<%= f.select :tracker_id,
@issue.project.trackers.collect { |t| [t.name, t.id] },
{:required => true, :no_label => true},
:onchange => "updateIssueFrom('#{escape_javascript project_issue_form_path(@project, :id => @issue, :format => 'js')}')",
:class => "w150"
%>
<% end %>
</li>
<li>
<% if @issue.safe_attribute? 'is_private' %>
<%= f.check_box :is_private, :no_label => true, :class => "ml30" %>
<label class="fl ml5 mt3" for="issue_is_private" id="issue_is_private_label"><%= l(:field_is_private) %></label>
<% end %>
</li>
<div class="cl"></div>
<!--<li>-->
<!--<%# if @issue.safe_attribute? 'project_id' %>-->
<%#= f.select :project_id, project_tree_options_for_select(@issue.allowed_target_projects, :selected => @issue.project), {:required => true},
:onchange => "updateIssueFrom('#{escape_javascript project_issue_form_path(@project, :id => @issue, :format => 'js')}')" %>
<!--<%# end %>-->
<!--</li>-->
<li>
<% if @issue.safe_attribute? 'subject' %>
<label class="label"><span class="c_red f12">*</span>&nbsp;主题&nbsp;&nbsp;:&nbsp;</label>
<%= f.text_field :subject,
:class => "w583",
:maxlength => 255,
:required => true,
:style => "font-size:small",
:no_label => true
%>
<!--Added by young-->
<%= javascript_tag do %>
observeAutocompleteField('issue_subject', '<%= escape_javascript auto_complete_issues_path(:project_id => @project,:scope => (Setting.cross_project_issue_relations? ? 'all' : nil)) %>',
{ select: function(event, ui) {
$('input#issue_subject').val(ui.item.value);
}
});
<% end %>
<!--<%# end %>-->
<!--</li>-->
<li>
<% if @issue.safe_attribute? 'subject' %>
<label class="label"><span class="c_red f12">*</span>&nbsp;主题&nbsp;&nbsp;:&nbsp;</label>
<%= f.text_field :subject,
:class => "w583",
:maxlength => 255,
:style => "font-size:small",
:no_label => true
%>
<!--Added by young-->
<%= javascript_tag do %>
observeAutocompleteField('issue_subject',
'<%= escape_javascript auto_complete_issues_path(:project_id => @project, :scope => (Setting.cross_project_issue_relations? ? 'all' : nil)) %>
',
{ select: function(event, ui) {
$('input#issue_subject').val(ui.item.value);
}
});
<% end %>
<% end %>
</li>
<div class="cl"></div>
<% end %>
</li>
<div class="cl"></div>
<li>
<% if @issue.safe_attribute? 'description' %>
<label class="label"><span class="c_red f12">*</span>&nbsp;描述&nbsp;&nbsp;:&nbsp;</label>
<%= f.label_for_field :description, :required => @issue.required_attribute?('description'), :no_label=>true , :class=> "label" %>
<%= link_to_function image_tag('edit.png'), '$(this).hide(); $("#issue_description_and_toolbar").show()' unless @issue.new_record? %>
<%= content_tag 'span', :id => "issue_description_and_toolbar", :style => (@issue.new_record? ? nil : 'display:none') do %>
<%= f.text_area :description,
:rows => (@issue.description.blank? ? 10 : [[10, @issue.description.length / 50].max, 100].min),
:accesskey => accesskey(:edit),
:class => "w583",
:no_label => true %>
<% end %>
<li>
<% if @issue.safe_attribute? 'description' %>
<label class="label"><span class="c_red f12">*</span>&nbsp;描述&nbsp;&nbsp;:&nbsp;</label>
<%= f.label_for_field :description, :required => @issue.required_attribute?('description'), :no_label => true, :class => "label" %>
<%= link_to_function image_tag('edit.png'), '$(this).hide(); $("#issue_description_and_toolbar").show()' unless @issue.new_record? %>
<%= content_tag 'span', :id => "issue_description_and_toolbar", :style => (@issue.new_record? ? nil : 'display:none') do %>
<%= f.text_area :description,
:rows => (@issue.description.blank? ? 10 : [[10, @issue.description.length / 50].max, 100].min),
:accesskey => accesskey(:edit),
:class => "w583",
:no_label => true %>
<% end %>
<%= wikitoolbar_for 'issue_description' %>
<% end %>
</li>
<div class="cl"></div>
<%= wikitoolbar_for 'issue_description' %>
<% end %>
</li>
<div class="cl"></div>
</ul>
</div>
<li>
<% if @copy_from && @copy_from.attachments.any? %>
<p>
@ -92,15 +86,31 @@
</li>
<div class="cl"></div>
<li>
<label class="label" ><span class="c_red f12">*</span><%= l(:label_attachment_plural) %></label>
<br>
<label class="label"><span class="c_red f12">*</span><%= l(:label_attachment_plural) %></label>
<%= render :partial => 'attachments/form', :locals => {:container => @issue} %>
<li>
</li>
<div class="cl"></div>
</ul>
<div id="attributes">
<%= render :partial => 'issues/attributes' %>
</div>
</div>
<%= call_hook(:view_issues_form_details_bottom, { :issue => @issue, :form => f }) %>
<% end %>
<div id="attributes">
<%= render :partial => 'issues/attributes' %>
</div>
<div class="cl"></div>
<div class="newpro_box02 ">
<label class="label"> <%= l(:label_issue_watchers) %></label>
<input id="" name="" size="22" class="fl mb10 h26" type="text" placeholder="搜索添加跟踪者">
<span class="search_for_watchers">
<%= link_to "",
{:controller => 'watchers', :action => 'new', :project_id => @issue.project},
:remote => true,
:method => 'get',
:class => "pic_sch mt5 ml5" %>
</span>
<%= javascript_tag "observeSearchfield('user_search', 'users_for_watcher', '#{ escape_javascript watchers_autocomplete_for_user_path(:user => @available_watchers, :format => 'js', :flag => 'ture') }')" %>
<div class="cl"></div>
<span id="watchers_inputs">
<%= watchers_checkboxes(@issue, @available_watchers) %>
</span>
<div class="cl"></div>
</div>
<%= call_hook(:view_issues_form_details_bottom, {:issue => @issue, :form => f}) %>
<% end %>

View File

@ -17,24 +17,17 @@
<% end %>
</p>
</div>
<!--编辑、引用、回复按钮-->
<div class="ping_disfoot"><%= render_links(issue, journal, :reply_links => reply_links) unless journal.notes.blank? %></div>
<!--回复内容、引用内容-->
<p><%= render_notes_issue(issue, journal, :reply_links => reply_links) unless journal.notes.blank? %></p>
<div class="cl"></div>
<div class="recall" >
<div class="recall_head"><a href="#" target="_blank"><img src="images/project/pic_01.jpg" width="30" height="30" /></a></div>
<div class="recall_con">
<p><%= render_notes(issue, journal, :reply_links => reply_links) unless journal.notes.blank? %></p>
<span class="c_grey fl"><%= format_time journal.created_on %></span>
</div>
<div class="cl"></div>
</div><!---recall end-->
<!---recall end-->
</div>
<div class="cl"></div>
</div>
</div>
<%= call_hook(:view_issues_history_journal_bottom, { :journal => journal }) %>
<%= call_hook(:view_issues_history_journal_bottom, { :journal => journal }) %>
<% end %>
<% heads_for_wiki_formatter if User.current.allowed_to?(:edit_issue_notes, issue.project) || User.current.allowed_to?(:edit_own_issue_notes, issue.project) %>

View File

@ -11,7 +11,7 @@
<div class="problem_txt fl">
<%= link_to issue.author.name, user_path(issue.author), :class => "problem_name c_orange fl" %>
<span class="fl"><%= l(:label_post_on_issue) %>(<%= "#{raw column_content[2]}" %>)</span>
<%=link_to "#{column_content[4]}<span class = '#{get_issue_type(column_content[1])}'>#{get_issue_typevalue(column_content[1])}</span>".html_safe, issue_path(issue.id), :class => "problem_tit02 fl" %>
<%=link_to "#{column_content[4]}<span class = '#{get_issue_type(column_content[1])}'>#{get_issue_typevalue(column_content[1])}</span>".html_safe, issue_path(issue.id), :class => "problem_tit02 fl break_word" %>
<div class="cl"></div>
<p>
<% unless issue.assigned_to_id.nil? %>

View File

@ -1,6 +1,7 @@
<div class="project_r_h">
<h2 class="project_h2"><%= l(:label_issue_tracking) %></h2>
</div>
<div class="problem_top">
<% unless @project.enabled_modules.where("name = 'issue_tracking'").empty? %>
<span>
@ -8,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,48 +1,20 @@
<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}) %>
<%= labelled_form_for @issue, :url => project_issues_path(@project),
:html => {:id => 'issue-form', :multipart => true} do |f| %>
<%= error_messages_for 'issue' %>
<%= hidden_field_tag 'copy_from', params[:copy_from] if params[:copy_from] %>
<div class="newpro_box">
<%= render :partial => 'issues/form', :locals => {:f => f} %>
</div>
<div class="newpro_box02 ">
<% if @issue.safe_attribute? 'watcher_user_ids' -%>
<div>
<label class="label" > <%= l(:label_issue_watchers) %></label>
<input id="" name="" size="22" class="fl mb10 h26" type="text" value="搜索添加跟踪者" >
<span class="search_for_watchers">
<%= link_to "",
{:controller => 'watchers', :action => 'new', :project_id => @issue.project},
:remote => true,
:method => 'get',
:class=>"pic_sch mt5 ml5" %>
</span>
</div>
<%= javascript_tag "observeSearchfield('user_search', 'users_for_watcher', '#{ escape_javascript watchers_autocomplete_for_user_path(:user=> @available_watchers, :format => 'js',:flag => 'ture') }')" %>
<div class="cl"></div>
<span id="watchers_inputs">
<%= watchers_checkboxes(@issue, @available_watchers) %>
</span>
<div class="cl"></div>
<div id="watchers_inputs">
</div>
<div class="cl"></div>
</ul>
<div class="cl"></div>
<% end %>
:html => {:id => 'issue-form', :multipart => true} do |f| %>
<%= error_messages_for 'issue' %>
<%= hidden_field_tag 'copy_from', params[:copy_from] if params[:copy_from] %>
<div>
<%= render :partial => 'issues/form', :locals => {:f => f} %>
</div>
<!--<%= javascript_tag "$('#issue_subject').focus();" %>-->
<a href="#" class="blue_btn fl ml80" onclick="$('#issue-form').submit();">
<%= l(:button_create)%>
<%= l(:button_create) %>
</a>
<%= preview_link preview_new_issue_path(:project_id => @project), 'issue-form','preview',{:class => "blue_btn fl ml10"}%>
</div>
<%= javascript_tag "$('#issue_subject').focus();" %>
<%= preview_link preview_new_issue_path(:project_id => @project), 'issue-form', 'preview', {:class => "blue_btn fl ml10"} %>
<% end %>
<div id="preview" class="wiki"></div>

View File

@ -1,195 +1,154 @@
<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" >
<div class="pro_page_top">
<a href="javascript:void(0)"><%= @issue.project.name %></a> >
<a href="javascript:void(0)"><%= "#" + @issue.project_index %></a>
</div>
<div class="problem_main">
<div class="ping_dispic">
<%= link_to image_tag(url_to_avatar(@issue.author),:width => 46,:height => 46), user_path(@issue.author), :class => "ping_dispic" %>
<div class="pro_page_box">
<div class="pro_page_top">
<a href="javascript:void(0)"><%= @issue.project.name %></a> >
<a href="javascript:void(0)"><%= "#" + @issue.project_index %></a>
</div>
<div class="talk_txt fl">
<p class="pro_page_tit" >
<%= @issue.subject %><span class='<%= "#{get_issue_type(@issue.tracker_id)}" %>'><%= get_issue_typevalue(@issue.tracker_id) %></span></p><br />
<div class="cl"></div>
<p>由<a href="javascript:void(0)" class="problem_name"><%= @issue.author %></a>
<% if @issue.created_on != @issue.updated_on %>
更新于 <%= format_time(@issue.created_on).html_safe %>
<% else %>
添加于 <%= format_time(@issue.updated_on).html_safe %>
<% end %>
</div><!--talk_txt end-->
<a href="javascript:void(0)" class="talk_edit fr"<%= render :partial => 'action_menu' %></a>
<div class="cl"></div>
<div class="talk_info mb10">
<% if @issue.description? || @issue.attachments.any? -%>
<% if @issue.description? %>
<%#= link_to l(:button_quote), quoted_issue_path(@issue.id), :remote => true, :method => 'post', :class => 'icon icon-comment' if authorize_for('issues', 'edit') %>
<%= textilizable @issue, :description, :attachments => @issue.attachments %>
<div class="problem_main">
<div class="ping_dispic">
<%= link_to image_tag(url_to_avatar(@issue.author), :width => 46, :height => 46), user_path(@issue.author), :class => "ping_dispic" %>
</div>
<div class="talk_txt fl">
<p class="pro_page_tit" style="word-break:break-all;">
<%= @issue.subject %>
<span class='<%= "#{get_issue_type(@issue.tracker_id)}" %>'><%= get_issue_typevalue(@issue.tracker_id) %></span>
</p><br/>
<div class="cl"></div>
<p>由<a href="javascript:void(0)" class="problem_name"><%= @issue.author %></a>
<% if @issue.created_on != @issue.updated_on %>
更新于 <%= format_time(@issue.created_on).html_safe %>
<% else %>
添加于 <%= format_time(@issue.updated_on).html_safe %>
<% end %>
</div>
<div class="pro_pic_box mb10">
<a href="javascript:void(0)" class="link_img fl"><span class="pic_img fl"></span>
<!--显示附件、图片-->
<%= link_to_attachments @issue, :thumbnails => true %></a><br />
<% end -%>
<%= call_hook(:view_issues_show_description_bottom, :issue => @issue) %>
</div><!--pro_pic_box end-->
<div class="cl"></div>
<!--属性-->
<div class="pro_info_box mb10">
<%= issue_fields_rows do |rows| %>
<ul class="fl" >
<li><p class="label" ><span class="c_red f12">*</span>&nbsp;状态&nbsp;&nbsp;:&nbsp;</p><p class="pro_info_p"><%= @issue.status.name %></p>
</li>
<div class="cl"></div>
<li><p class="label" ><span class="c_red f12">*</span>&nbsp;优先级&nbsp;&nbsp;:&nbsp;</p><span class="pro_info_p"><%= @issue.priority.name %></span>
</li>
<div class="cl"></div>
<% unless @issue.disabled_core_fields.include?('assigned_to_id') %>
<li><p class="label" >&nbsp;指派给&nbsp;&nbsp;:&nbsp;</p><span class="pro_info_p"><%= @issue.assigned_to ? link_to_user(@issue.assigned_to, :class => "pro_info_p") : "-" %></span></li>
</div>
<!--talk_txt end-->
<a href="javascript:void(0)" class="talk_edit fr"<%= render :partial => 'action_menu' %></a>
<div class="cl"></div>
<div class="talk_info mb10" style="word-break:break-all;">
<% if @issue.description? || @issue.attachments.any? -%>
<% if @issue.description? %>
<%#= link_to l(:button_quote), quoted_issue_path(@issue.id), :remote => true, :method => 'post', :class => 'icon icon-comment' if authorize_for('issues', 'edit') %>
<%= textilizable @issue, :description, :attachments => @issue.attachments %>
<% end %>
</div>
<div class="pro_pic_box mb10">
<a href="javascript:void(0)" class="link_img fl">
<!--显示附件、图片-->
<%= link_to_attachment_project @issue, :thumbnails => true %></a><br/>
<% end -%>
<%= call_hook(:view_issues_show_description_bottom, :issue => @issue) %>
</div><!--pro_pic_box end-->
<div class="cl"></div>
<% unless @issue.disabled_core_fields.include?('fixed_version_id') %>
<li><p class="label" >&nbsp;目标版本&nbsp;&nbsp;:&nbsp;</p><span class="pro_info_p"><%= (@issue.fixed_version ? link_to_version(@issue.fixed_version, :class => "pro_info_p") : "-") %></span></li>
<% end %>
<!--属性-->
<div class="pro_info_box mb10">
<%= issue_fields_rows do |rows| %>
<ul class="fl">
<li><p class="label"><span class="c_red f12">*</span>&nbsp;状态&nbsp;&nbsp;:&nbsp;</p>
<p class="pro_info_p"><%= @issue.status.name %></p>
</li>
<div class="cl"></div>
<li><p class="label"><span class="c_red f12">*</span>&nbsp;优先级&nbsp;&nbsp;:&nbsp;</p>
<span class="pro_info_p"><%= @issue.priority.name %></span>
</li>
<div class="cl"></div>
<% unless @issue.disabled_core_fields.include?('assigned_to_id') %>
<li><p class="label">&nbsp;指派给&nbsp;&nbsp;:&nbsp;</p>
<span class="pro_info_p"><%= @issue.assigned_to ? link_to_isuue_user(@issue.assigned_to) : "-" %></span>
</li>
<% end %>
<div class="cl"></div>
<% unless @issue.disabled_core_fields.include?('fixed_version_id') %>
<li><p class="label">&nbsp;目标版本&nbsp;&nbsp;:&nbsp;</p>
<span class="pro_info_p"><%= (@issue.fixed_version ? link_to_version(@issue.fixed_version, :class => "pro_info_p") : "-") %></span>
</li>
<% end %>
<div class="cl"></div>
</ul>
<ul class="fl ml90">
<% unless @issue.disabled_core_fields.include?('start_date') %>
<li><p class="label02">&nbsp;开始日期&nbsp;&nbsp;:&nbsp;</p>
<p class="pro_info_p"><%= format_date(@issue.start_date) %></p></li>
<% end %>
<div class="cl"></div>
<% unless @issue.disabled_core_fields.include?('due_date') %>
<li><p class="label02">&nbsp;计划完成日期&nbsp;&nbsp;:&nbsp;</p>
<span class="pro_info_p"><%= format_date(@issue.due_date) %></span>
</li>
<% end %>
<div class="cl"></div>
<% unless @issue.disabled_core_fields.include?('estimated_hours') %>
<li><p class="label02">&nbsp;预期时间&nbsp;&nbsp;:&nbsp;</p>
<span class="pro_info_p"><%= l_hours(@issue.estimated_hours) %></span>
</li>
<% end %>
<div class="cl"></div>
<% unless @issue.disabled_core_fields.include?('done_ratio') %>
<li><p class="label02">&nbsp;% 完成&nbsp;&nbsp;:&nbsp;</p>
<span class="pro_info_p"><%= @issue.done_ratio %>%</span>
</li>
<% end %>
<div class="cl"></div>
</ul>
<% end %>
<%#= render_custom_fields_rows(@issue) %>
<%#= call_hook(:view_issues_show_details_bottom, :issue => @issue) %>
</div>
<!--pro_info_box 属性 end-->
<div class="cl"></div>
</ul>
<ul class="fl ml90" >
<% unless @issue.disabled_core_fields.include?('start_date') %>
<li><p class="label02" >&nbsp;开始日期&nbsp;&nbsp;:&nbsp;</p><p class="pro_info_p"><%= format_date(@issue.start_date) %></p></li>
<% end %>
<%= link_to l(:button_quote), quoted_issue_path(@issue.id), :remote => true, :method => 'post', :class => 'talk_edit fr' if authorize_for('issues', 'edit') %></a>
<div class="cl"></div>
<% unless @issue.disabled_core_fields.include?('due_date') %>
<li><p class="label02" >&nbsp;计划完成日期&nbsp;&nbsp;:&nbsp;</p><span class="pro_info_p"><%= format_date(@issue.due_date) %></span>
</li>
<% end %>
<div class="cl"></div>
<% unless @issue.disabled_core_fields.include?('estimated_hours') %>
<li><p class="label02" >&nbsp;预期时间&nbsp;&nbsp;:&nbsp;</p><span class="pro_info_p"><%= l_hours(@issue.estimated_hours) %></span>
</li>
<% end %>
<div class="cl"></div>
<% unless @issue.disabled_core_fields.include?('done_ratio') %>
<li><p class="label02" >&nbsp;% 完成&nbsp;&nbsp;:&nbsp;</p><span class="pro_info_p"><%= progress_bar(@issue.done_ratio, :width => '80px', :legend => "#{@issue.done_ratio}%") %></span>
</li>
<% end %>
<div class="cl"></div>
</ul>
<% end %>
<%#= render_custom_fields_rows(@issue) %>
<%#= call_hook(:view_issues_show_details_bottom, :issue => @issue) %>
</div><!--pro_info_box 属性 end-->
<div class="cl"></div>
<%= link_to l(:button_quote), quoted_issue_path(@issue.id), :remote => true, :method => 'post', :class => 'talk_edit fr' if authorize_for('issues', 'edit') %></a>
<div class="cl"></div>
</div><!--problem_main end-->
<!--留言-->
<% if @journals.present? %>
<div id="history">
<h3><%=l(:label_history)%></h3>
<%= render :partial => 'history', :locals => { :issue => @issue, :journals => @journals } %>
</div>
<% end %>
</div><!--pro_page_box end-->
<%# html_title "#{@issue.tracker.name} ##{@issue.id}: #{@issue.subject}" %>
<!--<div class="<%#= @issue.css_classes %> details">-->
<!--<%#· if @prev_issue_id || @next_issue_id %>-->
<!--<div class="next-prev-links contextual">-->
<%#·= link_to_if @prev_issue_id,
# "\xc2\xab #{l(:label_previous)}",
# (@prev_issue_id ? issue_path(Issue.find_by_id(@prev_issue_id)) : nil),
:title => "##{@prev_issue_id}" %> |
<!--<%# if @issue_position && @issue_count %>-->
<!--<span class="position"><%#= l(:label_item_position, :position => @issue_position, :count => @issue_count) %></span> |-->
<!--<%# end %>-->
<%#= link_to_if @next_issue_id,
# "#{l(:label_next)} \xc2\xbb",
# (@next_issue_id ? issue_path(Issue.find_by_id(@next_issue_id)) : nil),
:title => "##{@next_issue_id}" %>
<!--</div>-->
<!--<%# end %>-->
<!-- 顶和踩 在这里添加 -->
<!--<span id="praise_tread" style="float: right">-->
<!--<%#= render :partial => "/praise_tread/praise_tread",:locals => {:obj => @issue,:show_flag => true,:user_id =>User.current.id,:horizontal => false}%>-->
<!--</span>-->
<!--<p class="author">-->
<%#= authoring @issue.created_on, @issue.author %>.
<!--<%# if @issue.created_on != @issue.updated_on %>-->
<%#= l(:label_updated_time, time_tag(@issue.updated_on)).html_safe %>.
<!--<%# end %>-->
<!--</p>-->
<!-- added by william -for tag -->
<!--<div id="tags">-->
<!--<%#= render :partial => 'tags/tag', :locals => {:obj => @issue,:object_flag => "3" }%>-->
<!--</div>-->
<!--<%# if false # !@issue.leaf? || User.current.allowed_to?(:manage_subtasks, @project) %>-->
<!--<hr />-->
<!--<div id="issue_tree">-->
<!--<div class="contextual">-->
<!--<%#= link_to_new_subtask(@issue) if User.current.allowed_to?(:manage_subtasks, @project) %>-->
<!--</div>-->
<!--<p><strong><%#=l(:label_subtask_plural)%></strong></p>-->
<!--<%#= render_descendants_tree(@issue) unless @issue.leaf? %>-->
<!--</div>-->
<!--<%# end %>-->
<!--<%# if @relations.present? || User.current.allowed_to?(:manage_issue_relations, @project) %>-->
<!--<hr />-->
<!--<div id="relations">-->
<!--<%#= render :partial => 'relations' %>-->
<!--</div>-->
<!--<%# end %>-->
<!--</div>-->
</div>
<!--problem_main end-->
<div style="clear: both;"></div>
<% if @issue.editable? %>
<div id="update">
<%= render :partial => 'edit' %>
</div>
<% end %>
<!--留言-->
<a remote="true" href="javascript:void(0)" class="blue_btn fr mr80" onclick="$('#issue-form').submit();">
<%= l(:button_submit) %>
</a>
<%#= submit_tag l(:button_submit) %>
<%= preview_link preview_edit_issue_path(:project_id => @project, :id => @issue), 'issue-form' ,'preview',{:class => "blue_btn fr mr10"}%>
</div>
<% if @changesets.present? %>
<div id="issue-changesets">
<h3><%=l(:label_associated_revisions)%></h3>
<%= render :partial => 'changesets', :locals => { :changesets => @changesets} %>
</div>
<div id="issue-changesets">
<h3><%= l(:label_associated_revisions) %></h3>
<%= render :partial => 'changesets', :locals => {:changesets => @changesets} %>
</div>
<% end %>
<!--留言-->
<!--留言-- end>
<!--<div style="clear: both;"></div>-->
<!--<%#= render :partial => 'action_menu' %>-->
<div style="clear: both;"></div>
<% if @issue.editable? %>
<div id="update">
<%= render :partial => 'edit' %>
</div>
<% end %>
<div class="cl"></div>
<% other_formats_links do |f| %>
<%= f.link_to 'Atom', :url => {:key => User.current.rss_key} %>
<%= f.link_to 'PDF' %>
<%= f.link_to 'Atom', :url => {:key => User.current.rss_key} %>
<%= f.link_to 'PDF' %>
<% end %>
<% content_for :sidebar do %>
<%= render :partial => 'issues/sidebar' %>
<% if User.current.allowed_to?(:add_issue_watchers, @project) ||
(@issue.watchers.present? && User.current.allowed_to?(:view_issue_watchers, @project)) %>
<div id="watchers">
<%= render :partial => 'watchers/watchers', :locals => {:watched => @issue} %>
</div>
<% end %>
<%= render :partial => 'issues/sidebar' %>
<br>
<% if User.current.allowed_to?(:add_issue_watchers, @project) ||
(@issue.watchers.present? && User.current.allowed_to?(:view_issue_watchers, @project)) %>
<div id="watchers">
<%= render :partial => 'watchers/watchers', :locals => {:watched => @issue} %>
</div>
<% end %>
<% end %>
<% content_for :header_tags do %>

View File

@ -1,5 +1,4 @@
<% attaments_num = @project.attachments.count+Attachment.where(["`container_type` = 'Version' and `container_id` in (?)",@project.versions.map{ |v| v.id}]).all.count %>
<div id="project_memu">
<div class="subNav">
<%= link_to l(:label_activity), {:controller => 'projects', :action => 'show', :id => @project.id}, :class => "f14 c_blue02" %>
<% unless ForgeActivity.where("project_id = ?", @project.id).count == 0 %>
@ -50,5 +49,4 @@
<div class="subNav subNav_jiantou" onclick="expand_tools_expand();" id="expand_tools_expand"><%= l(:label_project_more) %></div>
<ul class="navContent">
<%= render 'projects/tools_expand' %>
</ul>
</div>
</ul>

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

@ -1,5 +1,4 @@
<% attaments_num = @project.attachments.count+Attachment.where(["`container_type` = 'Version' and `container_id` in (?)",@project.versions.map{ |v| v.id}]).all.count %>
<div id="project_memu">
<div class="subNav">
<%= link_to l(:label_activity), {:controller => 'projects', :action => 'show', :id => @project.id}, :class => "f14 c_blue02" %>
<% unless ForgeActivity.where("project_id = ?", @project.id).count == 0 %>
@ -27,5 +26,4 @@
<%= link_to "+"+l(:label_upload_files), project_files_path(@project,:flag => true), :class => "subnav_green ml95" %>
<% end %>
</div>
<% end %>
</div>
<% end %>

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

@ -1,5 +1,4 @@
<% attaments_num = @project.attachments.count+Attachment.where(["`container_type` = 'Version' and `container_id` in (?)",@project.versions.map{ |v| v.id}]).all.count %>
<div id="project_memu">
<div class="subNav">
<%= link_to l(:label_activity), {:controller => 'projects', :action => 'show', :id => @project.id}, :class => "f14 c_blue02" %>
<% unless ForgeActivity.where("project_id = ?", @project.id).count == 0 %>
@ -38,5 +37,4 @@
<%= link_to "+"+l(:label_upload_files), project_files_path(@project,:flag => true), :class => "subnav_green ml95" %>
<% end %>
</div>
<% end%>
</div>
<% end%>

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

@ -12,7 +12,7 @@
<%= favicon %>
<%= javascript_heads %>
<%= heads_for_theme %>
<%= stylesheet_link_tag 'public', 'pleft', 'project' %>
<%= stylesheet_link_tag 'public', 'pleft', 'project','jquery/jquery-ui-1.9.2' %>
<%= javascript_include_tag 'project', 'header' %>
<%= call_hook :view_layouts_base_html_head %>
<!-- page specific tags -->
@ -43,19 +43,19 @@
if(data == 1)
{
$("#setting_project_type").replaceWith("<%= escape_javascript(project_type_link(l(:label_development_team)))%>");
$("#project_memu").html('<%= escape_javascript(render(:partial => 'layouts/base_development_group')) %>');
$("#project_memu_list").html('<%= escape_javascript(render(:partial => 'layouts/base_development_group')) %>');
$("#close_light").attr("onClick","close_window('development_group');");
}
else if(data == 2)
{
$("#setting_project_type").replaceWith("<%= escape_javascript(project_type_link(l(:label_research_group)))%>");
$("#project_memu").html('<%= escape_javascript(render(:partial => 'layouts/base_research_team')) %>');
$("#project_memu_list").html('<%= escape_javascript(render(:partial => 'layouts/base_research_team')) %>');
$("#close_light").attr("onClick","close_window('research_group');");
}
else if(data == 3)
{
$("#setting_project_type").replaceWith("<%= escape_javascript(project_type_link(l(:label_friend_organization)))%>");
$("#project_memu").html('<%= escape_javascript(render(:partial => 'layouts/base_friend_group')) %>');
$("#project_memu_list").html('<%= escape_javascript(render(:partial => 'layouts/base_friend_group')) %>');
$("#close_light").attr("onClick","close_window('friend_organization');");
}
else
@ -99,8 +99,8 @@
<a href="#" onclick="submitSerch('<%= l(:label_search_conditions_not_null) %>');" class="search_btn fl f14 c_white" >
<%= l(:label_search)%>
</a>
<br />
<span id="project_name_span" style="float: left"></span>
<div class="cl"></div>
<span id="project_name_span" class="fl"></span>
<% end %>
</div>
</div><!--TopBar end-->
@ -165,13 +165,15 @@
<% end %><!--end-->
<!--menu 左侧工具栏 -->
<!--project_new_type: 1为开发组2为科研组3为朋友圈子-->
<% if @project.project_new_type == 1 || @project.project_new_type.nil? %>
<div id="project_memu_list">
<% if @project.project_new_type == 1 || @project.project_new_type.nil? %>
<%= render :partial => 'layouts/base_development_group', :locals => {:project => @project}%>
<% elsif @project.project_new_type == 2 %>
<%= render :partial => 'layouts/base_research_team', :locals => {:project => @project}%>
<% else %>
<% else %>
<%= render :partial => 'layouts/base_friend_group', :locals => {:project => @project}%>
<% end %>
</div>
<!-- end -->
</div><!--项目侧导航 end-->
<div class="cl"></div>
@ -179,15 +181,15 @@
<!-- 项目描述 -->
<div class="project_intro">
<div id="course_description" class="course_description">
<h4 ><%= l(:label_course_brief_introduction)%></h4>
<h4 ><%= l(:label_project_overview)%></h4>
<div id="course_description_content">
<%= textilizable(@project.description) if @project.description && !@project.description.blank? %>
</div>
</div>
<div class="lg-foot" id="lg-foot" onclick="show_more_msg();">
<%= l(:label_expend_information)%>
<label id="expend_more_information" value="<%= l(:label_expend_information)%>"><%= l(:label_expend_information)%></label>
<span class="g-arr-down">
<img src="/images/jiantou.jpg" width="12" height="6" />
<img id="arrow" src="/images/jiantou.jpg" width="12" height="6" />
</span>
</div>
</div><!--项目简介 end-->

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>

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