This commit is contained in:
alanlong9278 2015-06-19 14:41:05 +08:00
commit 96f907480e
117 changed files with 2444 additions and 1096 deletions

View File

@ -53,7 +53,7 @@ group :assets do
gem 'coffee-rails', '~> 3.2.1' gem 'coffee-rails', '~> 3.2.1'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes # See https://github.com/sstephenson/execjs#readme for more supported runtimes
gem 'therubyracer', :platforms => :ruby gem 'therubyracer', :platforms => :ruby
gem 'uglifier', '>= 1.0.3' gem 'uglifier', '>= 1.0.3'
end end

View File

@ -10,7 +10,7 @@ module Mobile
else else
f[field] f[field]
end end
elsif f.is_a?(::Bid) elsif f.is_a?(::HomeworkCommon)
if f.respond_to?(field) if f.respond_to?(field)
f.send(field) f.send(field)
else else

View File

@ -23,6 +23,7 @@ class AttachmentsController < ApplicationController
before_filter :delete_authorize, :only => [:destroy] before_filter :delete_authorize, :only => [:destroy]
before_filter :authorize_global, :only => [:upload] before_filter :authorize_global, :only => [:upload]
before_filter :authorize_attachment_download1, :only => [:download] before_filter :authorize_attachment_download1, :only => [:download]
before_filter :has_login
#before_filter :login_without_softapplication, only: [:download] #before_filter :login_without_softapplication, only: [:download]
accept_api_auth :show, :download, :upload accept_api_auth :show, :download, :upload
require 'iconv' require 'iconv'
@ -79,9 +80,7 @@ class AttachmentsController < ApplicationController
if candown || User.current.admin? || User.current.id == @attachment.author_id if candown || User.current.admin? || User.current.id == @attachment.author_id
@attachment.increment_download @attachment.increment_download
if stale?(:etag => @attachment.digest) if stale?(:etag => @attachment.digest)
if params[:force] == 'true' if params[:preview] == 'true'
direct_download
else
convered_file = @attachment.diskfile convered_file = @attachment.diskfile
#如果本身不是pdf文件则先寻找是不是已转换化如果没有则转化 #如果本身不是pdf文件则先寻找是不是已转换化如果没有则转化
unless pdf?(convered_file) unless pdf?(convered_file)
@ -96,6 +95,8 @@ class AttachmentsController < ApplicationController
else else
direct_download direct_download
end end
else
direct_download
end end
end end
else else
@ -511,4 +512,8 @@ private
format.js format.js
end end
end end
def has_login
render_403 unless User.current.logged?
end
end end

View File

