diff --git a/app/api/mobile/apis/courses.rb b/app/api/mobile/apis/courses.rb index 0d34cecaf..3d05ab3f3 100644 --- a/app/api/mobile/apis/courses.rb +++ b/app/api/mobile/apis/courses.rb @@ -336,6 +336,19 @@ module Mobile student_works = cs.student_work_list params,current_user present :data,student_works.all,with:Mobile::Entities::StudentWork end + + desc '开启匿评' + params do + requires :token,type:String + requires :course_id,type:Integer,desc:'课程id' + requires :homework_id,type:Integer,desc:'作业id' + end + get ':course_id/start_anonymous_comment' do + cs = CoursesService.new + status = cs.start_anonymous_comment params,current_user + present :data,status + present :status,0 + end end end end diff --git a/app/api/mobile/entities/attachment.rb b/app/api/mobile/entities/attachment.rb index b7424fac9..bb67b6d28 100644 --- a/app/api/mobile/entities/attachment.rb +++ b/app/api/mobile/entities/attachment.rb @@ -14,9 +14,10 @@ module Mobile f.send(field) end else - #case field - # when "" - #end + case field + when :file_dir + "attachments/download/" << f.send(:id).to_s << '/' + end end end end @@ -27,6 +28,7 @@ module Mobile attachment_expose :downloads attachment_expose :quotes attachment_expose :created_on + attachment_expose :file_dir end end end \ No newline at end of file diff --git a/app/api/mobile/entities/homework.rb b/app/api/mobile/entities/homework.rb index 2ea9404b8..e78689bfb 100644 --- a/app/api/mobile/entities/homework.rb +++ b/app/api/mobile/entities/homework.rb @@ -28,6 +28,8 @@ module Mobile get_homework_status f when :homework_times f.course.homework_commons.index(f) + 1 + when :homework_status_desc + homework_status_desc f end end end @@ -80,7 +82,8 @@ module Mobile expose :submit_student_list ,using: Mobile::Entities::User do |f,opt| get_submit_sutdent_list f end - homework_expose :homework_status + homework_expose :homework_status #作业的状态 + homework_expose :homework_status_desc #状态的解释 end end diff --git a/app/controllers/activity_notifys_controller.rb b/app/controllers/activity_notifys_controller.rb index 01e4260ea..ad9818fcc 100644 --- a/app/controllers/activity_notifys_controller.rb +++ b/app/controllers/activity_notifys_controller.rb @@ -6,6 +6,7 @@ class ActivityNotifysController < ApplicationController # accept_rss_auth :index, :show helper :activities + helper :attachments def index query = nil if @course diff --git a/app/controllers/comments_controller.rb b/app/controllers/comments_controller.rb index d226000c0..c10f8bc84 100644 --- a/app/controllers/comments_controller.rb +++ b/app/controllers/comments_controller.rb @@ -34,6 +34,20 @@ class CommentsController < ApplicationController ids = params[:asset_id].split(',') update_kindeditor_assets_owner ids,@comment.id,OwnerTypeHelper::COMMENT end + # ض̬ļ¼add start + if( @comment.id && @news.course ) + if(@news.author_id != User.current.id) + notify = ActivityNotify.new() + notify.activity_container_id = @news.course.id + notify.activity_container_type = 'Course' + notify.activity_id = @comment.id + notify.activity_type = 'Comment' + notify.notify_to = @news.author_id + notify.is_read = 0 + notify.save() + end + end + # ض̬ļ¼add end flash[:notice] = l(:label_comment_added) end diff --git a/app/controllers/journals_controller.rb b/app/controllers/journals_controller.rb index d8cd8eeec..6cebfef7a 100644 --- a/app/controllers/journals_controller.rb +++ b/app/controllers/journals_controller.rb @@ -74,7 +74,7 @@ class JournalsController < ApplicationController text = text.to_s.strip.gsub(%r{
((.|\s)*?)
}m, '[...]') @content = "> #{ll(Setting.default_language, :text_user_wrote, user)}\n> " @content << text.gsub(/(\r?\n|\r\n?)/, "\n> ") + "\n\n" - @content = "
" << @content + # @content = "
" << @content @id = user.id rescue ActiveRecord::RecordNotFound render_404 diff --git a/app/controllers/news_controller.rb b/app/controllers/news_controller.rb index f71a77ca7..56b4a30fc 100644 --- a/app/controllers/news_controller.rb +++ b/app/controllers/news_controller.rb @@ -141,6 +141,21 @@ class NewsController < ApplicationController ids = params[:asset_id].split(',') update_kindeditor_assets_owner ids,@news.id,OwnerTypeHelper::NEWS end + # ض̬ļ¼add start + teachers = searchTeacherAndAssistant(@course) + for teacher in teachers + if(teacher.user_id != User.current.id) + notify = ActivityNotify.new() + notify.activity_container_id = @course.id + notify.activity_container_type = 'Course' + notify.activity_id = @news.id + notify.activity_type = 'News' + notify.notify_to = teacher.user_id + notify.is_read = 0 + notify.save() + end + end + # ض̬ļ¼add end render_attachment_warning_if_needed(@news) flash[:notice] = l(:notice_successful_create) redirect_to course_news_index_url(@course) diff --git a/app/helpers/api_helper.rb b/app/helpers/api_helper.rb index 916383b05..6c17f8566 100644 --- a/app/helpers/api_helper.rb +++ b/app/helpers/api_helper.rb @@ -89,6 +89,29 @@ module ApiHelper homework_status end + #获取作业的是否可以匿评的描述 + def homework_status_desc homework + if homework.homework_type == 1 && homework.homework_detail_manual #匿评作业 + if Time.parse(homework.end_time.to_s).strftime("%Y-%m-%d") >= Time.now.strftime("%Y-%m-%d") + link = "启动匿评".html_safe + elsif homework.student_works.count >= 2 #作业份数大于2 + case homework.homework_detail_manual.comment_status + when 1 + link = '启动匿评' + when 2 + link = '关闭匿评' + when 3 + link = " 匿评结束" + end + else + link = "学生提交作业数大于2时才可以启动匿评" + end + else + link = "未开启匿评作业不可以启动匿评" + end + link + end + #获取 def get_submit_sutdent_list homework studentlist = [] @@ -104,6 +127,11 @@ module ApiHelper #计算作业的截止日期,剩余日期 def show_homework_deadline homework - "距作业截止还有" << (Date.parse(Time.now.to_s) - Date.parse(homework.end_time.to_s)).to_i.to_s << "天" + day = 0 + if (day = (Date.parse(homework.end_time.to_s) - Date.parse(Time.now.to_s)).to_i) > 0 + "距作业截止还有" << (Date.parse(Time.now.to_s) - Date.parse(homework.end_time.to_s)).to_i.to_s << "天" + else + "已截止,但可补交" + end end end \ No newline at end of file diff --git a/app/models/comment.rb b/app/models/comment.rb index bdb642d3c..a4842a23f 100644 --- a/app/models/comment.rb +++ b/app/models/comment.rb @@ -19,6 +19,14 @@ class Comment < ActiveRecord::Base include Redmine::SafeAttributes include ApplicationHelper has_many_kindeditor_assets :assets, :dependent => :destroy + + has_many :ActivityNotifies,:as => :activity, :dependent => :destroy + acts_as_event :datetime => :updated_on, + :description => :comments, + :type => 'news', + :title=>Proc.new {|o| "RE: #{o.commented.title}" }, + :url => Proc.new {|o| {:controller => 'news', :action => 'show', :id => o.commented.id} } + belongs_to :commented, :polymorphic => true, :counter_cache => true belongs_to :author, :class_name => 'User', :foreign_key => 'author_id' validates_presence_of :commented, :author, :comments @@ -38,4 +46,17 @@ class Comment < ActiveRecord::Base def delete_kindeditor_assets delete_kindeditor_assets_from_disk self.id,OwnerTypeHelper::COMMENT end + + def set_notify_id(notify_id) + @notify_id= notify_id + end + def get_notify_id() + return @notify_id + end + def set_notify_is_read(notify_is_read) + @notify_is_read = notify_is_read + end + def get_notify_is_read() + return @notify_is_read + end end diff --git a/app/models/mailer.rb b/app/models/mailer.rb index 0d0b82752..7aa793d82 100644 --- a/app/models/mailer.rb +++ b/app/models/mailer.rb @@ -104,13 +104,13 @@ class Mailer < ActionMailer::Base # 查询user的缺陷,项目中成员都能收到 sql = "select DISTINCT * from members m, issues i where i.project_id = m.project_id and m.user_id='#{user.id}' - and (i.updated_on between '#{date_from}' and '#{date_to}') order by i.updated_on desc" + and (i.updated_on between '#{date_from}' and '#{date_to}') order by i.project_id, i.updated_on desc" @issues = Issue.find_by_sql(sql) # issue回复 @issues_journals = Journal.find_by_sql("select j.* from journals j, members m, projects p, issues i where m.user_id = '#{user.id}' and p.id = m.project_id and i.project_id = p.id and j.journalized_id = i.id - and j.journalized_type='Issue' and (j.created_on between '#{date_from}' and '#{date_to}') order by created_on desc") + and j.journalized_type='Issue' and (j.created_on between '#{date_from}' and '#{date_to}') order by i.project_id, created_on desc") # @bids 查询课程作业,包括老师发布的作业,以及user提交作业 # @attachments查询课程课件更新 @@ -120,17 +120,17 @@ class Mailer < ActionMailer::Base count = courses.count count = count - 1 for i in 0..count do - bids = courses[i].homework_commons.where("homework_commons.created_at between '#{date_from}' and '#{date_to}'").order("homework_commons.created_at desc") - attachments = courses[i].attachments.where("attachments.created_on between '#{date_from}' and '#{date_to}'").order('attachments.created_on DESC') + bids = courses[i].homework_commons.where("homework_commons.created_at between '#{date_from}' and '#{date_to}'").order(" '#{courses[i].id}', homework_commons.created_at desc") + attachments = courses[i].attachments.where("attachments.created_on between '#{date_from}' and '#{date_to}'").order(" '#{courses[i].id}',attachments.created_on DESC' ") @bids += bids if bids.count > 0 @attachments += attachments if attachments.count > 0 end - @bids.sort {|a, b| a.created_at <=> b.created_at} + # @bids = @bids.sort_by { |obj| obj.created_at } end # 项目附件 @project_attachments = Attachment.find_by_sql("select DISTINCT a.* from members m, attachments a - where a.container_id = m.project_id and m.user_id='#{user.id}' and container_type = 'Project' and (a.created_on between '#{date_from}' and '#{date_to}') order by a.created_on desc") + where a.container_id = m.project_id and m.user_id='#{user.id}' and container_type = 'Project' and (a.created_on between '#{date_from}' and '#{date_to}') order by m.project_id, a.created_on desc") # user 提交的作业 # @homeworks = HomeworkAttach.where("user_id=#{user.id} and (created_at between '#{date_from}' and '#{date_to}')").order("created_at desc") @@ -138,18 +138,18 @@ class Mailer < ActionMailer::Base # 查询user所在项目添加wiki @wiki_contents = WikiContent.find_by_sql("select DISTINCT wc.* from wikis w, members m, projects p, wiki_pages wp, wiki_contents wc where 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") + and (wc.updated_on between '#{date_from}' and '#{date_to}') order by m.project_id, 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") + and (me.created_on between '#{date_from}' and '#{date_to}') order by m.course_id, 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") + and b.project_id != '-1' and m.user_id = '#{user.id}' and (me.created_on between '#{date_from}' and '#{date_to}') order by m.project_id, 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 ||= [] @project_messages ||= [] @@ -168,31 +168,31 @@ class Mailer < ActionMailer::Base # 查询user在课程中发布的通知和回复通知 @course_news = (course_ids && !course_ids.empty?) ? News.find_by_sql("select DISTINCT n.* from news n where n.course_id in (#{course_ids}) - and (created_on between '#{date_from}' and '#{date_to}') order by created_on desc") : [] + and (created_on between '#{date_from}' and '#{date_to}') order by n.course_id, created_on desc") : [] @course_news_comments = Comment.find_by_sql("select cm.* from comments cm, members m, courses c, news n where m.user_id = '#{user.id}' and c.id = m.course_id and n.course_id = c.id and cm.commented_id = n.id - and cm.commented_type ='News' and (cm.created_on between '#{date_from}' and '#{date_to}') order by created_on desc") + and cm.commented_type ='News' and (cm.created_on between '#{date_from}' and '#{date_to}') order by m.course_id, created_on desc") # 查询user在项目中添加新闻和回复新闻 @project_news = (project_ids && !project_ids.empty?) ? News.find_by_sql("select DISTINCT n.* from news n where n.project_id in (#{project_ids}) - and (created_on between '#{date_from}' and '#{date_to}') order by created_on desc") : [] + and (created_on between '#{date_from}' and '#{date_to}') order by n.project_id, created_on desc") : [] @project_news_comments = Comment.find_by_sql("select c.* from comments c, members m, projects p, news n where m.user_id = '#{user.id}' and p.id = m.project_id and n.project_id = p.id and c.commented_id = n.id - and c.commented_type ='News' and (c.created_on between '#{date_from}' and '#{date_to}') order by created_on desc") + and c.commented_type ='News' and (c.created_on between '#{date_from}' and '#{date_to}') order by m.project_id, created_on desc") # 查询user在课程及个人中留言 @course_journal_messages = JournalsForMessage.find_by_sql("select DISTINCT jfm.* from journals_for_messages jfm, members m, courses c where m.user_id = '#{user.id}' and c.id = m.course_id and jfm.jour_id = c.id - and jfm.jour_type='Course' and (jfm.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 m.course_id, 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") + and jfm.jour_type='Project' and (jfm.created_on between '#{date_from}' and '#{date_to}') order by m.project_id, created_on desc") # 查询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") diff --git a/app/models/memo.rb b/app/models/memo.rb index 2831effe3..e0abaa19f 100644 --- a/app/models/memo.rb +++ b/app/models/memo.rb @@ -9,7 +9,7 @@ class Memo < ActiveRecord::Base # 若是主题帖,则内容可以是空 #validates :content, presence: true, if: Proc.new{|o| !o.parent_id.nil? } validates_length_of :subject, maximum: 50 - #validates_length_of :content, maximum: 3072 + validates_length_of :content, maximum: 5000 validate :cannot_reply_to_locked_topic, :on => :create acts_as_tree :counter_cache => :replies_count, :order => "#{Memo.table_name}.created_at ASC" diff --git a/app/models/news.rb b/app/models/news.rb index 7e809cbfd..7d33d760e 100644 --- a/app/models/news.rb +++ b/app/models/news.rb @@ -30,6 +30,8 @@ class News < ActiveRecord::Base has_many :forge_acts, :class_name => 'ForgeActivity',:as =>:forge_act ,:dependent => :destroy # end + has_many :ActivityNotifies,:as => :activity, :dependent => :destroy + validates_presence_of :title, :description validates_length_of :title, :maximum => 60 validates_length_of :summary, :maximum => 255 @@ -85,6 +87,19 @@ class News < ActiveRecord::Base #description end + def set_notify_id(notify_id) + @notify_id= notify_id + end + def get_notify_id() + return @notify_id + end + def set_notify_is_read(notify_is_read) + @notify_is_read = notify_is_read + end + def get_notify_is_read() + return @notify_is_read + end + private def add_author_as_watcher diff --git a/app/services/courses_service.rb b/app/services/courses_service.rb index b77703a37..7efe76b3a 100644 --- a/app/services/courses_service.rb +++ b/app/services/courses_service.rb @@ -434,24 +434,15 @@ class CoursesService # 课程课件 def course_attachments params result = [] - @course = Course.find(params[:course_id]) - @attachments = @course.attachments.order("created_on desc") + course = Course.find(params[:course_id]) + attachments = course.attachments.order("created_on ") if !params[:name].nil? && params[:name] != "" - @attachments.each do |atta| - result << {:filename => atta.filename, - :description => atta.description, - :downloads => atta.downloads, - :quotes => atta.quotes.nil? ? 0 :atta.quotes } if atta.filename.include?(params[:name]) + attachments.each do |atta| + result << atta if atta.filename.include?(params[:name]) end else - @attachments.each do |atta| - result << {:filename => atta.filename, - :description => atta.description, - :downloads => atta.downloads, - :quotes => atta.quotes.nil? ? 0 :atta.quotes } - - end + result = attachments end result end @@ -651,9 +642,9 @@ class CoursesService return end if current_user == @user || current_user.admin? - membership = @user.coursememberships.page(1).per(10) + membership = @user.coursememberships.page(1).per(15) else - membership = @user.coursememberships.page(1).per(10).all(:conditions => Course.visible_condition(current_user)) + membership = @user.coursememberships.page(1).per(15).all(:conditions => Course.visible_condition(current_user)) end if membership.nil? || membership.count == 0 raise l(:label_no_courses, :locale => get_user_language(current_user)) @@ -669,10 +660,11 @@ class CoursesService dynamics_count = 0 # 课程学霸 学生总分数排名靠前的5个人 homework_count = course.homework_commons.count - unless homework_count == 0 - sql = "select users.*,sum(IFNULL(0,student_works.final_score))/#{homework_count} score from student_works left outer join users on student_works.user_id = users.id" << + sql = "select users.*,sum(IFNULL(0,student_works.final_score))/#{homework_count} score from student_works left outer join users on student_works.user_id = users.id" << " where homework_common_id in ( select id from homework_commons where homework_commons.course_id = #{course.id}) GROUP BY student_works.user_id ORDER BY score limit 0,6" - latest_course_dynamics <<{:type=> 6,:time=>Time.now.to_s,:count=> 6,:better_students=> User.find_by_sql(sql)} + better_students = User.find_by_sql(sql) + if homework_count != 0 && !better_students.empty? + latest_course_dynamics <<{:type=> 6,:time=>Time.now.to_s,:count=> 6,:better_students=> better_students} dynamics_count += 1 end # 课程通知 @@ -754,5 +746,41 @@ class CoursesService student_works end + # 开启匿评 + #statue 1:启动成功,2:启动失败,作业总数大于等于2份时才能启动匿评,3:已开启匿评,请务重复开启,4:没有开启匿评的权限 + def start_anonymous_comment params,current_user + homework = HomeworkCommon.find(params[:homework_id]) + return {:status=>4} unless current_user.admin? || current_user.allowed_to?(:as_teacher,Course.find(params[:course_id])) + return {:status=>5} if Time.parse(homework.end_time.to_s).strftime("%Y-%m-%d") >= Time.now.strftime("%Y-%m-%d") + homework_detail_manual = homework.homework_detail_manual + if homework_detail_manual.comment_status == 1 + student_works = homework.student_works + if student_works && student_works.size >=2 + student_works.each_with_index do |work, index| + user = work.user + n = homework_detail_manual.evaluation_num + n = n < student_works.size ? n : student_works.size - 1 + assigned_homeworks = get_assigned_homeworks(student_works, n, index) + assigned_homeworks.each do |h| + student_works_evaluation_distributions = StudentWorksEvaluationDistribution.new(user_id: user.id, student_work_id: h.id) + student_works_evaluation_distributions.save + end + end + homework_detail_manual.update_column('comment_status', 2) + statue = 1 + else + statue = 2 + end + else + statue = 3 + end + {:status => statue} + end + + def get_assigned_homeworks(student_works, n, index) + student_works += student_works + student_works[index + 1 .. index + n] + end + end diff --git a/app/views/courses/_history.html.erb b/app/views/courses/_history.html.erb index e9639f4f0..043bac947 100644 --- a/app/views/courses/_history.html.erb +++ b/app/views/courses/_history.html.erb @@ -9,7 +9,7 @@
- <%= link_to journal.user.show_name, user_path(journal.user),:class => 'c_blue fb fl mb10', :target => "_blank"%> + <%= link_to "#{journal.user.show_name}(#{journal.user.login})", user_path(journal.user),:class => 'c_blue fb fl mb10', :target => "_blank"%> <%= format_time(journal.created_on) %> diff --git a/app/views/files/create.js.erb b/app/views/files/create.js.erb index 87bf5b864..a1c278a7a 100644 --- a/app/views/files/create.js.erb +++ b/app/views/files/create.js.erb @@ -21,14 +21,26 @@ $("#attachments_fields").children().remove(); $("#upload_file_count").text("未上传文件"); $('#upload_file_div').slideToggle('slow'); - <% if @project%> + <% if @project %> closeModal(); $("#resource_list").html('<%= j(render partial: "project_file_new" ,locals: {project: @project}) %>'); +// 添加文件上传成功提示 + <% unless params[:attachments].nil? %> + var div = $('
文件上传成功!
'); + $("#course_list").prepend(div); + setTimeout( function(){div.remove();},3000) + <% end %> <%elsif @course%> closeModal(); $("#resource_list").html('<%= j(render partial: "course_file" ,locals: {course: @course}) %>'); $("#courses_files_count_info").html("<%= @all_attachments.count%>"); $("#courses_files_count_nav").html("(<%= @all_attachments.count%>)") + // 添加文件上传成功提示, + <% unless params[:attachments].nil? %> + var div = $('
文件上传成功!
'); + $("#course_list").prepend(div); + setTimeout( function(){div.remove();},3000) + <% end %> <% end %> <% end %> $(document).ready(img_thumbnails); diff --git a/app/views/issues/_edit.html.erb b/app/views/issues/_edit.html.erb index 444016db8..1f3f984b4 100644 --- a/app/views/issues/_edit.html.erb +++ b/app/views/issues/_edit.html.erb @@ -23,7 +23,7 @@
回复 - <%= f.text_area :notes, :style => "width:99%;", :rows => "5", :no_label => true %> + <%= f.text_area :notes, :style => "width:99%;", :rows => "5", :no_label => true %>
diff --git a/app/views/issues/_history.html.erb b/app/views/issues/_history.html.erb index a5b1661eb..2ad36875c 100644 --- a/app/views/issues/_history.html.erb +++ b/app/views/issues/_history.html.erb @@ -1,33 +1,31 @@ <% reply_links = authorize_for('issues', 'edit') -%> <% journals.reverse.each do |journal| %> - -
- -
- -
-
- <%= journal.user %><%= format_time journal.created_on %> + +
+ +
+ +
+
+ <%= journal.user %><%= format_time journal.created_on %> +
+

