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

56 lines
2.6 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) {
}
);
}
</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.course.is_public == 0 && homework.user_id != User.current.id %>
<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? %>
<%= link_to("提交申请", apply_for_homework_user_path(User.current.id,:homework_id => homework.id), :remote => true) %>
<% elsif ah.status == 1 %>
待审核
<% elsif ah.status == 2 %>
可引用
<% 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>