@ -60,7 +60,7 @@ class CoursesController < ApplicationController
end end
end end
def join_private_courses def join_private_courses
respond_to do |format| respond_to do |format|
format.js format.js
@ -73,14 +73,14 @@ class CoursesController < ApplicationController
c = cs.edit_course params,@course,User.current c = cs.edit_course params,@course,User.current
@course = c[:course] @course = c[:course]
if @course.errors.full_messages.count <= 0 if @course.errors.full_messages.count <= 0
respond_to do |format| respond_to do |format|
format.html { format.html {
# render :layout => 'base_courses' # render :layout => 'base_courses'
flash[:notice] = l(:notice_successful_update) flash[:notice] = l(:notice_successful_update)
redirect_to settings_course_url(@course) redirect_to settings_course_url(@course)
} }
format.api { render_api_ok } format.api { render_api_ok }
end end
else else
respond_to do |format| respond_to do |format|
format.html { format.html {
@ -94,6 +94,9 @@ class CoursesController < ApplicationController
def new_join def new_join
@course = Course.find(params[:object_id]) @course = Course.find(params[:object_id])
respond_to do |format|
format.js
end
end end
# 课程搜索 # 课程搜索
@ -305,7 +308,7 @@ class CoursesController < ApplicationController
def member def member
## 有角色参数的才是课程,没有的就是项目 ## 有角色参数的才是课程,没有的就是项目
if (User.current.admin? || @course.is_public == 1 || (@course.is_public == 0 && User.current.member_of_course?(@course))) if (User.current.admin? || @course.is_public == 1 || (@course.is_public == 0 && User.current.member_of_course?(@course)))
@render_file = 'new_member_list' @render_file = 'new_member_list'
@score_sort_by = "desc" @score_sort_by = "desc"
@canShowCode = User.current.allowed_to?(:as_teacher,@course) && params[:role] != '1' @canShowCode = User.current.allowed_to?(:as_teacher,@course) && params[:role] != '1'
@ -340,8 +343,8 @@ class CoursesController < ApplicationController
def export_course_member_excel def export_course_member_excel
@all_members = student_homework_score(0,0,0,"desc") @all_members = student_homework_score(0,0,0,"desc")
filename="#{@course.teacher.lastname.to_s + @course.teacher.firstname.to_s }_#{@course.name}_#{@course.time.to_s + @course.term}#{l(:excel_member_list)}"; filename="#{@course.teacher.lastname.to_s + @course.teacher.firstname.to_s }_#{@course.name}_#{@course.time.to_s + @course.term}#{l(:excel_member_list)}";
# 如果是ie11 需要转码 # 如果是ie 需要转码
if(/rv\:11\.0/.match(request.env["HTTP_USER_AGENT"]) != nil) if(/trident/.match(request.env["HTTP_USER_AGENT"]) != nil)
filename= URI::encode(filename) filename= URI::encode(filename)
end end
respond_to do |format| respond_to do |format|
@ -447,24 +450,24 @@ class CoursesController < ApplicationController
end end
else else
respond_to do |format| respond_to do |format|
format.html { format.html {
# render :layout => 'base_courses' # render :layout => 'base_courses'
flash[:notice] = l(:notice_successful_create) flash[:notice] = l(:notice_successful_create)
if params[:continue] if params[:continue]
redirect_to new_course_url(attrs, :course => '0') redirect_to new_course_url(attrs, :course => '0')
elsif params[:course_continue] elsif params[:course_continue]
redirect_to new_course_url(:course => '1') redirect_to new_course_url(:course => '1')
else else
redirect_to settings_course_url(@course, :course_type => 1) redirect_to settings_course_url(@course, :course_type => 1)
end end
} }
format.api { render :action => 'show', :status => :created, :location => url_for(:controller => 'courses', :action => 'show', :id => @course.id) } format.api { render :action => 'show', :status => :created, :location => url_for(:controller => 'courses', :action => 'show', :id => @course.id) }
end end
end end
end end
def course def course
@school_id = params[:school_id] @school_id = params[:school_id]
per_page_option = 10 per_page_option = 10
if @school_id == "0" or @school_id.nil? if @school_id == "0" or @school_id.nil?
@courses_all = Course.active.visible. @courses_all = Course.active.visible.
@ -548,8 +551,8 @@ class CoursesController < ApplicationController
def index def index
if !User.current.admin? if !User.current.admin?
render_404 render_404
return return
end end
@course_type = params[:course_type] @course_type = params[:course_type]
@school_id = params[:school_id] @school_id = params[:school_id]
@ -598,7 +601,7 @@ class CoursesController < ApplicationController
respond_to do |format| respond_to do |format|
format.html { format.html {
render :layout => 'base' render :layout => 'base'
} }
format.atom { format.atom {
courses = Course.visible.order('created_on DESC').limit(Setting.feeds_limit.to_i).all courses = Course.visible.order('created_on DESC').limit(Setting.feeds_limit.to_i).all
@ -692,24 +695,31 @@ class CoursesController < ApplicationController
# 显示老师和助教的活动 # 显示老师和助教的活动
# @authors = searchTeacherAndAssistant(@course) # @authors = searchTeacherAndAssistant(@course)
@authors = course_all_member(@course) @authors = course_all_member(@course)
Dir.glob("#{Rails.root}/app/models/*.rb").sort.each { |file| require file }
events = [] events = []
@authors.each do |author| key = "course_events_#{@course.id}".to_sym
@activity = Redmine::Activity::Fetcher.new(User.current, :course => @course, if Rails.env.production? && Setting.course_cahce_enabled?
:with_subprojects => false, events = Rails.cache.read(key) || []
:author => author.user) end
if events.empty?
@authors.each do |author|
@activity = Redmine::Activity::Fetcher.new(User.current, :course => @course,
:with_subprojects => false,
:author => author.user)
@activity.scope_select {|t| has["show_#{t}"]} @activity.scope_select {|t| has["show_#{t}"]}
# modify by nwb # modify by nwb
# 添加私密性判断 # 添加私密性判断
if User.current.member_of_course?(@course)|| User.current.admin? if User.current.member_of_course?(@course)|| User.current.admin?
events += @activity.events(@days, @course.created_at) events += @activity.events(@days, @course.created_at)
else else
events += @activity.events(@days, @course.created_at, :is_public => 1) events += @activity.events(@days, @course.created_at, :is_public => 1)
end
end end
Rails.cache.write(key, events) if Rails.env.production? && Setting.course_cahce_enabled?
end end
else else
# @author = @course.teacher # @author = @course.teacher
@activity = Redmine::Activity::Fetcher.new(User.current, :course => @course, @activity = Redmine::Activity::Fetcher.new(User.current, :course => @course,
:with_subprojects => false, :with_subprojects => false,
:author => @author) :author => @author)
@ -827,7 +837,7 @@ class CoursesController < ApplicationController
def can_show_course def can_show_course
@first_page = FirstPage.find_by_page_type('project') @first_page = FirstPage.find_by_page_type('project')
if @first_page.try(:show_course) == 2 if @first_page.try(:show_course) == 2
render_404 render_404
end end
end end
@ -836,7 +846,7 @@ class CoursesController < ApplicationController
sql_select = "" sql_select = ""
if groupid == 0 if groupid == 0
sql_select = "SELECT members.*,( sql_select = "SELECT members.*,(
SELECT SUM(student_works.final_score) SELECT AVG(student_works.final_score)
FROM student_works,homework_commons FROM student_works,homework_commons
WHERE student_works.homework_common_id = homework_commons.id WHERE student_works.homework_common_id = homework_commons.id
AND homework_commons.course_id = #{@course.id} AND homework_commons.course_id = #{@course.id}
@ -848,7 +858,7 @@ class CoursesController < ApplicationController
WHERE members.course_id = #{@course.id} ORDER BY score #{score_sort_by}" WHERE members.course_id = #{@course.id} ORDER BY score #{score_sort_by}"
else else
sql_select = "SELECT members.*,( sql_select = "SELECT members.*,(
SELECT SUM(student_works.final_score) SELECT AVG(student_works.final_score)
FROM student_works,homework_commons FROM student_works,homework_commons
WHERE student_works.homework_common_id = homework_commons.id WHERE student_works.homework_common_id = homework_commons.id
AND homework_commons.course_id = #{@course.id} AND homework_commons.course_id = #{@course.id}

View File

@ -3,7 +3,8 @@ class HomeworkCommonController < ApplicationController
before_filter :find_course, :only => [:index,:new,:create] before_filter :find_course, :only => [:index,:new,:create]
before_filter :find_homework, :only => [:edit,:update,:alert_anonymous_comment,:start_anonymous_comment,:stop_anonymous_comment,:destroy] before_filter :find_homework, :only => [:edit,:update,:alert_anonymous_comment,:start_anonymous_comment,:stop_anonymous_comment,:destroy]
before_filter :teacher_of_course, :only => [:new, :create, :edit, :update, :destroy, :start_anonymous_comment, :stop_anonymous_comment, :alert_anonymous_comment] before_filter :teacher_of_course, :only => [:new, :create, :edit, :update, :destroy, :start_anonymous_comment, :stop_anonymous_comment, :alert_anonymous_comment]
caches_action :index before_filter :member_of_course, :only => [:index]
def index def index
homeworks = @course.homework_commons.order("created_at desc") homeworks = @course.homework_commons.order("created_at desc")
@is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,@course)) @is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,@course))
@ -29,7 +30,6 @@ class HomeworkCommonController < ApplicationController
@homework_detail_manual.evaluation_start = Time.now.strftime('%Y-%m-%d') @homework_detail_manual.evaluation_start = Time.now.strftime('%Y-%m-%d')
@homework_detail_manual.evaluation_end = (Time.now + 3600 * 24).strftime('%Y-%m-%d') @homework_detail_manual.evaluation_end = (Time.now + 3600 * 24).strftime('%Y-%m-%d')
@homework.homework_detail_manual = @homework_detail_manual @homework.homework_detail_manual = @homework_detail_manual
respond_to do |format| respond_to do |format|
format.html format.html
end end
@ -61,7 +61,6 @@ class HomeworkCommonController < ApplicationController
homework.homework_detail_manual = homework_detail_manual homework.homework_detail_manual = homework_detail_manual
if homework.save if homework.save
expire_action(:controller => 'homework_common', :action => 'index')
respond_to do |format| respond_to do |format|
format.html { format.html {
flash[:notice] = l(:notice_successful_create) flash[:notice] = l(:notice_successful_create)
@ -107,7 +106,6 @@ class HomeworkCommonController < ApplicationController
render_attachment_warning_if_needed(@homework) render_attachment_warning_if_needed(@homework)
if @homework.save && @homework_detail_manual.save if @homework.save && @homework_detail_manual.save
expire_action(:controller => 'homework_common', :action => 'index')
respond_to do |format| respond_to do |format|
format.html { format.html {
flash[:notice] = l(:notice_successful_edit) flash[:notice] = l(:notice_successful_edit)
@ -127,7 +125,6 @@ class HomeworkCommonController < ApplicationController
def destroy def destroy
if @homework.destroy if @homework.destroy
expire_action(:controller => 'homework_common', :action => 'index')
respond_to do |format| respond_to do |format|
format.html {redirect_to homework_common_index_path(:course => @course.id)} format.html {redirect_to homework_common_index_path(:course => @course.id)}
end end
@ -207,6 +204,11 @@ class HomeworkCommonController < ApplicationController
render_403 unless User.current.allowed_to?(:as_teacher,@course) || User.current.admin? render_403 unless User.current.allowed_to?(:as_teacher,@course) || User.current.admin?
end end
#当前用户是不是课程的成员
def member_of_course
render_403 unless User.current.member_of_course?(@course) || User.current.admin?
end
def get_assigned_homeworks(student_works, n, index) def get_assigned_homeworks(student_works, n, index)
student_works += student_works student_works += student_works
student_works[index + 1 .. index + n] student_works[index + 1 .. index + n]

View File

@ -1,8 +1,8 @@
class PollController < ApplicationController class PollController < ApplicationController
before_filter :find_poll_and_course, :only => [:edit,:update,:destroy,:show,:statistics_result,:create_poll_question,:commit_poll,:commit_answer,:publish_poll,:republish_poll,:poll_result,:close_poll] before_filter :find_poll_and_course, :only => [:edit,:update,:destroy,:show,:statistics_result,:create_poll_question,:commit_poll,:commit_answer,:publish_poll,:republish_poll,:poll_result,:close_poll,:export_poll]
before_filter :find_container, :only => [:new,:create, :index] before_filter :find_container, :only => [:new,:create, :index]
before_filter :is_member_of_course, :only => [:index,:show,:poll_result] before_filter :is_member_of_course, :only => [:index,:show,:poll_result]
before_filter :is_course_teacher, :only => [:new,:create,:edit,:update,:destroy,:publish_poll,:republish_poll,:close_poll] before_filter :is_course_teacher, :only => [:new,:create,:edit,:update,:destroy,:publish_poll,:republish_poll,:close_poll,:export_poll]
include PollHelper include PollHelper
def index def index
if @course if @course
@ -360,6 +360,17 @@ class PollController < ApplicationController
end end
end end
#导出问卷
def export_poll
poll_questions = @poll.poll_questions
respond_to do |format|
format.xls {
send_data(poll_to_xls(poll_questions), :type => "text/excel;charset=utf-8; header=present",
:filename => "#{@poll.polls_name}.xls")
}
end
end
private private
def find_poll_and_course def find_poll_and_course
@poll = Poll.find params[:id] @poll = Poll.find params[:id]
@ -438,4 +449,59 @@ class PollController < ApplicationController
end end
pu pu
end end
#将poll中题目转换为Excel
def poll_to_xls poll_questions
xls_report = StringIO.new
book = Spreadsheet::Workbook.new
sheet1 = book.create_worksheet :name => "poll"
blue = Spreadsheet::Format.new :color => :blue, :weight => :bold, :size => 10
count_row = 0
poll_questions.each do |poll_question|
if poll_question.question_type == 1 || poll_question.question_type == 2
sheet1.row(count_row).default_format = blue
sheet1[count_row,0]= l(:label_poll_question_num,:num => poll_question.question_number)
sheet1[count_row + 1,0] = l(:label_poll_subtotal)
sheet1[count_row + 2,0] = l(:label_poll_proportion)
poll_question.poll_answers.each_with_index do |poll_answer,i|
sheet1[count_row, i + 1] = poll_answer.answer_text.gsub(/<\/?.*?>/,"").gsub(/&nbsp;/," ")
sheet1[count_row + 1, i + 1] = poll_answer.poll_votes.count
sheet1[count_row + 2, i + 1] = statistics_result_percentage(poll_answer.poll_votes.count, total_answer(poll_question.id)).to_s + "%"
end
sheet1[count_row + 3,0] = l(:label_poll_valid_commit)
sheet1[count_row + 3,1] = total_answer(poll_question.id)
count_row += 5
else
sheet1.row(count_row).default_format = blue
sheet1[count_row,0] = l(:label_poll_question_num,:num => poll_question.question_number)
sheet1[count_row,1] = poll_question.question_title
count_row += 1
poll_question.poll_votes.each do |poll_vote|
sheet1[count_row,0] = poll_vote.vote_text.gsub(/<\/?.*?>/,"").gsub(/&nbsp;/," ")
count_row += 1
end
count_row += 1
end
end
sheet1.row(count_row).default_format = blue
sheet1[count_row ,0] = l(:label_bidding_user_studentname)
poll_questions.each_with_index do |poll_question, i|
sheet1[count_row ,i + 1] = poll_question.question_title
end
count_row += 1
@poll.users.each do |user|
sheet1[count_row ,0] = user.show_name
poll_questions.each_with_index do |poll_question, i|
if poll_question.question_type == 1 || poll_question.question_type == 2
sheet1[count_row ,i + 1] = user.poll_votes.where(:poll_question_id => poll_question.id).map{|poll_vote| poll_vote.poll_answer.answer_text.gsub(/<\/?.*?>/,"").gsub(/&nbsp;/," ") if poll_vote.poll_answer}.join(";")
else
sheet1[count_row ,i + 1] = user.poll_votes.where(:poll_question_id => poll_question.id).map{|poll_vote| poll_vote.vote_text.gsub(/<\/?.*?>/,"").gsub(/&nbsp;/," ")}.join(";")
end
end
count_row += 1
end
book.write xls_report
xls_report.string
end
end end

View File

@ -66,7 +66,6 @@ class StudentWorkController < ApplicationController
stundet_work.save_attachments(params[:attachments]) stundet_work.save_attachments(params[:attachments])
render_attachment_warning_if_needed(stundet_work) render_attachment_warning_if_needed(stundet_work)
if stundet_work.save if stundet_work.save
expire_action(:controller => 'homework_common', :action => 'index')
respond_to do |format| respond_to do |format|
format.html { format.html {
flash[:notice] = l(:notice_successful_create) flash[:notice] = l(:notice_successful_create)
@ -122,7 +121,6 @@ class StudentWorkController < ApplicationController
def destroy def destroy
if @work.destroy if @work.destroy
expire_action(:controller => 'homework_common', :action => 'index')
respond_to do |format| respond_to do |format|
format.html { format.html {
redirect_to student_work_index_url(:homework => @homework.id) redirect_to student_work_index_url(:homework => @homework.id)
@ -255,13 +253,13 @@ class StudentWorkController < ApplicationController
#是不是当前课程的成员 #是不是当前课程的成员
#当前课程成员才可以看到作品列表 #当前课程成员才可以看到作品列表
def member_of_course def member_of_course
render_403 unless User.current.member_of_course? @course || User.current.admin? render_403 unless User.current.member_of_course? @course
end end
#判断是不是当前作品的提交者 #判断是不是当前作品的提交者
#提交者 && (非匿评作业 || 未开启匿评) 可以编辑作品 #提交者 && (非匿评作业 || 未开启匿评) 可以编辑作品
def author_of_work def author_of_work
render_403 unless (User.current.id == @work.user_id || User.current.admin?) && (@homework.homework_type != 1 || @homework.homework_detail_manual.comment_status == 1 ) render_403 unless User.current.id == @work.user_id && (@homework.homework_type != 1 || @homework.homework_detail_manual.comment_status == 1 )
end end
#根据条件过滤作业结果 #根据条件过滤作业结果

View File

@ -24,7 +24,7 @@ class TestController < ApplicationController
end end
@paths = homeworks_attach_path @paths = homeworks_attach_path
zipfile = ziping homeworks_attach_path zipfile = ziping homeworks_attach_path
send_file zipfile, :filename => bid.name, send_file zipfile, :filename => filename_for_content_disposition(bid.name),
:type => detect_content_type(zipfile) :type => detect_content_type(zipfile)
rescue Errno::ENOENT => e rescue Errno::ENOENT => e
logger.error "[Errno::ENOENT] ===> #{e}" logger.error "[Errno::ENOENT] ===> #{e}"

View File

@ -219,7 +219,7 @@ class WelcomeController < ApplicationController
# 判断网站的入口,是课程 course 则跳过index去渲染 course 方法 # 判断网站的入口,是课程 course 则跳过index去渲染 course 方法
def entry_select def entry_select
url = request.original_url.gsub('/','') url = request.original_url.gsub('/','')
if url.include?(Setting.host_course.gsub('/','')) if url.include?(Setting.url_course.gsub('/',''))
if @first_page.show_course == 1 if @first_page.show_course == 1
course course
render :course render :course
@ -228,7 +228,7 @@ class WelcomeController < ApplicationController
end end
return 0 return 0
elsif url.include?(Setting.host_contest.gsub('/','')) elsif url.include?(Setting.url_contest.gsub('/',''))
if @first_page.show_contest == 1 if @first_page.show_contest == 1
contest contest
render :contest render :contest
@ -237,7 +237,7 @@ class WelcomeController < ApplicationController
end end
return 0 return 0
elsif url.include?(Setting.host_user.gsub('/','')) elsif url.include?(Setting.url_user.gsub('/',''))
#redirect_to(:controller => "users", :action => "index") #redirect_to(:controller => "users", :action => "index")
end end

View File

@ -11,7 +11,7 @@ class ZipdownController < ApplicationController
def download def download
if User.current.logged? if User.current.logged?
begin begin
send_file "#{OUTPUT_FOLDER}/#{params[:file]}", :filename => params[:filename], :type => detect_content_type(params[:file]) send_file "#{OUTPUT_FOLDER}/#{params[:file]}", :filename => filename_for_content_disposition(params[:filename]), :type => detect_content_type(params[:file])
rescue => e rescue => e
render file: 'public/no_file_found.html' render file: 'public/no_file_found.html'
end end
@ -59,9 +59,10 @@ class ZipdownController < ApplicationController
if homework != nil if homework != nil
unless homework.attachments.empty? unless homework.attachments.empty?
zipfile = zip_homework_by_user homework zipfile = zip_homework_by_user homework
send_file zipfile.file_path, :filename => ((homework.user.user_extensions.nil? || homework.user.user_extensions.student_id.nil?) ? "" : homework.user.user_extensions.student_id) + filename = ((homework.user.user_extensions.nil? || homework.user.user_extensions.student_id.nil?) ? "" : homework.user.user_extensions.student_id) +
"_" + homework.user.show_name + "_" + homework.user.show_name +
"_" + homework.name + ".zip", :type => detect_content_type(zipfile.file_path) if(zipfile) "_" + homework.name + ".zip"
send_file zipfile.file_path, :filename => filename_for_content_disposition(filename), :type => detect_content_type(zipfile.file_path) if(zipfile)
else else
render file: 'public/no_file_found.html' render file: 'public/no_file_found.html'
end end

View File

@ -1,7 +1,6 @@
module ActivityNotifysHelper module ActivityNotifysHelper
def get_new_notify_count(container,type) def get_new_notify_count(container,type)
logger.info('xxoo') query = ActivityNotify.where('activity_container_id=? and activity_container_type=? and notify_to=? and is_read=0',container.id,type,User.current.id);
query = ActivityNotify.where('activity_container_id=? and activity_container_type=? and notify_to=?',container.id,type,User.current.id);
return query.count() return query.count()
end end
end end

View File

@ -2330,4 +2330,11 @@ module ApplicationHelper
def cur_user_works_for_homework homework def cur_user_works_for_homework homework
homework.student_works.where("user_id = ?",User.current).first homework.student_works.where("user_id = ?",User.current).first
end end
def file_preview_tag(file, html_options={})
if %w(pdf pptx doc docx xls xlsx).any?{|x| file.filename.downcase.end_with?(x)}
link_to '预览', download_named_attachment_path(file.id, file.filename, preview: true),html_options
end
end
end end

View File

@ -5,4 +5,6 @@ class Activity < ActiveRecord::Base
validates :act_id, presence: true validates :act_id, presence: true
validates :act_type, presence: true validates :act_type, presence: true
validates :user_id, presence: true validates :user_id, presence: true
include Trustie::Cache::ClearCourseEvent
end end

View File

@ -10,158 +10,158 @@ homework_type == 1 文件提交
homework_type == 2 Project提交 homework_type == 2 Project提交
=end =end
class Bid < ActiveRecord::Base class Bid < ActiveRecord::Base
Enterprise = 1 # Enterprise = 1
Contest = 2 # Contest = 2
Homework = 3 # Homework = 3
HomeworkFile = 1 # HomeworkFile = 1
HomeworkProject = 2 # HomeworkProject = 2
attr_accessible :author_id, :budget, :deadline, :name, :description, :homework_type, :password # attr_accessible :author_id, :budget, :deadline, :name, :description, :homework_type, :password
include Redmine::SafeAttributes # include Redmine::SafeAttributes
include ApplicationHelper # include ApplicationHelper
has_many_kindeditor_assets :assets, :dependent => :destroy # has_many_kindeditor_assets :assets, :dependent => :destroy
belongs_to :author, :class_name => 'User', :foreign_key => :author_id # belongs_to :author, :class_name => 'User', :foreign_key => :author_id
belongs_to :course # belongs_to :course
has_many :biding_projects, :dependent => :destroy # has_many :biding_projects, :dependent => :destroy
has_many :projects, :through => :biding_projects # has_many :projects, :through => :biding_projects
has_many :courses_member, :class_name => 'User', :through => :courses # has_many :courses_member, :class_name => 'User', :through => :courses
has_many :journals_for_messages, :as => :jour, :dependent => :destroy # has_many :journals_for_messages, :as => :jour, :dependent => :destroy
has_many :acts, :class_name => 'Activity', :as => :act, :dependent => :destroy # has_many :acts, :class_name => 'Activity', :as => :act, :dependent => :destroy
has_many :homework_for_courses, :dependent => :destroy # has_many :homework_for_courses, :dependent => :destroy
has_many :courses, :through => :homework_for_courses, :source => :course # has_many :courses, :through => :homework_for_courses, :source => :course
has_many :homeworks, :class_name => 'HomeworkAttach', :dependent => :destroy # has_many :homeworks, :class_name => 'HomeworkAttach', :dependent => :destroy
has_many :homework_evaluations, :through => :homeworks # has_many :homework_evaluations, :through => :homeworks
has_many :join_in_contests, :dependent => :destroy # has_many :join_in_contests, :dependent => :destroy
has_many :praise_tread, as: :praise_tread_object, dependent: :destroy # has_many :praise_tread, as: :praise_tread_object, dependent: :destroy
# has_many :fork_homework, :class_name => 'Bid', :conditions => "#{Bid.table_name}.parent_id = #{id}" # # has_many :fork_homework, :class_name => 'Bid', :conditions => "#{Bid.table_name}.parent_id = #{id}"
acts_as_attachable # acts_as_attachable
#
NAME_LENGTH_LIMIT = 60 # NAME_LENGTH_LIMIT = 60
DESCRIPTION_LENGTH_LIMIT = 3000 # DESCRIPTION_LENGTH_LIMIT = 3000
validates :name, length: {maximum: NAME_LENGTH_LIMIT}, presence: true # validates :name, length: {maximum: NAME_LENGTH_LIMIT}, presence: true
validates :description, length: {maximum: DESCRIPTION_LENGTH_LIMIT} # validates :description, length: {maximum: DESCRIPTION_LENGTH_LIMIT}
validates :author_id, presence: true # validates :author_id, presence: true
validates :deadline, presence: true, format: {:with => /^[\d]{4}[-][\d]{1,2}[-][\d]{1,2}$/} # validates :deadline, presence: true, format: {:with => /^[\d]{4}[-][\d]{1,2}[-][\d]{1,2}$/}
validates :name, length: {maximum: NAME_LENGTH_LIMIT} # validates :name, length: {maximum: NAME_LENGTH_LIMIT}
validates :budget, format: { with: ->(p) { if p.reward_type == 1 then /^(\d+)$|^(\d+).([0-9]{2})|^(\d+).([0-9]{1})$/ # validates :budget, format: { with: ->(p) { if p.reward_type == 1 then /^(\d+)$|^(\d+).([0-9]{2})|^(\d+).([0-9]{1})$/
elsif p.reward_type == 3 then /^(\d+)$|^(\d+).([0-9]{1})$/ end } } # elsif p.reward_type == 3 then /^(\d+)$|^(\d+).([0-9]{1})$/ end } }
#
validate :validate_user # validate :validate_user
validate :validate_reward_type # validate :validate_reward_type
after_create :act_as_activity # after_create :act_as_activity
after_destroy :delete_kindeditor_assets # after_destroy :delete_kindeditor_assets
scope :visible, lambda {|*args| # scope :visible, lambda {|*args|
nil # nil
} # }
#
scope :like, lambda {|arg| # scope :like, lambda {|arg|
if arg.blank? # if arg.blank?
where(nil) # where(nil)
else # else
pattern = "%#{arg.to_s.strip.downcase}%" # pattern = "%#{arg.to_s.strip.downcase}%"
where("LOWER(id) LIKE :p OR LOWER(name) LIKE :p OR LOWER(description) LIKE :p", :p => pattern) # where("LOWER(id) LIKE :p OR LOWER(name) LIKE :p OR LOWER(description) LIKE :p", :p => pattern)
end # end
} # }
#
scope :course_visible, lambda {|*args| # scope :course_visible, lambda {|*args|
includes(:courses).where(Course.allowed_to_condition(args.shift || User.current, :view_homeworks, *args)) # includes(:courses).where(Course.allowed_to_condition(args.shift || User.current, :view_homeworks, *args))
} # }
#
acts_as_watchable # acts_as_watchable
acts_as_taggable # acts_as_taggable
#
acts_as_event :title => Proc.new {|o| "#{l(:label_course_homework)} ##{o.id}: #{o.name}" }, # acts_as_event :title => Proc.new {|o| "#{l(:label_course_homework)} ##{o.id}: #{o.name}" },
:description => :description, # :description => :description,
:author => :author, # :author => :author,
:url => Proc.new {|o| {:controller => 'bids', :action => 'show', :id => o.id}} # :url => Proc.new {|o| {:controller => 'bids', :action => 'show', :id => o.id}}
#
acts_as_activity_provider :type => 'homeworks', # acts_as_activity_provider :type => 'homeworks',
:author_key => :author_id # :author_key => :author_id
#
acts_as_activity_provider :find_options => {:include => [:projects, :author]}, # acts_as_activity_provider :find_options => {:include => [:projects, :author]},
:author_key => :author_id # :author_key => :author_id
#
safe_attributes 'name',
'description',
'budget',
'deadline',
'homework_type',
'reward_type',
'password'
# safe_attributes 'name', # safe_attributes 'name',
# 'description', # 'description',
# 'deadline' # 'budget',
def add_jour(user, notes, reference_user_id = 0, options = {}) # 'deadline',
if options.count == 0 # 'homework_type',
jfm = JournalsForMessage.new(:user_id => user.id, :notes => notes, :reply_id => reference_user_id) # 'reward_type',
self.journals_for_messages << jfm # 'password'
jfm #
else #
jfm = self.journals_for_messages.build(options) # # safe_attributes 'name',
jfm.save # # 'description',
jfm # # 'deadline'
end # def add_jour(user, notes, reference_user_id = 0, options = {})
end # if options.count == 0
# jfm = JournalsForMessage.new(:user_id => user.id, :notes => notes, :reply_id => reference_user_id)
def self.creat_bids(budget, deadline, name, description=nil, reward_type) # self.journals_for_messages << jfm
self.create(:author_id => User.current.id, :budget => budget, # jfm
:deadline => deadline, :name => name, :description => description, :commit => 0, :reward_type => reward_type) # else
# self.acts << Activity.new(:user_id => self.author_id) # jfm = self.journals_for_messages.build(options)
end # jfm.save
# jfm
def update_bids(budget, deadline, name, description=nil) # end
if(User.current.id == self.author_id) # end
self.name = name #
self.budget = budget # def self.creat_bids(budget, deadline, name, description=nil, reward_type)
self.deadline = deadline # self.create(:author_id => User.current.id, :budget => budget,
self.description = description # :deadline => deadline, :name => name, :description => description, :commit => 0, :reward_type => reward_type)
self.save # # self.acts << Activity.new(:user_id => self.author_id)
end # end
end #
# def update_bids(budget, deadline, name, description=nil)
def delete_bids # if(User.current.id == self.author_id)
unless self.nil? # self.name = name
if User.current.id == self.author_id # self.budget = budget
self.destroy # self.deadline = deadline
end # self.description = description
end # self.save
end # end
# end
def set_commit(commit) #
self.update_attribute(:commit, commit) # def delete_bids
end # unless self.nil?
# if User.current.id == self.author_id
private # self.destroy
# end
def validate_user # end
errors.add :author_id, :invalid if author.nil? || !author.active? # end
end #
# def set_commit(commit)
def validate_reward_type # self.update_attribute(:commit, commit)
errors.add :reward_type, :invalid if self.reward_type == 0 # end
end #
# private
def act_as_activity #
self.acts << Activity.new(:user_id => self.author_id) # def validate_user
end # errors.add :author_id, :invalid if author.nil? || !author.active?
# end
# used to validate weather the user is the creater of the bid #
# added by william # def validate_reward_type
def validate_bid_manager(user_id) # errors.add :reward_type, :invalid if self.reward_type == 0
unless user_id.nil? # end
if self.author_id == user_id #
return true # def act_as_activity
else # self.acts << Activity.new(:user_id => self.author_id)
return false # end
end #
end # # used to validate weather the user is the creater of the bid
end # # added by william
# def validate_bid_manager(user_id)
# Time 2015-04-01 14:19:06 # unless user_id.nil?
# Author lizanle # if self.author_id == user_id
# Description 删除对应课程通知的图片资源 # return true
def delete_kindeditor_assets # else
delete_kindeditor_assets_from_disk self.id,OwnerTypeHelper::BID # return false
end # end
# end
# end
#
# # Time 2015-04-01 14:19:06
# # Author lizanle
# # Description 删除对应课程通知的图片资源
# def delete_kindeditor_assets
# delete_kindeditor_assets_from_disk self.id,OwnerTypeHelper::BID
# end
end end

View File

@ -19,4 +19,5 @@ class ForgeActivity < ActiveRecord::Base
validates :project_id,presence: true validates :project_id,presence: true
validates :forge_act_id,presence: true validates :forge_act_id,presence: true
validates :forge_act_type, presence: true validates :forge_act_type, presence: true
end end

View File

@ -23,10 +23,11 @@ class JournalsForMessage < ActiveRecord::Base
:foreign_key => 'jour_id', :foreign_key => 'jour_id',
:conditions => "#{self.table_name}.jour_type = 'Project' " :conditions => "#{self.table_name}.jour_type = 'Project' "
belongs_to :course, belongs_to :course,
:foreign_key => 'jour_id' :foreign_key => 'jour_id', :touch => true
belongs_to :jour, :polymorphic => true belongs_to :jour, :polymorphic => true
belongs_to :m_parent,:class_name => 'JournalsForMessage',:foreign_key => 'm_parent_id', :touch => true
belongs_to :user belongs_to :user
belongs_to :homework_attach belongs_to :homework_attach
belongs_to :student_works_score belongs_to :student_works_score

View File

@ -103,7 +103,7 @@ class Mailer < ActionMailer::Base
course_ids = courses.map {|course| course.id}.join(",") course_ids = courses.map {|course| course.id}.join(",")
# 查询user的缺陷项目中成员都能收到 # 查询user的缺陷项目中成员都能收到
sql = "select * from members m, issues i where i.project_id = m.project_id and m.user_id='#{user.id}' sql = "select DISTINCT * from members m, issues i where i.project_id = m.project_id and m.user_id='#{user.id}'
and (i.created_on between '#{date_from}' and '#{date_to}') order by i.created_on desc" and (i.created_on between '#{date_from}' and '#{date_to}') order by i.created_on desc"
@issues = Issue.find_by_sql(sql) @issues = Issue.find_by_sql(sql)
@ -125,21 +125,35 @@ class Mailer < ActionMailer::Base
# user 提交的作业 # user 提交的作业
# @homeworks = HomeworkAttach.where("user_id=#{user.id} and (created_at between '#{date_from}' and '#{date_to}')").order("created_at desc") # @homeworks = HomeworkAttach.where("user_id=#{user.id} and (created_at between '#{date_from}' and '#{date_to}')").order("created_at desc")
# 查询user在课程。项目中发布的讨论帖子 # 查询user所在项目添加wiki
messages = Message.find_by_sql("select me.* from messages me, boards b, members m where @wiki_contents = WikiContent.find_by_sql("select DISTINCT wc.* from wikis w, members m, projects p, wiki_pages wp, wiki_contents wc where
b.id = me.board_id and b.project_id = m.project_id and m.user_id = '#{user.id}' and (me.created_on between '#{date_from}' and '#{date_to}') order by created_on desc") m.user_id = '#{user.id}' and m.project_id = p.id and w.project_id = p.id and w.id = wp.wiki_id and wc.page_id = wp.id and w.project_id>0
and (wc.updated_on between '#{date_from}' and '#{date_to}') order by updated_on desc")
# 查询user在课程中发布的讨论帖子
course_mesages = Message.find_by_sql("select DISTINCT me.* from messages me, boards b, members m where
b.id = me.board_id and b.course_id = m.course_id
and b.course_id is not Null and m.user_id = '#{user.id}'
and (me.created_on between '#{date_from}' and '#{date_to}') order by created_on desc")
# 查询user在项目中发布的讨论帖子
project_messages = Message.find_by_sql("select DISTINCT me.* from messages me, boards b, members m where
b.id = me.board_id and b.project_id = m.project_id
and b.project_id != '-1' and m.user_id = '#{user.id}' and (me.created_on between '#{date_from}' and '#{date_to}') order by created_on desc")
# messages = Message.find_by_sql("select DISTINCT * from messages where author_id = #{user.id} and (created_on between '#{date_from}' and '#{date_to}') order by created_on desc") # messages = Message.find_by_sql("select DISTINCT * from messages where author_id = #{user.id} and (created_on between '#{date_from}' and '#{date_to}') order by created_on desc")
@course_messages ||= [] @course_messages ||= []
@project_messages ||= [] @project_messages ||= []
unless messages.first.nil? unless course_mesages.first.nil?
messages.each do |msg| course_mesages.each do |msg|
if msg.project @course_messages << msg
@project_messages << msg
elsif msg.course
@course_messages << msg
end
end end
end end
unless project_messages.first.nil?
project_messages.each do |msg|
@project_messages << msg
end
end
# wiki
# 查询user在课程中发布的通知项目中发的新闻 # 查询user在课程中发布的通知项目中发的新闻
@course_news = (course_ids && !course_ids.empty?) ? 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
@ -149,17 +163,24 @@ class Mailer < ActionMailer::Base
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") : []
# 查询user在课程及个人中留言 # 查询user在课程及个人中留言
@course_journal_messages = JournalsForMessage.find_by_sql("select DISTINCT * from journals_for_messages where @course_journal_messages = JournalsForMessage.find_by_sql("select DISTINCT jfm.* from journals_for_messages jfm, members m, courses c
jour_type='Course' and user_id = #{user.id} where m.user_id = '#{user.id}' and c.id = m.course_id and jfm.jour_id = c.id
and (created_on between '#{date_from}' and '#{date_to}') order by created_on desc") and jfm.jour_type='Course' and (jfm.created_on between '#{date_from}' and '#{date_to}') order by created_on desc")
@user_journal_messages = user.journals_for_messages.where("m_parent_id IS NULL and (created_on between '#{date_from}' and '#{date_to}')").order('created_on DESC')
@user_journal_messages = user.journals_for_messages.where("jour_type='Principal' and (created_on between '#{date_from}' and '#{date_to}')").order('created_on DESC')
# 查询user在项目中留言用户反馈
@project_journal_messages = JournalsForMessage.find_by_sql("select DISTINCT jfm.* from journals_for_messages jfm, members m, projects p
where m.user_id = '#{user.id}' and p.id = m.project_id and jfm.jour_id = p.id
and jfm.jour_type='Project' and (jfm.created_on between '#{date_from}' and '#{date_to}') order by created_on desc")
# 查询user新建贴吧或发布帖子 # 查询user新建贴吧或发布帖子
@forums = Forum.find_by_sql("select DISTINCT * from forums where creator_id = #{user.id} and (created_at between '#{date_from}' and '#{date_to}') order by created_at desc") @forums = Forum.find_by_sql("select DISTINCT * from forums where creator_id = #{user.id} and (created_at between '#{date_from}' and '#{date_to}') order by created_at desc")
@memos = Memo.find_by_sql("select DISTINCT m.* from memos m, forums f where (m.author_id = #{user.id} or (m.forum_id = f.id and f.creator_id = #{user.id})) @memos = Memo.find_by_sql("select DISTINCT m.* from memos m, forums f where (m.author_id = #{user.id} or (m.forum_id = f.id and f.creator_id = #{user.id}))
and (m.created_at between '#{date_from}' and '#{date_to}') order by m.created_at desc") and (m.created_at between '#{date_from}' and '#{date_to}') order by m.created_at desc")
has_content = [@issues,@course_messages,@project_messages,@course_news,@project_news, has_content = [@issues,@course_messages,@project_messages,@course_news,@project_news,
@course_journal_messages,@user_journal_messages,@forums,@memos,@attachments,@bids].any? {|o| !o.empty?} @course_journal_messages,@user_journal_messages,@project_journal_messages,@forums,@memos,@attachments,@bids,@wiki_contents].any? {|o| !o.empty?}
mylogger.debug "Sent activity mail : #{user.mail} - #{has_content}" mylogger.debug "Sent activity mail : #{user.mail} - #{has_content}"
#有内容才发,没有不发 #有内容才发,没有不发
mail :to => user.mail,:subject => subject if has_content mail :to => user.mail,:subject => subject if has_content

View File

@ -116,21 +116,33 @@ class Member < ActiveRecord::Base
# 查找每个学生每个作业的评分 # 查找每个学生每个作业的评分
def student_homework_score def student_homework_score
score_count = 0
homework_score = StudentWork.find_by_sql("SELECT homework_commons.name,student_works.final_score as score homework_score = StudentWork.find_by_sql("SELECT homework_commons.name,student_works.final_score as score
FROM student_works,homework_commons FROM student_works,homework_commons
WHERE student_works.homework_common_id = homework_commons.id WHERE student_works.homework_common_id = homework_commons.id
AND homework_commons.course_id = #{self.course_id} AND homework_commons.course_id = #{self.course_id}
AND student_works.user_id = #{self.user_id}") AND student_works.user_id = #{self.user_id}")
homework_score.each do |homework| score_count = StudentWork.joins(:homework_common).where("student_works.user_id = #{self.user_id} and homework_commons.course_id = #{self.course_id}").average(:final_score).try(:round, 2).to_f
mem_score = 0
if homework[:score]
mem_score = homework[:score]
end
score_count = score_count + mem_score
end
[homework_score, format("%0.2f", score_count)] [homework_score, format("%0.2f", score_count)]
end end
def student_work_score
StudentWork.select("homework_commons.name, student_works.final_score").joins(:homework_common).where("student_works.user_id = #{self.user_id} and homework_commons.course_id = #{self.course_id}")
end
#当前课程的作业列表
def homework_common_list
HomeworkCommon.where(:course_id => self.course_id)
end
#当前学生在指定作业内的得分
def homework_common_score homework_common
StudentWork.select("final_score").where(:homework_common_id => homework_common.id,:user_id => self.user_id)
end
def student_work_score_avg
StudentWork.joins(:homework_common).where("student_works.user_id = #{self.user_id} and homework_commons.course_id = #{self.course_id}").average(:final_score).try(:round, 2).to_f
end
protected protected
def validate_role def validate_role

View File

@ -330,7 +330,7 @@ class CoursesService
def homework_list params,current_user def homework_list params,current_user
course = Course.find(params[:id]) course = Course.find(params[:id])
if course.is_public != 0 || current_user.member_of_course?(course) if course.is_public != 0 || current_user.member_of_course?(course)
bids = course.homeworks.order('deadline DESC') bids = course.homework_commons.order('end_time DESC')
bids = bids.like(params[:name]) if params[:name].present? bids = bids.like(params[:name]) if params[:name].present?
homeworks = [] homeworks = []
bids.each do |bid| bids.each do |bid|
@ -375,9 +375,9 @@ class CoursesService
unless latest_attachment.nil? unless latest_attachment.nil?
latest_course_dynamics << {:type => 3,:time => latest_attachment.created_on,:message =>latest_attachment.author.realname<< l(:label_recently_updated_courseware,:locale => get_user_language(current_user))<<""<<latest_attachment.filename} latest_course_dynamics << {:type => 3,:time => latest_attachment.created_on,:message =>latest_attachment.author.realname<< l(:label_recently_updated_courseware,:locale => get_user_language(current_user))<<""<<latest_attachment.filename}
end end
latest_bid = course.homeworks.order('updated_on DESC').first latest_bid = course.homework_commons.order('updated_at DESC').first
unless latest_bid.nil? unless latest_bid.nil?
latest_course_dynamics << {:type => 4,:time => latest_bid.updated_on,:message => latest_bid.author.realname<<l(:label_recently_updated_homework,:locale => get_user_language(current_user))<<""<<latest_bid.name} latest_course_dynamics << {:type => 4,:time => latest_bid.updated_at,:message => latest_bid.user.realname<<l(:label_recently_updated_homework,:locale => get_user_language(current_user))<<""<<latest_bid.name}
end end
# Time 2015-04-07 14:58:30 # Time 2015-04-07 14:58:30
@ -390,24 +390,24 @@ class CoursesService
#每个作业中的最新留言 #每个作业中的最新留言
messages = [] # messages = []
course.homeworks.each do |bid| # course.homework_commons.each do |hc|
jour = bid.journals_for_messages.order("created_on desc").first # jour = hc.journals_for_messages.order("created_on desc").first
unless jour.nil? # unless jour.nil?
messages << jour # messages << jour
end # end
end # end
unless messages.count == 0 # unless messages.count == 0
messages.sort!{|order,newer| newer.created_on <=> order.created_on} # messages.sort!{|order,newer| newer.created_on <=> order.created_on}
end # end
latest_bid_message = messages.first # latest_bid_message = messages.first
unless latest_bid_message.nil? # unless latest_bid_message.nil?
latest_course_dynamics << {:type => 4,:time => latest_bid_message.created_on,:message => l(:label_recently_updated_message,:locale => get_user_language(current_user))} # latest_course_dynamics << {:type => 4,:time => latest_bid_message.created_on,:message => l(:label_recently_updated_message,:locale => get_user_language(current_user))}
end # end
#每个作业中学生最后提交的作业 #每个作业中学生最后提交的作业
homeworks = [] homeworks = []
course.homeworks.each do |bid| course.homework_commons.each do |bid|
homework_attach = bid.homeworks.order('updated_at DESC').first homework_attach = bid.student_works.order('updated_at DESC').first
unless homework_attach.nil? unless homework_attach.nil?
homeworks << homework_attach homeworks << homework_attach
end end
@ -533,21 +533,21 @@ class CoursesService
mems mems
end end
def show_homework_info course,bid,current_user,is_course_teacher def show_homework_info course,bid,current_user,is_course_teacher
author_real_name = bid.author.lastname + bid.author.firstname author_real_name = bid.user.lastname + bid.user.firstname
many_times = course.homeworks.index(bid) + 1 many_times = course.homework_commons.index(bid) + 1
name = bid.name name = bid.name
homework_count = bid.homeworks.count #已提交的作业数量 homework_count = bid.student_works.count #已提交的作业数量
student_questions_count = bid.journals_for_messages.where('m_parent_id IS NULL').count #student_questions_count = bid.journals_for_messages.where('m_parent_id IS NULL').count
description = bid.description description = bid.description
#if is_course_teacher(User.current, course) && @bid.open_anonymous_evaluation == 1 && @bid.homeworks.count >= 2 #if is_course_teacher(User.current, course) && @bid.open_anonymous_evaluation == 1 && @bid.homeworks.count >= 2
state = bid.comment_status state = bid.homework_detail_manual.comment_status
unless is_course_teacher unless is_course_teacher
homework_for_anonymous_comments = get_student_batch_homework_list bid,current_user homework_for_anonymous_comments = get_student_batch_homework_list bid,current_user
end end
#end #end
open_anonymous_evaluation = bid.open_anonymous_evaluation open_anonymous_evaluation = bid.homework_detail_manual.comment_status
{:course_name => course.name,:course_id => course.id,:id => bid.id, :author => bid.author,:author_real_name => author_real_name, :homework_times => many_times, :homework_name => name, :homework_count => homework_count,:student_questions_count => student_questions_count, {:course_name => course.name,:course_id => course.id,:id => bid.id, :author => bid.user,:author_real_name => author_real_name, :homework_times => many_times, :homework_name => name, :homework_count => homework_count,:student_questions_count => 0,
:description => description, :homework_state => state,:open_anonymous_evaluation => open_anonymous_evaluation,:homework_for_anonymous_comments => homework_for_anonymous_comments,:created_on => bid.created_on,:deadline => bid.deadline} :description => description, :homework_state => state,:open_anonymous_evaluation => open_anonymous_evaluation,:homework_for_anonymous_comments => homework_for_anonymous_comments,:created_on => bid.created_at,:deadline => bid.end_time}
end end

View File

@ -14,21 +14,21 @@ class HomeworkService
# state=1 关闭匿评 # state=1 关闭匿评
# state=2 匿评结束 # state=2 匿评结束
def show_homework params def show_homework params
@bid = Bid.find(params[:id]) @bid = HomeworkCommon.find(params[:id])
course = @bid.courses.first course = @bid.course
author = @bid.author.lastname + @bid.author.firstname author = @bid.user.lastname + @bid.user.firstname
many_times = course.homeworks.index(@bid) + 1 many_times = course.homework_commons.index(@bid) + 1
name = @bid.name name = @bid.name
homework_count = @bid.homeworks.count #已提交的作业数量 homework_count = @bid.student_works.count #已提交的作业数量
student_questions_count = @bid.journals_for_messages.where('m_parent_id IS NULL').count #student_questions_count = @bid.journals_for_messages.where('m_parent_id IS NULL').count
description = @bid.description description = @bid.description
#if is_course_teacher(User.current, course) && @bid.open_anonymous_evaluation == 1 && @bid.homeworks.count >= 2 #if is_course_teacher(User.current, course) && @bid.open_anonymous_evaluation == 1 && @bid.homeworks.count >= 2
state = @bid.comment_status state = @bid.homework_detail_manual.comment_status
#end #end
open_anonymous_evaluation = @bid.open_anonymous_evaluation open_anonymous_evaluation = @bid.homework_type
jours = @bid.journals_for_messages.where('m_parent_id IS NULL').order('created_on DESC') #jours = @bid.journals_for_messages.where('m_parent_id IS NULL').order('created_on DESC')
{:course_name => course.name,:course_id => course.id,:id => @bid.id, :author => @bid.author,:author_real_name =>author, :homework_times => many_times, :homework_name => name, :homework_count => homework_count,:student_questions_count => student_questions_count, {:course_name => course.name,:course_id => course.id,:id => @bid.id, :author => @bid.user,:author_real_name =>author, :homework_times => many_times, :homework_name => name, :homework_count => homework_count,:student_questions_count => 0,
:description => description, :homework_state => state,:open_anonymous_evaluation => open_anonymous_evaluation,:created_on => @bid.created_on,:deadline => @bid.deadline,:jours => jours} :description => description, :homework_state => state,:open_anonymous_evaluation => open_anonymous_evaluation,:created_on => @bid.created_at,:deadline => @bid.end_time,:jours => nil}
end end
# 启动作业匿评前提示信息 # 启动作业匿评前提示信息

View File

@ -1,9 +1,11 @@
// @status: 0 该项目不存在1 不重复加入2 成功加入; 3 已是项目成员;其它 加入失败
<% if @status == 0%> <% if @status == 0%>
alert("<%= l('project.join.tips.notexist') %>"); alert("<%= l('project.join.tips.notexist') %>");
<% elsif @status == 1%> <% elsif @status == 1%>
alert("<%= l('project.join.tips.repeat') %>"); alert("<%= l('project.join.tips.repeat') %>");
<% elsif @status == 2%> <% elsif @status == 2%>
alert("<%= l('project.join.tips.success') %>"); alert("<%= l('project.join.tips.success') %>");
hideModal($("#popbox"));
<% elsif @status == 3%> <% elsif @status == 3%>
alert("<%= l('project.join.tips.has') %>"); alert("<%= l('project.join.tips.has') %>");
<%else%> <%else%>

View File

@ -53,7 +53,7 @@
<% end %> <% end %>
<% if options[:author] %> <% if options[:author] %>
<span class="author" title="<%= attachment.author%>"> <span class="author" title="<%= attachment.author%>">
<%= link_to h(truncate(attachment.author.name, length: 10, omission: '...')),user_path(attachment.author) %>, <%= link_to h(truncate(attachment.author.name, length: 10, omission: '...')),user_path(attachment.author),:class => "author_name" %>,
<%= format_time(attachment.created_on) %> <%= format_time(attachment.created_on) %>
</span> </span>
<% end %> <% end %>

View File

@ -1,11 +1,13 @@
<style type="text/css">
input.is_public,input.is_public_checkbox{height:12px;}
input.is_public_checkbox{margin-left:4px;margin-right:4px;}
</style>
<div class="fl"> <div class="fl">
<span id="attachments_fields" xmlns="http://www.w3.org/1999/html"> <span id="attachments_fields" xmlns="http://www.w3.org/1999/html">
<% if defined?(container) && container && container.saved_attachments %> <% if defined?(container) && container && container.saved_attachments %>
<% container.attachments.each_with_index do |attachment, i| %> <% container.attachments.each_with_index do |attachment, i| %>
<span id="attachments_p<%= i %>" class="attachment"> <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}][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>
<%= 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') %> <%= 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? <%= if attachment.id.nil?
#待补充代码 #待补充代码

View File

@ -29,7 +29,7 @@
<% is_float ||= false %> <% is_float ||= false %>
<% for attachment in attachments %> <% for attachment in attachments %>
<div style="float:left;"> <div style="float:left;">
<p style="height:14px;line-height:10px;width: 100%;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;"> <p style="height:14px;line-height:12px;width: 100%;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">
<%if is_float%> <%if is_float%>
<div style="max-width:55%;white-space: nowrap; overflow: hidden; text-overflow: ellipsis;float: left;"> <div style="max-width:55%;white-space: nowrap; overflow: hidden; text-overflow: ellipsis;float: left;">
<% end%> <% end%>

View File

@ -1,25 +0,0 @@
<!-- fq --> <!-- modified by bai -->
<%= error_messages_for 'bid' %>
<!--[form:project]-->
<p><%= l(:label_fork_form_new_description) %></p>
<!-- modified by bai -->
<p style="margin-left:-68px;padding-right: 20px;"><strong><%= l(:label_choose_course) %><span class="required"> *&nbsp;</span></strong><%= select_tag 'course', course_options_for_select(@courses) %></p>
<p><%= f.text_field :name, :required => true, :size => 60, :style => "width:490px;", :maxlength => Bid::NAME_LENGTH_LIMIT, :value => @bid.name %></p>
<!-- end -->
<p style="margin-left:-10px;padding-right: 20px;">
<%= f.text_area :description, :rows => 8, :value => @bid.description, :class => 'wiki-edit', :style => "font-size:small;width:490px;margin-left:10px;", :maxlength => Bid::DESCRIPTION_LENGTH_LIMIT %></p>
<!-- <p><%#= select_tag 'bid_reward_type', "<option value = '0'>#{l(:label_choose_reward)}</option><option value = '1'>#{l(:label_money)}</option><option value = '3'>#{l(:label_bids_credit)}</option><option value = '2'>#{l(:label_reward_1)}</option>".html_safe,
:onChange => "show('bid_reward_type', 'bid_budget', '"+l(:label_bids_reward_what)+"','"+l(:label_bids_new_money)+"','"+l(:label_bids_new_credit)+"','"+l(:label_bids_new_content)+"')" %>
<%#= f.text_field :budget, :required => true, :size => 60, :style => "width:350px;", :placeholder => l(:label_bids_reward_what) %>
</p> -->
<p><%= f.text_field :deadline, :value => nil,:required => true, :size => 60, :style => "width:150px;" , :readonly => true %><%= calendar_for('bid_deadline')%>
<!--
<p><%#= f.select :homework_type, homework_type_option %>
</p>
-->
<p><%= f.select :is_evaluation, is_evaluation_option %>
<fieldset><legend><%= l(:label_attachment_plural) %></legend>
<p><%= render :partial => 'attachments/form', :locals => {:container => @homework} %></p>
</fieldset>

View File

@ -1,36 +0,0 @@
<!-- huang -->
<script type="text/javascript" language="javascript">
function show(id, id_t, label_reward, label_money, label_credit, label_content) {
var text = $('#' + id);
var text_t = $('#' + id_t);
if (text.val() == 0) {
text_t.attr("placeholder", label_reward);
}
if (text.val() == 1) {
text_t.attr("placeholder", label_money);
}
if (text.val() == 3) {
text_t.attr("placeholder", label_credit);
}
if (text.val() == 2) {
text_t.attr("placeholder", label_content);
}
return content;
}
</script>
<%= error_messages_for 'bid' %>
<!--[form:project]-->
<p style="width:500px;"><%= l(:label_bids_form_contest_new_description) %></p>
<p><%= f.text_field :name, :required => true, :size => 60, :style => "width:490px;", :maxlength => Bid::NAME_LENGTH_LIMIT, :placeholder => "#{l(:label_contest_name)}" %></p>
<p style="margin-left:-10px;padding-right: 20px;"><%= f.text_area :description, :rows => 8, :class => 'wiki-edit', :style => "font-size:small;width:490px;margin-left:10px;", :maxlength => Bid::DESCRIPTION_LENGTH_LIMIT, :placeholder => "#{l(:label_contest_description)}" %></p>
<p style="margin-left:-10px;"><%= f.text_field :password, :size => 60, :style => "width:488px;margin-left: 10px;" %></p>
<p>
<%= f.text_field :budget, :required => true, :size => 60, :style => "width:350px;", :placeholder => l(:label_bids_reward_what) %>
<!-- 设置奖项设置的打开 关闭开关-->
</p>
<!-- <em class="info" style="margin-left:95px;"><%= l(:text_contest_reward) %></em> -->
<p><%= f.text_field :deadline, :required => true, :size => 60, :style => "width:150px;", :readonly => true, :placeholder => "#{l(:label_deadline)}" %><%= calendar_for('bid_deadline')%></p>

View File

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

View File

@ -1,30 +0,0 @@
<div class="inf_user_image">
<% for user in @bid.watcher_users %>
<ul class="list_watch"><li>
<table width="660px" border="0" align="center">
<tr>
<td colspan="2" valign="top" width="50" ><%= image_tag(url_to_avatar(user), :class => "avatar") %></td>
<td><table width="580px" border="0">
<tr>
<td colspan="2" valign="top"><strong><%= content_tag "div", link_to_user(user), :class => "project_avatar_name" %>
</td>
</tr>
<tr>
<td colspan="2" width="580px" ><p class="font_description">
<% unless user.memberships.empty? %>
<%= l(:label_x_contribute_to, :count => user.memberships.count) %>
<% for member in user.memberships %>
<%= link_to_project(member.project) %><%= (user.memberships.last == member) ? '' : '' %>
<% end %>
<% end %>
</p></td>
</tr>
<tr>
<td width="200" align="right" class="font_lighter"><%= l(:label_user_joinin) %><%= format_date(user.created_on) %>
</td>
</tr>
</table></td>
</tr>
</table></li></ul>
<% end %>
</div>

View File

@ -66,7 +66,31 @@
<div class="cl"></div> <div class="cl"></div>
<script> <script>
$(function(){if($("#contentmessage<%=topic.id %>").height()>182){$("#project_show_<%= topic.id%>").show();}}); //$(function(){if($("#contentmessage<%#=topic.id %>").height()>182){$("#project_show_<%#= topic.id%>").show();}});
//解决由于图片加载慢造成div高度不够 以至于展开按钮不显示的bug
$(function(){
function nh_show_btn(){
if($("#contentmessage<%=topic.id %>").height()>182){
$("#project_show_<%= topic.id%>").show();
}
}
var div = $("#contentmessage<%=topic.id %>");
var imgs = $('img',div);
var lens = imgs.length;
function nh_load_img_end(){
lens--;
if(lens <= 0){
nh_show_btn();
}
}
if(lens <= 0){
nh_show_btn();
}else{
$('img',div).load(function(){
nh_load_img_end();
});
}
});
</script> </script>
<div class="project_board_content break_word" id="content_<%=topic.id%>"> <div class="project_board_content break_word" id="content_<%=topic.id%>">
<div id="contentmessage<%=topic.id %>" class="upload_img"> <div id="contentmessage<%=topic.id %>" class="upload_img">
@ -92,7 +116,7 @@
<div class="cl"></div> <div class="cl"></div>
<div class="talk_new ml15 mb10" nhname='about_talk' id="about_newtalk<%=topic.id%>" style="display: none"> <div class="talk_new ml15 mb10" nhname='about_talk' id="about_newtalk<%=topic.id%>" style="display: none;border-top: 1px dashed #d9d9d9;padding-top:5px;margin-left:0px;padding-left:15px;">
<ul> <ul>
<%= render :partial => 'edit',locals: {:topic => topic} %> <%= render :partial => 'edit',locals: {:topic => topic} %>
</ul> </ul>
@ -253,7 +277,7 @@
}; };
params.get_ref_str_call=function(btn){ params.get_ref_str_call=function(btn){
var div = btn.parent('div'); var div = btn.parent('div');
var str = '<blockquote>'+$('a',div).filter(':first').html()+' 写到: <br/>'+$("input[nhname='nh_content_val']",div).val()+'</blockquote>'; var str = '<blockquote>'+$('a',div).filter(':first').html()+' 写到: <br/>'+$("input[nhname='nh_content_val']",div).val()+'<div class="cl"></div></blockquote>';
return str; return str;
} }
nh_init_board(params); nh_init_board(params);

View File

@ -39,7 +39,7 @@
<label class="fl ml3" ><span class="c_red">*</span>&nbsp;<%= l(:field_description) %>&nbsp;</label> <label class="fl ml3" ><span class="c_red">*</span>&nbsp;<%= l(:field_description) %>&nbsp;</label>
<% end %> <% end %>
<%= text_area :quote,:quote,:style => 'display:none',:nhname=>"quote_input" %> <%= text_area :quote,:quote,:style => 'display:none',:nhname=>"quote_input" %>
<div class="content"> <div class="content <%= replying ? '':'ml55' %>">
<% if replying%> <% if replying%>
<%= f.text_area :content, <%= f.text_area :content,

View File

@ -1,13 +1,13 @@
<style> <style>
.comment{ /*.comment{*/
position: relative; /*position: relative;*/
width: 330px; /*width: 330px;*/
padding: 10px; /*padding: 10px;*/
} /*}*/
.comment .ke-toolbar{ /*.comment .ke-toolbar{*/
position: absolute; /*position: absolute;*/
bottom: -18px; /*bottom: -18px;*/
} /*}*/
</style> </style>
<%= error_messages_for 'message' %> <%= error_messages_for 'message' %>
@ -47,6 +47,7 @@
</li> </li>
<li> <li>
<div nhname="quote_show" id="message_quote" class="wiki" style="width: 100%;word-break: break-all;word-wrap: break-word;"></div> <div nhname="quote_show" id="message_quote" class="wiki" style="width: 100%;word-break: break-all;word-wrap: break-word;"></div>
<div class="cl"></div>
<% unless replying %> <% unless replying %>
<label class="fl ml3" ><span class="c_red">*</span>&nbsp;<%= l(:field_description) %>&nbsp;</label> <label class="fl ml3" ><span class="c_red">*</span>&nbsp;<%= l(:field_description) %>&nbsp;</label>
<% end %> <% end %>

View File

@ -58,7 +58,31 @@
<a href="javascript:void(0)" class="talk_up fr c_red" style="margin-right: 10px;"><%= l(:label_board_sticky)%></a> <a href="javascript:void(0)" class="talk_up fr c_red" style="margin-right: 10px;"><%= l(:label_board_sticky)%></a>
<% end %> <% end %>
<script> <script>
$(function(){if($("#contentmessage<%=topic.id %>").height()>182){$("#project_show_<%= topic.id%>").show();}}); //$(function(){if($("#contentmessage<%#=topic.id %>").height()>182){$("#project_show_<%#= topic.id%>").show();}});
//解决由于图片加载慢造成div高度不够 以至于展开按钮不显示的bug
$(function(){
function nh_show_btn(){
if($("#contentmessage<%=topic.id %>").height()>182){
$("#project_show_<%= topic.id%>").show();
}
}
var div = $("#contentmessage<%=topic.id %>");
var imgs = $('img',div);
var lens = imgs.length;
function nh_load_img_end(){
lens--;
if(lens <= 0){
nh_show_btn();
}
}
if(lens <= 0){
nh_show_btn();
}else{
$('img',div).load(function(){
nh_load_img_end();
});
}
});
</script> </script>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
@ -80,7 +104,7 @@
<a href="javascript:void(0)" nhname="showbtn_reply" class="c_dblue fr" style="margin-right:10px;"><%= l(:button_reply) %></a> <a href="javascript:void(0)" nhname="showbtn_reply" class="c_dblue fr" style="margin-right:10px;"><%= l(:button_reply) %></a>
<% end %> <% end %>
<div class="cl"></div> <div class="cl"></div>
<div class="talk_new ml15 mb10" nhname='about_talk' id="about_newtalk<%=topic.id%>" style="display: none"> <div class="talk_new ml15 mb10" nhname='about_talk' id="about_newtalk<%=topic.id%>" style="display: none;border-top: 1px dashed #d9d9d9;padding-top:5px;margin-left:0px;padding-left:15px;">
<ul> <ul>
<%= render :partial => 'edit',locals: {:topic => topic} %> <%= render :partial => 'edit',locals: {:topic => topic} %>
</ul> </ul>
@ -238,7 +262,7 @@
}; };
params.get_ref_str_call=function(btn){ params.get_ref_str_call=function(btn){
var div = btn.parent('div'); var div = btn.parent('div');
var str = '<blockquote>'+$('a',div).filter(':first').html()+' 写到: <br/>'+$("input[nhname='nh_content_val']",div).val()+'</blockquote>'; var str = '<blockquote>'+$('a',div).filter(':first').html()+' 写到: <br/>'+$("input[nhname='nh_content_val']",div).val()+'<div class="cl"></div></blockquote>';
return str; return str;
} }
nh_init_board(params); nh_init_board(params);

View File

@ -1,4 +1,5 @@
<style type="text/css"> <style type="text/css">
div.talk_new .ke-container{margin-left:2px;}
/*div.ke-toolbar{display:none;width:400px;border:none;background:none;padding:0px 0px;} /*div.ke-toolbar{display:none;width:400px;border:none;background:none;padding:0px 0px;}
span.ke-toolbar-icon{line-height:26px;font-size:14px;padding-left:26px;} span.ke-toolbar-icon{line-height:26px;font-size:14px;padding-left:26px;}
span.ke-toolbar-icon-url{background-image:url( /images/public_icon.png )} span.ke-toolbar-icon-url{background-image:url( /images/public_icon.png )}
@ -33,7 +34,7 @@
else if (window.attachEvent) else if (window.attachEvent)
window.attachEvent("onload", buildsubmenus) window.attachEvent("onload", buildsubmenus)
</script> </script>
<%= javascript_include_tag "/assets/kindeditor/kindeditor" %> <%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' %>
<%#= javascript_include_tag "/assets/kindeditor/kindeditor-min" %> <%#= javascript_include_tag "/assets/kindeditor/kindeditor-min" %>
<% if @project %> <% if @project %>
@ -105,6 +106,7 @@ function nh_check_field(params){
} }
if(params.content.html()!=params.textarea.html() || params.issubmit==true){ if(params.content.html()!=params.textarea.html() || params.issubmit==true){
params.textarea.html(params.content.html()); params.textarea.html(params.content.html());
params.content.sync(); //用上面那句ie11提交到服务器居然木有值
if(params.content.isEmpty()){ if(params.content.isEmpty()){
params.contentmsg.html('内容不能为空'); params.contentmsg.html('内容不能为空');
params.contentmsg.css({color:'#ff0000'}); params.contentmsg.css({color:'#ff0000'});
@ -121,18 +123,23 @@ function nh_check_field(params){
function nh_init_board(params){ function nh_init_board(params){
//发帖/编辑/回复按钮的click //发帖/编辑/回复按钮的click
params.showbtn.click(function(){ params.showbtn.click(function(){
params.textarea.removeAttr('placeholder');
if(params.textarea.data('init') == undefined){ if(params.textarea.data('init') == undefined){
//初始化编辑器 //初始化编辑器
var editor = params.kindutil.create(params.textarea, { var editor = params.kindutil.create(params.textarea, {
// allowPreviewEmoticons : false, // allowPreviewEmoticons : false,
// allowImageUpload : false, // allowImageUpload : false,
resizeType : 1,minWidth:"1px",width:"565px",height:"150px", resizeType : 1,minWidth:"1px",width:"560px",height:"150px",
allowFileManager:true,uploadJson:"/kindeditor/upload", allowFileManager:true,uploadJson:"/kindeditor/upload",
fileManagerJson:"/kindeditor/filemanager", fileManagerJson:"/kindeditor/filemanager",
afterChange:function(){//按键事件 afterChange:function(){//按键事件
nh_check_field({content:this,contentmsg:params.contentmsg,textarea:params.textarea}); nh_check_field({content:this,contentmsg:params.contentmsg,textarea:params.textarea});
}, },
afterCreate:function(){ afterCreate:function(){
var userAgent = navigator.userAgent.toLowerCase();
if(/trident/.test(userAgent)){
$("div.talk_new .ke-container").css({'margin-left':'0px'});
}
// var toolbar = $("div[class='ke-toolbar']",params.about_talk); // var toolbar = $("div[class='ke-toolbar']",params.about_talk);
// $(".ke-outline>.ke-toolbar-icon",toolbar).append('表情'); // $(".ke-outline>.ke-toolbar-icon",toolbar).append('表情');
// params.toolbar_container.append(toolbar); // params.toolbar_container.append(toolbar);
@ -184,9 +191,17 @@ function nh_init_board(params){
if(params.quote_input!=undefined)params.quote_input.empty(); if(params.quote_input!=undefined)params.quote_input.empty();
}else{ }else{
if(params.type=='reply'){ if(params.type=='reply'){
params.jumphref.attr('href','#'+params.form.attr('id')); params.textarea.show();
params.jumphref[0].click(); params.textarea.focus();
}else params.inputsubject.focus(); params.textarea.hide();
//params.jumphref.attr('href','#'+params.form.attr('id'));
//params.jumphref[0].click();
}else{
params.textarea.show();
params.textarea.focus();
params.textarea.hide();
// params.inputsubject.focus();
}
} }
}); });
params.textarea.data('init','1');//标记为已经初始化 params.textarea.data('init','1');//标记为已经初始化
@ -213,4 +228,4 @@ function nh_init_board(params){
} }
</script> </script>

View File

@ -1,25 +1,33 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"> <html xmlns="http://www.w3.org/1999/xhtml">
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>没有访问权限</title> <title>没有访问权限</title>
<style> <style>
body{ font-size:12px; font-family:"微软雅黑","宋体"; line-height:1.9; background:#fff; font-style:normal;} body{ font-size:12px; font-family:"微软雅黑","宋体"; line-height:1.9; background:#fff; font-style:normal;}
div,html,img,ul,li,p,body,h1,h2,h3,h4,p,a,table,tr,td,fieldset,input,span{ margin:0; padding:0;} div,html,img,ul,li,p,body,h1,h2,h3,h4,p,a,table,tr,td,fieldset,input,span{ margin:0; padding:0;}
div,img,tr,td{ border:0;} div,img,tr,td{ border:0;}
table,tr,td{border:0; cellspacing:0; cellpadding:0;} table,tr,td{border:0; cellspacing:0; cellpadding:0;}
ul,li{ list-style-type:none} ul,li{ list-style-type:none}
.cl{ clear:both; overflow:hidden; } .cl{ clear:both; overflow:hidden; }
a{ text-decoration:none; } a{ text-decoration:none !important; }
a:hover{ } a:hover{ }
.error_content{ width:550px; height:200px; margin:0 auto; padding:10px 0;} .error_content{ width:550px; height:200px; margin:0 auto; padding:10px 0;}
.error_left{color:#15bccf; font-size:100px; font-weight:bold; font-style:oblique; width:200px; height:120px; padding-right:30px; float:left;} .error_left{color:#15bccf; font-size:100px; font-weight:bold; font-style:oblique; width:200px; height:120px; padding-right:30px; float:left;}
.error_right{ width:240px; height:120px; float:left;color:#15bccf; font-size: 17px; font-weight:bold; padding-left:30px; margin-top:40px; border-left:1px dashed #CCC; } .error_right{ width:240px; height:120px; float:left;color:#15bccf; font-size: 17px; font-weight:bold; padding-left:30px; margin-top:40px; border-left:1px dashed #CCC; }
.error_link{ margin-top:8px;} .error_link{ margin-top:8px;}
.error_link a{ display:block; width:80px; height:28px; font-size:14px; font-weight:bold; color:#fff; text-align:center; background:#15bccf; float:left; margin-right:10px;} .error_link a{ display:block; width:80px; height:28px; font-size:14px; font-weight:bold; color:#fff; text-align:center; background:#15bccf; float:left; margin-right:10px;}
.error_link a:hover{ background:#ff8417;} .error_link a:hover{ background:#ff8417;}
</style> </style>
<script type="text/javascript">
$(function(){
if(window.history.length == 1)
{
$("#history_back").css("background","#CCC");
}
});
</script>
</head> </head>
<body> <body>
@ -31,7 +39,7 @@ a:hover{ }
没有访问权限!建议您</p> 没有访问权限!建议您</p>
<div class="error_link"> <div class="error_link">
<!---<a href="http://forge.trustie.net/" target="_blank">返回首页</a>----> <!---<a href="http://forge.trustie.net/" target="_blank">返回首页</a>---->
<a href="javascript:history.back()">后退一步</a> <a href="javascript:history.back()" id="history_back">后退一步</a>
<a href="http://user.trustie.net/users/5/user_newfeedback">给我留言</a> <a href="http://user.trustie.net/users/5/user_newfeedback">给我留言</a>
</div> </div>
</div> </div>

View File

@ -1,6 +1,19 @@
<style type="text/css">
div.ke-toolbar{display:none;width:400px;border:none;background:none;padding:0px 0px;}
span.ke-toolbar-icon{line-height:26px;font-size:14px;padding-left:26px;}
span.ke-toolbar-icon-url{background-image:url( /images/public_icon.png )}
div.ke-toolbar .ke-outline{padding:0px 0px;line-height:26px;font-size:14px;}
span.ke-icon-emoticons{background-position:0px -671px;width:50px;height:26px;}
span.ke-icon-emoticons:hover{background-position:-79px -671px;width:50px;height:26px;}
div.ke-toolbar .ke-outline{border:none;}
div.respond-form .reply_btn{margin-left:565px;margin-top:5px;}
div.recall_con{width:600px;}
div.recall_con .reply_btn{margin-left:555px;margin-top:5px;}
</style>
<%= javascript_include_tag "/assets/kindeditor/kindeditor" %> <%= javascript_include_tag "/assets/kindeditor/kindeditor" %>
<% cache [:courses_jours, @course] do%> <% cache [:courses_jours, @course, User.current.logged? ] do%>
<div class="msg_box" id='leave-message'> <div class="msg_box" id='leave-message' nhname="new_message">
<%# reply_allow = JournalsForMessage.create_by_user? User.current %> <%# reply_allow = JournalsForMessage.create_by_user? User.current %>
<h4><%= l(:label_leave_message) %></h4> <h4><%= l(:label_leave_message) %></h4>
@ -11,24 +24,192 @@
<hr/> <hr/>
</div> </div>
<% else %> <% else %>
<%= form_for('new_form', :method => :post, <%= form_for('new_form', :method => :post,
:url => {:controller => 'words', :action => 'leave_course_message'},:html => {:id=>'leave_message_form'}) do |f|%> :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' %> <%= 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;", <%#= 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}%> :placeholder => "#{l(:label_welcome_my_respond)}",:maxlength => 250}%>
<a href="javascript:void(0)" class="grey_btn fr ml10 mt10" onclick="KindEditor.instances[0].html('');">取&nbsp;&nbsp;消</a> <textarea cols="40" nhname="new_message_textarea" maxlength="250" name="new_form[course_message]" placeholder="请在此留下你的意见和建议!" rows="20" style="display: none;"></textarea>
<a href="javascript:void(0)" onclick='leave_message_editor.sync();$("#leave_message_form").submit();' class="blue_btn fr mt10"> <p nhname="contentmsg"></p>
<%= l(:button_leave_meassge)%> <div class="fl" style="padding-top:5px;" nhname="toolbar_container"></div>
</a> <a href="javascript:void(0)" class="grey_btn fr ml10 mt10" nhname="cancel_btn">取&nbsp;&nbsp;消</a>
<% end %> <a href="javascript:void(0)" onclick='$("#leave_message_form").submit();' class="blue_btn fr mt10">
<%= l(:button_leave_meassge)%>
</a>
<% end %>
<% end %> <% end %>
</div> </div>
<% end %> <% end %>
<% cache [:courses_jours_list, @jour.size ] do %> <div class="cl"></div>
<div id="history"> <% if @page == "1" %>
<%= render :partial => 'history',:locals => { :contest => @contest, :journals => @jour, :state => false} %> <% cache [:courses_jours_list, @course, @jour.maximum(:updated_on), User.current.logged? ] do %>
</div> <div id="history">
<%= render :partial => 'history',:locals => { :contest => @contest, :journals => @jour, :page => @page, :state => false} %>
</div>
<% end %>
<% else %>
<div id="history">
<%= render :partial => 'history',:locals => { :contest => @contest, :journals => @jour, :state => false} %>
</div>
<% end %> <% end %>
<ul class="wlist"> <ul class="wlist">
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%> <%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%>
</ul> </ul>
<div style="display:none;"><a href="#" id="nhjump"></a></div>
<script type="text/javascript">
$(function(){
function init_editor(params){
var editor = params.kindutil.create(params.textarea, {
resizeType : 1,minWidth:"1px",width:"100%",height:"150px",
items:['emoticons'],
afterChange:function(){//按键事件
nh_check_field({content:this,contentmsg:params.contentmsg,textarea:params.textarea});
},
afterCreate:function(){
var toolbar = $("div[class='ke-toolbar']",params.div_form);
$(".ke-outline>.ke-toolbar-icon",toolbar).append('表情');
params.toolbar_container.append(toolbar);
}
}).loadPlugin('paste');
return editor;
}
function nh_check_field(params){
var result=true;
if(params.content!=undefined){
if(params.content.isEmpty()){
result=false;
}
if(params.content.html()!=params.textarea.html() || params.issubmit==true){
params.textarea.html(params.content.html());
params.content.sync();
if(params.content.isEmpty()){
params.contentmsg.html('内容不能为空');
params.contentmsg.css({color:'#ff0000'});
}else{
params.contentmsg.html('填写正确');
params.contentmsg.css({color:'#008000'});
}
params.contentmsg.show();
}
}
return result;
}
function init_form(params){
// var flag = false;
// if(params.form.attr('data-remote') != undefined ){
// flag = true
// }
// params.form[0].onsubmit = function(){
// if(flag){
// $(this).removeAttr('data-remote');//不这么搞return false没用 花擦花擦
// }
// var is_checked = nh_check_field({
// issubmit:true,
// content:params.editor,
// contentmsg:params.contentmsg,
// textarea:params.textarea
// });
// if(is_checked){
// if(flag){
// alert('add')
// $(this).attr('data-remote','true');
// }
// alert('ok')
// return true;
// }
// return false;
// }
params.form.submit(function(){
var flag = false;
if(params.form.attr('data-remote') != undefined ){
flag = true
}
var is_checked = nh_check_field({
issubmit:true,
content:params.editor,
contentmsg:params.contentmsg,
textarea:params.textarea
});
if(is_checked){
if(flag){
return true;
}else{
$(this)[0].submit();
return false;
}
// return true; //这个涛哥的firefox不能提交
//$(this).trigger('submit'); //这个虽然能提交 但是他是个死循环
//$(this)[0].submit(); //用这个form的data-remote='true'没效果了
//肿么破阿 我滴个神 实在不行就用$.ajax()算了
}
return false;
});
}
function nh_reset_form(params){
params.form[0].reset();
params.textarea.empty();
if(params.editor != undefined){
params.editor.html(params.textarea.html());
}
params.contentmsg.hide();
}
KindEditor.ready(function(K){
$("a[nhname='reply_btn']").live('click',function(){
var params = {};
params.kindutil = K;
params.container = $(this).parent('div').parent('div');
params.div_form = $(">.respond-form",params.container);
params.form = $("form",params.div_form);
params.textarea = $("textarea[name='user_notes']",params.div_form);
params.contentmsg = $("p[nhname='contentmsg']",params.div_form);
params.toolbar_container = $("div[nhname='toolbar_container']",params.div_form);
params.cancel_btn = $("input[nhname='cancel_btn']",params.div_form);
if(params.textarea.data('init') == undefined){
params.editor = init_editor(params);
init_form(params);
params.cancel_btn.click(function(){
nh_reset_form(params);
});
}
params.cancel_btn.click();
toggleAndSettingWordsVal(params.div_form, params.textarea);
setTimeout(function(){
if(!params.div_form.is(':hidden')){
params.textarea.show();
params.textarea.focus();
params.textarea.hide();
// $("#nhjump").attr('href','#'+params.div_form.attr('id'));
// $("#nhjump")[0].click();
}
},300);
params.textarea.data('init',1);
});
$("div[nhname='new_message']").each(function(){
var params = {};
params.kindutil = K;
params.div_form = $(this);
params.form = $("form",params.div_form);
if(params.form==undefined || params.form.length==0){
return;
}
params.textarea = $("textarea[nhname='new_message_textarea']",params.div_form);
params.contentmsg = $("p[nhname='contentmsg']",params.div_form);
params.toolbar_container = $("div[nhname='toolbar_container']",params.div_form);
if(params.textarea.data('init') == undefined){
params.editor = init_editor(params);
init_form(params);
$("a[nhname='cancel_btn']",params.div_form).click(function(){
nh_reset_form(params);
});
params.textarea.data('init',1);
}
});
});
});
</script>

View File

@ -1,55 +1,55 @@
<% reply_allow = JournalsForMessage.create_by_user? User.current %> <% reply_allow = JournalsForMessage.create_by_user? User.current %>
<% if journals.size > 0 %> <% if journals.size > 0 %>
<% for journal in journals %> <% for journal in journals %>
<div class="ping_C" id='word_li_<%= journal.id.to_s %>'> <div class="ping_C" id='word_li_<%= journal.id.to_s %>'>
<div class="ping_dispic"> <div class="ping_dispic">
<%= link_to image_tag(url_to_avatar(journal.user),:width => '46',:height => '46'), user_path(journal.user) %> <%= link_to image_tag(url_to_avatar(journal.user),:width => '46',:height => '46'), user_path(journal.user) %>
</div> </div>
<div class="ping_discon upload_img" style="width: 610px;"> <div class="ping_discon upload_img" style="width: 610px;">
<div class="ping_distop"> <div class="ping_distop">
<!-- <a style=" font-weight:bold; color:#15bccf; margin-right:30px; background:none;" target="_blank" href="#">gugu01</a> --> <!-- <a style=" font-weight:bold; color:#15bccf; margin-right:30px; background:none;" target="_blank" href="#">gugu01</a> -->
<span> <span>
<%= link_to journal.user, user_path(journal.user),:class => 'c_blue fb fl mb10', :target => "_blank"%> <%= link_to journal.user, user_path(journal.user),:class => 'c_blue fb fl mb10', :target => "_blank"%>
</span> </span>
<span class="c_grey fr"> <span class="c_grey fr">
<%= format_time(journal.created_on) %> <%= format_time(journal.created_on) %>
</span> </span>
<div class="cl"></div>
<p>
<%= journal.notes.html_safe %>
</p>
</div>
<div class="ping_disfoot">
<% ids = 'project_respond_form_'+ journal.id.to_s%>
<% if journal.user == User.current|| User.current.admin? || (@course && User.current.allowed_to?(:as_teacher,@course)) %>
<%= link_to(l(:label_bid_respond_delete),
{:controller => 'words', :action => 'destroy', :object_id => journal, :user_id => @user},
:remote => true, :confirm => l(:text_are_you_sure), :method => 'delete',
:class => "delete", :title => l(:button_delete)) %>
<% end %>
<% if reply_allow %>
<%= link_to l(:label_bid_respond_quote),'',
{:focus => 'project_respond', :onclick => "toggleAndSettingWordsVal($('##{ids}'), $('##{ids} textarea')); $('##{ids} textarea') ;return false;"} %>
<% end %>
</div>
<div class="cl"></div>
<% ids = 'project_respond_form_'+ journal.id.to_s%>
<% if reply_allow %>
<div id='<%= ids %>' class="respond-form">
<%= render :partial => 'words/new_respond_course', :locals => {:journal => journal, :m_reply_id => journal,:show_name => true} %>
</div>
<% end %>
<div class="cl"></div>
<%= render :partial => "words/journal_reply", :locals => {:journal => journal, :show_name => true, :allow_delete => @course && User.current.allowed_to?(:as_teacher,@course)} %>
</div>
<div class="cl"></div> <div class="cl"></div>
<p>
<%= journal.notes.html_safe %>
</p>
</div> </div>
<% end %> <div class="ping_disfoot">
<% ids = 'project_respond_form_'+ journal.id.to_s%>
<% if journal.user == User.current|| User.current.admin? || (@course && User.current.allowed_to?(:as_teacher,@course)) %>
<%= link_to(l(:label_bid_respond_delete),
{:controller => 'words', :action => 'destroy', :object_id => journal, :user_id => @user},
:remote => true, :confirm => l(:text_are_you_sure), :method => 'delete',
:class => "delete", :title => l(:button_delete)) %>
<% end %>
<% if reply_allow %>
<%#= link_to l(:label_bid_respond_quote),'',
{:focus => 'project_respond',:nhname=>"reply_btn", :onclick => "toggleAndSettingWordsVal($('##{ids}'), $('##{ids} textarea')); $('##{ids} textarea') ;return false;"} %>
<%= link_to l(:label_bid_respond_quote),'javascript:;',{:nhname=>"reply_btn"} %>
<% end %>
</div>
<div class="cl"></div>
<% ids = 'project_respond_form_'+ journal.id.to_s%>
<% if reply_allow %>
<div id='<%= ids %>' class="respond-form">
<%= render :partial => 'words/new_respond_course', :locals => {:journal => journal, :m_reply_id => journal,:show_name => true} %>
</div>
<% end %>
<div class="cl"></div>
<%= render :partial => "words/journal_reply", :locals => {:journal => journal, :show_name => true, :allow_delete => @course && User.current.allowed_to?(:as_teacher,@course)} %>
</div>
<div class="cl"></div>
</div>
<% end %> <% end %>
<% end %>

View File

@ -32,7 +32,6 @@
<script type="text/javascript"> <script type="text/javascript">
function submit_form(obj) function submit_form(obj)
{ {
hideModal(obj);
$("#new-watcher-form").submit(); $("#new-watcher-form").submit();
} }

View File

@ -1,6 +1,6 @@
<% <%
id = "finish_course_#{course.id}" id = "finish_course_#{course.id}"
display = (course.teacher.id == User.current.id || User.current.admin?) display = (User.current.allowed_to?(:as_teacher,course) || User.current.admin?)
%> %>
<% if display #如果课程已结束%> <% if display #如果课程已结束%>

View File

@ -4,7 +4,7 @@
<% if @state %> <% if @state %>
<% if @state == 0 %> <% if @state == 0 %>
alert("加入成功"); alert("加入成功");
hideModal("#popbox02"); hideModal($("#popbox"));
<% elsif @state == 1 %> <% elsif @state == 1 %>
alert("密码错误"); alert("密码错误");
<% elsif @state == 2 %> <% elsif @state == 2 %>

View File

@ -17,17 +17,18 @@
<h2><%= @member_score.user.name %> 历次作业积分</h2> <h2><%= @member_score.user.name %> 历次作业积分</h2>
<ul class="tscore_box"> <ul class="tscore_box">
<li ><span class="c_blue02 w280">作业名称</span><span class="c_blue02 w70">得分</span></li> <li ><span class="c_blue02 w280">作业名称</span><span class="c_blue02 w70">得分</span></li>
<% @member_score.student_homework_score[0].each do |homework_score| %> <% @member_score.homework_common_list.each do |homework_common| %>
<li> <li>
<span class="c_grey02 w280"> <span class="c_grey02 w280">
<%= homework_score.name %> <%= homework_common.name %>
</span> </span>
<span class="c_red w70"> <span class="c_red w70">
<%= format("%0.2f",homework_score[:score].nil? ? 0 : homework_score[:score]) %> <% final_score = @member_score.homework_common_score(homework_common).first%>
<%= final_score.nil? || final_score.final_score.nil? ? "--" : format("%0.2f", final_score.final_score) %>
</span> </span>
</li> </li>
<% end %> <% end %>
<li><span class="c_blue03 w280">作业积分(总得分)</span><span class="c_red w70"><%= @member_score.student_homework_score[1] %></span></li> <li><span class="c_blue03 w280">作业积分(平均分)</span><span class="c_red w70"><%= @member_score.student_work_score_avg %></span></li>
</ul> </ul>
</div> </div>

View File

@ -47,9 +47,10 @@
<br /> <br />
<p class="mt5 break_word"><%= e.event_description.html_safe %> <p class="mt5 break_word"><%= e.event_description.html_safe %>
<br /> <br />
<div class="cl"></div>
<%= l :label_activity_time %> <%= format_activity_day(day) %>&nbsp;<%= format_time(e.event_datetime, false) %> <%= l :label_activity_time %> <%= format_activity_day(day) %>&nbsp;<%= format_time(e.event_datetime, false) %>
</p> </p>
<%= link_to_attachments_course(e) if e.is_a?(News) %> <%= link_to_attachments_course(e) if e.class.to_s == "News" %>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</div><!--课程动态 end--> </div><!--课程动态 end-->
@ -125,4 +126,4 @@
}); });
nh_new_notify_count_show(); nh_new_notify_count_show();
}); });
</script> </script>

View File

@ -25,7 +25,9 @@
<% if file.is_public? || User.current.member_of_course?(course) %> <% if file.is_public? || User.current.member_of_course?(course) %>
<div class="re_con_box" id="container_files_<%= file.id %>"> <div class="re_con_box" id="container_files_<%= file.id %>">
<div class=""> <div class="">
<%= link_to_attachment file, :download => true,:text => truncate(file.filename,length: 35, omission: '...'), :title => file.filename+"\n"+file.description.to_s,:class => "c_dblue f_14 f_b f_l hiddent" %> <%= link_to truncate(file.filename,length: 35, omission: '...'),
download_named_attachment_path(file.id, file.filename),
:title => file.filename+"\n"+file.description.to_s, :style => "overflow: hidden; white-space: nowrap;text-overflow: ellipsis;",:class => "c_dblue f_14 f_b f_l" %>
<% if User.current.logged? %> <% if User.current.logged? %>
<% if (is_course_teacher(User.current,@course) || file.author_id == User.current.id) && course_contains_attachment?(@course,file) %> <% if (is_course_teacher(User.current,@course) || file.author_id == User.current.id) && course_contains_attachment?(@course,file) %>
<%= link_to("选入我的其他课程",quote_resource_show_course_file_path(@course,file),:class => "f_l re_select c_lorange",:remote => true) if has_course?(User.current,file) %> <%= link_to("选入我的其他课程",quote_resource_show_course_file_path(@course,file),:class => "f_l re_select c_lorange",:remote => true) if has_course?(User.current,file) %>
@ -40,7 +42,7 @@
<% else %> <% else %>
<%= link_to("选入我的课程",quote_resource_show_course_file_path(@course,file),:class => "f_l re_select c_lorange",:remote => true) if has_course?(User.current,file) %> <%= link_to("选入我的课程",quote_resource_show_course_file_path(@course,file),:class => "f_l re_select c_lorange",:remote => true) if has_course?(User.current,file) %>
<% end %> <% end %>
<%= link_to '下载',download_named_attachment_path(file.id, file.filename, force: true),class: 'f_l re_open' %> <%= file_preview_tag(file, class: 'f_l re_open') %>
<% else %> <% else %>
<% end %> <% end %>
</div> </div>

View File

@ -18,7 +18,9 @@
<% project_attachments.each do |file| %> <% project_attachments.each do |file| %>
<div class="re_con_box"> <div class="re_con_box">
<div class=""> <div class="">
<%= link_to_attachment file, :download => true,:text => truncate(file.filename,length: 35, omission: '...'), :title => file.filename+"\n"+file.description.to_s, :style => "overflow: hidden; white-space: nowrap;text-overflow: ellipsis;",:class => "c_dblue f_14 f_b f_l" %> <%= link_to truncate(file.filename,length: 35, omission: '...'),
download_named_attachment_path(file.id, file.filename),
:title => file.filename+"\n"+file.description.to_s, :style => "overflow: hidden; white-space: nowrap;text-overflow: ellipsis;",:class => "c_dblue f_14 f_b f_l" %>
<% if User.current.logged? %> <% if User.current.logged? %>
<% if (manage_allowed || file.author_id == User.current.id) && project_contains_attachment?(project,file) %> <% if (manage_allowed || file.author_id == User.current.id) && project_contains_attachment?(project,file) %>
<%= link_to(l(:label_slected_to_other_project),quote_resource_show_project_project_file_path(project,file),:class => "f_l re_select",:remote => true) if has_project?(User.current,file) %> <%= link_to(l(:label_slected_to_other_project),quote_resource_show_project_project_file_path(project,file),:class => "f_l re_select",:remote => true) if has_project?(User.current,file) %>
@ -30,7 +32,7 @@
<% else %> <% else %>
<%= link_to(l(:label_slected_to_project),quote_resource_show_project_project_file_path(project,file),:class => "f_l re_select",:remote => true) if has_project?(User.current,file) %> <%= link_to(l(:label_slected_to_project),quote_resource_show_project_project_file_path(project,file),:class => "f_l re_select",:remote => true) if has_project?(User.current,file) %>
<% end %> <% end %>
<%= link_to '下载',download_named_attachment_path(file.id, file.filename, force: true),class: 'f_l re_open' %> <%= file_preview_tag(file, class: 'f_l re_open') %>
<% end %> <% end %>
</div> </div>
<div class="cl"></div> <div class="cl"></div>

View File

@ -1,4 +1,4 @@
<!-- added by fq --> <!-- added by fq -->
<h1>编辑讨论区</h1> <h1>编辑讨论区</h1>
<%= javascript_include_tag "/assets/kindeditor/kindeditor" %> <%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' %>
<%= render 'form_edit_mode' %> <%= render 'form_edit_mode' %>

View File

@ -5,7 +5,7 @@
<% @nav_dispaly_forum_label = 1%> <% @nav_dispaly_forum_label = 1%>
<!-- added by fq --> <!-- added by fq -->
<h1 style="margin-top: 2%; margin-left: 49%"><%= l :label_forum_new %></h1> <h1 style="margin-top: 2%; margin-left: 49%"><%= l :label_forum_new %></h1>
<%= javascript_include_tag "/assets/kindeditor/kindeditor" %> <%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' %>
<%= render 'form_create_mode' %> <%= render 'form_create_mode' %>
<%#= link_to l(:button_back), forums_path %> <%#= link_to l(:button_back), forums_path %>

View File

@ -4,19 +4,21 @@
<span class="c_red">*</span> <span class="c_red">*</span>
&nbsp;<%= l(:field_name)%>&nbsp; &nbsp;<%= l(:field_name)%>&nbsp;
</label> </label>
<input type="text" name="homework_common[name]" id="homework_name" class="w548 h26 fl" maxlength="<%= Bid::NAME_LENGTH_LIMIT%>" onkeyup="regex_homework_name();" value="<%= homework.name%>" > <input type="text" name="homework_common[name]" id="homework_name" class="w548 h26 fl" maxlength="255" onkeyup="regex_homework_name();" value="<%= homework.name%>" >
<p id="homework_name_span" class="c_red ml110"></p> <p id="homework_name_span" class="c_red ml110"></p>
</li> </li>
<div class="cl"></div> <div class="cl"></div>
<li > <li >
<label class="label02 ">&nbsp;&nbsp;&nbsp;<%= l(:field_quote)%>&nbsp;</label> <label class="label02 ">&nbsp;&nbsp;&nbsp;<%= l(:field_quote)%>&nbsp;</label>
<!--<textarea name="" placeholder="请在此填入作业的要求及评分依据" class=" w548 h150 mb10 fl" ></textarea>--> <!--<textarea name="" placeholder="请在此填入作业的要求及评分依据" class=" w548 h150 mb10 fl" ></textarea>-->
<% if edit_mode %> <div style="width: 83%;float: left;">
<%= f.kindeditor :description,:width=>'83%',:editor_id => 'homework_description_editor',:owner_id => homework.id,:owner_type =>OwnerTypeHelper::HOMEWORKCOMMON %> <% if edit_mode %>
<% else %> <%= f.kindeditor :description,:editor_id => 'homework_description_editor',:owner_id => homework.id,:owner_type =>OwnerTypeHelper::HOMEWORKCOMMON %>
<%= hidden_field_tag :asset_id,params[:asset_id],:required => false,:style => 'display:none' %> <% else %>
<%= f.kindeditor :description,:width=>'83%',:editor_id => 'homework_description_editor' %> <%= hidden_field_tag :asset_id,params[:asset_id],:required => false,:style => 'display:none' %>
<% end %> <%= f.kindeditor :description,:editor_id => 'homework_description_editor' %>
<% end %>
</div>
</li> </li>
<div class="cl"></div> <div class="cl"></div>
<li class="mt10"> <li class="mt10">

View File

@ -1,4 +1,4 @@
<%= javascript_include_tag "/assets/kindeditor/kindeditor" %> <%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' %>
<%= error_messages_for 'homework_common' %> <%= error_messages_for 'homework_common' %>
<div class="project_r_h"> <div class="project_r_h">
@ -13,4 +13,4 @@
<%= link_to '取消',homework_common_index_path(:course => @course.id),:class => 'grey_btn fl'%> <%= link_to '取消',homework_common_index_path(:course => @course.id),:class => 'grey_btn fl'%>
<% end%> <% end%>
</div><!--hwork_new end--> </div><!--hwork_new end-->
<div class="cl"></div> <div class="cl"></div>

View File

@ -41,9 +41,9 @@
<%= homework.description.html_safe %> <%= homework.description.html_safe %>
</div> </div>
</div> </div>
<div class="news_foot c_red" id="bid_show_more_des_button<%= homework.id%>" onclick="bid_show_more_des(<%= homework.id%>);" style="cursor:pointer;display: none;">
<%= l(:button_more)%>... <div class="news_foot currentDd" id="bid_show_more_des_button<%= homework.id%>" onclick="bid_show_more_des(<%= homework.id%>);" style="cursor:pointer;display: none;">
<span class="g-arr-down"></span> [展开]
</div> </div>
<div class="cl"></div> <div class="cl"></div>

View File

@ -1,4 +1,4 @@
<%= javascript_include_tag "/assets/kindeditor/kindeditor" %> <%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' %>
<%= error_messages_for 'homework_common' %> <%= error_messages_for 'homework_common' %>
<div class="project_r_h"> <div class="project_r_h">
@ -14,4 +14,4 @@
<%= link_to '取消',homework_common_index_path(:course => @course.id),:class => 'grey_btn fl'%> <%= link_to '取消',homework_common_index_path(:course => @course.id),:class => 'grey_btn fl'%>
<% end%> <% end%>
</div><!--hwork_new end--> </div><!--hwork_new end-->
<div class="cl"></div> <div class="cl"></div>

View File

@ -1,4 +1,4 @@
<%= javascript_include_tag "/assets/kindeditor/kindeditor" %> <%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' %>
<div class="project_r_h" xmlns="http://www.w3.org/1999/html"> <div class="project_r_h" xmlns="http://www.w3.org/1999/html">
<h2 class="project_h2"><%= l(:label_issue_new) %></h2> <h2 class="project_h2"><%= l(:label_issue_new) %></h2>
</div> </div>

View File

@ -1,4 +1,4 @@
<%= javascript_include_tag "/assets/kindeditor/kindeditor" %> <%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' %>
<div class="project_r_h"> <div class="project_r_h">
<h2 class="project_h2"><%= l(:label_issue_edit) %></h2> <h2 class="project_h2"><%= l(:label_issue_edit) %></h2>
</div> </div>

View File

@ -20,19 +20,6 @@
<li id="current_user_li"> <li id="current_user_li">
<%= link_to "#{User.current.login}<span class='pic_triangle'></span>".html_safe, {:controller=> 'users', :action => 'show', id: User.current.id, host: Setting.host_user}, target:"_blank", :class => "uses_name"%> <%= link_to "#{User.current.login}<span class='pic_triangle'></span>".html_safe, {:controller=> 'users', :action => 'show', id: User.current.id, host: Setting.host_user}, target:"_blank", :class => "uses_name"%>
<ul id="user_sub_menu" style="right: 0px;display: none;"> <ul id="user_sub_menu" style="right: 0px;display: none;">
<% unless User.current.projects.empty? %>
<li id="my_projects_li">
<%= link_to l(:label_my_projects), {:controller => 'users', :action => 'user_projects', id: User.current.id, host: Setting.host_name},target:"_blank", :class => "parent" %>
<ul id="my_projects_ul" >
<% User.current.projects.each do |project| %>
<li title="<%=project.name%>">
<%= link_to project.name, {:controller => 'projects', :action => 'show',id: project.id, host: Setting.host_name }, target:"_blank" %>
</li>
<% end %>
</ul>
</li>
<% end %>
<% if @show_course == 1 && User.current.user_extensions && [UserExtensions::TEACHER, UserExtensions::STUDENT].include?(User.current.user_extensions.identity) %> <% if @show_course == 1 && User.current.user_extensions && [UserExtensions::TEACHER, UserExtensions::STUDENT].include?(User.current.user_extensions.identity) %>
<% user_course = get_user_course User.current%> <% user_course = get_user_course User.current%>
<% unless user_course.empty? %> <% unless user_course.empty? %>
@ -48,6 +35,19 @@
</li> </li>
<% end %> <% end %>
<% end %> <% end %>
<% unless User.current.projects.empty? %>
<li id="my_projects_li">
<%= link_to l(:label_my_projects), {:controller => 'users', :action => 'user_projects', id: User.current.id, host: Setting.host_name},target:"_blank", :class => "parent" %>
<ul id="my_projects_ul" >
<% User.current.projects.each do |project| %>
<li title="<%=project.name%>">
<%= link_to project.name, {:controller => 'projects', :action => 'show',id: project.id, host: Setting.host_name }, target:"_blank" %>
</li>
<% end %>
</ul>
</li>
<% end %>
<li> <li>
<%=link_to l(:label_user_edit), {:controller => 'my', :action=> 'account', host: Setting.host_user}%> <%=link_to l(:label_user_edit), {:controller => 'my', :action=> 'account', host: Setting.host_user}%>
</li> </li>

View File

@ -28,8 +28,8 @@
<div id="Container"> <div id="Container">
<%= render :partial => 'layouts/new_header' %> <%= render :partial => 'layouts/new_header' %>
<div class="cl"></div> <div class="cl"></div>
<!-- add by alan 对课程当前位置以及搜索框做缓存 -->
<% cache [:courses,@course.id] do%> <% cache [:course_head,@course.id] do%>
<div id="TopBar"> <div id="TopBar">
<div class="topbar_info02 fl"> <div class="topbar_info02 fl">
@ -51,7 +51,7 @@
</div> </div>
<div class="search fl"> <div class="search fl">
<%= form_tag({:controller => 'courses', :action => 'search'},:id => "course_search_form", :method => :get, :class => "search_form") do %> <%= 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)}');" %> <input class="search_text fl" id="name" name="name" onkeyup="regexName('搜索条件不能为空');" placeholder="课程名称" type="text">
<a href="javascript:void(0)" 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)%> <%= l(:label_search)%>
</a> </a>
@ -64,8 +64,11 @@
<% end %> <% end %>
<div class="cl"></div> <div class="cl"></div>
<div id="content"> <div id="content">
<% cache [:course_left, @course ] do%>
<div id="LSide" class="fl"> <div id="LSide" class="fl">
<div class="project_info"> <div class="project_info">
<!-- 对课程的图片及id 片段做缓存 -->
<% cache [:course_pic, @course.id] do%>
<div class="pr_info_logo fl mr10 mb5"> <div class="pr_info_logo fl mr10 mb5">
<!--<a href="#"><img src="images/courses/pic_courses.jpg" width="60" height="60" alt="logo" /></a>--> <!--<a href="#"><img src="images/courses/pic_courses.jpg" width="60" height="60" alt="logo" /></a>-->
<%= image_tag(url_to_avatar(@course), :width => "60", :height => "60") %> <%= image_tag(url_to_avatar(@course), :width => "60", :height => "60") %>
@ -73,6 +76,8 @@
<div class="pr_info_id fl mb5 f14"> <div class="pr_info_id fl mb5 f14">
ID:<%= @course.id%> ID:<%= @course.id%>
</div> </div>
<% end %>
<%# cache_if%>
<div class="pr_info_join fl"> <div class="pr_info_join fl">
<% if is_teacher%> <% if is_teacher%>
<%= link_to "<span class='pr_setting'></span>#{l(:button_configure)}".html_safe, {:controller => 'courses', :action => 'settings', :id => @course}, :class => "pr_join_a" %> <%= link_to "<span class='pr_setting'></span>#{l(:button_configure)}".html_safe, {:controller => 'courses', :action => 'settings', :id => @course}, :class => "pr_join_a" %>
@ -103,6 +108,7 @@
<%= l(:project_module_attachments)%><%= link_to course_file_num, course_files_path(@course), :class => 'info_foot_num c_blue',:id=>'courses_files_count_info' %></div> <%= l(:project_module_attachments)%><%= link_to course_file_num, course_files_path(@course), :class => 'info_foot_num c_blue',:id=>'courses_files_count_info' %></div>
<div class="cl"></div> <div class="cl"></div>
</div><!--课程信息 end--> </div><!--课程信息 end-->
<% cache [:course_info_left, @course.id ] do%>
<div class="info_box"> <div class="info_box">
<ul> <ul>
<li><%= l(:label_main_teacher)%> :&nbsp;&nbsp;<%= link_to(@course.teacher.lastname+@course.teacher.firstname, user_path(@course.teacher), :class => 'c_dblue') %></li> <li><%= l(:label_main_teacher)%> :&nbsp;&nbsp;<%= link_to(@course.teacher.lastname+@course.teacher.firstname, user_path(@course.teacher), :class => 'c_dblue') %></li>
@ -113,14 +119,14 @@
<% end%> <% end%>
</ul> </ul>
</div> </div>
<% end %>
<div class="subNavBox"> <div class="subNavBox">
<div class="subNav"> <div class="subNav">
<%= link_to l(:label_activity), course_path(@course), :class => "f14 c_blue02" %> <%= link_to l(:label_activity), course_path(@course), :class => "f14 c_blue02" %>
<!--暂时不显示课程动态数,优化后在显示--> <!--暂时不显示课程动态数,优化后在显示-->
<%= link_to "(#{course_activity_count @course})", course_path(@course), :class => "subnav_num c_orange"%> <%= link_to "(#{course_activity_count @course})", course_path(@course), :class => "subnav_num c_orange"%>
</div> </div>
<%# cache [:courses, @course] do %> <% cache [:course_models, @course] do %>
<div class="subNav"> <div class="subNav">
<%= link_to l(:label_homework), homework_common_index_path(:course => @course.id), :class => "f14 c_blue02"%> <%= link_to l(:label_homework), homework_common_index_path(:course => @course.id), :class => "f14 c_blue02"%>
<%= link_to "(#{@course.homework_commons.count})", homework_common_index_path(:course => @course.id), :class => "subnav_num c_orange"%> <%= link_to "(#{@course.homework_commons.count})", homework_common_index_path(:course => @course.id), :class => "subnav_num c_orange"%>
@ -150,10 +156,11 @@
<%= link_to "(#{course_poll_count})", poll_index_path(:polls_type => "Course", :polls_group_id => @course.id), :class => "subnav_num c_orange" %> <%= link_to "(#{course_poll_count})", poll_index_path(:polls_type => "Course", :polls_group_id => @course.id), :class => "subnav_num c_orange" %>
<%= link_to( "+#{l(:label_new_poll)}", new_poll_path(:polls_type => "Course",:polls_group_id => @course.id), :class => 'subnav_green c_white') if is_teacher %> <%= link_to( "+#{l(:label_new_poll)}", new_poll_path(:polls_type => "Course",:polls_group_id => @course.id), :class => 'subnav_green c_white') if is_teacher %>
</div> </div>
<%# end %> <% end %>
</div><!--项目侧导航 end--> </div><!--项目侧导航 end-->
<div class="cl"></div> <div class="cl"></div>
<% cache [:course_description, expire_in: 2.hours] do%>
<div class="project_intro"> <div class="project_intro">
<div id="course_description" class="course_description"> <div id="course_description" class="course_description">
<h4 ><%= l(:label_course_brief_introduction)%></h4> <h4 ><%= l(:label_course_brief_introduction)%></h4>
@ -168,6 +175,7 @@
</span> </span>
</div> </div>
</div><!--项目简介 end--> </div><!--项目简介 end-->
<% end %>
<div class="project_Label"> <div class="project_Label">
<h4 class="mb5" ><%= l(:label_tag)%>:</h4> <h4 class="mb5" ><%= l(:label_tag)%>:</h4>
<div class="tag_h" > <div class="tag_h" >
@ -176,7 +184,7 @@
<div class="cl"></div> <div class="cl"></div>
</div><!--项目标签 end--> </div><!--项目标签 end-->
</div><!--LSide end--> </div><!--LSide end-->
<% end %>
<div id="RSide" class="fl"> <div id="RSide" class="fl">
<%= render_flash_messages %> <%= render_flash_messages %>
<%= yield %> <%= yield %>
@ -187,11 +195,14 @@
</div><!--Content end--> </div><!--Content end-->
<div class="cl"></div> <div class="cl"></div>
<% cache 'footer', expire_in: 2.hours do%>
<%= render :partial => 'layouts/new_footer' %> <%= render :partial => 'layouts/new_footer' %>
<% end %>
<div class="cl"></div> <div class="cl"></div>
</div><!--Container end--> </div><!--Container end-->
<%= render :partial => 'layouts/new_feedback' %> <% cache 'feedback', expire_in: 2.hours do%>
<%= render :partial => 'layouts/new_feedback' %>
<% end %>
<div id="ajax-indicator" style="display:none;"> <div id="ajax-indicator" style="display:none;">
<span><%= l(:label_loading) %></span> <span><%= l(:label_loading) %></span>
</div> </div>

View File

@ -12,10 +12,10 @@
<meta name="keywords" content="issue,bug,tracker" /> <meta name="keywords" content="issue,bug,tracker" />
<%= csrf_meta_tag %> <%= csrf_meta_tag %>
<%= favicon %> <%= favicon %>
<%= javascript_include_tag "/assets/kindeditor/kindeditor" %>
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'application', 'nyan', :media => 'all' %> <%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'application', 'nyan', :media => 'all' %>
<%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %> <%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %>
<%= javascript_heads %> <%= javascript_heads %>
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' %>
<%= heads_for_theme %> <%= heads_for_theme %>
<%= call_hook :view_layouts_base_html_head %> <%= call_hook :view_layouts_base_html_head %>

View File

@ -107,7 +107,9 @@
<!--邀请加入--> <!--邀请加入-->
<div class="subNavBox"> <div class="subNavBox">
<% if User.current.member_of?(@project) %> <% if User.current.member_of?(@project) %>
<div class="subNav currentDd currentDt subNav_jiantou" id="expand_tools_expand_invit" nhtype="toggle4cookie" data-id="expand_invit" data-target="#navContent_invit"><%= l(:label_invite)%></div> <div class="subNav currentDd currentDt subNav_jiantou" id="expand_tools_expand_invit" nhtype="toggle4cookie" data-id="expand_invit" data-target="#navContent_invit" data-val="expand">
<%= l(:label_invite)%>
</div>
<ul class="navContent " style="display:block" id="navContent_invit"> <ul class="navContent " style="display:block" id="navContent_invit">
<li><%= link_to l(:label_invite_new_user), :controller=>"projects", :action=>"invite_members_by_mail", :id => @project %></li> <li><%= link_to l(:label_invite_new_user), :controller=>"projects", :action=>"invite_members_by_mail", :id => @project %></li>
<% if User.current.allowed_to?(:manage_members, @project) %> <% if User.current.allowed_to?(:manage_members, @project) %>

View File

@ -3,65 +3,64 @@
<%= @subject %> <%= @subject %>
</h4> </h4>
<% if @attachments.first || @course_news.first || @bids.first || <% if @attachments.first || @course_news.first || @bids.first ||
@course_journal_messages.first|| @course_messages.first %> @course_journal_messages.first|| @course_messages.first || @attachments.first %>
<div class="wmail_main" style="padding:20px 10px 0px;"> <div class="wmail_main" style="padding:20px 10px 0px;">
<h2 class="wmail_h2" style="color:#15bccf; "><%= l(:label_course_overview)%></h2> <h3 class="wmail_h2" style="color:#15bccf; "><%= l(:label_course_overview)%></h3>
<% unless @course_news.first.nil? %> <% unless @course_news.first.nil? %>
<ul class="wmail_ul" style=" list-style-type:none;clear: both;margin-left:10px; border-bottom:1px dashed #cfcfcf; padding-bottom:15px; width:720px; margin-bottom:15px;"> <ul class="wmail_ul" style=" list-style-type:none;clear: both;margin-left:10px; border-bottom:1px dashed #cfcfcf; padding-bottom:15px; width:1020px; margin-bottom:15px;">
<h4 class="wmail_h4" style="color:#474646; font-size:14px; margin-bottom:5px;" > <span class="wmail_h4" style="color:#474646; font-size:14px; margin-bottom:5px;" >
<%= l(:label_course_news) %> <%= l(:label_course_news) %>
<span class="wmail_num" style="color:#fe3f0c; margin-left:5px; font-weight:normal;">(<%= @course_news.count %>)</span> </span>
</h4>
<% @course_news.each do |course_new|%> <% @course_news.each do |course_new|%>
<li style="clear: both; list-style: none;"> <li style="clear: both; list-style: none;">
<span class="wmail_dis" style="float:left; color:#000000; margin-right:5px;">▪</span> <span class="wmail_dis" style="float:left; color:#000000; margin-right:5px;">▪</span>
<span class="wmail_b" style="color:#1b55a7; font-weight:bold; float:left;">[</span> <span class="wmail_b" style="color:#666; font-weight:bold; float:left;">[</span>
<%= link_to truncate(course_new.course.name,length: 30,omission: '...'), course_url(course_new.course, :token => @token.value), <%= link_to truncate(course_new.course.name,length: 30,omission: '...'), course_url(course_new.course, :token => @token.value),
:class=> "wmail_column", :class=> "wmail_column",
:style=> " font-weight: bold; display:block; float:left; color:#1b55a7;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %> :style=> " font-weight: bold; display:block; float:left; color:#666;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %>
<span class="wmail_b" style="color:#1b55a7; font-weight:bold; float:left;">]</span> <span class="wmail_b" style="color:#666; font-weight:bold; float:left;">]</span>
<%= link_to course_new.author, user_activities_url(course_new.author,:token => @token.value), :class => "wmail_name", <%= link_to course_new.author, user_activities_url(course_new.author,:token => @token.value), :class => "wmail_name",
:style => "color:#fe5722; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"%> :style => "color:#2E8DD7; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"%>
<span class="wmail_txt" style="float:left; margin-right:5px;color:#6e6e6e;"><%= l(:label_project_notice) %></span> <span class="wmail_txt" style="float:left; margin-right:5px;color:#ACAEB1;"><%= l(:label_project_notice) %></span>
<%= link_to truncate(course_new.title,length: 30,omission: '...'), news_url(course_new,:token => @token.value), <%= link_to truncate(course_new.title,length: 30,omission: '...'), news_url(course_new,:token => @token.value),
:class => 'wmail_info', :class => 'wmail_info',
:style => "color:#5a5a5a; float:left; margin-right:5px; display:block;color:#1b55a7;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" :style => "color:#2E8DD7;float:left; font-weight:normal;margin-right:5px; display:block;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"
%> %>
<span class="wmail_date" style="color:#6e6e6e; float:right;display:block; margin-left:10px;"><%= format_time(course_new.created_on) %></span> <span class="wmail_date" style="color:#6e6e6e; float:left;display:block; margin-left:40px;"><%= format_time(course_new.created_on) %></span>
</li> </li>
<% end %> <% end %>
<div class="cl"></div> <div class="cl"></div>
</ul><!--课程通知 end--> </ul><!--课程通知 end-->
<% end %> <% end %>
<!--课程作业--> <!--课程作业-->
<% unless @bids.empty? %> <% unless @bids.empty? %>
<ul class="wmail_ul" style="clear: both;margin-left:10px; border-bottom:1px dashed #cfcfcf; padding-bottom:15px; width:720px; margin-bottom:15px;"> <ul class="wmail_ul" style="clear: both;margin-left:10px; border-bottom:1px dashed #cfcfcf; padding-bottom:15px; width:1020px; margin-bottom:15px;">
<h4 class="wmail_h4" style="color:#474646; font-size:14px; margin-bottom:5px;"><%= l(:label_homework_overview) %><span class="wmail_num" style="color:#fe3f0c; margin-left:5px; font-weight:normal;">(<%= @bids.count %>)</span></h4> <span class="wmail_h4" style="color:#474646; font-size:14px; margin-bottom:5px;">
<%= l(:label_homework_overview) %>
</span>
<% unless @bids.first.nil?%> <% unless @bids.first.nil?%>
<% @bids.each do |bid| %> <% @bids.each do |bid| %>
<li style="clear: both; list-style: none;"> <li style="clear: both; list-style: none;">
<span class="wmail_dis" style="float:left; color:#000000; margin-right:5px;">▪</span> <span class="wmail_dis" style="float:left; color:#000000; margin-right:5px;">▪</span>
<span class="wmail_b" style="color:#1b55a7; font-weight:bold; float:left;">[</span> <span class="wmail_b" style="color:#666; font-weight:bold; float:left;">[</span>
<%= link_to truncate(bid.course.name,length: 30,omission: '...'), course_url(bid.course, :token => @token.value), <%= link_to truncate(bid.course.name,length: 30,omission: '...'), course_url(bid.course, :token => @token.value),
:class=> "wmail_column", :class=> "wmail_column",
:style=> " font-weight: bold; display:block; float:left; color:#1b55a7;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %> :style=> " font-weight: bold; display:block; float:left; color:#666;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %>
<span class="wmail_b" style="color:#1b55a7; font-weight:bold; float:left;">]</span> <span class="wmail_b" style="color:#666; font-weight:bold; float:left;">]</span>
<%= link_to bid.user, user_activities_url(bid.user,:token => @token.value), :class => "wmail_name", <%= link_to bid.user, user_activities_url(bid.user,:token => @token.value), :class => "wmail_name",
:style => "color:#fe5722; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"%> :style => "color:#2E8DD7; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"%>
<span class="wmail_txt" style="float:left; margin-right:5px;color:#6e6e6e;"><%= l(:label_course_homework) %></span> <span class="wmail_txt" style="float:left; margin-right:5px;color:#ACAEB1;"><%= l(:label_course_homework) %></span>
<%= link_to truncate(bid.name,length: 30,omission: '...'), student_work_index_path(:homework => bid.id,:token => @token.value), <%= link_to truncate(bid.name,length: 30,omission: '...'), student_work_index_path(:homework => bid.id,:token => @token.value),
:class => 'wmail_info', :class => 'wmail_info',
:style => "color:#5a5a5a; float:left; margin-right:5px; display:block;color:#1b55a7;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" :style => "color:#2E8DD7;float:left; font-weight:normal;margin-right:5px; display:block;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"
%> %>
<span class="wmail_date" style="color:#6e6e6e; float:right;display:block; margin-left:10px;"><%= format_time(bid.created_at) %></span> <span class="wmail_date" style="color:#6e6e6e; float:left;display:block; margin-left:40px;"><%= format_time(bid.created_at) %></span>
</li> </li>
<% end %> <% end %>
<% end %> <% end %>
@ -72,31 +71,30 @@
<!-- 课程留言 --> <!-- 课程留言 -->
<% unless @course_journal_messages.first.nil? %> <% unless @course_journal_messages.first.nil? %>
<ul class="wmail_ul" style="clear: both;margin-left:10px; border-bottom:1px dashed #cfcfcf; padding-bottom:15px; width:720px; margin-bottom:15px;"> <ul class="wmail_ul" style="clear: both;margin-left:10px; border-bottom:1px dashed #cfcfcf; padding-bottom:15px; width:1020px; margin-bottom:15px;">
<h4 class="wmail_h4" style="color:#474646; font-size:14px; margin-bottom:5px;" > <span class="wmail_h4" style="color:#666; font-size:14px; margin-bottom:5px;" >
<%= l(:view_course_journals_for_messages) %> <%= l(:view_course_journals_for_messages) %>
<span class="wmail_num" style="color:#fe3f0c; margin-left:5px; font-weight:normal;">(<%= @course_journal_messages.count %>)</span> </span>
</h4>
<% @course_journal_messages.each do |course_journal_message|%> <% @course_journal_messages.each do |course_journal_message|%>
<li style="clear: both; list-style: none;"> <li style="clear: both; list-style: none;">
<span class="wmail_dis" style="float:left; color:#000000; margin-right:5px;">▪</span> <span class="wmail_dis" style="float:left; color:#000000; margin-right:5px;">▪</span>
<span class="wmail_b" style="color:#1b55a7; font-weight:bold; float:left;">[</span> <span class="wmail_b" style="color:#666; font-weight:bold; float:left;">[</span>
<%= link_to truncate(course_journal_message.course.name,length: 30,omission: '...'), course_url(course_journal_message.course, :token => @token.value), <%= link_to truncate(course_journal_message.course.name,length: 30,omission: '...'), course_url(course_journal_message.course, :token => @token.value),
:class=> "wmail_column", :class=> "wmail_column",
:style=> " font-weight: bold; display:block; float:left; color:#1b55a7;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %> :style=> " font-weight: bold; display:block; float:left; color:#666;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %>
<span class="wmail_b" style="color:#1b55a7; font-weight:bold; float:left;">]</span> <span class="wmail_b" style="color:#666; font-weight:bold; float:left;">]</span>
<%= link_to course_journal_message.user, user_activities_url(course_journal_message.user,:token => @token.value), :class => "wmail_name", <%= link_to course_journal_message.user, user_activities_url(course_journal_message.user,:token => @token.value), :class => "wmail_name",
:style => "color:#fe5722; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"%> :style => "color:#2E8DD7; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"%>
<span class="wmail_txt" style="float:left; margin-right:5px;color:#6e6e6e;"><%= l(:label_send_course_journals_for_messages) %></span> <span class="wmail_txt" style="float:left; margin-right:5px;color:#ACAEB1;"><%= l(:label_send_course_journals_for_messages) %></span>
<%= link_to truncate(course_journal_message.notes,length: 30,omission: '...'), course_feedback_url(course_journal_message.course,:token => @token.value), <%= link_to truncate(course_journal_message.notes.html_safe,length: 30,omission: '...'), course_feedback_url(course_journal_message.course,:token => @token.value),
:class => 'wmail_info', :class => 'wmail_info',
:style => "color:#5a5a5a; float:left; margin-right:5px; display:block;color:#1b55a7;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" :style => "color:#2E8DD7;float:left; font-weight:normal;margin-right:5px; display:block;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"
%> %>
<span class="wmail_date" style="color:#6e6e6e; float:right;display:block; margin-left:10px;"><%= format_time(course_journal_message.created_on) %></span> <span class="wmail_date" style="color:#6e6e6e; float:left;display:block; margin-left:40px;"><%= format_time(course_journal_message.created_on) %></span>
</li> </li>
<% end %> <% end %>
<div class="cl"></div> <div class="cl"></div>
@ -105,26 +103,25 @@
<!-- 课程讨论区 --> <!-- 课程讨论区 -->
<% unless @course_messages.first.nil? %> <% unless @course_messages.first.nil? %>
<ul class="wmail_ul" style="margin-left:10px; border-bottom:1px dashed #cfcfcf; padding-bottom:15px; width:720px; margin-bottom:15px;"> <ul class="wmail_ul" style="margin-left:10px; border-bottom:1px dashed #cfcfcf; padding-bottom:15px; width:1020px; margin-bottom:15px;">
<h4 class="wmail_h4" style="color:#474646; font-size:14px; margin-bottom:5px;" > <span class="wmail_h4" style="color:#666; font-size:14px; margin-bottom:5px;" >
<%= l(:view_borad_course) %> <%= l(:view_borad_course) %>
<span class="wmail_num" style="color:#fe3f0c; margin-left:5px; font-weight:normal;">(<%= @course_journal_messages.count %>)</span> </span>
</h4>
<% @course_messages.each do |course_message|%> <% @course_messages.each do |course_message|%>
<li style="clear: both; list-style: none;"> <li style="clear: both; list-style: none;">
<span class="wmail_dis" style="float:left; color:#000000; margin-right:5px;">▪</span> <span class="wmail_dis" style="float:left; color:#000000; margin-right:5px;">▪</span>
<span class="wmail_b" style="color:#1b55a7; font-weight:bold; float:left;">[</span> <span class="wmail_b" style="color:#666; font-weight:bold; float:left;">[</span>
<%= link_to truncate(course_message.course.name,length: 30,omission: '...'), course_url(course_message.course.id, :token => @token.value), <%= link_to truncate(course_message.course.name,length: 30,omission: '...'), course_url(course_message.course.id, :token => @token.value),
:class=> "wmail_column", :class=> "wmail_column",
:style=> " font-weight: bold; display:block; float:left; color:#1b55a7;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %> :style=> " font-weight: bold; display:block; float:left; color:#666;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %>
<span class="wmail_b" style="color:#1b55a7; font-weight:bold; float:left;">]</span> <span class="wmail_b" style="color:#666; font-weight:bold; float:left;">]</span>
<%= link_to course_message.author, user_activities_url(course_message.author,:token => @token.value), :class => "wmail_name", <%= link_to course_message.author, user_activities_url(course_message.author,:token => @token.value), :class => "wmail_name",
:style => "color:#fe5722; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"%> :style => "color:#2E8DD7; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"%>
<span class="wmail_txt" style="float:left; margin-right:5px;color:#6e6e6e;"><%= l(:label_send_course_messages) %></span> <span class="wmail_txt" style="float:left; margin-right:5px;color:#ACAEB1;"><%= l(:label_send_course_messages) %></span>
<%= link_to truncate(course_message.subject,length: 30,omission: '...'),board_message_url(course_message, :board_id => course_message.board_id,:token => @token.value), <%= link_to truncate(course_message.subject,length: 30,omission: '...'),board_message_url(course_message, :board_id => course_message.board_id,:token => @token.value),
:class => 'wmail_info', :class => 'wmail_info',
:style => "color:#5a5a5a; float:left; margin-right:5px; display:block;color:#1b55a7;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %> :style => "color:#2E8DD7;float:left; font-weight:normal;margin-right:5px; display:block;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %>
<span class="wmail_date" style="color:#6e6e6e; float:right;display:block; margin-left:10px;"><%= format_time(course_message.created_on) %></span> <span class="wmail_date" style="color:#6e6e6e; float:left;display:block; margin-left:40px;"><%= format_time(course_message.created_on) %></span>
</li> </li>
<% end %> <% end %>
<div class="cl"></div> <div class="cl"></div>
@ -133,30 +130,29 @@
<!-- 课件 --> <!-- 课件 -->
<% unless @attachments.first.nil? %> <% unless @attachments.first.nil? %>
<ul class="wmail_ul" style="margin-left:10px; border-bottom:1px dashed #cfcfcf; padding-bottom:15px; width:720px; margin-bottom:15px;"> <ul class="wmail_ul" style="margin-left:10px; border-bottom:1px dashed #cfcfcf; padding-bottom:15px; width:1020px; margin-bottom:15px;">
<h4 class="wmail_h4" style="color:#474646; font-size:14px; margin-bottom:5px;" > <span class="wmail_h4" style="color:#666; font-size:14px; margin-bottom:5px;" >
<%= l(:label_course_attendingcontestwork_download) %> <%= l(:label_course_attendingcontestwork_download) %>
<span class="wmail_num" style="color:#fe3f0c; margin-left:5px; font-weight:normal;">(<%= @attachments.count %>)</span> </span>
</h4>
<% @attachments.each do |attachment|%> <% @attachments.each do |attachment|%>
<li style="clear: both; list-style: none;"> <li style="clear: both; list-style: none;">
<span class="wmail_dis" style="float:left; color:#000000; margin-right:5px;">▪</span> <span class="wmail_dis" style="float:left; color:#000000; margin-right:5px;">▪</span>
<span class="wmail_b" style="color:#1b55a7; font-weight:bold; float:left;">[</span> <span class="wmail_b" style="color:#666; font-weight:bold; float:left;">[</span>
<%= link_to truncate(attachment.course.name,length: 30,omission: '...'), course_url(attachment.course, :token => @token.value), <%= link_to truncate(attachment.course.name,length: 30,omission: '...'), course_url(attachment.course, :token => @token.value),
:class=> "wmail_column", :class=> "wmail_column",
:style=> " font-weight: bold; display:block; float:left; color:#1b55a7;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %> :style=> " font-weight: bold; display:block; float:left; color:#666;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %>
<span class="wmail_b" style="color:#1b55a7; font-weight:bold; float:left;">]</span> <span class="wmail_b" style="color:#666; font-weight:bold; float:left;">]</span>
<%= link_to attachment.author, user_activities_url(attachment.author,:token => @token.value), :class => "wmail_name", <%= link_to attachment.author, user_activities_url(attachment.author,:token => @token.value), :class => "wmail_name",
:style => "color:#fe5722; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"%> :style => "color:#2E8DD7; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"%>
<span class="wmail_txt" style="float:left; margin-right:5px;color:#6e6e6e;"><%= l(:label_course_file_upload) %></span> <span class="wmail_txt" style="float:left; margin-right:5px;color:#ACAEB1;"><%= l(:label_course_file_upload) %></span>
<%= link_to truncate(attachment.filename,length: 30,omission: '...'),course_files_url(attachment.course,:token => @token.value), <%= link_to truncate(attachment.filename,length: 30,omission: '...'),course_files_url(attachment.course,:token => @token.value),
:class => 'wmail_info', :class => 'wmail_info',
:style => "color:#5a5a5a; float:left; margin-right:5px; display:block;color:#1b55a7;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" :style => "color:#2E8DD7;float:left; font-weight:normal;margin-right:5px; display:block;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"
%> %>
<span class="wmail_date" style="color:#6e6e6e; float:right;display:block; margin-left:10px;"><%= format_time(attachment.created_on) %></span> <span class="wmail_date" style="color:#6e6e6e; float:left;display:block; margin-left:40px;"><%= format_time(attachment.created_on) %></span>
</li> </li>
<% end %> <% end %>
<div class="cl"></div> <div class="cl"></div>
@ -165,34 +161,30 @@
</div> </div>
<% end %> <% end %>
<!--项目相关--> <!--项目相关-->
<% if @issues.first || @project_messages.first %> <% if @issues.first || @project_messages.first || @wiki_contents.first || @project_news.first || @project_journal_messages.first %>
<div class="wmail_main" style="padding:20px 10px 0px;"> <div class="wmail_main" style="padding:20px 10px 0px;">
<h2 class="wmail_h2" style="color:#15bccf; "><%= l(:label_project_overview_new)%></h2> <h3 class="wmail_h2" style="color:#15BCCF; "><%= l(:label_project_overview_new)%></h3>
<% unless @issues.first.nil? %> <% unless @issues.first.nil? %>
<ul class="wmail_ul" style="margin-left:10px; border-bottom:1px dashed #cfcfcf; padding-bottom:15px; width:720px; margin-bottom:15px;"> <ul class="wmail_ul" style="margin-left:10px; border-bottom:1px dashed #cfcfcf; padding-bottom:15px; width:1020px; margin-bottom:15px;">
<h4 class="wmail_h4" style="color:#474646; font-size:14px; margin-bottom:5px;" > <span class="wmail_h4" style="color:#666; font-size:14px; margin-bottom:5px;" >
<%= l(:label_issue_tracking) %> <%= l(:label_issue_tracking) %>
<span class="wmail_num" style="color:#fe3f0c; margin-left:5px; font-weight:normal;">(<%= @issues.count %>)</span> </span>
</h4>
<% @issues.each do |issue|%> <% @issues.each do |issue|%>
<li style="clear: both; list-style: none;"> <li style="clear: both; list-style: none;">
<span class="wmail_dis" style="float:left; color:#000000; margin-right:5px;">▪</span> <span class="wmail_dis" style="float:left; color:#000000; margin-right:5px;">▪</span>
<span class="wmail_b" style="color:#1b55a7; font-weight:bold; float:left;">[</span> <span class="wmail_b" style="color:#666; font-weight:bold; float:left;">[</span>
<%= link_to truncate(issue.project.name,length: 30,omission: '...'), project_url(issue.project, :token => @token.value), <%= link_to truncate(issue.project.name,length: 30,omission: '...'), project_url(issue.project, :token => @token.value),
:class=> "wmail_column", :class=> "wmail_column",
:style=> " font-weight: bold; display:block; float:left; color:#1b55a7;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %> :style=> " font-weight: bold; display:block; float:left; color:#666;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %>
<span class="wmail_b" style="color:#1b55a7; font-weight:bold; float:left;">]</span> <span class="wmail_b" style="color:#666; font-weight:bold; float:left;">]</span>
<%= link_to issue.author, user_activities_url(issue.author,:token => @token.value), :class => "wmail_name", <%= link_to issue.author, user_activities_url(issue.author,:token => @token.value), :class => "wmail_name",
:style => "color:#fe5722; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"%> :style => "color:#2E8DD7; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"%>
<span class="wmail_txt" style="float:left; margin-right:5px;color:#6e6e6e;"><%= l(:label_project_issue) %></span> <span class="wmail_txt" style="float:left; margin-right:5px;color:#ACAEB1;"><%= l(:label_project_issue) %></span>
<%= link_to truncate(issue.subject,length: 30,omission: '...'),issue_url(issue, :token => @token.value), <%= link_to truncate(issue.subject,length: 30,omission: '...'),issue_url(issue, :token => @token.value),
:class => 'wmail_info', :style => "color:#2E8DD7;float:left; font-weight:normal;margin-right:5px; display:block;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"
:style => "color:#5a5a5a; float:left; margin-right:5px; display:block;color:#1b55a7;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"
%> %>
<span class="wmail_date" style="color:#6e6e6e; float:right;display:block; margin-left:10px;"><%= format_time(issue.created_on) %></span> <span class="wmail_date" style="color:#6e6e6e; float:left;display:block; margin-left:40px;"><%= format_time(issue.created_on) %></span>
</li> </li>
<% end %> <% end %>
@ -202,31 +194,29 @@
<!-- 讨论区 --> <!-- 讨论区 -->
<% unless @project_messages.first.nil? %> <% unless @project_messages.first.nil? %>
<ul class="wmail_ul" style="margin-left:10px; border-bottom:1px dashed #cfcfcf; padding-bottom:15px; width:720px; margin-bottom:15px;"> <ul class="wmail_ul" style="margin-left:10px; border-bottom:1px dashed #cfcfcf; padding-bottom:15px; width:1020px; margin-bottom:15px;">
<h4 class="wmail_h4" style="color:#474646; font-size:14px; margin-bottom:5px;" > <span class="wmail_h4" style="color:#666; font-size:14px; margin-bottom:5px;" >
<%= l(:project_moule_boards_show) %> <%= l(:project_moule_boards_show) %>
<span class="wmail_num" style="color:#fe3f0c; margin-left:5px; font-weight:normal;">(<%= @project_messages.count %>)</span> </span>
</h4>
<% @project_messages.each do |project_message|%> <% @project_messages.each do |project_message|%>
<li style="clear: both; list-style: none;"> <li style="clear: both; list-style: none;">
<span class="wmail_dis" style="float:left; color:#000000; margin-right:5px;">▪</span> <span class="wmail_dis" style="float:left; color:#000000; margin-right:5px;">▪</span>
<span class="wmail_b" style="color:#1b55a7; font-weight:bold; float:left;">[</span> <span class="wmail_b" style="color:#666; font-weight:bold; float:left;">[</span>
<%= link_to truncate(project_message.project.name,length: 30,omission: '...'), project_url(project_message.project, :token => @token.value), <%= link_to truncate(project_message.project.name,length: 30,omission: '...'), project_url(project_message.project, :token => @token.value),
:class=> "wmail_column", :class=> "wmail_column",
:style=> " font-weight: bold; display:block; float:left; color:#1b55a7;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %> :style=> " font-weight: bold; display:block; float:left; color:#666;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %>
<span class="wmail_b" style="color:#1b55a7; font-weight:bold; float:left;">]</span> <span class="wmail_b" style="color:#666; font-weight:bold; float:left;">]</span>
<%= link_to project_message.author, user_activities_url(project_message.author,:token => @token.value), :class => "wmail_name", <%= link_to project_message.author, user_activities_url(project_message.author,:token => @token.value), :class => "wmail_name",
:style => "color:#fe5722; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"%> :style => "color:#2E8DD7; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"%>
<span class="wmail_txt" style="float:left; margin-right:5px;color:#6e6e6e;"><%= l(:label_send_course_messages) %></span> <span class="wmail_txt" style="float:left; margin-right:5px;color:#ACAEB1;"><%= l(:label_send_course_messages) %></span>
<%= link_to truncate(project_message.subject,length: 30,omission: '...'),board_message_url(project_message, :board_id => project_message.board_id,:token => @token.value), <%= link_to truncate(project_message.subject,length: 30,omission: '...'),board_message_url(project_message, :board_id => project_message.board_id,:token => @token.value),
:class => 'wmail_info', :class => 'wmail_info',
:style => "color:#5a5a5a; float:left; margin-right:5px; display:block;color:#1b55a7;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" :style => "color:#2E8DD7;float:left; font-weight:normal;margin-right:5px; display:block;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"
%> %>
<span class="wmail_date" style="color:#6e6e6e; float:right;display:block; margin-left:10px;"><%= format_time(project_message.created_on) %></span> <span class="wmail_date" style="color:#6e6e6e; float:left;display:block; margin-left:40px;"><%= format_time(project_message.created_on) %></span>
</li> </li>
<% end %> <% end %>
@ -234,50 +224,109 @@
</ul><!--项目论坛 end--> </ul><!--项目论坛 end-->
<% end %> <% end %>
<!--项目wiki-->
<% unless @wiki_contents.first.nil? %>
<ul class="wmail_ul" style=" list-style-type:none;clear: both;margin-left:10px; border-bottom:1px dashed #cfcfcf; padding-bottom:15px; width:1020px; margin-bottom:15px;">
<span class="wmail_h4" style="color:#666; font-size:14px; margin-bottom:5px;" >
<%= l(:label_wiki) %>
</span>
<% @wiki_contents.each do |wikicontent|%>
<li style="clear: both; list-style: none;">
<span class="wmail_dis" style="float:left; color:#000000; margin-right:5px;">▪</span>
<span class="wmail_b" style="color:#666; font-weight:bold; float:left;">[</span>
<% unless wikicontent.page.nil? %>
<%= link_to truncate(wikicontent.page.wiki.project.name,length: 30,omission: '...'), project_url(wikicontent.page.wiki.project, :token => @token.value),
:class=> "wmail_column",
:style=> " font-weight: bold; display:block; float:left; color:#666;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %>
<% end %>
<span class="wmail_b" style="color:#666; font-weight:bold; float:left;">]</span>
<%= link_to wikicontent.author, user_activities_url(wikicontent.author,:token => @token.value), :class => "wmail_name",
:style => "color:#2E8DD7; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"%>
<span class="wmail_txt" style="float:left; margin-right:5px;color:#ACAEB1;"><%= l(:label_wiki_mail_notification) %></span>
<% unless wikicontent.page.nil? %>
<%= link_to truncate(wikicontent.text.html_safe, length: 30,omission: '...'), project_wiki_url(wikicontent.page.wiki,:token => @token.value),
:class => 'wmail_info',
:style => "color:#2E8DD7;float:left; font-weight:normal;margin-right:5px; display:block;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %>
<% end %>
<span class="wmail_date" style="color:#6e6e6e; float:left;display:block; margin-left:40px;"><%= format_time(wikicontent.updated_on) %></span>
</li>
<% end %>
<div class="cl"></div>
</ul><!-- 项目wikiend -->
<% end %>
<!--项目新闻--> <!--项目新闻-->
<% unless @project_news.first.nil? %> <% unless @project_news.first.nil? %>
<ul class="wmail_ul" style=" list-style-type:none;clear: both;margin-left:10px; border-bottom:1px dashed #cfcfcf; padding-bottom:15px; width:720px; margin-bottom:15px;"> <ul class="wmail_ul" style=" list-style-type:none;clear: both;margin-left:10px; border-bottom:1px dashed #cfcfcf; padding-bottom:15px; width:1020px; margin-bottom:15px;">
<h4 class="wmail_h4" style="color:#474646; font-size:14px; margin-bottom:5px;" > <span class="wmail_h4" style="color:#666; font-size:14px; margin-bottom:5px;" >
<%= l(:label_project_news) %> <%= l(:label_project_news) %>
<span class="wmail_num" style="color:#fe3f0c; margin-left:5px; font-weight:normal;">(<%= @project_news.count %>)</span> </span>
</h4>
<% @project_news.each do |project_new|%> <% @project_news.each do |project_new|%>
<li style="clear: both; list-style: none;"> <li style="clear: both; list-style: none;">
<span class="wmail_dis" style="float:left; color:#000000; margin-right:5px;">▪</span> <span class="wmail_dis" style="float:left; color:#000000; margin-right:5px;">▪</span>
<span class="wmail_b" style="color:#1b55a7; font-weight:bold; float:left;">[</span> <span class="wmail_b" style="color:#666; font-weight:bold; float:left;">[</span>
<%= link_to truncate(project_new.project.name,length: 30,omission: '...'), project_url(project_new.project, :token => @token.value), <%= link_to truncate(project_new.project.name,length: 30,omission: '...'), project_url(project_new.project, :token => @token.value),
:class=> "wmail_column", :class=> "wmail_column",
:style=> " font-weight: bold; display:block; float:left; color:#1b55a7;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %> :style=> " font-weight: bold; display:block; float:left; color:#666;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %>
<span class="wmail_b" style="color:#1b55a7; font-weight:bold; float:left;">]</span> <span class="wmail_b" style="color:#666; font-weight:bold; float:left;">]</span>
<%= link_to project_new.author, user_activities_url(project_new.author,:token => @token.value), :class => "wmail_name", <%= link_to project_new.author, user_activities_url(project_new.author,:token => @token.value), :class => "wmail_name",
:style => "color:#fe5722; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"%> :style => "color:#2E8DD7; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"%>
<span class="wmail_txt" style="float:left; margin-right:5px;color:#6e6e6e;"><%= l(:label_project_notice) %></span> <span class="wmail_txt" style="float:left; margin-right:5px;color:#ACAEB1;"><%= l(:label_project_mail_notice) %></span>
<%= link_to truncate(project_new.title,length: 30,omission: '...'), news_url(project_new,:token => @token.value), <%= link_to truncate(project_new.title,length: 30,omission: '...'), news_url(project_new,:token => @token.value),
:class => 'wmail_info', :class => 'wmail_info',
:style => "color:#5a5a5a; float:left; margin-right:5px; display:block;color:#1b55a7;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" :style => "color:#2E8DD7;float:left; font-weight:normal;margin-right:5px; display:block;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %>
%> <span class="wmail_date" style="color:#6e6e6e; float:left;display:block; margin-left:40px;"><%= format_time(project_new.created_on) %></span>
<span class="wmail_date" style="color:#6e6e6e; float:right;display:block; margin-left:10px;"><%= format_time(project_new.created_on) %></span>
</li> </li>
<% end %> <% end %>
<div class="cl"></div> <div class="cl"></div>
</ul><!-- 项目新闻end --> </ul><!-- 项目新闻end -->
<% end %> <% end %>
<!--项目留言-->
<% unless @project_journal_messages.first.nil? %>
<ul class="wmail_ul" style="clear: both;margin-left:10px; border-bottom:1px dashed #cfcfcf; padding-bottom:15px; width:1020px; margin-bottom:15px;">
<span class="wmail_h4" style="color:#666; font-size:14px; margin-bottom:5px;" >
<%= l(:label_project_mail_feedback) %>
</span>
<% @project_journal_messages.each do |project_journal_message|%>
<li style="clear: both; list-style: none;">
<span class="wmail_dis" style="float:left; color:#000000; margin-right:5px;">▪</span>
<span class="wmail_b" style="color:#666; font-weight:bold; float:left;">[</span>
<%= link_to truncate(project_journal_message.project.name,length: 30,omission: '...'), project_url(project_journal_message.project, :token => @token.value),
:class=> "wmail_column",
:style=> " font-weight: bold; display:block; float:left; color:#666;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %>
<span class="wmail_b" style="color:#666; font-weight:bold; float:left;">]</span>
<%= link_to project_journal_message.user, user_activities_url(project_journal_message.user,:token => @token.value), :class => "wmail_name",
:style => "color:#2E8DD7; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"%>
<span class="wmail_txt" style="float:left; margin-right:5px;color:#ACAEB1;"><%= l(:label_send_course_journals_for_messages) %></span>
<%= link_to truncate(project_journal_message.notes.html_safe,length: 30,omission: '...'), project_feedback_url(project_journal_message.project,:token => @token.value),
:class => 'wmail_info',
:style => "color:#2E8DD7;float:left; font-weight:normal;margin-right:5px; display:block;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"
%>
<span class="wmail_date" style="color:#6e6e6e; float:left;display:block; margin-left:40px;"><%= format_time(project_journal_message.created_on) %></span>
</li>
<% end %>
<div class="cl"></div>
</ul><!--项目留言 end-->
<% end %>
</div> </div>
<% end %><!-- 项目动态end --> <% end %><!-- 项目动态end -->
<!-- 用户留言 --> <!-- 用户留言 -->
<% unless @user_journal_messages.first.nil? %> <% unless @user_journal_messages.first.nil? %>
<div class="wmail_main" style="padding:20px 10px 0px;"> <div class="wmail_main" style="padding:20px 10px 0px;">
<h2 class="wmail_h2" style="color:#15bccf; "><%= l(:label_activities) %></h2> <h3 class="wmail_h2" style="color:#15bccf; "><%= l(:label_activities) %></h3>
<ul class="wmail_ul" style="margin-left:10px; border-bottom:1px dashed #cfcfcf; padding-bottom:15px; width:720px; margin-bottom:15px;"> <ul class="wmail_ul" style="margin-left:10px; border-bottom:1px dashed #cfcfcf; padding-bottom:15px; width:1020px; margin-bottom:15px;">
<h4 class="wmail_h4" style="color:#474646; font-size:14px; margin-bottom:5px;" > <span class="wmail_h4" style="color:#666; font-size:14px; margin-bottom:5px;" >
<%= l(:label_user_message) %> <%= l(:label_user_message) %>
<span class="wmail_num" style="color:#fe3f0c; margin-left:5px; font-weight:normal;">(<%= @user_journal_messages.count %>)</span> </span>
</h4>
<% @user_journal_messages.each do |user_journal_message|%> <% @user_journal_messages.each do |user_journal_message|%>
<li style="clear: both; list-style: none;"> <li style="clear: both; list-style: none;">
@ -285,14 +334,14 @@
<%= link_to user_journal_message.user, user_activities_url(user_journal_message.user,:token => @token.value), <%= link_to user_journal_message.user, user_activities_url(user_journal_message.user,:token => @token.value),
:class => "wmail_name", :class => "wmail_name",
:style => "color:#fe5722; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %> :style => "color:#2E8DD7; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %>
<span class="wmail_txt" style="float:left; margin-right:5px;color:#6e6e6e;"><%= l(:label_show_your_message) %></span> <span class="wmail_txt" style="float:left; margin-right:5px;color:#ACAEB1;"><%= l(:label_show_your_message) %></span>
<%= link_to truncate(user_journal_message.notes,length: 30,omission: '...'),feedback_url(@user,:token => @token.value), <%= link_to truncate(user_journal_message.notes,length: 30,omission: '...'),feedback_url(@user,:token => @token.value),
:class => 'wmail_info', :class => 'wmail_info',
:style => "color:#5a5a5a; float:left; margin-right:5px; display:block;color:#1b55a7;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" :style => "color:#2E8DD7;float:left; font-weight:normal;margin-right:5px; display:block;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"
%> %>
<span class="wmail_date" style="color:#6e6e6e; float:right;display:block; margin-left:10px;"><%= format_time(user_journal_message.created_on) %></span></li> <span class="wmail_date" style="color:#6e6e6e; float:left;display:block; margin-left:40px;"><%= format_time(user_journal_message.created_on) %></span></li>
<% end %> <% end %>
@ -303,13 +352,13 @@
<% end %> <% end %>
<% if @forums.first || @memos.first %> <% if @forums.first || @memos.first %>
<div class="wmail_main" style="padding:20px 10px 0px;"> <div class="wmail_main" style="padding:20px 10px 0px;">
<h2 class="wmail_h2" style="color:#15bccf; "><%= l(:lable_bar_active) %></h2> <h3 class="wmail_h2" style="color:#15bccf; "><%= l(:lable_bar_active) %></h3>
<% unless @forums.first.nil? %> <% unless @forums.first.nil? %>
<ul class="wmail_ul" style="margin-left:10px; border-bottom:1px dashed #cfcfcf; padding-bottom:15px; width:720px; margin-bottom:15px;"> <ul class="wmail_ul" style="margin-left:10px; border-bottom:1px dashed #cfcfcf; padding-bottom:15px; width:1020px; margin-bottom:15px;">
<h4 class="wmail_h4" style="color:#474646; font-size:14px; margin-bottom:5px;" > <span class="wmail_h4" style="color:#474646; font-size:14px; margin-bottom:5px;" >
<%= l(:label_user_forum) %> <%= l(:label_user_forum) %>
<span class="wmail_num" style="color:#fe3f0c; margin-left:5px; font-weight:normal;">(<%= @forums.count %>)</span> <span class="wmail_num" style="color:#666; margin-left:5px; font-weight:normal;">(<%= @forums.count %>)</span>
</h4> </span>
<% @forums.each do |forum|%> <% @forums.each do |forum|%>
<li style="clear: both; list-style: none;"> <li style="clear: both; list-style: none;">
@ -317,14 +366,14 @@
<%= link_to forum.creator, user_activities_url(forum.creator,:token => @token.value), <%= link_to forum.creator, user_activities_url(forum.creator,:token => @token.value),
:class => "wmail_name", :class => "wmail_name",
:style => "color:#fe5722; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %> :style => "color:#2E8DD7; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %>
<span class="wmail_txt" style="float:left; margin-right:5px;color:#6e6e6e;"><%= l(:label_forum_new) %></span> <span class="wmail_txt" style="float:left; margin-right:5px;color:#ACAEB1;"><%= l(:label_forum_new) %></span>
<%= link_to truncate(forum.name,length: 30,omission: '...'),forum_url(forum,:token => @token.value), <%= link_to truncate(forum.name,length: 30,omission: '...'),forum_url(forum,:token => @token.value),
:class => 'wmail_info', :class => 'wmail_info',
:style => "color:#5a5a5a; float:left; margin-right:5px; display:block;color:#1b55a7;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" :style => "color:#2E8DD7;float:left; font-weight:normal;margin-right:5px; display:block;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"
%> %>
<span class="wmail_date" style="color:#6e6e6e; float:right;display:block; margin-left:10px;"><%= format_time(forum.created_at) %></span></li> <span class="wmail_date" style="color:#6e6e6e; float:left;display:block; margin-left:40px;"><%= format_time(forum.created_at) %></span></li>
<% end %> <% end %>
@ -332,11 +381,10 @@
</ul><!-- 新建贴吧 end--> </ul><!-- 新建贴吧 end-->
<% end %> <% end %>
<% unless @memos.first.nil? %> <% unless @memos.first.nil? %>
<ul class="wmail_ul" style="margin-left:10px; border-bottom:1px dashed #cfcfcf; padding-bottom:15px; width:720px; margin-bottom:15px;"> <ul class="wmail_ul" style="margin-left:10px; border-bottom:1px dashed #cfcfcf; padding-bottom:15px; width:1020px; margin-bottom:15px;">
<h4 class="wmail_h4" style="color:#474646; font-size:14px; margin-bottom:5px;" > <span class="wmail_h4" style="color:#474646; font-size:14px; margin-bottom:5px;" >
<%= l(:label_user_message_forum) %> <%= l(:label_user_message_forum) %>
<span class="wmail_num" style="color:#fe3f0c; margin-left:5px; font-weight:normal;">(<%= @memos.count %>)</span> </span>
</h4>
<% @memos.each do |memo|%> <% @memos.each do |memo|%>
<li style="clear: both; list-style: none;"> <li style="clear: both; list-style: none;">
@ -344,14 +392,14 @@
<%= link_to memo.author, user_activities_url(memo.author,:token => @token.value), <%= link_to memo.author, user_activities_url(memo.author,:token => @token.value),
:class => "wmail_name", :class => "wmail_name",
:style => "color:#fe5722; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %> :style => "color:#2E8DD7; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %>
<span class="wmail_txt" style="float:left; margin-right:5px;color:#6e6e6e;"><%= memo.parent_id.nil? ? l(:label_memo_new_from_forum) : l(:label_reply) %></span> <span class="wmail_txt" style="float:left; margin-right:5px;color:#ACAEB1;"><%= memo.parent_id.nil? ? l(:label_memo_new_from_forum) : l(:label_reply) %></span>
<%= link_to truncate(memo.subject,length: 30,omission: '...'),forum_memo_url(memo.forum, (memo.parent_id.nil? ? memo : memo.parent_id)), <%= link_to truncate(memo.subject,length: 30,omission: '...'),forum_memo_url(memo.forum, (memo.parent_id.nil? ? memo : memo.parent_id)),
:class => 'wmail_info', :class => 'wmail_info',
:style => "color:#5a5a5a; float:left; margin-right:5px; display:block;color:#1b55a7;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" :style => "color:#2E8DD7;float:left; font-weight:normal;margin-right:5px; display:block;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"
%> %>
<span class="wmail_date" style="color:#6e6e6e; float:right;display:block; margin-left:10px;"><%= format_time(memo.created_at) %></span></li> <span class="wmail_date" style="color:#6e6e6e; float:left;display:block; margin-left:40px;"><%= format_time(memo.created_at) %></span></li>
<% end %> <% end %>
@ -361,6 +409,7 @@
</div><!--贴吧动态 end--> </div><!--贴吧动态 end-->
<% end %> <% end %>
<div class="wmail_foot" style="margin-top:20px;color:#2775d2; margin-left:10px;"> <div class="wmail_foot" style="margin-top:20px;color:#2775d2; margin-left:10px;">
<span style="color:#666;"><%= l(:label_mail_policy) %></span>
<% [:label_user_mail_option_all, :label_user_mail_option_day, :label_user_mail_option_none].each do |mail_option| %> <% [:label_user_mail_option_all, :label_user_mail_option_day, :label_user_mail_option_none].each do |mail_option| %>
<% if Hash[*User::MAIL_NOTIFICATION_OPTIONS.flatten][@user.mail_notification] == mail_option %> <% if Hash[*User::MAIL_NOTIFICATION_OPTIONS.flatten][@user.mail_notification] == mail_option %>
<label style="margin-top:20px;color:gray; margin-left:10px;"><%= l(mail_option) %></label> <label style="margin-top:20px;color:gray; margin-left:10px;"><%= l(mail_option) %></label>

View File

@ -4,7 +4,7 @@
<%= l(:label_course_overview)%> <%= l(:label_course_overview)%>
<% unless @course_news.first.nil? %> <% unless @course_news.first.nil? %>
<%= l(:label_course_news) %> <%= l(:label_course_news) %>
(<%= @course_news.count %>)
<% @course_news.each do |course_new|%> <% @course_news.each do |course_new|%>
@ -15,27 +15,27 @@
<%= link_to truncate(course_new.course.name,length: 30,omission: '...'), course_url(course_new.course, :token => @token.value)%> <%= link_to truncate(course_new.course.name,length: 30,omission: '...'), course_url(course_new.course, :token => @token.value)%>
] ]
<%= link_to course_new.author, user_activities_url(course_new.author,:token => @token.value) <%= link_to course_new.author, user_activities_url(course_new.author,:token => @token.value)
%> %>
<%= l(:label_project_notice) %> <%= l(:label_project_notice) %>
<%= link_to truncate(course_new.title,length: 30,omission: '...'), news_url(course_new,:token => @token.value) <%= link_to truncate(course_new.title,length: 30,omission: '...'), news_url(course_new,:token => @token.value)
%> <%= format_time(course_new.created_on) %> %> <%= format_time(course_new.created_on) %>
<% end %> <% end %>
<% end %> <% end %>
<% unless @bids.empty? %> <% unless @bids.empty? %>
<%= l(:label_homework_overview) %><%= @bids.count %> <%= l(:label_homework_overview) %>
<% unless @bids.first.nil?%> <% unless @bids.first.nil?%>
<% @bids.each do |bid| %> <% @bids.each do |bid| %>
[ [
<%= link_to truncate(bid.course.name,length: 30,omission: '...'),course_url(bid.course, :token => @token.value) <%= link_to truncate(bid.course.name,length: 30,omission: '...'),course_url(bid.course, :token => @token.value)
%> %>
] ]
@ -44,8 +44,8 @@
<%= l(:label_course_homework) %> <%= l(:label_course_homework) %>
<%= link_to truncate(bid.name, length: 30,omission: '...'), student_work_index_path(:homework => bid.id,:token => @token.value) <%= link_to truncate(bid.name, length: 30,omission: '...'), student_work_index_path(:homework => bid.id,:token => @token.value)
%> %>
<%= format_time(bid.created_at) %> <%= format_time(bid.created_at) %>
@ -58,7 +58,7 @@
<% unless @course_journal_messages.first.nil? %> <% unless @course_journal_messages.first.nil? %>
<%= l(:view_course_journals_for_messages) %> (<%= @course_journal_messages.count %>) <%= l(:view_course_journals_for_messages) %>
<% @course_journal_messages.each do |course_journal_message|%> <% @course_journal_messages.each do |course_journal_message|%>
@ -66,17 +66,17 @@
[ [
<%= link_to truncate(course_journal_message.course.name,length: 30,omission: '...'), course_url(course_journal_message.course, :token => @token.value) <%= link_to truncate(course_journal_message.course.name,length: 30,omission: '...'), course_url(course_journal_message.course, :token => @token.value)
%> %>
] ]
<%= link_to course_journal_message.user, user_activities_url(course_journal_message.user,:token => @token.value) <%= link_to course_journal_message.user, user_activities_url(course_journal_message.user,:token => @token.value)
%> %>
<%= l(:label_send_course_journals_for_messages) %> <%= l(:label_send_course_journals_for_messages) %>
<%= link_to truncate(course_journal_message.notes,length: 30,omission: '...'), course_feedback_url(course_journal_message.course,:token => @token.value) <%= link_to truncate(course_journal_message.notes,length: 30,omission: '...'), course_feedback_url(course_journal_message.course,:token => @token.value)
%> %>
<%= format_time(course_journal_message.created_on) %> <%= format_time(course_journal_message.created_on) %>
@ -88,7 +88,7 @@
<% unless @course_messages.first.nil? %> <% unless @course_messages.first.nil? %>
<%= l(:view_borad_course) %> <%= l(:view_borad_course) %>
(<%= @course_journal_messages.count %>)
<% @course_messages.each do |course_message|%> <% @course_messages.each do |course_message|%>
@ -97,7 +97,7 @@
[ [
<%= link_to truncate(course_message.course.name,length: 30,omission: '...'), course_url(course_message.course, :token => @token.value) <%= link_to truncate(course_message.course.name,length: 30,omission: '...'), course_url(course_message.course, :token => @token.value)
%> %>
] ]
@ -106,8 +106,8 @@
<%= l(:label_send_course_messages) %> <%= l(:label_send_course_messages) %>
<%= link_to truncate(course_message.subject,length: 30,omission: '...'),board_message_url(course_message, :board_id => course_message.board_id,:token => @token.value) <%= link_to truncate(course_message.subject,length: 30,omission: '...'),board_message_url(course_message, :board_id => course_message.board_id,:token => @token.value)
%> %>
<%= format_time(course_message.created_on) %> <%= format_time(course_message.created_on) %>
@ -119,14 +119,14 @@
<% unless @attachments.first.nil? %> <% unless @attachments.first.nil? %>
<%= l(:label_course_attendingcontestwork_download) %> <%= l(:label_course_attendingcontestwork_download) %>
(<%= @attachments.count %>)
<% @attachments.each do |attachment|%> <% @attachments.each do |attachment|%>
▪[ ▪[
<%= link_to truncate(attachment.course.name,length: 30,omission: '...'), course_url(attachment.course, :token => @token.value) <%= link_to truncate(attachment.course.name,length: 30,omission: '...'), course_url(attachment.course, :token => @token.value)
%> %>
] ]
@ -135,8 +135,8 @@
<%= l(:label_course_file_upload) %> <%= l(:label_course_file_upload) %>
<%= link_to truncate(attachment.filename,length: 30,omission: '...'),course_files_url(attachment.course,:token => @token.value) <%= link_to truncate(attachment.filename,length: 30,omission: '...'),course_files_url(attachment.course,:token => @token.value)
%> %>
<%= format_time(attachment.created_on) %> <%= format_time(attachment.created_on) %>
</li> </li>
@ -146,19 +146,19 @@
<% end %> <% end %>
<% end %><!--课程动态 end--> <% end %><!--课程动态 end-->
<% @issues.first || @project_messages.first %> <% @issues.first || @project_messages.first || @wiki_contents.first || @project_news.first || @project_journal_messages.first %>
<%= l(:label_project_overview_new)%> <%= l(:label_project_overview_new)%>
<% unless @issues.first.nil? %> <% unless @issues.first.nil? %>
<%= l(:label_issue_tracking) %> <%= l(:label_issue_tracking) %>
(<%= @issues.count %>)
<% @issues.each do |issue|%> <% @issues.each do |issue|%>
[ [
<%= link_to truncate(issue.project.name,length: 30,omission: '...'), project_url(issue.project, :token => @token.value) <%= link_to truncate(issue.project.name,length: 30,omission: '...'), project_url(issue.project, :token => @token.value)
%> %>
] ]
@ -167,8 +167,8 @@
<%= l(:label_project_issue) %> <%= l(:label_project_issue) %>
<%= link_to truncate(issue. subject,length: 30,omission: '...'),issue_url(issue, :token => @token.value) <%= link_to truncate(issue. subject,length: 30,omission: '...'),issue_url(issue, :token => @token.value)
%> %>
<%= format_time(issue.created_on) %> <%= format_time(issue.created_on) %>
<% end %> <% end %>
@ -179,13 +179,13 @@
<% unless @project_messages.first.nil? %> <% unless @project_messages.first.nil? %>
<%= l(:project_moule_boards_show) %> <%= l(:project_moule_boards_show) %>
(<%= @project_messages.count %>)
<% @project_messages.each do |project_message|%> <% @project_messages.each do |project_message|%>
▪[ ▪[
<%= link_to truncate(project_message.project.name,length: 30,omission: '...'), project_url(project_message.project, :token => @token.value) <%= link_to truncate(project_message.project.name,length: 30,omission: '...'), project_url(project_message.project, :token => @token.value)
%> %>
] ]
@ -194,12 +194,74 @@
<%= l(:label_send_course_messages) %> <%= l(:label_send_course_messages) %>
<%= link_to truncate(project_message. subject,length: 30,omission: '...'),board_message_url(project_message, :board_id => project_message.board_id,:token => @token.value) <%= link_to truncate(project_message. subject,length: 30,omission: '...'),board_message_url(project_message, :board_id => project_message.board_id,:token => @token.value)
%> %>
<%= format_time(project_message.created_on) %> <%= format_time(project_message.created_on) %>
<% end %> <% end %>
<% unless @wiki_contents.first.nil? %>
<%= l(:label_wiki) %>
<% @wiki_contents.each do |wikicontent|%>
▪[
<% unless wikicontent.page.nil? %>
<%= link_to truncate(wikicontent.page.wiki.project.name,length: 30,omission: '...'), project_url(wikicontent.page.wiki.project, :token => @token.value)
%>
<% end %>
]
<%= link_to wikicontent.author, user_activities_url(wikicontent.author,:token => @token.value) %>
<%= l(:label_project_notice) %>
<% unless wikicontent.page.nil? %>
<%= link_to truncate(wikicontent.text.html_safe, length: 30,omission: '...'), project_wiki_url(wikicontent.page.wiki,:token => @token.value) %>
<% end %>
<%= format_time(wikicontent.updated_on) %>
<% end %>
<% end %>
<!--项目新闻-->
<% unless @project_news.first.nil? %>
<%= l(:label_project_news) %>
<% @project_news.each do |project_new|%>
▪[
<%= link_to truncate(project_new.project.name,length: 30,omission: '...'), project_url(project_new.project, :token => @token.value)
%>
]
<%= link_to project_new.author, user_activities_url(project_new.author,:token => @token.value)
%>
<%= l(:label_project_notice) %>
<%= link_to truncate(project_new.title,length: 30,omission: '...'), news_url(project_new,:token => @token.value)
%>
<%= format_time(project_new.created_on) %>
<% end %>
<% end %>
<!--项目留言-->
<% unless @project_journal_messages.first.nil? %>
<%= l(:label_project_mail_feedback) %>
<% @project_journal_messages.each do |project_journal_message|%>
▪[
<%= link_to truncate(project_journal_message.project.name,length: 30,omission: '...'), project_url(project_journal_message.project, :token => @token.value)
%>
]
<%= link_to project_journal_message.user, user_activities_url(project_journal_message.user,:token => @token.value) %>
<%= l(:label_send_course_journals_for_messages) %>
<%= link_to truncate(project_journal_message.notes.html_safe,length: 30,omission: '...'), project_feedback_url(project_journal_message.project,:token => @token.value)
%>
<%= format_time(project_journal_message.created_on) %>
<% end %>
<% end %>
<% end %> <% end %>
@ -215,13 +277,13 @@
<%= link_to user_journal_message.user, user_activities_url(user_journal_message.user,:token => @token.value) <%= link_to user_journal_message.user, user_activities_url(user_journal_message.user,:token => @token.value)
%> %>
<%= l(:label_show_your_message) %> <%= l(:label_show_your_message) %>
<%= link_to truncate(user_journal_message.notes,length: 30,omission: '...'), feedback_url(@user,:token => @token.value) <%= link_to truncate(user_journal_message.notes,length: 30,omission: '...'), feedback_url(@user,:token => @token.value)
%> %>
<%= format_time(user_journal_message.created_on) %> <%= format_time(user_journal_message.created_on) %>
@ -234,7 +296,7 @@
<% unless @forums.first.nil? %> <% unless @forums.first.nil? %>
<%= l(:label_user_forum) %> <%= l(:label_user_forum) %>
(<%= @forums.count %>)
<% @forums.each do |forum|%> <% @forums.each do |forum|%>
@ -253,7 +315,7 @@
<% unless @memos.first.nil? %> <% unless @memos.first.nil? %>
<%= l(:label_user_message_forum) %> <%= l(:label_user_message_forum) %>
(<%= @memos.count %>)
<% @memos.each do |memo|%> <% @memos.each do |memo|%>

View File

@ -1,6 +1,6 @@
<!-- <h1>New memo</h1> --> <!-- <h1>New memo</h1> -->
<% @replying = !@memo.parent.nil? %> <% @replying = !@memo.parent.nil? %>
<%= javascript_include_tag "/assets/kindeditor/kindeditor" %> <%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' %>
<h3><%=l(:label_memo_edit)%></h3> <h3><%=l(:label_memo_edit)%></h3>
<%= labelled_form_for(@memo, :url => forum_memo_path(@memo.forum_id, @memo)) do |f| %> <%= labelled_form_for(@memo, :url => forum_memo_path(@memo.forum_id, @memo)) do |f| %>
<% if @memo.errors.any? %> <% if @memo.errors.any? %>

View File

@ -4,7 +4,7 @@
@nav_dispaly_main_contest_label = 1 %> @nav_dispaly_main_contest_label = 1 %>
<% @nav_dispaly_forum_label = 1%> <% @nav_dispaly_forum_label = 1%>
<!-- <h1>New memo</h1> --> <!-- <h1>New memo</h1> -->
<%= javascript_include_tag "/assets/kindeditor/kindeditor" %> <%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' %>
<div class="top-content"> <div class="top-content">
<table> <table>
<tr> <tr>

View File

@ -4,7 +4,7 @@
margin-bottom: 13px; margin-bottom: 13px;
} }
</style> </style>
<%= javascript_include_tag "/assets/kindeditor/kindeditor" %> <%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' %>
<div class="lz"> <div class="lz">
<!-- 在这里添加赞和踩--> <!-- 在这里添加赞和踩-->
<span id="praise_tread" style="float: right"> <%= render :partial => "/praise_tread/praise_tread",:locals => {:obj => @memo,:show_flag => true,:user_id =>User.current.id,:horizontal => true}%> </span> <span id="praise_tread" style="float: right"> <%= render :partial => "/praise_tread/praise_tread",:locals => {:obj => @memo,:show_flag => true,:user_id =>User.current.id,:horizontal => true}%> </span>

View File

@ -1,4 +1,4 @@
<%= javascript_include_tag "/assets/kindeditor/kindeditor" %> <%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' %>
<%= error_messages_for 'message' %> <%= error_messages_for 'message' %>
<% replying ||= false %> <% replying ||= false %>
<% extra_option = replying ? { hidden: "hidden"} : { maxlength: 200 } %> <% extra_option = replying ? { hidden: "hidden"} : { maxlength: 200 } %>

View File

@ -1,4 +1,4 @@
<%= javascript_include_tag "/assets/kindeditor/kindeditor" %> <%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' %>
<li> <li>
<label><span class="c_red">*</span>&nbsp;<%= l(:field_title) %>&nbsp;&nbsp;</label> <label><span class="c_red">*</span>&nbsp;<%= l(:field_title) %>&nbsp;&nbsp;</label>
<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 %>"> <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 %>">
@ -8,11 +8,15 @@
<% if is_new %> <% if is_new %>
<%= hidden_field_tag :asset_id,params[:asset_id],:required => false,:style => 'display:none' %> <%= 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> <label class="fl" ><span class="c_red">*</span>&nbsp;<%= l(:field_description) %>&nbsp;&nbsp;</label>
<%= f.kindeditor :description,:width=>'91%',:editor_id=>'news_description_editor' %> <div class="fl" style="width: 91%">
<%= f.kindeditor :description,:editor_id=>'news_description_editor' %>
</div>
<p id="description_notice_span" class="ml55"></p> <p id="description_notice_span" class="ml55"></p>
<% else %> <% else %>
<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>
<%= f.kindeditor :description,:width=>'91%',:editor_id=>'news_description_editor',:owner_id => @news.id,:owner_type => OwnerTypeHelper::NEWS %> <div class="fl" style="width: 91%">
<%= f.kindeditor :description,:editor_id=>'news_description_editor',:owner_id => @news.id,:owner_type => OwnerTypeHelper::NEWS %>
</div>
<p id="description_notice_span" class="ml55"></p> <p id="description_notice_span" class="ml55"></p>
<% end %> <% end %>
@ -33,4 +37,4 @@
<% end %> <% end %>
<div class="cl"></div> <div class="cl"></div>
</li> </li>
<!-- <#%= wikitoolbar_for 'news_description'%>--> <!-- <#%= wikitoolbar_for 'news_description'%>-->

View File

@ -26,9 +26,11 @@
<%= l(:label_no_data) %> <%= l(:label_no_data) %>
</p> </p>
<% else %> <% else %>
<% cache [:course_news, @newss.max().created_at] do%>
<% cache [:course_news_list, @newss.max().created_on] do%>
<% @newss.each do |news| %> <% @newss.each do |news| %>
<div class="problem_main upload_img"> <% cache [:course_news_each, news] do%>
<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" %> <%= 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"> <div class="problem_txt fl mt5">
<%= link_to_user_header(news.author,false,{:class=> 'problem_name c_orange fl'}) if news.respond_to?(:author) %> <%= link_to_user_header(news.author,false,{:class=> 'problem_name c_orange fl'}) if news.respond_to?(:author) %>
@ -46,16 +48,17 @@
<%= news.description.html_safe %> <%= news.description.html_safe %>
</div> </div>
</div> </div>
<div class="news_foot c_red" style="cursor:pointer;display: none;" onclick="news_show_more_des(<%= news.id %>);" id="news_foot_<%= news.id %>"> <div class="news_foot currentDd" 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> </div>
<span class="fl"><%= l(:label_create_time)%><%= format_time(news.created_on)%></span> <span class="fl"><%= l(:label_create_time)%><%= format_time(news.created_on)%></span>
<%= link_to_attachments_course news %> <%= link_to_attachments_course news %>
<div class="cl"></div>
<%#= render :partial => 'student_work/work_attachments', :locals => {:attachments => news.attachments} %>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</div><!--problem_main end--> </div><!--problem_main end-->
<% end %>
<% end %> <% end %>
<% end %> <% end %>
<% end %> <% end %>

View File

@ -1,4 +1,4 @@
<%= javascript_include_tag "/assets/kindeditor/kindeditor" %> <%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' %>
<div class="project_r_h"> <div class="project_r_h">
<h2 class="project_h2"><%= l(:label_course_news) %></h2> <h2 class="project_h2"><%= l(:label_course_news) %></h2>
</div> </div>
@ -25,7 +25,7 @@
</div> </div>
<% if @news.commentable? %> <% if @news.commentable? %>
<div class="msg_box"> <div class="msg_box fl">
<h4><%= l(:label_comment_add) %></h4> <h4><%= l(:label_comment_add) %></h4>
<%= form_tag({:controller => 'comments', :action => 'create', :id => @news}, :id => "add_comment_form") do %> <%= form_tag({:controller => 'comments', :action => 'create', :id => @news}, :id => "add_comment_form") do %>
<div class="box" id="news_comment"> <div class="box" id="news_comment">
@ -43,7 +43,7 @@
<% end %> <% end %>
</div> </div>
<% end %> <% end %>
<div class="cl"></div>
<% comments = @comments.reverse %> <% comments = @comments.reverse %>
<% comments.each do |comment| %> <% comments.each do |comment| %>
<% next if comment.new_record? %> <% next if comment.new_record? %>
@ -76,4 +76,4 @@
<% end %> <% end %>
<% html_title @news.title -%> <% html_title @news.title -%>

View File

@ -1,4 +1,4 @@
<%= javascript_include_tag "/assets/kindeditor/kindeditor" %> <%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' %>
<li> <li>
<label><span class="c_red">*</span>&nbsp;<%= l(:field_title) %>&nbsp;&nbsp;</label> <label><span class="c_red">*</span>&nbsp;<%= l(:field_title) %>&nbsp;&nbsp;</label>
<input type="text" name="news[title]" class="hwork_input_news" id="news_title" width="576px" onkeyup="regexTitle();" maxlength="60" placeholder="60个字符以内" value="<%= is_new ? '' : @news.title %>"> <input type="text" name="news[title]" class="hwork_input_news" id="news_title" width="576px" onkeyup="regexTitle();" maxlength="60" placeholder="60个字符以内" value="<%= is_new ? '' : @news.title %>">
@ -28,9 +28,9 @@
<%= link_to l(:button_create), "javascript:void(0)", :onclick => 'submitNews();', :onmouseover => 'submitFocus(this);', :class => 'blue_btn fl c_white' %> <%= link_to l(:button_create), "javascript:void(0)", :onclick => 'submitNews();', :onmouseover => 'submitFocus(this);', :class => 'blue_btn fl c_white' %>
<%= link_to l(:button_cancel), project_news_index_path(@project), :onclick => '$("#add-news").hide()', :class => 'blue_btn grey_btn fl c_white' %> <%= link_to l(:button_cancel), project_news_index_path(@project), :onclick => '$("#add-news").hide()', :class => 'blue_btn grey_btn fl c_white' %>
<% else %> <% else %>
<%= link_to l(:button_save), "javascript:void(0)", :onclick => "submitNews();",:onmouseover => 'this.focus()',:class => 'blue_btn fl c_white' %> <%= link_to l(:button_save), "javascript:void(0)", :onclick => "submitNews();",:onmouseover => 'this.focus()',:class => 'blue_btn fl c_white'%>
<%= link_to l(:button_cancel), news_path(@news), :class => 'blue_btn grey_btn fl c_white' %> <%= link_to l(:button_cancel), news_path(@news), :class => 'blue_btn grey_btn fl c_white' %>
<% end %> <% end %>
<div class="cl"></div> <div class="cl"></div>
</li> </li>
<!-- <#%= wikitoolbar_for 'news_description'%>--> <!-- <#%= wikitoolbar_for 'news_description'%>-->

View File

@ -1,69 +1,11 @@
<div class="project_r_h"> <div class="project_r_h">
<h2 class="project_h2"><%= l(:label_news) %></h2> <h2 class="project_h2"><%= l(:label_news) %></h2>
</div> </div>
<script type="text/javascript">
function regexTitle()
{
var name = $("#news_title").val();
if(name.length ==0)
{
$("#title_notice_span").text("<%= l(:label_title_blank)%>");
$("#title_notice_span").css('color','#ff0000');
$("#title_notice_span").focus();
return false;
}
else if(name.length <= 60)
{
$("#title_notice_span").text("<%= l(:label_field_correct)%>");
$("#title_notice_span").css('color','#008000');
return true;
}
else
{
$("#title_notice_span").text("<%= l(:label_title_long)%>");
$("#title_notice_span").css('color','#ff0000');
$("#title_notice_span").focus();
return false;
}
}
function submitComment()
{
$("#add_comment_form").submit();
}
function regexDescription()
{
var name = $("#news_description").val();
if(name.length ==0)
{
$("#description_notice_span").text("<%= l(:label_descripition_blank)%>");
$("#description_notice_span").css('color','#ff0000');
$("#description_notice_span").focus();
return false;
}
else
{
$("#description_notice_span").text("<%= l(:label_field_correct)%>");
$("#description_notice_span").css('color','#008000');
return true;
}
}
function submitNews()
{
if(regexTitle() && regexDescription())
{
$("#news-form").submit();
}
}
</script>
<% if authorize_for('news', 'edit') %> <% if authorize_for('news', 'edit') %>
<div id="edit-news" style="display:none;"> <div id="edit-news" style="display:none;">
<%= labelled_form_for :news, @news, :url => news_path(@news), <%= labelled_form_for :news, @news, :url => news_path(@news),
:html => { :id => 'news-form', :multipart => true, :method => :put } do |f| %> :html => { :id => 'news-form', :multipart => true, :method => :put } do |f| %>
<%= render :partial => 'project_form', :locals => { :f => f, :is_new => false } %> <%= render :partial => 'project_form', :locals => { :f => f, :is_new => false } %>
<% end %> <% end %>
<div id="preview" class="wiki"></div> <div id="preview" class="wiki"></div>

View File

@ -1,4 +1,4 @@
<%= javascript_include_tag "/assets/kindeditor/kindeditor" %> <%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' %>
<div class="project_r_h"> <div class="project_r_h">
<h2 class="project_h2"><%= l(:label_course_news) %></h2> <h2 class="project_h2"><%= l(:label_course_news) %></h2>
</div> </div>
@ -8,4 +8,4 @@
<%= render :partial => 'course_form', :locals => { :f => f, :is_new => false } %> <%= render :partial => 'course_form', :locals => { :f => f, :is_new => false } %>
<% end %> <% end %>
<div id="preview" class="wiki"></div> <div id="preview" class="wiki"></div>
</div> </div>

View File

@ -37,6 +37,13 @@
<li class="polls_de_grey fr ml5">关闭</li> <li class="polls_de_grey fr ml5">关闭</li>
<% end%> <% end%>
<% if poll.polls_status == 1%>
<li class="polls_de_grey fr ml5">导出</li>
<% elsif poll.polls_status == 2 || poll.polls_status == 3 %>
<li><%= link_to "导出", export_poll_poll_path(poll.id,:format => "xls"), :class => "polls_de fr ml5"%></li>
<% end%>
<li class="polls_date fr"><%= format_date poll.created_at.to_date%></li> <li class="polls_date fr"><%= format_date poll.created_at.to_date%></li>
<% else%> <% else%>
<% if poll.polls_status == 2%> <% if poll.polls_status == 2%>

View File

@ -1,6 +1,6 @@
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'commit_alert',:locals => {:status => @status}) %>'); $('#ajax-modal').html('<%= escape_javascript(render :partial => 'commit_alert',:locals => {:status => @status}) %>');
showModal('ajax-modal', '250px'); showModal('ajax-modal', '270px');
$('#ajax-modal').css('height','100px'); $('#ajax-modal').css('height','110px');
$('#ajax-modal').siblings().remove(); $('#ajax-modal').siblings().remove();
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" + $('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
"<a href='javascript:' onclick='hidden_atert_form();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>"); "<a href='javascript:' onclick='hidden_atert_form();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");

View File

@ -9,7 +9,8 @@
<span><%= link_to journal.user, user_path(journal.user), :class => 'c_blue fb fl mb10', :target => "_blank" %> <span><%= link_to journal.user, user_path(journal.user), :class => 'c_blue fb fl mb10', :target => "_blank" %>
</span><span class="c_grey fr"><%= format_time(journal.created_on) %></span> </span><span class="c_grey fr"><%= format_time(journal.created_on) %></span>
<div class="cl"></div> <div class="cl"></div>
<p><%= textilizable journal.notes%></p> <!--<p><%#= textilizable journal.notes%></p>-->
<p><%=journal.notes.html_safe%>
</div> </div>
<div class="ping_disfoot"> <div class="ping_disfoot">
<% ids = 'project_respond_form_'+ journal.id.to_s%> <% ids = 'project_respond_form_'+ journal.id.to_s%>
@ -20,8 +21,9 @@
:class => "delete", :title => l(:button_delete)) %> :class => "delete", :title => l(:button_delete)) %>
<% end %> <% end %>
<% if reply_allow %> <% if reply_allow %>
<%= link_to l(:label_bid_respond_quote),'', <%#= link_to l(:label_bid_respond_quote),'',
{:focus => 'project_respond', :onclick => "toggleAndSettingWordsVal($('##{ids}'), $('##{ids} textarea')); $('##{ids} textarea') ;return false;"} %> {:focus => 'project_respond',:nhname=>"reply_btn", :onclick => "toggleAndSettingWordsVal($('##{ids}'), $('##{ids} textarea')); $('##{ids} textarea') ;return false;"} %>
<%= link_to l(:label_bid_respond_quote),'javascript:;', {:nhname=>"reply_btn"} %>
<% end %> <% end %>
</span> </span>

View File

@ -21,7 +21,7 @@
.C_form{ margin:20px 0 0 60px;} .C_form{ margin:20px 0 0 60px;}
.C_form ul li{ font-size:14px; color:#3f3a39; line-height:30px; padding-left: 60px;} .C_form ul li{ font-size:14px; color:#3f3a39; line-height:30px; padding-left: 60px;}
.C_form ul li input{ margin-left:20px; border:0px; border:1px solid #e1e1e1; color:#898989; padding-left:5px; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px; padding: 0 !important; } .C_form ul li input{ margin-left:20px; border:0px; border:1px solid #e1e1e1; color:#898989; padding-left:5px; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px; padding: 0 !important; }
.C_form ul li.mB5{ color:#898989; font-size:12px; padding-left:150px;} .C_form ul li.mB5{ color:#898989; font-size:12px; padding-left:140px;}
.width190{ width:190px; height:26px; border-color:#e1e1e1;} .width190{ width:190px; height:26px; border-color:#e1e1e1;}
.C_form a{ font-size:12px; color:#15bccf; float:left; display:block; height:40px; width:200px; margin-top:25px;} .C_form a{ font-size:12px; color:#15bccf; float:left; display:block; height:40px; width:200px; margin-top:25px;}
.C_form a:hover{ text-decoration:underline;} .C_form a:hover{ text-decoration:underline;}
@ -31,7 +31,6 @@
<script type="text/javascript"> <script type="text/javascript">
function submit_form(obj) function submit_form(obj)
{ {
hideModal(obj);
$("#new-watcher-form").submit(); $("#new-watcher-form").submit();
// alert("申请成功"); // alert("申请成功");
} }
@ -52,25 +51,25 @@
</div> </div>
<div class="C_form"> <div class="C_form">
<%= form_tag({:controller => 'applied_project', <%= form_tag({:controller => 'applied_project',
:action => 'applied_join_project'}, :action => 'applied_join_project'},
:remote => true, :remote => true,
:method => :post, :method => :post,
:id => 'new-watcher-form') do %> :id => 'new-watcher-form') do %>
<ul> <ul>
<li style="padding-top: 15px;"> <li style="padding-top: 15px;">
<span class="tips"><%= l('project.join.id.label')%></span> <span class="tips"><%= l('project.join.id.label')%></span>
<input type="hidden" name="project_join" value="1"> <input type="hidden" name="project_join" value="1">
<input type="hidden" name="user_id" value="<%= User.current.id%>"> <input type="hidden" name="user_id" value="<%= User.current.id %>">
<input class=" width190" name="project_id" id="project_id" type="text" value="" > <input class=" width190" name="project_id" id="project_id" type="text" value="" >
<input type="text" style="display: none"/> <input type="text" style="display: none"/>
</li> </li>
<li class="mB5" style="width: 260px"><%= l('project.join.id.tips')%></li> <li class="mB5" style="width: 260px"><%= l('project.join.id.tips')%></li>
<li> <li>
<a href="#" class="btn" style="margin-left: 50px;" onclick="submit_form(this);"> <a href="#" class="btn" style="margin-left: 50px;" onclick="submit_form(this);">
<%= l(:label_apply_project) %> <%= l(:label_apply_project) %>
</a> </a>
<a href="#" class="btn" style="margin-left: 20px;" onclick="hideModal(this);"> <a href="#" class="btn" style="margin-left: 20px;" onclick="hideModal(this);">
<%= l(:button_cancel)%> <%= l(:button_cancel) %>
</a> </a>
</li> </li>
</ul> </ul>

View File

@ -1,4 +1,18 @@
<div class="msg_box" id='leave-message'> <style type="text/css">
div.ke-toolbar{display:none;width:400px;border:none;background:none;padding:0px 0px;}
span.ke-toolbar-icon{line-height:26px;font-size:14px;padding-left:26px;}
span.ke-toolbar-icon-url{background-image:url( /images/public_icon.png )}
div.ke-toolbar .ke-outline{padding:0px 0px;line-height:26px;font-size:14px;}
span.ke-icon-emoticons{background-position:0px -671px;width:50px;height:26px;}
span.ke-icon-emoticons:hover{background-position:-79px -671px;width:50px;height:26px;}
div.ke-toolbar .ke-outline{border:none;}
div.respond-form .reply_btn{margin-left:565px;margin-top:5px;}
div.recall_con{width:570px;}
div.recall_con .reply_btn{margin-left:525px;margin-top:5px;}
</style>
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' %>
<div class="msg_box" id='leave-message' nhname='new_message' style="height:auto;">
<% reply_allow = JournalsForMessage.create_by_user? User.current %> <% reply_allow = JournalsForMessage.create_by_user? User.current %>
<h4><%= l(:label_user_response) %></h4> <h4><%= l(:label_user_response) %></h4>
<% if !User.current.logged?%> <% if !User.current.logged?%>
@ -12,8 +26,10 @@
<%= form_for('new_form', :method => :post, <%= form_for('new_form', :method => :post,
:url => {:controller => 'words', :action => 'leave_project_message'}) do |f|%> :url => {:controller => 'words', :action => 'leave_project_message'}) do |f|%>
<%= f.text_area 'project_message', :rows => 3, :cols => 65, <%= f.text_area 'project_message', :rows => 3, :cols => 65,
:placeholder => "#{l(:label_welcome_my_respond)}" %> :placeholder => "#{l(:label_welcome_my_respond)}",:nhname=>'new_message_textarea' %>
<%= submit_tag l(:button_leave_meassge), :name => nil , :class => "blue_btn fr" %> <p nhname="contentmsg"></p>
<div class="fl mt10" style="padding-top:5px;" nhname="toolbar_container"></div>
<%= submit_tag l(:button_leave_meassge), :name => nil , :class => "blue_btn fr mt10 mb10" %>
<% end %> <% end %>
<% end %> <% end %>
@ -24,3 +40,161 @@
</div> </div>
<ul class="wlist"><%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%></ul> <ul class="wlist"><%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%></ul>
<div style="display:none;"><a href="#" id="nhjump"></a></div>
<script type="text/javascript">
$(function(){
function init_editor(params){
params.textarea.removeAttr('placeholder');
var editor = params.kindutil.create(params.textarea, {
resizeType : 1,minWidth:"1px",width:"100%",height:"150px",
items:['emoticons'],
afterChange:function(){//按键事件
nh_check_field({content:this,contentmsg:params.contentmsg,textarea:params.textarea});
},
afterCreate:function(){
var toolbar = $("div[class='ke-toolbar']",params.div_form);
$(".ke-outline>.ke-toolbar-icon",toolbar).append('表情');
params.toolbar_container.append(toolbar);
}
}).loadPlugin('paste');
return editor;
}
function nh_check_field(params){
var result=true;
if(params.content!=undefined){
if(params.content.isEmpty()){
result=false;
}
if(params.content.html()!=params.textarea.html() || params.issubmit==true){
params.textarea.html(params.content.html());
params.content.sync();
if(params.content.isEmpty()){
params.contentmsg.html('内容不能为空');
params.contentmsg.css({color:'#ff0000'});
}else{
params.contentmsg.html('填写正确');
params.contentmsg.css({color:'#008000'});
}
params.contentmsg.show();
}
}
return result;
}
function init_form(params){
// var flag = false;
// if(params.form.attr('data-remote') != undefined ){
// flag = true
// }
// params.form[0].onsubmit = function(){
// if(flag){
// $(this).removeAttr('data-remote');//不这么搞return false没用 花擦花擦
// }
// var is_checked = nh_check_field({
// issubmit:true,
// content:params.editor,
// contentmsg:params.contentmsg,
// textarea:params.textarea
// });
// if(is_checked){
// if(flag){
// alert('add')
// $(this).attr('data-remote','true');
// }
// alert('ok')
// return true;
// }
// return false;
// }
params.form.submit(function(){
var flag = false;
if(params.form.attr('data-remote') != undefined ){
flag = true
}
var is_checked = nh_check_field({
issubmit:true,
content:params.editor,
contentmsg:params.contentmsg,
textarea:params.textarea
});
if(is_checked){
if(flag){
return true;
}else{
$(this)[0].submit();
return false;
}
// return true; //这个涛哥的firefox不能提交
//$(this).trigger('submit'); //这个虽然能提交 但是他是个死循环
//$(this)[0].submit(); //用这个form的data-remote='true'没效果了
//肿么破阿 我滴个神 实在不行就用$.ajax()算了
}
return false;
});
}
function nh_reset_form(params){
params.form[0].reset();
params.textarea.empty();
if(params.editor != undefined){
params.editor.html(params.textarea.html());
}
params.contentmsg.hide();
}
KindEditor.ready(function(K){
$("a[nhname='reply_btn']").live('click',function(){
var params = {};
params.kindutil = K;
params.container = $(this).parent('div').parent('div');
params.div_form = $(">.respond-form",params.container);
params.form = $("form",params.div_form);
params.textarea = $("textarea[name='user_notes']",params.div_form);
params.contentmsg = $("p[nhname='contentmsg']",params.div_form);
params.toolbar_container = $("div[nhname='toolbar_container']",params.div_form);
params.cancel_btn = $("input[nhname='cancel_btn']",params.div_form);
if(params.textarea.data('init') == undefined){
params.editor = init_editor(params);
init_form(params);
params.cancel_btn.click(function(){
nh_reset_form(params);
});
}
params.cancel_btn.click();
toggleAndSettingWordsVal(params.div_form, params.textarea);
setTimeout(function(){
if(!params.div_form.is(':hidden')){
params.textarea.show();
params.textarea.focus();
params.textarea.hide();
// $("#nhjump").attr('href','#'+params.div_form.attr('id'));
// $("#nhjump")[0].click();
}
},300);
params.textarea.data('init',1);
});
$("div[nhname='new_message']").each(function(){
var params = {};
params.kindutil = K;
params.div_form = $(this);
params.form = $("form",params.div_form);
if(params.form==undefined || params.form.length==0){
return;
}
params.textarea = $("textarea[nhname='new_message_textarea']",params.div_form);
params.contentmsg = $("p[nhname='contentmsg']",params.div_form);
params.toolbar_container = $("div[nhname='toolbar_container']",params.div_form);
if(params.textarea.data('init') == undefined){
params.editor = init_editor(params);
init_form(params);
// $("a[nhname='cancel_btn']",params.div_form).click(function(){
// nh_reset_form(params);
// });
params.textarea.data('init',1);
}
});
});
});
</script>

View File

@ -19,7 +19,7 @@
<div class="invi_search"> <div class="invi_search">
<input hidden="hidden" value="true" name="flag"> <input hidden="hidden" value="true" name="flag">
<input id="principal_search" class="invi_search_input fl" type="text" placeholder=<%= l(:label_invite_trustie_user_tips) %>> <input id="principal_search" class="invi_search_input fl" type="text" placeholder=<%= l(:label_invite_trustie_user_tips) %>>
<a class="invi_search_btn fl" onclick="observeSearchfield('principal_search', null, '#{ escape_javascript autocomplete_project_memberships_path(@project, :format => 'js',:flag => true) }')">搜索</a> <a class="invi_search_btn fl" onclick="observeSearchfield('principal_search', null, '<%= escape_javascript autocomplete_project_memberships_path(@project, :format => 'js',:flag => true)%> ')">搜索</a>
<%= javascript_tag "observeSearchfield('principal_search', null, '#{ escape_javascript autocomplete_project_memberships_path(@project, :format => 'js',:flag => true) }')" %> <%= javascript_tag "observeSearchfield('principal_search', null, '#{ escape_javascript autocomplete_project_memberships_path(@project, :format => 'js',:flag => true) }')" %>
<div class="cl"></div> <div class="cl"></div>
<div id="principals_for_new_member"> <div id="principals_for_new_member">
@ -48,7 +48,7 @@
<% end %> <% end %>
</ul> </ul>
<div class="cl mb10"></div> <div class="cl mb10"></div>
<a href="#" class="btn_free" onclick="$('#new_membership').submit();"> <a href="javascript:void(0)" class="btn_free" onclick="submit_invite_members()">
<%= l(:label_invite_members)%> <%= l(:label_invite_members)%>
</a> </a>
</div> </div>
@ -67,37 +67,39 @@
var text=$(label).text(); var text=$(label).text();
$(label).attr("title",text); $(label).attr("title",text);
} }
function nh_show_err_message(msg){
$("#RSide>.flash").remove();
$("#RSide").prepend('<div class="flash error" id="flash_error">'+msg+'</div>');
}
$('#new_membership').submit(function(){
var user_ischeck=false;
$("input[name='membership[user_ids][]']").each(function(){
if($(this).prop('checked')){
user_ischeck=true;
}
});
var role_ischeck=false;
$("input[name='membership[role_ids][]']").each(function(){
if($(this).prop('checked')){
role_ischeck=true;
}
});
if(user_ischeck==false && role_ischeck==false){
nh_show_err_message('请选择用户和角色!');
return false;
}
if(user_ischeck==false){
nh_show_err_message('请选择用户!');
return false;
}
if(role_ischeck==false){
nh_show_err_message('请选择角色!');
return false;
}
return true;
});
}); });
function nh_show_err_message(msg){
$("#RSide>.flash").remove();
$("#RSide").prepend('<div class="flash error" id="flash_error">'+msg+'</div>');
}
function submit_invite_members()
{
var user_ischeck=false;
$("input[name='membership[user_ids][]']").each(function(){
if($(this).prop('checked')){
user_ischeck=true;
}
});
var role_ischeck=false;
$("input[name='membership[role_ids][]']").each(function(){
if($(this).prop('checked')){
role_ischeck=true;
}
});
if(user_ischeck==false && role_ischeck==false){
nh_show_err_message('请选择用户和角色!');
return false;
}
if(user_ischeck==false){
nh_show_err_message('请选择用户!');
return false;
}
if(role_ischeck==false){
nh_show_err_message('请选择角色!');
return false;
}
$('#new_membership').submit();
}
</script> </script>

View File

@ -70,6 +70,7 @@
:class => "problem_tit fl fb " %> :class => "problem_tit fl fb " %>
<br /> <br />
<p class="mt5 break_word"><%= textAreailizable act,:content %><br /> <p class="mt5 break_word"><%= textAreailizable act,:content %><br />
<div class="cl"></div>
<%= l :label_create_time %> <%= format_activity_day(act.created_on) %> <%= format_time(act.created_on, false) %></p> <%= l :label_create_time %> <%= format_activity_day(act.created_on) %> <%= format_time(act.created_on, false) %></p>
</div> </div>
<div class="cl"></div> <div class="cl"></div>

View File

@ -1,54 +1,53 @@
<% show_revision_graph = ( @repository.supports_revision_graph? && path.blank? ) %> <% show_revision_graph = ( @repository.supports_revision_graph? && path.blank? ) %>
<%= if show_revision_graph && revisions && revisions.any? <%= if show_revision_graph && revisions && revisions.any?
indexed_commits, graph_space = index_commits(revisions, @repository.branches) do |scmid| indexed_commits, graph_space = index_commits(revisions, @repository.branches) do |scmid|
url_for( url_for(
:controller => 'repositories', :controller => 'repositories',
:action => 'revision', :action => 'revision',
:id => project, :id => project,
:repository_id => @repository.identifier_param, :repository_id => @repository.identifier_param,
:rev => scmid) :rev => scmid)
end end
render :partial => 'revision_graph', render :partial => 'revision_graph',
:locals => { :locals => {
:commits => indexed_commits, :commits => indexed_commits,
:space => graph_space :space => graph_space
} }
end %> end %>
<%= form_tag( <%= form_tag(
{:controller => 'repositories', :action => 'diff', :id => project, {:controller => 'repositories', :action => 'diff', :id => project,
:repository_id => @repository.identifier_param, :path => to_path_param(path)}, :repository_id => @repository.identifier_param, :path => to_path_param(path)},
:method => :get :method => :get
) do %> ) do %>
<table class="list changesets"> <table class="list changesets">
<thead><tr> <thead><tr>
<th>#</th> <th>#</th>
<th></th> <th></th>
<th></th> <th></th>
<th><%= l(:label_date) %></th> <th><%= l(:label_date) %></th>
<th><%= l(:field_author) %></th> <th><%= l(:field_author) %></th>
<th><%= l(:field_comments) %></th> <th><%= l(:field_comments) %></th>
</tr></thead> </tr></thead>
<tbody> <tbody>
<% show_diff = revisions.size > 1 %> <% show_diff = revisions.size > 1 %>
<% line_num = 1 %> <% line_num = 1 %>
<% revisions.each do |changeset| %> <% revisions.each do |changeset| %>
<tr class="changeset <%= cycle 'odd', 'even' %>"> <tr class="changeset <%= cycle 'odd', 'even' %>">
<% id_style = (show_revision_graph ? "padding-left:#{(graph_space + 1) * 20}px" : nil) %> <% id_style = (show_revision_graph ? "padding-left:#{(graph_space + 1) * 20}px" : nil) %>
<%= content_tag(:td, :class => 'id', :style => id_style) do %> <%= content_tag(:td, :class => 'id', :style => id_style) do %>
<%= link_to_revision(changeset, @repository) %> <%= link_to_revision(changeset, @repository) %>
<% end %> <% end %>
<td class="checkbox"><%= radio_button_tag('rev', changeset.identifier, (line_num==1), :id => "cb-#{line_num}", :onclick => "$('#cbto-#{line_num+1}').attr('checked',true);") if show_diff && (line_num < revisions.size) %></td> <td class="checkbox"><%= radio_button_tag('rev', changeset.identifier, (line_num==1), :id => "cb-#{line_num}", :onclick => "$('#cbto-#{line_num+1}').attr('checked',true);") if show_diff && (line_num < revisions.size) %></td>
<td class="checkbox"><%= radio_button_tag('rev_to', changeset.identifier, (line_num==2), :id => "cbto-#{line_num}", :onclick => "if ($('#cb-#{line_num}').attr('checked')) {$('#cb-#{line_num-1}').attr('checked',true);}") if show_diff && (line_num > 1) %></td> <td class="checkbox"><%= radio_button_tag('rev_to', changeset.identifier, (line_num==2), :id => "cbto-#{line_num}", :onclick => "if ($('#cb-#{line_num}').attr('checked')) {$('#cb-#{line_num-1}').attr('checked',true);}") if show_diff && (line_num > 1) %></td>
<td class="committed_on"><%= format_time(changeset.committed_on) %></td> <td class="committed_on"><%= format_time(changeset.committed_on) %></td>
<td class="author"><%= h truncate(changeset.author.to_s, :length => 30) %></td> <td class="author"><%= h truncate(changeset.author.to_s, :length => 30) %></td>
<td class="comments"><%= textilizable(truncate_at_line_break(changeset.comments)) %></td> <td class="comments"><%= textilizable(truncate_at_line_break(changeset.comments)) %></td>
</tr> </tr>
<% line_num += 1 %> <% line_num += 1 %>
<% end %> <% end %>
</tbody> </tbody>
</table> </table>
<p style="padding-top: 10px;"> <p style="padding-top: 10px;">
<%= submit_tag(l(:label_view_diff), :name => nil, :class=>"c_blue") if show_diff %> <%= submit_tag(l(:label_view_diff), :name => nil, :class=>"c_blue") if show_diff %>
</p> </p>
<% end %> <% end %>

View File

@ -5,9 +5,8 @@
<div class="repository_con" style="line-height:1.9;"> <div class="repository_con" style="line-height:1.9;">
<div class="repositorytitle" style="float:left;"> <div class="repositorytitle" style="float:left;">
<%= render :partial => 'breadcrumbs', <%= render :partial => 'breadcrumbs',
:locals => {:path => @path, :kind => 'dir', :revision => @rev} %> :locals => {:path => @path, :kind => 'dir', :revision => @rev} %>
<%= render :partial => 'navigation' %> <%= render :partial => 'navigation' %>
</div> </div>
<!--contextual end--> <!--contextual end-->
<div class="cl"></div> <div class="cl"></div>
@ -25,18 +24,18 @@
link_to h(repo.name), link_to h(repo.name),
{:controller => 'repositories', :action => 'show', {:controller => 'repositories', :action => 'show',
:id => @project, :repository_id => repo.identifier_param, :rev => nil, :path => nil}, :id => @project, :repository_id => repo.identifier_param, :rev => nil, :path => nil},
:class => 'repository' + (repo == @repository ? ' selected' : ''), :class => 'repository' + (repo == @repository ? ' selected' : ''),
:class => "mb10 break_word c_orange" }.join('&nbsp|&nbsp').html_safe %>) :class => "mb10 break_word c_orange" }.join('&nbsp|&nbsp').html_safe %>)
</p> </p>
</div> </div>
</div> </div>
<div class="repos_more"><a id="showgithelp" value="show_help" onclick ="showhelpAndScrollTo('repos_git_more'); " class="c_dblue lh23">展开Git操作指南</a></div> <div class="repos_more"><a href="#" id="showgithelp" value="show_help" onclick ="showhelpAndScrollTo('repos_git_more'); " class="c_dblue lh23">展开Git操作指南</a></div>
<div id="repos_git_more"> <div id="repos_git_more">
<br> <br>
<div class=" c_dark f14"> <div class=" c_dark f14">
<p>项目代码请设置好正确的编码方式utf-8否则中文会出现乱码。</p> <p>项目代码请设置好正确的编码方式utf-8否则中文会出现乱码。</p>
<p>通过cmd命令提示符进入代码对应文件夹的根目录假设当前用户的登录名为user版本库名称为demo需要操作的版本库分支为branch。 <p>通过cmd命令提示符进入代码对应文件夹的根目录假设当前用户的登录名为user版本库名称为demo需要操作的版本库分支为branch。
如果是首次提交代码,执行如下命令:</p> 如果是首次提交代码,执行如下命令:</p>
</div> </div>
<div class="repos_explain"> <div class="repos_explain">
<p>git init</p> <p>git init</p>
@ -53,7 +52,7 @@
<p>git push -u origin branch:branch</p> <p>git push -u origin branch:branch</p>
</div> </div>
<!--repos_explain end--> <!--repos_explain end-->
<div class="c_dark f14"> <div class="c_dark f14">
<p>已经有本地库,还没有配置远程地址,打开命令行执行如下:</p> <p>已经有本地库,还没有配置远程地址,打开命令行执行如下:</p>
</div> </div>
@ -68,7 +67,7 @@
<p>git push -u origin branch:branch</p> <p>git push -u origin branch:branch</p>
</div> </div>
<!--repos_explain end--> <!--repos_explain end-->
<div class="c_dark f14"> <div class="c_dark f14">
<p>已有远程地址,创建一个远程分支,并切换到该分支,打开命令行执行如下:</p> <p>已有远程地址,创建一个远程分支,并切换到该分支,打开命令行执行如下:</p>
</div> </div>
@ -81,7 +80,7 @@
<p>git push origin branch_name</p> <p>git push origin branch_name</p>
</div> </div>
<!--repos_explain end--> <!--repos_explain end-->
<div class="c_dark f14"> <div class="c_dark f14">
<p>从网上获取别人的开源版本库转交到trustie网站上打开命令行执行如下</p> <p>从网上获取别人的开源版本库转交到trustie网站上打开命令行执行如下</p>
</div> </div>
@ -101,56 +100,59 @@
<p><a href="/users/646" class="c_orange">李海</a>提供</p> <p><a href="/users/646" class="c_orange">李海</a>提供</p>
</div> </div>
</div> </div>
<% if !@entries.nil? && authorize_for('repositories', 'browse') %> <!-- 代码库显示 -->
<%= render :partial => 'dir_list' %> <% if !@entries.nil? && authorize_for('repositories', 'browse') %>
<% end %> <%= render :partial => 'dir_list' %>
<% end %>
<%= render_properties(@properties) %>
<%= render_properties(@properties) %> <!-- 代码修订 -->
<% if authorize_for('repositories', 'revisions') %> <% if authorize_for('repositories', 'revisions') %>
<% if @changesets && !@changesets.empty? %> <%# if @changesets && !@changesets.empty? %>
<h3> <h3>
<%= l(:label_latest_revision_plural) %> <%= l(:label_latest_revision_plural) %>
</h3> </h3>
<%= render :partial => 'revisions', <%= render :partial => 'revisions',
:locals => {:project => @project, :path => @path, :locals => {:project => @project, :path => @path,
:revisions => @changesets, :entry => nil} %> :revisions => @changesets, :entry => nil} %>
<%# end %>
<p style="padding-top: 10px;">
<% has_branches = (!@repository.branches.nil? && @repository.branches.length > 0)
sep = '' %>
<% if @repository.supports_all_revisions? && @path.blank? %>
<%= link_to l(:label_view_all_revisions), {:action => 'revisions', :id => @project,
:repository_id => @repository.identifier_param},
:class => "orange_u_btn" %>
<% sep = '|' %>
<% end %> <% end %>
<p style="padding-top: 10px;"> <% if @repository.supports_directory_revisions? && (has_branches || !@path.blank? || !@rev.blank?) %>
<% has_branches = (!@repository.branches.nil? && @repository.branches.length > 0) <%= sep %>
sep = '' %> <%= link_to l(:label_view_revisions),
<% if @repository.supports_all_revisions? && @path.blank? %> {:action => 'changes',
<%= link_to l(:label_view_all_revisions), {:action => 'revisions', :id => @project, :path => to_path_param(@path),
:repository_id => @repository.identifier_param}, :id => @project,
:class => "orange_u_btn" %> :repository_id => @repository.identifier_param,
<% sep = '|' %> :rev => @rev},
<% end %> :class => "orange_u_btn" %>
<% if @repository.supports_directory_revisions? && (has_branches || !@path.blank? || !@rev.blank?) %>
<%= sep %>
<%= link_to l(:label_view_revisions),
{:action => 'changes',
:path => to_path_param(@path),
:id => @project,
:repository_id => @repository.identifier_param,
:rev => @rev},
:class => "orange_u_btn" %>
<% end %>
</p>
<% if @repository.supports_all_revisions? %>
<% content_for :header_tags do %>
<%= auto_discovery_link_tag(
:atom, params.merge(
{:format => 'atom', :action => 'revisions',
:id => @project, :page => nil, :key => User.current.rss_key})) %>
<% end %>
<% end %> <% end %>
<% end %> </p>
<% if @repository.supports_all_revisions? %>
<% content_for :header_tags do %>
<%= auto_discovery_link_tag(
:atom, params.merge(
{:format => 'atom', :action => 'revisions',
:id => @project, :page => nil, :key => User.current.rss_key})) %>
<% end %>
<% end %>
<% end %>
<!-- added by bai --> <!-- added by bai -->
<p class="fb c_dark mt10">查看如何提交代码: <p class="fb c_dark mt10">查看如何提交代码:
<%= link_to(l(:label_how_commit_code_chinese), ch_usage_path, :class => "c_blue") %> <%= link_to(l(:label_how_commit_code_chinese), ch_usage_path, :class => "c_blue") %>
<%= link_to('English', en_usage_path, :class => "c_blue") %> <%= link_to('English', en_usage_path, :class => "c_blue") %>
<div class="cl"></div> <div class="cl"></div>
<% content_for :header_tags do %> <% content_for :header_tags do %>
<%= stylesheet_link_tag "scm" %> <%= stylesheet_link_tag "scm" %>

View File

@ -61,7 +61,7 @@
</ul> </ul>
<div class="ping_box mt10" id="score_list_<%= @work.id%>" style="<%= @work.student_works_scores.empty? ? 'padding:0px;' : ''%>"> <div class="ping_box mt10" id="score_list_<%= @work.id%>" style="<%= @work.student_works_scores.empty? ? 'padding:0px;' : ''%>">
<%@work.student_works_scores.order("created_at desc").each do |score|%> <%@work.student_works_scores.order("updated_at desc").each do |score|%>
<div id="work_score_<%= score.id%>"> <div id="work_score_<%= score.id%>">
<%= render :partial => 'student_work_score',:locals => {:score => score}%> <%= render :partial => 'student_work_score',:locals => {:score => score}%>
</div> </div>

View File

@ -8,7 +8,7 @@
<a href="javascript:void(0);" class="c_orange fl" ><%= score.score%>分</a> <a href="javascript:void(0);" class="c_orange fl" ><%= score.score%>分</a>
<a href="javascript:void(0);" class="fr c_purple mr5" onclick="$('#add_score_reply_<%= score.id%>').slideToggle();">回复</a> <a href="javascript:void(0);" class="fr c_purple mr5" onclick="$('#add_score_reply_<%= score.id%>').slideToggle();">回复</a>
<span class=" fr c_grey mr20"> <span class=" fr c_grey mr20">
<%=format_time score.created_at %> <%=format_time score.updated_at %>
</span> </span>
<div class="cl mb5"></div> <div class="cl mb5"></div>
<p class="break_word"> <p class="break_word">

View File

@ -1,5 +1,5 @@
<li class="hwork_num "> <li class="hwork_num ">
<a href="javascript:void(0);" class=" f14 f_b c_dark fl" >学号</a> <span class="c_dark f14 fb fl">学号</span>
</li> </li>
<li class=" hwork_name f14 fb c_dark"> <li class=" hwork_name f14 fb c_dark">
学生姓名 学生姓名

View File

@ -2,7 +2,7 @@ $("#add_student_score_<%= @work.id%>").html("<%= escape_javascript(render :parti
$('#score_<%= @work.id%>').peSlider({range: 'min'}); $('#score_<%= @work.id%>').peSlider({range: 'min'});
<% if @is_new%> <% if @is_new%>
$("#score_list_<%= @work.id%>").prepend("<%= escape_javascript(render :partial => 'student_work_score', :locals => {:score => @score}) %>"); $("#score_list_<%= @work.id%>").prepend("<div id='work_score_<%= @score.id%>'><%= escape_javascript(render :partial => 'student_work_score', :locals => {:score => @score}) %></div>");
<% else %> <% else %>
$("#work_score_<%= @score.id%>").html("<%= escape_javascript(render :partial => 'student_work_score', :locals => {:score => @score}) %>"); $("#work_score_<%= @score.id%>").html("<%= escape_javascript(render :partial => 'student_work_score', :locals => {:score => @score}) %>");
<% end%> <% end%>

View File

@ -12,7 +12,7 @@
<!--</div>--> <!--</div>-->
<div class="hwork_ctt"> <div class="hwork_ctt">
<div class="hwork_dis" id="tbc_01"> <div class="hwork_dis" id="tbc_01">
<%= labelled_form_for @work do |f|%> <%= labelled_form_for @work,:html => { :multipart => true } do |f|%>
<div class="N_con"> <div class="N_con">
<p> <p>
<label class="fl"><span class="c_red">*</span>&nbsp;&nbsp;作品名称&nbsp;&nbsp;&nbsp;&nbsp;</label> <label class="fl"><span class="c_red">*</span>&nbsp;&nbsp;作品名称&nbsp;&nbsp;&nbsp;&nbsp;</label>
@ -57,4 +57,4 @@
</div> </div>
</div> </div>
</div><!--新建作业结束--> </div><!--新建作业结束-->
<div class="cl"></div> <div class="cl"></div>

View File

@ -19,6 +19,7 @@
<% end %> <% end %>
<% if User.current.logged?%> <% if User.current.logged?%>
<a href="javascript:void(0)" class="yellowBtn f_l" onclick="$('#add_tag01').slideToggle();"><%= l(:label_add_tag)%></a> <a href="javascript:void(0)" class="yellowBtn f_l" onclick="$('#add_tag01').slideToggle();"><%= l(:label_add_tag)%></a>
<span id="add_tag01" style="display:none; vertical-align: middle;" class="ml10 f_l"> <span id="add_tag01" style="display:none; vertical-align: middle;" class="ml10 f_l">
<%= form_for "tag_for_save",:remote=>true,:url=>save_tag_path,:update => "tags_show",:complete => '$("#put-tag-form").slideUp();' do |f| %> <%= form_for "tag_for_save",:remote=>true,:url=>save_tag_path,:update => "tags_show",:complete => '$("#put-tag-form").slideUp();' do |f| %>
@ -28,4 +29,5 @@
<input type="button" class="submit f_l" onclick="$('#tags_name').parent().submit();" /> <input type="button" class="submit f_l" onclick="$('#tags_name').parent().submit();" />
<% end %> <% end %>
</span> </span>
<% end%> <% end%>

View File

@ -11,7 +11,8 @@
<!-- <a style=" font-weight:bold; color:#15bccf; margin-right:30px; background:none;" target="_blank" href="#">gugu01</a> --> <!-- <a style=" font-weight:bold; color:#15bccf; margin-right:30px; background:none;" target="_blank" href="#">gugu01</a> -->
<span><%= link_to journal.user, user_path(journal.user),:style => " font-weight:bold; color:#15bccf; margin-right:30px; background:none;", :target => "_blank"%></span><span style="color:#a6a6a6; margin-right:40px; margin-left:30px;"><%= format_time(journal.created_on) %></span> <span><%= link_to journal.user, user_path(journal.user),:style => " font-weight:bold; color:#15bccf; margin-right:30px; background:none;", :target => "_blank"%></span><span style="color:#a6a6a6; margin-right:40px; margin-left:30px;"><%= format_time(journal.created_on) %></span>
<div class="cl"></div> <div class="cl"></div>
<p><%= textilizable journal.notes%></p> <!--<p><%#= textilizable journal.notes%></p>-->
<p><%=journal.notes.html_safe%></p>
</div> </div>
<div class="ping_disfoot"> <div class="ping_disfoot">
<% ids = 'project_respond_form_'+ journal.id.to_s%> <% ids = 'project_respond_form_'+ journal.id.to_s%>
@ -23,8 +24,9 @@
:class => "delete", :title => l(:button_delete)) %> :class => "delete", :title => l(:button_delete)) %>
<% end %> <% end %>
<% if reply_allow %> <% if reply_allow %>
<%= link_to l(:label_bid_respond_quote),'', <%#= link_to l(:label_bid_respond_quote),'',
{:focus => 'project_respond', :onclick => "toggleAndSettingWordsVal($('##{ids}'), $('##{ids} textarea')); $('##{ids} textarea') ;return false;"} %> {:focus => 'project_respond',:nhname=>'reply_btn', :onclick => "toggleAndSettingWordsVal($('##{ids}'), $('##{ids} textarea')); $('##{ids} textarea') ;return false;"} %>
<%= link_to l(:label_bid_respond_quote),'javascript:;',{:nhname=>'reply_btn'} %>
<% end %> <% end %>
</span> </span>

View File

@ -1,3 +1,17 @@
<style type="text/css">
div.ke-toolbar{display:none;width:400px;border:none;background:none;padding:0px 0px;}
span.ke-toolbar-icon{line-height:26px;font-size:14px;padding-left:26px;}
span.ke-toolbar-icon-url{background-image:url( /images/public_icon.png )}
div.ke-toolbar .ke-outline{padding:0px 0px;line-height:26px;font-size:14px;}
span.ke-icon-emoticons{background-position:0px -671px;width:50px;height:26px;}
span.ke-icon-emoticons:hover{background-position:-79px -671px;width:50px;height:26px;}
div.ke-toolbar .ke-outline{border:none;}
div.respond-form .reply_btn{margin-left:565px;margin-top:5px;}
div.recall_con{width:600px;}
div.recall_con .reply_btn{margin-left:555px;margin-top:5px;}
</style>
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' %>
<div class="dis"> <div class="dis">
<div class="msg_box" id='leave-message'> <div class="msg_box" id='leave-message'>
<% reply_allow = JournalsForMessage.create_by_user? User.current %> <% reply_allow = JournalsForMessage.create_by_user? User.current %>
@ -49,3 +63,170 @@
} }
</script> </script>
<div style="display:none;"><a href="#" id="nhjump"></a></div>
<script type="text/javascript">
$(function(){
function init_editor(params){
params.textarea.removeAttr('placeholder');
var editor = params.kindutil.create(params.textarea, {
resizeType : 1,minWidth:"1px",width:"100%",height:"150px",
items:['emoticons'],
afterChange:function(){//按键事件
nh_check_field({content:this,contentmsg:params.contentmsg,textarea:params.textarea});
},
afterCreate:function(){
var toolbar = $("div[class='ke-toolbar']",params.div_form);
$(".ke-outline>.ke-toolbar-icon",toolbar).append('表情');
params.toolbar_container.append(toolbar);
}
}).loadPlugin('paste');
return editor;
}
function nh_check_field(params){
var result=true;
if(params.content!=undefined){
if(params.content.isEmpty()){
result=false;
}
if(params.content.html()!=params.textarea.html() || params.issubmit==true){
params.textarea.html(params.content.html());
params.content.sync();
if(params.content.isEmpty()){
params.contentmsg.html('内容不能为空');
params.contentmsg.css({color:'#ff0000'});
}else{
params.contentmsg.html('填写正确');
params.contentmsg.css({color:'#008000'});
}
params.contentmsg.show();
}
}
return result;
}
function init_form(params){
// var flag = false;
// if(params.form.attr('data-remote') != undefined ){
// flag = true
// }
// params.form[0].onsubmit = function(){
// if(flag){
// $(this).removeAttr('data-remote');//不这么搞return false没用 花擦花擦
// }
// var is_checked = nh_check_field({
// issubmit:true,
// content:params.editor,
// contentmsg:params.contentmsg,
// textarea:params.textarea
// });
// if(is_checked){
// if(flag){
// alert('add')
// $(this).attr('data-remote','true');
// }
// alert('ok')
// return true;
// }
// return false;
// }
params.form.submit(function(){
var flag = false;
if(params.form.attr('data-remote') != undefined ){
flag = true
}
var is_checked = nh_check_field({
issubmit:true,
content:params.editor,
contentmsg:params.contentmsg,
textarea:params.textarea
});
if(is_checked){
if(flag){
return true;
}else{
$(this)[0].submit();
return false;
}
// return true; //这个涛哥的firefox不能提交
//$(this).trigger('submit'); //这个虽然能提交 但是他是个死循环
//$(this)[0].submit(); //用这个form的data-remote='true'没效果了
//肿么破阿 我滴个神 实在不行就用$.ajax()算了
}
return false;
});
}
function nh_reset_form(params){
params.form[0].reset();
params.textarea.empty();
if(params.editor != undefined){
params.editor.html(params.textarea.html());
}
params.contentmsg.hide();
}
KindEditor.ready(function(K){
$("a[nhname='reply_btn']").live('click',function(){
var params = {};
params.kindutil = K;
if($(this).parent('span')==undefined || $(this).parent('span').length==0){
params.container = $(this).parent('div').parent('div');
}else{
params.container = $(this).parent('span').parent('div').parent('div');
}
params.div_form = $(">.respond-form",params.container);
params.form = $("form",params.div_form);
params.textarea = $("textarea[name='user_notes']",params.div_form);
params.contentmsg = $("p[nhname='contentmsg']",params.div_form);
params.toolbar_container = $("div[nhname='toolbar_container']",params.div_form);
params.cancel_btn = $("input[nhname='cancel_btn']",params.div_form);
if(params.textarea.data('init') == undefined){
params.editor = init_editor(params);
init_form(params);
params.cancel_btn.click(function(){
nh_reset_form(params);
});
}
params.cancel_btn.click();
toggleAndSettingWordsVal(params.div_form, params.textarea);
setTimeout(function(){
if(!params.div_form.is(':hidden')){
params.textarea.show();
params.textarea.focus();
params.textarea.hide();
// $("#nhjump").attr('href','#'+params.div_form.attr('id'));
// $("#nhjump")[0].click();
}
},300);
params.textarea.data('init',1);
});
$("div[nhname='new_message']").each(function(){
var params = {};
params.kindutil = K;
params.div_form = $(this);
params.form = $("form",params.div_form);
if(params.form==undefined || params.form.length==0){
return;
}
params.textarea = $("textarea[nhname='new_message_textarea']",params.div_form);
params.contentmsg = $("p[nhname='contentmsg']",params.div_form);
params.toolbar_container = $("div[nhname='toolbar_container']",params.div_form);
params.cancel_btn = $("#new_message_cancel_btn");
if(params.textarea.data('init') == undefined){
params.editor = init_editor(params);
init_form(params);
params.cancel_btn.click(function(){
nh_reset_form(params);
});
// $("a[nhname='cancel_btn']",params.div_form).click(function(){
// nh_reset_form(params);
// });
params.textarea.data('init',1);
}
});
});
});
</script>

View File

@ -42,7 +42,7 @@
<%# memberships = user.memberships.all(:conditions => cond) %> <%# memberships = user.memberships.all(:conditions => cond) %>
<% user_courses = user_courses_list(user) %> <% user_courses = user_courses_list(user) %>
<%= l(:label_x_course_contribute_to, :count => user_courses.count) %> <%= l(:label_x_course_contribute_to, :count => user_courses.count) %>
<%= "" unless user_courses.empty? %> <%#= "" unless user_courses.empty? %>
<% for course in user_courses %> <% for course in user_courses %>
<%# if course.name != nil %> <%# if course.name != nil %>
<%= link_to course.name,{:controller => 'courses',:action => 'show',id:course.id, host: Setting.host_course} %><%= (user_courses.last == course) ? '' : '' %> <%= link_to course.name,{:controller => 'courses',:action => 'show',id:course.id, host: Setting.host_course} %><%= (user_courses.last == course) ? '' : '' %>

View File

@ -34,6 +34,9 @@ form #search_type{
-moz-appearance: none; -moz-appearance: none;
text-indent: 0.01px; text-indent: 0.01px;
text-overflow: ''; text-overflow: '';
padding-right:10px;
background-image:url(/images/arrow_expanded.png)!important;
background:no-repeat right;
} }
form #search_by form #search_by
@ -68,6 +71,21 @@ form #search_by
} }
<%#完了把上面东西放到 .css 里%> <%#完了把上面东西放到 .css 里%>
</style> </style>
<!--[if IE]>
<!--<style type="text/css">-->
<!--form #search_type{-->
<!--background:none!important;-->
<!--}-->
<!--</style>-->
<![endif]-->
<script type="text/javascript">
$(function(){
var userAgent = navigator.userAgent.toLowerCase();
if(/trident/.test(userAgent)){
$('form #search_type').css({'background-image':'none!important'});
}
});
</script>
<script type="text/javascript"> <script type="text/javascript">
function searchTypeChange() function searchTypeChange()
{ {

View File

@ -22,7 +22,7 @@
<% end %> <% end %>
<p> <p>
<%= reply.notes %> <%= reply.notes.html_safe %>
</p> </p>
<span class="c_grey fl"> <span class="c_grey fl">
<%= format_time reply.created_on %> <%= format_time reply.created_on %>
@ -33,8 +33,9 @@
:remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "delete", :title => l(:button_delete)) %> :remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "delete", :title => l(:button_delete)) %>
<% end %> <% end %>
<% if reply_allow %> <% if reply_allow %>
<%= link_to l(:button_reply),'', <%#= link_to l(:button_reply),'',
{:focus => 'project_respond', :onclick => "toggleAndSettingWordsVal($('##{id}'), $('##{id} textarea'), ''); return false;"} %> {:focus => 'project_respond',:nhname=>"reply_btn", :onclick => "toggleAndSettingWordsVal($('##{id}'), $('##{id} textarea'), ''); return false;"} %>
<%= link_to l(:button_reply),'javascript:;',{:nhname=>"reply_btn"} %>
<% end %> <!-- #{l(:label_reply_plural)} #{m_reply_id.user.name}: --> <% end %> <!-- #{l(:label_reply_plural)} #{m_reply_id.user.name}: -->
</div> </div>
<div class="cl"></div> <div class="cl"></div>

View File

@ -35,7 +35,7 @@
border: #d5dee9 1px solid; border: #d5dee9 1px solid;
} }
</style> </style>
<div style="width: 80%; margin-left:10%;"> <div style="width: 80%; margin-left:10%;" nhname='new_message'>
<%= form_for('new_form', :remote => true, :method => :post, <%= form_for('new_form', :remote => true, :method => :post,
:url => {:controller => 'words', :url => {:controller => 'words',
:action => 'create', :action => 'create',
@ -51,10 +51,13 @@
<%= f.text_area 'user_message', :rows => 3, :cols => 65, <%= f.text_area 'user_message', :rows => 3, :cols => 65,
:placeholder => "#{l(:label_leave_a_message)}", :placeholder => "#{l(:label_leave_a_message)}",
:style => "resize: none; width: 98%", :style => "resize: none; width: 98%",
:class => 'noline'%> :class => 'noline',:nhname=>'new_message_textarea'%>
<%# end %> <%# end %>
<%= f.text_field :reference_user_id, :style=>"display:none"%> <%= f.text_field :reference_user_id, :style=>"display:none"%>
<%= submit_tag l(:button_leave_meassge), :name => nil , :class => "enterprise" , :style => "display: block; float: right; margin-right: 1%; margin-top: 1px;"%> <p nhname="contentmsg"></p>
<div style="padding-top:5px;float:left;" nhname="toolbar_container"></div>
<%= submit_tag l(:button_leave_meassge), :name => nil , :class => "enterprise" , :style => "display: block; float: right; margin-top: 5px;"%>
<a href="javascript:;" id="new_message_cancel_btn" style="display:none;"></a>
<%else %> <%else %>
<div style="font-size: 14px;margin:10px;"> <div style="font-size: 14px;margin:10px;">
<%= l(:label_user_login_tips) %> <%= l(:label_user_login_tips) %>

View File

@ -1,15 +1,19 @@
<%= form_tag(words_create_reply_path, :remote => true) do %> <%= form_tag(words_create_reply_path, :remote => true) do %>
<%= text_area_tag 'user_notes', "", :class => 'noline', <%= text_area_tag 'user_notes', "", :class => 'noline',
:style => "resize: none;", :rows => 4, :style => "resize: none;", :rows => 4,
:placeholder => l(:label_feedback_respond_content), :placeholder => l(:label_feedback_respond_content)#,
:maxlength => 250 %> #:maxlength => 250
%>
<p nhname="contentmsg"></p>
<%= hidden_field_tag 'reference_id', params[:reference_id], :value => journal.id %> <%= hidden_field_tag 'reference_id', params[:reference_id], :value => journal.id %>
<%= hidden_field_tag 'reference_user_id', params[:reference_user_id], :value => m_reply_id.user.id %> <%= hidden_field_tag 'reference_user_id', params[:reference_user_id], :value => m_reply_id.user.id %>
<%= hidden_field_tag 'reference_message_id', params[:reference_message_id], :value => m_reply_id.id %> <%= hidden_field_tag 'reference_message_id', params[:reference_message_id], :value => m_reply_id.id %>
<%= hidden_field_tag 'show_name',params[:show_name],:value => show_name.nil? ? true : show_name %> <%= hidden_field_tag 'show_name',params[:show_name],:value => show_name.nil? ? true : show_name %>
<div class="fl" style="padding-top:5px;float:left;" nhname="toolbar_container"></div>
<%= submit_tag l(:button_feedback_respond), :name => nil , <%= submit_tag l(:button_feedback_respond), :name => nil ,
:class => "enterprise", :class => "enterprise",
:style => "float: right; margin-top: 1px; margin-right: 4px;margin-bottom: 5px;"%> :style => "float: right; margin-top: 1px; margin-right: 4px;margin-bottom: 5px;"%>
<input nhname="cancel_btn" type="button" style="display:none;"/>
<% end %> <% end %>

View File

@ -1,15 +1,18 @@
<%= form_tag(words_create_reply_path, :remote => true) do %> <%= form_tag(words_create_reply_path, :remote => true) do %>
<%= text_area_tag 'user_notes', "", :class => 'w520 h50 mb5', <%= text_area_tag 'user_notes', "", :class => 'w520 h50 mb5',
:style => "resize: none;overflow: hidden;",:rows => 4, :style => "resize: none;overflow: hidden;",:rows => 4,
:placeholder => l(:label_feedback_respond_content), :placeholder => l(:label_feedback_respond_content)#,
:maxlength => 250 %> #:maxlength => 250
%>
<p nhname="contentmsg"></p>
<%= hidden_field_tag 'reference_id', params[:reference_id], :value => journal.id %> <%= hidden_field_tag 'reference_id', params[:reference_id], :value => journal.id %>
<%= hidden_field_tag 'reference_user_id', params[:reference_user_id], :value => m_reply_id.user.id %> <%= hidden_field_tag 'reference_user_id', params[:reference_user_id], :value => m_reply_id.user.id %>
<%= hidden_field_tag 'reference_message_id', params[:reference_message_id], :value => m_reply_id.id %> <%= hidden_field_tag 'reference_message_id', params[:reference_message_id], :value => m_reply_id.id %>
<%= hidden_field_tag 'show_name',params[:show_name],:value => show_name.nil? ? true : show_name %> <%= hidden_field_tag 'show_name',params[:show_name],:value => show_name.nil? ? true : show_name %>
<div class="fl" style="padding-top:5px;" nhname="toolbar_container"></div>
<%= submit_tag l(:button_feedback_respond), :name => nil , <%= submit_tag l(:button_feedback_respond), :name => nil ,
:class => "reply_btn"%> :class => "reply_btn"%>
<input nhname="cancel_btn" type="button" style="display:none;"/>
<% end %> <% end %>

View File

@ -1,15 +1,18 @@
<%= form_tag(words_create_reply_path, :remote => true) do %> <%= form_tag(words_create_reply_path, :remote => true) do %>
<%= text_area_tag 'user_notes', "", :class => 'w520 h50 mb5', <%= text_area_tag 'user_notes', "", :class => 'w520 h50 mb5',
:style => "resize: none;overflow: hidden;",:rows => 4, :style => "resize: none;overflow: hidden;",:rows => 4,
:placeholder => l(:label_feedback_respond_content), :placeholder => l(:label_feedback_respond_content)
#,:maxlength => 250
:maxlength => 250 %> %>
<p nhname="contentmsg"></p>
<%= hidden_field_tag 'reference_id', params[:reference_id], :value => journal.id %> <%= hidden_field_tag 'reference_id', params[:reference_id], :value => journal.id %>
<%= hidden_field_tag 'reference_user_id', params[:reference_user_id], :value => m_reply_id.user.id %> <%= hidden_field_tag 'reference_user_id', params[:reference_user_id], :value => m_reply_id.user.id %>
<%= hidden_field_tag 'reference_message_id', params[:reference_message_id], :value => m_reply_id.id %> <%= hidden_field_tag 'reference_message_id', params[:reference_message_id], :value => m_reply_id.id %>
<%= hidden_field_tag 'show_name',params[:show_name],:value => show_name.nil? ? true : show_name %> <%= hidden_field_tag 'show_name',params[:show_name],:value => show_name.nil? ? true : show_name %>
<div class="fl" style="padding-top:5px;" nhname="toolbar_container"></div>
<%= submit_tag l(:button_feedback_respond), :name => nil , <%= submit_tag l(:button_feedback_respond), :name => nil ,
:class => "reply_btn"%> :class => "reply_btn"%>
<input nhname="cancel_btn" type="button" style="display:none;"/>
<% end %> <% end %>

View File

@ -3,4 +3,7 @@ $('#history').html('<%= escape_javascript(render(:partial => 'users/history',:lo
$('#jour_count').html('<%= @obj_count%>') $('#jour_count').html('<%= @obj_count%>')
$('#pre_show').html('<%= escape_javascript(render(:partial => 'pre_show', :locals => {:content => nil})) %>'); $('#pre_show').html('<%= escape_javascript(render(:partial => 'pre_show', :locals => {:content => nil})) %>');
$('#new_form_user_message').val(""); $('#new_form_user_message').val("");
if($('#new_message_cancel_btn') != undefined && $('#new_message_cancel_btn').length!=0){
$('#new_message_cancel_btn').click();
}
$('#new_form_reference_user_id').val(""); $('#new_form_reference_user_id').val("");

View File

@ -11,7 +11,7 @@ RedmineApp::Application.configure do
# Show full error reports and disable caching # Show full error reports and disable caching
config.consider_all_requests_local = true config.consider_all_requests_local = true
config.action_controller.perform_caching = true config.action_controller.perform_caching = true
config.cache_store = :file_store, "#{Rails.root }/files/cache_store/" # config.cache_store = :file_store, "#{Rails.root }/files/cache_store/"
#config.cache_store = :dalli_store #config.cache_store = :dalli_store
# Don't care if the mailer can't send # Don't care if the mailer can't send
config.action_mailer.raise_delivery_errors = true config.action_mailer.raise_delivery_errors = true

View File

@ -1 +1 @@
$redis = Redis.new(:host => "127.0.0.1", :port => 6379) $redis = Redis.new()

View File

@ -219,7 +219,7 @@ zh:
label_submit: 提交 label_submit: 提交
button_project_tags_add: 增加 button_project_tags_add: 增加
button_download: 下载 button_download: 下载
button_more: "更多»" button_more: "更多"
button_delete: 删除 button_delete: 删除
button_unfollow: 取消关注 button_unfollow: 取消关注
button_follow: 关注 button_follow: 关注

View File

@ -20,4 +20,4 @@ zh:
mail_issue_sent_from: "来源:" mail_issue_sent_from: "来源:"
mail_issue_from_project: "项目问题跟踪" mail_issue_from_project: "项目问题跟踪"
mail_issue_attachments: "附件:" mail_issue_attachments: "附件:"
mail_issue_reply: "我要回复" mail_issue_reply: "我要回复"

View File

@ -395,7 +395,8 @@ zh:
label_issue_score: issue得分 label_issue_score: issue得分
label_issue_number: issue的数量 label_issue_number: issue的数量
label_issue_journal_number: issue的留言数量 label_issue_journal_number: issue的留言数量
label_project_mail_feedback: 项目留言
label_news_score: 新闻得分 label_news_score: 新闻得分
label_new_number: 新闻的数量 label_new_number: 新闻的数量

View File

@ -736,6 +736,7 @@ zh:
label_date_to: label_date_to:
label_language_based: 根据用户的语言 label_language_based: 根据用户的语言
label_mail_policy: 邮件策略
label_send_test_email: 发送测试邮件 label_send_test_email: 发送测试邮件
label_feeds_access_key: RSS存取键 label_feeds_access_key: RSS存取键
label_missing_feeds_access_key: 缺少RSS存取键 label_missing_feeds_access_key: 缺少RSS存取键
@ -782,6 +783,7 @@ zh:
label_project_newother: "查看其他评论" label_project_newother: "查看其他评论"
label_project_newshare: "分享了" label_project_newshare: "分享了"
label_project_notice: "发布了通知:" label_project_notice: "发布了通知:"
label_project_mail_notice: "发布了新闻:"
label_project_issue: "发布了问题:" label_project_issue: "发布了问题:"
label_project_newadd: "添加了" label_project_newadd: "添加了"
label_project_unadd: "暂无项目,赶快去创建吧!" label_project_unadd: "暂无项目,赶快去创建吧!"
@ -1504,6 +1506,7 @@ zh:
label_news_number: 新闻的数量 label_news_number: 新闻的数量
label_wiki_number: wiki的数量 label_wiki_number: wiki的数量
label_wiki_mail_notification: 发布了wiki
@ -1936,6 +1939,7 @@ zh:
label_poll_description: 问卷描述 label_poll_description: 问卷描述
label_poll_options: 选项 label_poll_options: 选项
label_poll_subtotal: 小计 label_poll_subtotal: 小计
label_poll_question_num: "第%{num}题"
label_poll_proportion: 比例 label_poll_proportion: 比例
label_poll_valid_commit: 本题有效填写人次 label_poll_valid_commit: 本题有效填写人次
label_poll_result: 问卷调查_问卷统计 label_poll_result: 问卷调查_问卷统计

View File

@ -70,6 +70,7 @@ RedmineApp::Application.routes.draw do
get 'republish_poll' get 'republish_poll'
get 'poll_result' get 'poll_result'
get 'close_poll' get 'close_poll'
get 'export_poll'
end end
collection do collection do
delete 'delete_poll_question' delete 'delete_poll_question'

View File

@ -66,7 +66,8 @@ upload_avatar_max_size:
### delayjob for send email. ### delayjob for send email.
delayjob_enabled: delayjob_enabled:
default: 1 default: 1
course_cahce_enabled:
default: 1
bcc_recipients: bcc_recipients:
default: 1 default: 1
plain_text_mail: plain_text_mail:
@ -89,6 +90,12 @@ host_user:
default: user.trustie.net default: user.trustie.net
host_repository: host_repository:
default: repository.trustie.net default: repository.trustie.net
url_course:
default: course.trustie.net
url_contest:
default: contest.trustie.net
url_user:
default: user.trustie.net
protocol: protocol:
default: http default: http
feeds_limit: feeds_limit:

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