mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-03 20:00:49 +08:00
init project
This commit is contained in:
22
app/views/admins/course_lists/index.html.erb
Normal file
22
app/views/admins/course_lists/index.html.erb
Normal file
@@ -0,0 +1,22 @@
|
||||
<% define_admin_breadcrumbs do %>
|
||||
<% add_admin_breadcrumb('课程列表') %>
|
||||
<% end %>
|
||||
|
||||
<div class="box search-form-container course-list-list-form">
|
||||
<%= form_tag(admins_course_lists_path, method: :get, class: 'form-inline search-form flex-1', remote: true) do %>
|
||||
<div class="form-group">
|
||||
<label>搜索类型:</label>
|
||||
<% auto_trial_options = [['创建者姓名', 0], ['课程名称', 1]] %>
|
||||
<%= select_tag(:search_type, options_for_select(auto_trial_options), class: 'form-control') %>
|
||||
</div>
|
||||
<%= text_field_tag(:keyword, params[:keyword], class: 'form-control col-sm-2 ml-3', placeholder: '输入关键字搜索') %>
|
||||
<%= submit_tag('搜索', class: 'btn btn-primary ml-3','data-disable-with': '搜索中...') %>
|
||||
<%= link_to "清除",admins_course_lists_path,class: "btn btn-default",id:"course-lists-clear-search",'data-disable-with': '清除中...' %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="box admin-list-container course-list-list-container">
|
||||
<%= render partial: 'admins/course_lists/shared/list', locals: { courses: @course_lists } %>
|
||||
</div>
|
||||
|
||||
<%= render 'admins/course_lists/shared/merge_course_list_modal' %>
|
||||
1
app/views/admins/course_lists/index.js.erb
Normal file
1
app/views/admins/course_lists/index.js.erb
Normal file
@@ -0,0 +1 @@
|
||||
$(".course-list-list-container").html("<%= j render partial: 'admins/course_lists/shared/list', locals: { courses: @course_lists }%>");
|
||||
37
app/views/admins/course_lists/shared/_list.html.erb
Normal file
37
app/views/admins/course_lists/shared/_list.html.erb
Normal file
@@ -0,0 +1,37 @@
|
||||
<table class="table table-hover text-center shixuns-list-table">
|
||||
<thead class="thead-light">
|
||||
<th width="4%">序号</th>
|
||||
<th width="8%">ID</th>
|
||||
<th width="38%" class="text-left">课程名称</th>
|
||||
<th width="10%">课堂数</th>
|
||||
<th width="10%">创建者</th>
|
||||
<th width="12%"><%= sort_tag('创建时间', name: 'created_at', path: admins_course_lists_path) %></th>
|
||||
<th width="18%">操作</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% if courses.present? %>
|
||||
<% courses.each_with_index do |course_list,index| %>
|
||||
<tr id="course-list-item-<%= course_list.id %>">
|
||||
<td><%= list_index_no(@params_page.to_i, index) %></td>
|
||||
<td><%= course_list.id %></td>
|
||||
<td class="text-left"><%= course_list.name %></td>
|
||||
<% course_count = course_list.courses.size %>
|
||||
<td><%= course_count %></td>
|
||||
<td><%= link_to course_list.user.try(:real_name),"/users/#{course_list.user.try(:login)}",target:'_blank' %></td>
|
||||
<td><%= format_time course_list.created_at %></td>
|
||||
<td class="operate">
|
||||
<% if course_count == 0 %>
|
||||
<%= delete_link '删除', admins_course_list_path(course_list, element: ".course-list-item-#{course_list.id}"), class: 'delete-department-action' %>
|
||||
<% end %>
|
||||
<%= javascript_void_link '修改', class: 'action', data: { course_list_id: course_list.id,
|
||||
toggle: 'modal', target: '.admin-merge-course-list-modal', url: merge_admins_course_lists_path } %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<%= render 'admins/shared/no_data_for_table' %>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<%= render partial: 'admins/shared/paginate', locals: { objects: courses } %>
|
||||
@@ -0,0 +1,29 @@
|
||||
<div class="modal fade admin-merge-course-list-modal" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
<div class="modal-dialog modal-dialog-centered" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title">修改课程</h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form class="admin-merge-course-list-form" data-url="<%= merge_admins_course_lists_path %>">
|
||||
<%= hidden_field_tag(:origin_course_list_id, nil) %>
|
||||
|
||||
<div class="form-group d-flex">
|
||||
<label for="course_list_id" class="col-form-label">更改为:</label>
|
||||
<div class="d-flex flex-column-reverse w-75">
|
||||
<input id="course_list_name" name="course_list_name" placeholder="请输入课程名称" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
<div class="error text-danger"></div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
|
||||
<button type="button" class="btn btn-primary submit-btn">确认</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user