+ <% if journal.details.any? %> + <% details_to_strings(journal.details).each do |string| %> +

<%= string %>

+ <% end %> + <% end %> +

+
+ +
<%= render_links_easy(issue, journal, :reply_links => reply_links) unless journal.notes.blank? %>
+ +

<%= render_notes_issue(issue, journal, :reply_links => reply_links) unless journal.notes.blank? %>

+
+
-

- <% if journal.details.any? %> - <% details_to_strings(journal.details).each do |string| %> -

<%= string %>

- <% end %> - <% end %> -

- -
<%= render_links_easy(issue, journal, :reply_links => reply_links) unless journal.notes.blank? %>
- -

- <%= render_notes_issue(issue, journal, :reply_links => reply_links) unless journal.notes.blank? %> -

-
-
-
-
<%= call_hook(:view_issues_history_journal_bottom, { :journal => journal }) %> <% end %> diff --git a/app/views/issues/_list.html.erb b/app/views/issues/_list.html.erb index 616e205c4..0fcb37021 100644 --- a/app/views/issues/_list.html.erb +++ b/app/views/issues/_list.html.erb @@ -11,7 +11,7 @@
<%= link_to issue.author.name, user_path(issue.author), :class => "problem_name c_orange fl" %> <%= l(:label_post_on_issue) %>(<%= "#{raw column_content[2]}" %>): -
+
<%=link_to "#{column_content[4]}#{get_issue_type(column_content[1])[1]}".html_safe, issue_path(issue.id), :class => "problem_tit_a break_word",:target => "_blank" %>
diff --git a/app/views/journals/diff.html.erb b/app/views/journals/diff.html.erb index 5bc823c76..190459b71 100644 --- a/app/views/journals/diff.html.erb +++ b/app/views/journals/diff.html.erb @@ -1,5 +1,5 @@

