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

44 lines
1.5 KiB
Plaintext
Raw Normal View History

<script type="text/javascript">
var scrollHandler = function(){
if ($(window).scrollTop() == $(document).height() - $(window).height()) {
$.get(
'<%= user_homeworks_user_path(User.current.id)%>',
{ page : $("#user_show_more_homework").val()},
function (data) {
}
);
}
};
$(window).scroll(scrollHandler);
</script>
2015-08-25 13:50:42 +08:00
<% if User.current.user_extensions && User.current.user_extensions.identity == 0 && User.current.allowed_to?(:add_course, nil, :global => true)%>
<!-- 老师身份才可以发布作业 -->
2015-08-28 11:55:32 +08:00
<div class="resources mb10">
<div class="homepageRightBanner">
2015-08-25 13:50:42 +08:00
<div class="NewsBannerName">发布作业</div>
</div>
2015-08-28 11:55:32 +08:00
</div>
<div class="cl"></div>
<div class="HomeWork">
2015-08-26 13:56:37 +08:00
<% homework = HomeworkCommon.new %>
2015-08-26 17:29:47 +08:00
<%= labelled_form_for homework,:url => user_new_homework_users_path,:method => "post" do |f| %>
2015-08-28 11:32:57 +08:00
<div id="HomeWorkCon">
<%= render :partial => 'users/user_homework_form', :locals => { :homework => homework,:f => f,:edit_mode => false } %>
</div>
2015-08-26 13:56:37 +08:00
<% end%>
2015-08-25 13:50:42 +08:00
</div><!----HomeWork end-->
2015-08-26 17:37:53 +08:00
<%else%>
<div class="resources mb10">
<div class="homepageRightBanner">
<div class="NewsBannerName">作业</div>
</div>
</div>
<div class="cl"></div>
2015-08-25 13:50:42 +08:00
<% end%>
<%= render :partial => 'users/user_homework_list', :locals => {:homework_commons => @homework_commons,:page => 0} %>