<%= content_for(:header_tags) do %>
    <%= import_ke(enable_at: true, prettify: false, init_activity: true) %>
<% end %>

<div id="user_homework_list">
<% homework_commons.each do |homework_common|%>
    <script type="text/javascript">
        $(function() {
            sd_create_editor_from_data(<%= homework_common.id%>, null, "100%", "<%=homework_common.class.to_s%>");
        });

        function expand_reply(container,btnid){
            var target = $(container);
            var btn = $(btnid);
            if(btn.data('init')=='0'){
                btn.data('init',1);
                btn.html('收起回复');
                target.show();
            }else{
                btn.data('init',0);
                btn.html('展开更多');
                target.hide();
                target.eq(0).show();
                target.eq(1).show();
                target.eq(2).show();
            }
        }
    </script>
    <%= render :partial => 'users/user_homework_detail', :locals => {:homework_common => homework_common,:is_in_course => is_in_course} %>
<% end%>
<% if homework_commons.count == 10%>
    <% if is_in_course == 1%>
        <!-- 在课程内 -->
        <%#= link_to "点击展开更多",homework_common_index_path(:course => course_id,:page => page,:is_in_course => is_in_course),:id => "user_show_more_homework",:remote => "true",:class => "loadMore f_grey"%>
    <% else%>
        <!-- 在个人主页 -->
        <%= link_to "点击展开更多",student_homeworks_user_path(User.current.id,:page => page,:is_in_course => is_in_course),:id => "user_show_more_homework",:remote => "true",:class => "loadMore f_grey"%>
    <% end%>
<% end%>
</div>
