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 %>
- <%= image_tag("/images/trustie_logo1.png", width: "30px", height: "30px", class: "mt3") %>
+ <%= link_to image_tag(url_to_avatar(User.find(ma.apply_user_id)), :width => "30", :height => "30"), user_path(User.find(ma.apply_user_id)) %>
-
- 系统提示
- ">您有了新的引用作业申请:
+ <%= link_to User.find(ma.apply_user_id).show_name,
+ user_path(User.find(ma.apply_user_id)), :class => "newsBlue homepageNewsPublisher" %>
+ ">申请引用作业:
- -
+
-
<% content = ma.content.nil? ? '' : ':'+ ma.content.to_s %>
- <%=User.find(ma.apply_user_id).show_name+"申请引用作业\""+"#{HomeworkCommon.find(ma.course_message_id).name}"+"\"#{content}" %>
+ <%= link_to User.find(ma.apply_user_id).show_name+"申请引用作业\""+"#{HomeworkCommon.find(ma.course_message_id).name}"+"\"#{content}", student_work_index_path(:homework => ma.course_message.id), :title => User.find(ma.apply_user_id).show_name+"申请引用作业\""+"#{HomeworkCommon.find(ma.course_message_id).name}"+"\"#{content}",:class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey "}" %>
-
-
@@ -262,19 +262,18 @@
<% end %>
<% if ma.course_message_type == "HomeworkCommon" && ma.status == 6 %>
- <%= image_tag("/images/trustie_logo1.png", width: "30px", height: "30px", class: "mt3") %>
+ <%= image_tag(url_to_avatar(User.find(ma.apply_user_id)), width: "30px", height: "30px", class: "mt3") %>
-
- 系统提示
- ">
- 作业申请进度反馈:
+ <%= link_to ma.course_message.user.show_name,
+ user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher" %>
+ "><%= ma.apply_result == 1 ? '同意' : '拒绝'%>引用作业:
-
- ">
- <%= ma.apply_result == 1 ?
- '您申请引用作业"'+HomeworkCommon.find(ma.course_message_id).name+'"的申请已通过'
- :
- '您申请引用作业"'+HomeworkCommon.find(ma.course_message_id).name+'"的申请被拒绝' %>
-
+ <% link_str = ma.apply_result == 1 ?
+ '您申请引用作业"'+HomeworkCommon.find(ma.course_message_id).name+'"的申请已通过'
+ :
+ '您申请引用作业"'+HomeworkCommon.find(ma.course_message_id).name+'"的申请被拒绝' %>
+ <%= link_to link_str, student_work_index_path(:homework => ma.course_message.id), :title => link_str,:class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey "}" %>
diff --git a/app/views/users/apply_for_homework.js.erb b/app/views/users/apply_for_homework.js.erb
index ad3c6ed76..7eac2fb5f 100644
--- a/app/views/users/apply_for_homework.js.erb
+++ b/app/views/users/apply_for_homework.js.erb
@@ -8,5 +8,5 @@
$('#ajax-modal').before("" +
"");
$('#ajax-modal').parent().css("top","30%").css("left","30%").css("position","fixed").css("border","3px solid #269ac9");
- $("#homework_apply_status_<%=@homework.id %>").html("待审核");
+ $("#homework_apply_status_<%=@homework.id %>").html("等待回复");
<% end %>
\ No newline at end of file
|