diff --git a/Gemfile b/Gemfile index a690b224b..cf6e9f773 100644 --- a/Gemfile +++ b/Gemfile @@ -1,4 +1,4 @@ -source 'http://ruby.taobao.org' +source 'https://ruby.taobao.org' #source 'http://ruby.sdutlinux.org/' unless RUBY_PLATFORM =~ /w32/ @@ -28,6 +28,7 @@ gem 'ruby-ole' gem 'rails_kindeditor',path:'lib/rails_kindeditor' #gem "rmagick", ">= 2.0.0" gem 'binding_of_caller' +gem 'chinese_pinyin' group :development do gem 'grape-swagger' diff --git a/app/controllers/boards_controller.rb b/app/controllers/boards_controller.rb index 434ea4470..2ec3cac0d 100644 --- a/app/controllers/boards_controller.rb +++ b/app/controllers/boards_controller.rb @@ -90,65 +90,67 @@ class BoardsController < ApplicationController end end end + + sort_init 'updated_on', 'desc' + sort_update 'created_on' => "#{Message.table_name}.created_on", + 'replies' => "#{Message.table_name}.replies_count", + 'updated_on' => "COALESCE(last_replies_messages.created_on, #{Message.table_name}.created_on)" + + @is_new = params[:is_new] + @topic_count = @board ? @board.topics.count : 0 + if @project + @topic_pages = Paginator.new @topic_count, per_page_option, params['page'] + #现在发布帖子的时候置顶功能已经没有了。所以取消这个置顶排序 #{Message.table_name}.sticky DESC, + @topics = @board.topics. + reorder("#{Message.table_name}.created_on desc"). + includes(:last_reply). + limit(@topic_pages.per_page). + offset(@topic_pages.offset). + + preload(:author, {:last_reply => :author}). + all + elsif @course + # + # board_topics = @board ? @board.topics.reorder("#{Message.table_name}.sticky DESC, #{Message.table_name}.created_on desc"). + # includes(:last_reply). + # # limit(@topic_pages.per_page). + # # offset(@topic_pages.offset). + # + # preload(:author, {:last_reply => :author}). + # all : [] + # @topics = paginateHelper board_topics,10 + if (@board) + limit = 10; + #pageno = params[:page]; + #if(pageno == nil || pageno=='') + # dw_topic = nil; + # if( params[:parent_id]!=nil && params[:parent_id]!='' ) + # dw_topic = @board.topics.where(id:params[:parent_id]).first(); + # end + # if( dw_topic != nil ) + # dw_count = @board.topics.where('(sticky>?) or (sticky=? and created_on>?)',dw_topic.sticky,dw_topic.sticky,dw_topic.created_on).count(); + # dw_count = dw_count+1; + # pageno = dw_count%10==0 ? (dw_count/limit) : (dw_count/limit+1) + # end + #end + #if(pageno == nil || pageno=='') + # pageno=1; + #end + @topic_count = @board.topics.count(); + @topic_pages = (params[:page] ? params[:page].to_i + 1 : 0) *10 + @topics = @board.topics.reorder("#{Message.table_name}.sticky DESC, COALESCE(last_replies_messages.created_on, #{Message.table_name}.created_on) desc"). + limit(limit).offset(@topic_pages).includes(:last_reply). + preload(:author, {:last_reply => :author}).all(); + else + @topics = []; + end + end + + @message = Message.new(:board => @board) + #modify by nwb respond_to do |format| format.js format.html { - sort_init 'updated_on', 'desc' - sort_update 'created_on' => "#{Message.table_name}.created_on", - 'replies' => "#{Message.table_name}.replies_count", - 'updated_on' => "COALESCE(last_replies_messages.created_on, #{Message.table_name}.created_on)" - - @topic_count = @board ? @board.topics.count : 0 - if @project - @topic_pages = Paginator.new @topic_count, per_page_option, params['page'] - #现在发布帖子的时候置顶功能已经没有了。所以取消这个置顶排序 #{Message.table_name}.sticky DESC, - @topics = @board.topics. - reorder("#{Message.table_name}.created_on desc"). - includes(:last_reply). - limit(@topic_pages.per_page). - offset(@topic_pages.offset). - - preload(:author, {:last_reply => :author}). - all - elsif @course - # - # board_topics = @board ? @board.topics.reorder("#{Message.table_name}.sticky DESC, #{Message.table_name}.created_on desc"). - # includes(:last_reply). - # # limit(@topic_pages.per_page). - # # offset(@topic_pages.offset). - # - # preload(:author, {:last_reply => :author}). - # all : [] - # @topics = paginateHelper board_topics,10 - if( @board ) - limit = 10; - pageno = params[:page]; - if(pageno == nil || pageno=='') - dw_topic = nil; - if( params[:parent_id]!=nil && params[:parent_id]!='' ) - dw_topic = @board.topics.where(id:params[:parent_id]).first(); - end - if( dw_topic != nil ) - dw_count = @board.topics.where('(sticky>?) or (sticky=? and created_on>?)',dw_topic.sticky,dw_topic.sticky,dw_topic.created_on).count(); - dw_count = dw_count+1; - pageno = dw_count%10==0 ? (dw_count/limit) : (dw_count/limit+1) - end - end - if(pageno == nil || pageno=='') - pageno=1; - end - @topic_count = @board.topics.count(); - @topic_pages = Paginator.new @topic_count, limit, pageno - @topics = @board.topics.reorder("#{Message.table_name}.sticky DESC, #{Message.table_name}.created_on desc"). - limit(limit).offset(@topic_pages.offset).includes(:last_reply). - preload(:author, {:last_reply => :author}).all(); - else - @topics = []; - end - end - - @message = Message.new(:board => @board) - #modify by nwb if @project render :action => 'show', :layout => 'base_projects' elsif @course @@ -158,10 +160,10 @@ class BoardsController < ApplicationController } format.atom { @messages = @board.messages. - reorder('created_on DESC'). - includes(:author, :board). - limit(Setting.feeds_limit.to_i). - all + reorder('created_on DESC'). + includes(:author, :board). + limit(Setting.feeds_limit.to_i). + all if @project render_feed(@messages, :title => "#{@project}: #{@board}") elsif @course diff --git a/app/controllers/messages_controller.rb b/app/controllers/messages_controller.rb index 4f3f3ec0d..4f78d61f5 100644 --- a/app/controllers/messages_controller.rb +++ b/app/controllers/messages_controller.rb @@ -37,6 +37,7 @@ class MessagesController < ApplicationController # Show a topic and its replies def show +=begin if @course topic_id = params[:r]?params[:r]:params[:id] parent_id = params[:id] @@ -44,6 +45,7 @@ class MessagesController < ApplicationController redirect_to url return; end +=end @isReply = true page = params[:page] diff --git a/app/controllers/my_controller.rb b/app/controllers/my_controller.rb index 9728ddf11..16d516f82 100644 --- a/app/controllers/my_controller.rb +++ b/app/controllers/my_controller.rb @@ -126,11 +126,13 @@ class MyController < ApplicationController end @se = @user.extensions - if params[:occupation].to_i.to_s == params[:occupation] - @se.school_id = params[:occupation] - else - @se.occupation = params[:occupation] - end + # if params[:occupation].to_i.to_s == params[:occupation] + # @se.school_id = params[:occupation] + # else + # @se.occupation = params[:occupation] + # end + @se.school_id = params[:occupation] + @se.gender = params[:gender] @se.location = params[:province] if params[:province] @se.location_city = params[:city] if params[:city] diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index 126b269bb..f2f10d5b6 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -46,16 +46,21 @@ class RepositoriesController < ApplicationController rescue_from Redmine::Scm::Adapters::CommandFailed, :with => :show_error_command_failed def new - scm = params[:repository_scm] || (Redmine::Scm::Base.all & Setting.enabled_scm).first - @repository = Repository.factory(scm) - @repository.is_default = @project.repository.nil? - @repository.project = @project - @course_tag = params[:course] - if @course_tag == 1 - render :layout => 'base_courses' + if @project.repositories.count == 0 + scm = params[:repository_scm] || (Redmine::Scm::Base.all & Setting.enabled_scm).first + @repository = Repository.factory(scm) + @repository.is_default = @project.repository.nil? + @repository.project = @project + @course_tag = params[:course] + if @course_tag == 1 + render :layout => 'base_courses' + else + render :layout => 'base_projects' + end else - render :layout => 'base_projects' + render_403 end + end diff --git a/app/controllers/school_controller.rb b/app/controllers/school_controller.rb index 3e0c280ac..062b0fa34 100644 --- a/app/controllers/school_controller.rb +++ b/app/controllers/school_controller.rb @@ -105,4 +105,42 @@ class SchoolController < ApplicationController render :text => options end + + #根据学校名字或者拼音来查询 + def on_search + condition = "#{params[:name].strip}".gsub(" ","") + #将条件截断为汉字和拼音(全汉字 或者 全拼音 或者 汉字和拼音), + #获取拼音的第一次出现的位置 + chinese = [] + pinyin = [] + condition.scan(/./).each_with_index do |char,index| + if char =~ /[a-zA-Z0-9]/ + pinyin << char + else + chinese << char + end + end + if(condition == '') + @school = School.all + else + @school = School.where("name like '%#{chinese.join("")}%' and pinyin like '%#{pinyin.join("")}%'").all + end + + result = [] + # @school.each do |sc| + # result << {:value=>sc.name,:data=>sc.id} + # end + render :json => @school.to_json + end + + #添加学校 + def add_school + @school = School.new + @school.name = params[:name].strip + @school.pinyin = Pinyin.t(params[:name].strip, splitter: '') + @school.save + respond_to do |format| + format.js + end + end end diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 3de491421..90fdbe837 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -883,6 +883,7 @@ class UsersController < ApplicationController user_course_ids = @user.courses.visible.empty? ? "(-1)" : "(" + @user.courses.visible.map{|course| course.id}.join(",") + ")" course_types = "('Message','News','HomeworkCommon','Poll')" project_types = "('Message','Issue')" + principal_types = "JournalsForMessage" if params[:type].present? case params[:type] when "course_homework" @@ -897,13 +898,15 @@ class UsersController < ApplicationController @user_activities = UserActivity.where("container_type = 'Project' and container_id in #{user_project_ids} and act_type = 'Issue'").order('updated_at desc').limit(10).offset(@page * 10) when "project_message" @user_activities = UserActivity.where("container_type = 'Project' and container_id in #{user_project_ids} and act_type = 'Message'").order('updated_at desc').limit(10).offset(@page * 10) + when "user_journals" + @user_activities = UserActivity.where("container_type = 'Principal' and act_type= 'JournalsForMessage' and container_id = #{@user.id}").order('updated_at desc').limit(10).offset(@page * 10) when "current_user" @user_activities = UserActivity.where("user_id = #{@user.id} and ((container_type = 'Project' and container_id in #{user_project_ids} and act_type in #{project_types}) or (container_type = 'Course' and container_id in #{user_course_ids} and act_type in #{course_types}))").order('updated_at desc').limit(10).offset(@page * 10) else - @user_activities = UserActivity.where("(container_type = 'Project' and container_id in #{user_project_ids} and act_type in #{project_types}) or (container_type = 'Course' and container_id in #{user_course_ids} and act_type in #{course_types})").order('updated_at desc').limit(10).offset(@page * 10) + @user_activities = UserActivity.where("(container_type = 'Project' and container_id in #{user_project_ids} and act_type in #{project_types}) or (container_type = 'Course' and container_id in #{user_course_ids} and act_type in #{course_types}) or (container_type = 'Principal' and act_type= '#{principal_types}' and container_id = #{@user.id})").order('updated_at desc').limit(10).offset(@page * 10) end else - @user_activities = UserActivity.where("(container_type = 'Project' and container_id in #{user_project_ids} and act_type in #{project_types}) or (container_type = 'Course' and container_id in #{user_course_ids} and act_type in #{course_types})").order('updated_at desc').limit(10).offset(@page * 10) + @user_activities = UserActivity.where("(container_type = 'Project' and container_id in #{user_project_ids} and act_type in #{project_types}) or (container_type = 'Course' and container_id in #{user_course_ids} and act_type in #{course_types})or (container_type = 'Principal' and act_type= '#{principal_types}' and container_id = #{@user.id})").order('updated_at desc').limit(10).offset(@page * 10) end # @user_activities = paginateHelper @user_activities,500 @type = params[:type] diff --git a/app/controllers/words_controller.rb b/app/controllers/words_controller.rb index a59f507df..6304055ed 100644 --- a/app/controllers/words_controller.rb +++ b/app/controllers/words_controller.rb @@ -76,7 +76,8 @@ class WordsController < ApplicationController # render 'test/index' # } format.js { - @user_activity_id = params[:user_activity_id] if + @reply_type = params[:reply_type] + @user_activity_id = params[:user_activity_id] @activity = JournalsForMessage.find(parent_id) } end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 41e016562..b18d0c706 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -2349,22 +2349,25 @@ module ApplicationHelper #根据传入作业确定显示为编辑作品还是新建作品,或者显示作品数量 def user_for_homework_common homework,is_teacher - if is_teacher #老师显示作品数量 - link_to "提交(#{homework.student_works.count})",student_work_index_path(:homework => homework.id),:class => "c_blue" - else #学生显示提交作品、修改作品等按钮 - work = cur_user_works_for_homework homework - if work.nil? - link_to "提交作品", new_student_work_path(:homework => homework.id),:class => 'c_blue' - else - if homework.homework_detail_manual && homework.homework_detail_manual.comment_status != 1 #匿评作业,且作业状态不是在开启匿评之前 - link_to "作品已交", "javascript:void(0)", :class => 'c_blue', :title => "开启匿评后不可修改作品" - elsif homework.homework_type == 2 #编程作业不能修改作品 - link_to "修改作品", new_student_work_path(:homework => homework.id),:class => 'c_blue' + if User.current.member_of_course?(homework.course) + if is_teacher #老师显示作品数量 + link_to "提交(#{homework.student_works.count})",student_work_index_path(:homework => homework.id),:class => "c_blue" + else #学生显示提交作品、修改作品等按钮 + work = cur_user_works_for_homework homework + if work.nil? + link_to "提交作品", new_student_work_path(:homework => homework.id),:class => 'c_blue' else - link_to "修改作品", edit_student_work_path(work.id),:class => 'c_blue' + if homework.homework_detail_manual && homework.homework_detail_manual.comment_status != 1 #匿评作业,且作业状态不是在开启匿评之前 + link_to "作品匿评", student_work_index_path(:homework => homework.id), :class => 'c_blue', :title => "开启匿评后不可修改作品" + elsif homework.homework_type == 2 #编程作业不能修改作品 + link_to "修改作品", new_student_work_path(:homework => homework.id),:class => 'c_blue' + else + link_to "修改作品", edit_student_work_path(work.id),:class => 'c_blue' + end end end end + end def student_anonymous_comment homework diff --git a/app/models/journals_for_message.rb b/app/models/journals_for_message.rb index dde34abfd..faab129a6 100644 --- a/app/models/journals_for_message.rb +++ b/app/models/journals_for_message.rb @@ -56,6 +56,7 @@ class JournalsForMessage < ActiveRecord::Base acts_as_attachable has_many :acts, :class_name => 'Activity', :as => :act, :dependent => :destroy + has_many :principal_acts, :class_name => 'PrincipalActivity',:as =>:principal_act ,:dependent => :destroy # 课程动态 has_many :course_acts, :class_name => 'CourseActivity',:as =>:course_act ,:dependent => :destroy # 消息关联 @@ -63,7 +64,7 @@ class JournalsForMessage < ActiveRecord::Base has_many :user_feedback_messages, :class_name => 'UserFeedbackMessage', :as =>:journals_for_message, :dependent => :destroy validates :notes, presence: true, if: :is_homework_jour? - after_create :act_as_activity, :act_as_course_activity, :act_as_course_message, :act_as_user_feedback_message + after_create :act_as_activity, :act_as_course_activity, :act_as_course_message, :act_as_user_feedback_message, :act_as_principal_activity after_create :reset_counters! after_destroy :reset_counters! after_save :be_user_score @@ -133,6 +134,15 @@ class JournalsForMessage < ActiveRecord::Base end end + #用户动态公共表记录 + def act_as_principal_activity + if self.jour_type == 'Principal' + unless self.user_id == self.jour.id && self.user_id != self.reply_id && self.reply_id != 0 + self.principal_acts << PrincipalActivity.new(:user_id => self.user_id, :principal_id => self.jour_id) + end + end + end + def reset_counters! self.class.reset_counters!(self) end diff --git a/app/models/principal_activity.rb b/app/models/principal_activity.rb new file mode 100644 index 000000000..bdd7cd60e --- /dev/null +++ b/app/models/principal_activity.rb @@ -0,0 +1,34 @@ +class PrincipalActivity < ActiveRecord::Base + attr_accessible :principal_act_id, :principal_act_type, :principal_id, :user_id + #虚拟关联 + belongs_to :principal_act ,:polymorphic => true + belongs_to :user + validates :user_id,presence: true + validates :principal_id,presence: true + validates :principal_act_id,presence: true + validates :principal_act_type, presence: true + has_many :user_acts, :class_name => 'UserAcivity',:as =>:act + after_save :add_user_activity + before_destroy :destroy_user_activity + + #在个人动态里面增加当前动态 + def add_user_activity + user_activity = UserActivity.where("act_type = '#{self.principal_act_type.to_s}' and act_id = '#{self.principal_act_id}'").first + if user_activity + user_activity.save + else + user_activity = UserActivity.new + user_activity.act_id = self.principal_act_id + user_activity.act_type = self.principal_act_type + user_activity.container_type = "Principal" + user_activity.container_id = self.principal_id + user_activity.user_id = self.user_id + user_activity.save + end + end + + def destroy_user_activity + user_activity = UserActivity.where("act_type = '#{self.principal_act_type.to_s}' and act_id = '#{self.principal_act_id}'") + user_activity.destroy_all + end +end diff --git a/app/models/project.rb b/app/models/project.rb index 0cd6af35b..fcc96c404 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -91,8 +91,10 @@ class Project < ActiveRecord::Base has_many :tags, :through => :project_tags, :class_name => 'Tag' has_many :project_tags, :class_name => 'ProjectTags' + # 动态级联删除 + has_many :forge_activities, :class_name => 'ForgeActivity', :dependent => :destroy # 关联虚拟表 - has_many :forge_messages, :class_name =>'ForgeMessage', :as => :forge_message, :dependent => :destroy + has_many :forge_messages, :class_name =>'ForgeMessage', :as => :forge_message, :dependent => :destroy belongs_to :organization diff --git a/app/models/school.rb b/app/models/school.rb index a180eefbe..6cafb0473 100644 --- a/app/models/school.rb +++ b/app/models/school.rb @@ -1,5 +1,5 @@ class School < ActiveRecord::Base - attr_accessible :name, :province + attr_accessible :name, :province,:pinyin has_many :courses def to_s diff --git a/app/models/user.rb b/app/models/user.rb index 0ed8aeda0..d66785460 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -114,6 +114,7 @@ class User < Principal has_many :students_for_courses #has_many :courses, :through => :students_for_courses, :source => :project has_many :acts, :class_name => 'Activity', :as => :act, :dependent => :destroy + has_many :principal_acts, :class_name => 'PrincipalActivity',:as =>:principal_act ,:dependent => :destroy has_many :file_commit, :class_name => 'Attachment', :foreign_key => 'author_id', :conditions => "container_type = 'Project' or container_type = 'Version'" #### # added by bai @@ -211,7 +212,7 @@ class User < Principal before_save :update_hashed_password before_destroy :remove_references_before_destroy # added by fq - after_create :act_as_activity, :add_onclick_time + after_create :act_as_activity, :add_onclick_time, :act_as_principal_activity # end # 更新邮箱用户或用户名的同事,同步更新邀请信息 after_update :update_invite_list @@ -1006,6 +1007,11 @@ class User < Principal self.acts << Activity.new(:user_id => self.id) end + #用户动态公共表记录 + def act_as_principal_activity + self.principal_acts << PrincipalActivity.new(:user_id => self.id,:principal_id => self.id) + end + # 注册用户的时候消息默认点击时间为用户创建时间 def add_onclick_time if OnclickTime.where("user_id =?" , self.id).first.nil? diff --git a/app/views/attachments/_form_course.html.erb b/app/views/attachments/_form_course.html.erb index b0ab39b5a..b66632c7f 100644 --- a/app/views/attachments/_form_course.html.erb +++ b/app/views/attachments/_form_course.html.erb @@ -42,7 +42,9 @@
<% content_for :header_tags do %> diff --git a/app/views/boards/_course_message_edit.html.erb b/app/views/boards/_course_message_edit.html.erb new file mode 100644 index 000000000..16807afb0 --- /dev/null +++ b/app/views/boards/_course_message_edit.html.erb @@ -0,0 +1,16 @@ + +讨论区共有<%= @topic_count %>个帖子
-<% if @topics.any? %> - <% @topics.each do |topic| %> -:
- - - <% if topic.course_editable_by?(User.current) %> - <%= l(:button_edit) %> - <% end %> - - <%= link_to(l(:button_delete), {:controller =>'messages',:action => 'destroy', :id => topic.id, :board_id => topic.board_id, :is_board=>'true'}, - :method => :post, - :data => {:confirm => l(:text_are_you_sure)}, - :class => 'talk_edit fr', - :style => ' margin-right: 10px;') if topic.destroyable_by?(User.current) %> - - <% if topic.sticky? %> - <%= l(:label_board_sticky)%> - <% end %> - - - -<%= l(:label_no_data) %>
-<% end %> -- <%= @topic.subject %> -
-- 由<%= link_to_user_header @topic.author,false,:class=> 'problem_name' %> - 添加于<%= format_time(@topic.created_on) %> -
-<%= textAreailizable message,:content,:attachments => message.attachments %>
- <%= link_to_attachments_course message, :author => false %> ++ <%= @topic.subject %> +
++ 由<%= link_to_user_header @topic.author,false,:class=> 'problem_name' %> + 添加于<%= format_time(@topic.created_on) %> +
+<%= textAreailizable message,:content,:attachments => message.attachments %>
+ <%= link_to_attachments_course message, :author => false %> +<%= l(:field_identifier) %> | -<%= l(:field_repository_is_default) %> | -<%= l(:label_scm) %> | -<%= l(:label_repository_path) %> | -- | - |
- <%= link_to truncate(repository.identifier), ({:controller => 'repositories', :action => 'show', :id => @project, :repository_id => repository.identifier_param} if repository.identifier.present?) %> | -<%= checked_image repository.is_default? %> | -<%=h repository.scm_name %> | - <%if repository.scm_name=="Git"%> -|||
<%= l(:field_identifier) %> | +<%= l(:field_repository_is_default) %> | +<%= l(:label_scm) %> | +<%= l(:label_repository_path) %> | ++ | + |
+ <%= link_to truncate(repository.identifier), ({:controller => 'repositories', :action => 'show', :id => @project, :repository_id => repository.identifier_param} if repository.identifier.present?) %> | +<%= checked_image repository.is_default? %> | +<%=h repository.scm_name %> | + <%if repository.scm_name=="Git"%> + - <%else %> - - <% end %> -- <% if repository.scm_name=="Git"%> - <%if User.current.allowed_to?(:manage_repository, @project) %> - <%= link_to(l(:label_user_plural), committers_repository_path(repository)) %> - <% end %> - <% end %> - | -- <% if repository.login.to_s==User.current.login.to_s %> - <%= delete_new_link repository_path(repository) %> - <% end %> | -
<%= l(:label_repository_no_data) %>
<% end %> + +<%# 新建版本库 %> +<% if @project.repositories.count == 0 %> + + + <% course_tag = @project.project_type %> + <% if User.current.allowed_to?(:manage_repository, @project) %> + + <%= link_to l(:label_repository_new_repos),"#" , :onclick=>"pro_st_show_ku();", :class => 'c_blue fl' %> + <% end %> + + + + <%= labelled_form_for :repository, @repository, :url =>project_repositories_path(@project),:html => {:id => 'repository-form',:method=>"post",:autocomplete=>'off'} do |f| %> +<%= string %>
diff --git a/app/views/users/_project_message.html.erb b/app/views/users/_project_message.html.erb index 11ca8ef1c..4b83cb906 100644 --- a/app/views/users/_project_message.html.erb +++ b/app/views/users/_project_message.html.erb @@ -49,7 +49,7 @@ <%=count %> )课程名称:<%= ma.course_message.course.name %>(<%= ma.course_message.course.term %>)
作业标题:<%= ma.course_message.name %>
+缺评扣分:<%= ma.course_message.homework_detail_manual.absence_penalty %>分
- 截止日期:<%= ma.course_message.homework_detail_manual.evaluation_end %> 24点 + 匿评截止:<%= ma.course_message.homework_detail_manual.evaluation_end %> 24点
+ <% unless User.current.allowed_to?(:as_teacher, ma.course_message.course)%> +请您尽早完成匿评!如果您在规定时间内未完成匿评,一次将被扣<%= ma.course_message.homework_detail_manual.absence_penalty %>分。
+ <% end%>