2016-03-05 03:16:04 +08:00
|
|
|
<script type="text/javascript">
|
|
|
|
function show_homework_detail(url){
|
|
|
|
$.get(
|
|
|
|
url,
|
|
|
|
{
|
|
|
|
|
|
|
|
},
|
|
|
|
function (data) {
|
|
|
|
}
|
|
|
|
);
|
2016-05-04 16:17:37 +08:00
|
|
|
};
|
2016-03-05 03:16:04 +08:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<div class="h450">
|
|
|
|
<% homeworks.each do |homework| %>
|
|
|
|
<ul class="subject-list-row">
|
2016-04-26 15:35:42 +08:00
|
|
|
<li class="subject-list-name fl">
|
2016-03-05 03:16:04 +08:00
|
|
|
<label onclick="show_homework_detail('<%=show_homework_detail_user_path(@user,:homework=>homework.id,:is_import => 0) %>')">
|
2016-04-26 15:35:42 +08:00
|
|
|
<input type="radio" name="checkMenu" class="mr5 subject-name-middle" value="<%= homework.id%>"/>
|
|
|
|
<span title="<%= homework.name%>" class="subject-name-middle subject-name-hidden"><%= homework.name%></span>
|
2016-03-05 03:16:04 +08:00
|
|
|
</label>
|
2016-04-29 15:46:26 +08:00
|
|
|
<% if homework.course.is_public == 0 %>
|
|
|
|
<img src="/images/locked.png" width="16" height="16" alt="私有" title="私有" class="subject-name-middle" />
|
|
|
|
<% end %>
|
2016-03-05 03:16:04 +08:00
|
|
|
</li>
|
|
|
|
<li class="subject-list-from fl hidden"><span title="<%=homework.course.name %>(<%=current_time_and_term(homework.course) %>)"><%=homework.course.name %>(<%=current_time_and_term_short(homework.course) %>)</span></li>
|
|
|
|
<li class="subject-list-type fl">
|
|
|
|
<% case homework.homework_type %>
|
|
|
|
<% when 1 %>
|
|
|
|
普通
|
|
|
|
<% when 2 %>
|
|
|
|
编程
|
|
|
|
<% when 3 %>
|
|
|
|
分组
|
|
|
|
<% end %>
|
|
|
|
</li>
|
|
|
|
<li class="subject-list-publisher fl hidden"><%= homework.user.show_name %></li>
|
|
|
|
<li class="subject-list-count fl" id="subject_count_homework_<%=homework.id %>"><%= homework.quotes %></li>
|
|
|
|
<li class="fl subject-list-date"><%=format_date homework.publish_time %></li>
|
2016-05-13 17:11:53 +08:00
|
|
|
<% if homework.user != User.current && (homework.course.is_public == 0 && !User.current.allowed_to?(:as_teacher,homework.course)) %>
|
|
|
|
<li class="fl subject-list-option" id="homework_apply_status_<%=homework.id %>">
|
2016-04-29 15:46:26 +08:00
|
|
|
<% ah = ApplyHomework.where("user_id = ? and homework_common_id = ?", User.current.id, homework.id).first %>
|
|
|
|
<% if ah.nil? %>
|
2016-05-04 16:17:37 +08:00
|
|
|
<%= link_to("请求分享", apply_homework_user_path(User.current.id,:homework_id => homework.id), :class => 'green_btn_share c_white', :remote => true) %>
|
2016-04-29 15:46:26 +08:00
|
|
|
<% elsif ah.status == 1 %>
|
2016-05-12 09:30:06 +08:00
|
|
|
等待回复
|
2016-04-29 15:46:26 +08:00
|
|
|
<% elsif ah.status == 2 %>
|
|
|
|
可引用
|
2016-04-29 17:55:57 +08:00
|
|
|
<% elsif ah.status == 3 %>
|
|
|
|
已拒绝
|
2016-04-29 15:46:26 +08:00
|
|
|
<% end %>
|
|
|
|
</li>
|
|
|
|
<% else %>
|
|
|
|
<li class="fl subject-list-option" id="homework_apply_status_<%=homework.id %>"><a href="javascript:void(0);">--</a></li>
|
|
|
|
<% end %>
|
2016-03-05 03:16:04 +08:00
|
|
|
</ul>
|
|
|
|
<% end %>
|
2016-03-03 17:04:38 +08:00
|
|
|
</div>
|