分享申请的消息更改
This commit is contained in:
parent
fdefbf3795
commit
9ec488684b
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)},
|
||||
|
|
|
@ -65,7 +65,7 @@
|
|||
</td>
|
||||
<td align="center">
|
||||
<% if homework.status == 1 %>
|
||||
待审核
|
||||
等待回复
|
||||
<% elsif homework.status == 2 %>
|
||||
已通过
|
||||
<% else %>
|
||||
|
|
|
@ -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 %>
|
||||
|
|
|
@ -231,17 +231,17 @@
|
|||
<% end %>
|
||||
<% if ma.course_message_type == "HomeworkCommon" && ma.status == 5 %>
|
||||
<ul class="homepageNewsList fl">
|
||||
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><div class="navHomepageLogo fl"><%= image_tag("/images/trustie_logo1.png", width: "30px", height: "30px", class: "mt3") %></div></a></li>
|
||||
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><div class="navHomepageLogo fl"><%= 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)) %></div></a></li>
|
||||
<li class="homepageNewsPubType fl">
|
||||
<span class="newsBlue homepageNewsPublisher">系统提示</span>
|
||||
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">您有了新的引用作业申请:</span>
|
||||
<%= link_to User.find(ma.apply_user_id).show_name,
|
||||
user_path(User.find(ma.apply_user_id)), :class => "newsBlue homepageNewsPublisher" %>
|
||||
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">申请引用作业:</span>
|
||||
</li>
|
||||
<li class="homepageHomeworkContent fl"><a href="javascript:void(0);" class="newsGrey">
|
||||
<li class="homepageHomeworkContent fl">
|
||||
<% content = ma.content.nil? ? '' : ':'+ ma.content.to_s %>
|
||||
<span title='<%=User.find(ma.apply_user_id).show_name+"申请引用作业\""+"#{HomeworkCommon.find(ma.course_message_id).name}"+"\"#{content}" %>' class ='#{ma.viewed==0 ? "newsBlack" : "newsGrey"}'><%=User.find(ma.apply_user_id).show_name+"申请引用作业\""+"#{HomeworkCommon.find(ma.course_message_id).name}"+"\"#{content}" %></span>
|
||||
<%= 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 "}" %>
|
||||
<!--:onmouseover => "message_titile_show($(this),event)",-->
|
||||
<!--:onmouseout => "message_titile_hide($(this))" %>-->
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li class="homepageHomeworkContentWarn fl">
|
||||
|
@ -262,19 +262,18 @@
|
|||
<% end %>
|
||||
<% if ma.course_message_type == "HomeworkCommon" && ma.status == 6 %>
|
||||
<ul class="homepageNewsList fl">
|
||||
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><div class="navHomepageLogo fl"><%= image_tag("/images/trustie_logo1.png", width: "30px", height: "30px", class: "mt3") %></div></a></li>
|
||||
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><div class="navHomepageLogo fl"><%= image_tag(url_to_avatar(User.find(ma.apply_user_id)), width: "30px", height: "30px", class: "mt3") %></div></a></li>
|
||||
<li class="homepageNewsPubType fl">
|
||||
<span class="newsBlue homepageNewsPublisher">系统提示</span>
|
||||
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">
|
||||
作业申请进度反馈:</span>
|
||||
<%= link_to ma.course_message.user.show_name,
|
||||
user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher" %>
|
||||
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>"><%= ma.apply_result == 1 ? '同意' : '拒绝'%>引用作业:</span>
|
||||
</li>
|
||||
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
|
||||
<span class='#{ma.viewed==0 ? "newsBlack" : "newsGrey"}' title="<%= ma.apply_result == 1 ? '您申请引用作业"'+HomeworkCommon.find(ma.course_message_id).name+'"的申请已通过' : '您申请引用作业"'+HomeworkCommon.find(ma.course_message_id).name+'"的申请被拒绝' %>">
|
||||
<%= ma.apply_result == 1 ?
|
||||
'您申请引用作业"'+HomeworkCommon.find(ma.course_message_id).name+'"的申请已通过'
|
||||
:
|
||||
'您申请引用作业"'+HomeworkCommon.find(ma.course_message_id).name+'"的申请被拒绝' %>
|
||||
</span>
|
||||
<% 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 "}" %>
|
||||
<!--:onmouseover => "message_titile_show($(this),event)",-->
|
||||
<!--:onmouseout => "message_titile_hide($(this))" %>-->
|
||||
</a>
|
||||
|
|
|
@ -8,5 +8,5 @@
|
|||
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
|
||||
"<a href='javascript:' onclick='hideModal();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
|
||||
$('#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 %>
|
Loading…
Reference in New Issue