socialforge/app/views/users/_homework_repository.html.erb

58 lines
2.8 KiB
Plaintext
Raw Normal View History

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">
<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) %>')">
<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>
<% 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>
<% 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 %>">
<% 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) %>
<% elsif ah.status == 1 %>
2016-05-12 09:30:06 +08:00
等待回复
<% elsif ah.status == 2 %>
可引用
<% elsif ah.status == 3 %>
已拒绝
<% 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>