socialforge/app/views/admin/courses.html.erb

85 lines
2.4 KiB
Plaintext
Raw Normal View History

2015-07-01 17:34:17 +08:00
<div class="contextual">
<%= link_to l(:label_course_new), {:controller => 'courses', :action => 'new'}, :class => 'icon icon-add' %>
</div>
<h3>
<%=l(:label_course_all)%>
</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'},:remote => true, :class => 'icon icon-reload' %>
2015-07-01 17:34:17 +08:00
</fieldset>
<% end %>
&nbsp;
<div class="autoscroll">
<table class="list" style="width: 100%;table-layout: fixed">
<thead>
<tr>
<th style="width: 30px;">
序号
</th>
<th style="width: 85px;">
2015-07-01 17:34:17 +08:00
课程
</th>
<th style="width: 35px;">
2015-07-01 17:34:17 +08:00
主讲老师
</th>
<th style="width: 30px;">
学时
</th>
<th style="width: 20px;">
<%=l(:field_is_public)%>
</th>
<th style="width: 60px;">
2015-07-01 17:34:17 +08:00
<%=l(:field_created_on)%>
</th>
<th style="width: 65px;">
动态时间
</th>
2015-07-01 17:34:17 +08:00
</tr>
</thead>
<tbody>
<% @courses.each do |course| %>
<tr class="<%= cycle("odd", "even") %>">
<td style="text-align: center;">
<%= course.id %>
</td>
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="name" title='<%=course.name%>'>
<span>
<%= link_to(course.name, course_path(course.id)) %>
</span>
</td>
<td align="center">
<%= link_to(course.try(:teacher).try(:realname).truncate(6, omission: '...'), user_path(course.teacher)) %>
</td>
<td align="center">
<%= course.class_period %>
</td>
<td class="center">
<%= checked_image course.is_public? %>
</td>
<td class="center">
<%= format_date(course.created_at) %>
</td>
<td class="center">
<%= course.updated_at.strftime('%Y-%m-%d %H:%M:%S') %>
</td>
2015-07-01 17:34:17 +08:00
</tr>
<% end %>
</tbody>
</table>
</div>
<div class="pagination">
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false %>
</div>
2015-07-01 17:34:17 +08:00
<% html_title(l(:label_course_all)) -%>