From 9ec488684b1e0aad209c6777b32bf3c29aa3fc47 Mon Sep 17 00:00:00 2001 From: cxt Date: Thu, 12 May 2016 09:30:06 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=86=E4=BA=AB=E7=94=B3=E8=AF=B7=E7=9A=84?= =?UTF-8?q?=E6=B6=88=E6=81=AF=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/apply_homework.rb | 2 +- app/models/homework_common.rb | 1 + app/models/user.rb | 1 + app/views/admin/apply_for_homework.html.erb | 2 +- app/views/users/_homework_repository.html.erb | 2 +- app/views/users/_user_message_course.html.erb | 31 +++++++++---------- app/views/users/apply_for_homework.js.erb | 2 +- 7 files changed, 21 insertions(+), 20 deletions(-) diff --git a/app/models/apply_homework.rb b/app/models/apply_homework.rb index 0a7c505a4..f4ded9733 100644 --- a/app/models/apply_homework.rb +++ b/app/models/apply_homework.rb @@ -1,5 +1,5 @@ class ApplyHomework < ActiveRecord::Base - #status:1. 待审核 2.审核通过 3.已拒绝 + #status:1. 等待回复 2.审核通过 3.已拒绝 belongs_to :user belongs_to :homework_common attr_accessible :status, :user_id, :homework_common_id diff --git a/app/models/homework_common.rb b/app/models/homework_common.rb index f8e222b0f..ac3303c15 100644 --- a/app/models/homework_common.rb +++ b/app/models/homework_common.rb @@ -15,6 +15,7 @@ class HomeworkCommon < ActiveRecord::Base has_many :student_works, :dependent => :destroy, :conditions => "is_test=0" has_many :student_works_evaluation_distributions, :through => :student_works #一个作业的分配的匿评列表 has_many :journals_for_messages, :as => :jour, :dependent => :destroy + has_many :apply_homeworks, :dependent => :destroy has_many :acts, :class_name => 'Activity', :as => :act, :dependent => :destroy #用户活动 # 课程动态 has_many :course_acts, :class_name => 'CourseActivity',:as =>:course_act ,:dependent => :destroy diff --git a/app/models/user.rb b/app/models/user.rb index 2a9a13c73..cf71ec42c 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -108,6 +108,7 @@ class User < Principal has_many :student_works_evaluation_distributions, :dependent => :destroy has_many :student_works_scores, :dependent => :destroy has_many :student_work_projects, :dependent => :destroy + has_many :apply_homeworks, :dependent => :destroy #end has_and_belongs_to_many :groups, :after_add => Proc.new {|user, group| group.user_added(user)}, diff --git a/app/views/admin/apply_for_homework.html.erb b/app/views/admin/apply_for_homework.html.erb index 1c7a04901..25d15f707 100644 --- a/app/views/admin/apply_for_homework.html.erb +++ b/app/views/admin/apply_for_homework.html.erb @@ -65,7 +65,7 @@ <% if homework.status == 1 %> - 待审核 + 等待回复 <% elsif homework.status == 2 %> 已通过 <% else %> diff --git a/app/views/users/_homework_repository.html.erb b/app/views/users/_homework_repository.html.erb index 738de678c..6443942fb 100644 --- a/app/views/users/_homework_repository.html.erb +++ b/app/views/users/_homework_repository.html.erb @@ -43,7 +43,7 @@ <% if ah.nil? %> <%= link_to("请求分享", apply_homework_user_path(User.current.id,:homework_id => homework.id), :class => 'green_btn_share c_white', :remote => true) %> <% elsif ah.status == 1 %> - 待审核 + 等待回复 <% elsif ah.status == 2 %> 可引用 <% elsif ah.status == 3 %> diff --git a/app/views/users/_user_message_course.html.erb b/app/views/users/_user_message_course.html.erb index f3942d95e..9d49f687f 100644 --- a/app/views/users/_user_message_course.html.erb +++ b/app/views/users/_user_message_course.html.erb @@ -231,17 +231,17 @@ <% end %> <% if ma.course_message_type == "HomeworkCommon" && ma.status == 5 %>