<div class="contextual">
  <%= link_to l(:label_course_new), {:controller => 'courses', :action => 'new'}, :class => 'icon icon-add' %>
</div>

<h3>
  <%=l(:label_course_all)%>
</h3>
<%= render 'tab_syllabuses_courses' %>

<h3>
  班级列表
</h3>

<%= form_tag({}, :method => :get) do %>
    <fieldset>
      <label for='name'>
        班级:
      </label>
      <%= text_field_tag 'name', params[:name], :size => 30, :placeholder => '班级、老师名称' %>
      <%= submit_tag l(:button_apply), :class => "small", :name => nil %>
      <%= link_to l(:button_clear), {:controller => 'admin', :action => 'courses'}, :class => 'icon icon-reload' %>
    </fieldset>
<% end %>
&nbsp;

<div class="autoscroll">
  <table class="list" style="width: 100%;table-layout: fixed">
    <thead>
    <tr>
      <th style="width: 20px;">
        序号
      </th>
      <th style="width: 70px;">
        班级
      </th>
      <th style="width: 35px;">
        主讲老师
      </th>
      <th style="width: 20px;">
        学时
      </th>
      <th style="width: 15px;">
        <%=l(:field_is_public)%>
      </th>
      <th style="width: 20px;">
        状态
      </th>
      <th style="width: 45px;">
        <%=l(:field_created_on)%>
      </th>
      <th style="width: 45px;">
        动态时间
      </th>
      <th style="width:75px">
        课程
      </th>
      <th style="width:35px">

      </th>
    </tr>
    </thead>
    <tbody>
    <% @courses.each do |course| %>
        <% unless course.teacher.nil? %>
        <tr class="<%= cycle("odd", "even") %>" id="course_<%=course.id %>">
          <%=render :partial => 'courselist_detail_tr', :locals => {:course => course} %>
        </tr>
        <% end %>
    <% end %>
    </tbody>
  </table>
</div>

<div class="pagination">
  <%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false %>
</div>

<script type="text/javascript">
  function select_syllabus(id){
      val = $("#new_syllabus_id_"+id).children('option:selected').val();
      if(val != "0") {
          $.ajax({
              type: "post",
              url: "/admin/select_course_syllabus",
              data: {syllabus_id: val,
                  course_id: id},
              success: function (data) {
              }
          });
      }
  }
</script>
<% html_title(l(:label_course_all)) -%>