<%=h @issue.tracker %> #<%= @issue.id %>

-

<%= authoring @journal.created_on, @journal.user, :label => :label_updated_time_by %>

+

由<%= @journal.user %> 更新于 <%= format_time @journal.created_on %>

<%= simple_format_without_paragraph @diff.to_html %> diff --git a/app/views/journals/new.js.erb b/app/views/journals/new.js.erb index d02568426..ae2574595 100644 --- a/app/views/journals/new.js.erb +++ b/app/views/journals/new.js.erb @@ -1,11 +1,11 @@ -$('#journal_issue_note').html("<%= raw escape_javascript(@content.html_safe) %>"); -$("input[name='issue_quote_new']").val("<%= raw escape_javascript(@content.html_safe) %>"); +$('#issue_notes').val("<%= raw escape_javascript(@content) %>"); <% # when quoting a private journal, check the private checkbox - if @journal && @journal.private_notes? + if @journal && @journal.private_notes? %> $('#issue_private_notes').attr('checked', true); <% end %> + showAndScrollTo("update", "notes"); $('#notes').scrollTop = $('#notes').scrollHeight - $('#notes').clientHeight; diff --git a/app/views/news/_course_news.html.erb b/app/views/news/_course_news.html.erb index 6d4369c7b..c89f0af26 100644 --- a/app/views/news/_course_news.html.erb +++ b/app/views/news/_course_news.html.erb @@ -34,6 +34,7 @@ <%= l(:label_release_news) %>: <%= link_to h(news.title), news_path(news),:class => 'problem_tit fl fb c_dblue' %> + <%=link_to "#{news.comments.all.count}".html_safe, news_path(news.id), :class => "pro_mes_w" %>