课程大纲列表

cxt_course
cxt 9 years ago
parent a50e15b2ab
commit 3b7679b254

@ -17,15 +17,17 @@
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<div class="syllabus_courses_box">
<% if @syllabus.any? %> <% if @syllabus.any? %>
<% @syllabus.each_with_index do |syllabus, index|%> <% @syllabus.each_with_index do |syllabus, index|%>
<div class="syllabus_courses_box">
<% courses = @courses.where("syllabus_id = #{syllabus.id}").select("courses.*,(SELECT MAX(updated_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS time").order("time desc") %> <% courses = @courses.where("syllabus_id = #{syllabus.id}").select("courses.*,(SELECT MAX(updated_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS time").order("time desc") %>
<div class="syllabus_courses_list"> <div class="syllabus_courses_list">
<div class="<%=index == 0 ? 'sy_courses_open' : 'sy_courses_close' %>"> <div class="<%=index == 0 ? 'sy_courses_open' : 'sy_courses_close' %>">
<span class="<%=index == 0 ? 'icons_sy_open' : 'icons_sy_close' %> fl mr5"></span> <span class="<%=index == 0 ? 'icons_sy_open' : 'icons_sy_close' %> fl mr5"></span>
<h3 class="syllabus_courses_title fl"><%=syllabus.title %></h3> <h3 class="syllabus_courses_title fl"><%=syllabus.title %></h3>
</div> </div>
<%=link_to '', syllabus_path(syllabus.id), :class => 'icons_sy_setting fr',:target => '_blank', :title => '查看课程' %>
<p class="fl sy_p_grey">更新时间:<%=format_date syllabus.updated_at %> <p class="fl sy_p_grey">更新时间:<%=format_date syllabus.updated_at %>
<span class="mr10"></span>创建老师:<%=syllabus.user.show_name %> <span class="mr10"></span>创建老师:<%=syllabus.user.show_name %>
<span class="mr10"></span>班级:<%=courses.count %> <span class="mr10"></span>班级:<%=courses.count %>
@ -65,10 +67,8 @@
<% end %> <% end %>
</ul> </ul>
</div><!--syllabus_class_box end--> </div><!--syllabus_class_box end-->
</div>
<% end %>
<%=link_to '', syllabus_path(syllabus.id), :class => 'icons_sy_setting fr', :title => '管理课程' %>
<% end %>
<div> <div>
<ul class="wlist" id="pages" > <ul class="wlist" id="pages" >
<%= pagination_links_full @atta_pages, @atta_count, :per_page_links => false, :remote => @is_remote, :flag => true %> <%= pagination_links_full @atta_pages, @atta_count, :per_page_links => false, :remote => @is_remote, :flag => true %>
@ -78,7 +78,6 @@
<% else %> <% else %>
<p class="nodata"><%= l(:label_no_data) %></p> <p class="nodata"><%= l(:label_no_data) %></p>
<% end %> <% end %>
</div>
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
@ -91,22 +90,23 @@
var tmpHeight = $(".syllabus_box").height() + diffHeight; var tmpHeight = $(".syllabus_box").height() + diffHeight;
$(".syllabus_box").css("height", tmpHeight); $(".syllabus_box").css("height", tmpHeight);
} }
$(".syllabus_courses_list").toggle(function(){ $(".sy_courses_open").toggle(function(){
$(this).next().hide(); //$(this).hide();
$(this).children(":first-child").children(":first-child").addClass("icons_sy_close").removeClass("icons_sy_open"); $(this).parent().next().hide();
$(this).children(":first-child").addClass("icons_sy_close").removeClass("icons_sy_open");
//$(this).parent().next().show(); //$(this).parent().next().show();
},function(){ },function(){
$(this).next().show(); $(this).parent().next().show();
$(this).children(":first-child").children(":first-child").addClass("icons_sy_open").removeClass("icons_sy_close"); $(this).children(":first-child").addClass("icons_sy_open").removeClass("icons_sy_close");
}); });
$(".sy_courses_close").toggle(function(){ $(".sy_courses_close").toggle(function(){
//$(this).hide(); //$(this).hide();
$(this).next().show(); $(this).parent().next().show();
$(this).children(":first-child").children(":first-child").addClass("icons_sy_open").removeClass("icons_sy_close"); $(this).children(":first-child").addClass("icons_sy_open").removeClass("icons_sy_close");
//$(this).parent().next().show(); //$(this).parent().next().show();
},function(){ },function(){
$(this).next().hide(); $(this).parent().next().hide();
$(this).children(":first-child").children(":first-child").addClass("icons_sy_close").removeClass("icons_sy_open"); $(this).children(":first-child").addClass("icons_sy_close").removeClass("icons_sy_open");
}); });
}); });
</script> </script>
Loading…
Cancel
Save