<table class="table table-hover text-center subject-list-table"> <thead class="thead-light"> <tr> <th width="14%" class="text-left">名称</th> <th width="6%">阶段数</th> <th width="6%">实训数</th> <th width="8%">技术体系</th> <th width="8%">等级体系</th> <th width="8%">封面</th> <th width="8%">二维码图片</th> <th width="7%">创建者</th> <th width="10%">单位</th> <th width="6%">开课人数</th> <th width="10%"><%= sort_tag('创建时间', name: 'created_at', path: admins_subjects_path) %></th> <th width="7%">状态</th> <th width="9%">操作</th> </tr> </thead> <tbody> <% if subjects.present? %> <% subjects.each do |subject| %> <tr class="subject-item-<%= subject.id %>"> <td class="text-left"> <%= link_to(subject.name, "/paths/#{subject.id}", target: '_blank') %> <span class="badge badge-pill badge-success homepage-show-badge" style="<%= subject.homepage_show? ? '' : 'display:none' %>">首页</span> <span class="badge badge-pill badge-info excellent-badge" style="<%= subject.excellent? ? '' : 'display:none' %>">金课</span> </td> <td><%= subject.stages_count %></td> <td><%= subject.shixuns_count %></td> <td><%= display_text subject.repertoire&.name %></td> <td><%= display_text subject.subject_level_system&.name %></td> <td> <% image_exists = Util::FileManage.exists?(subject) %> <%= image_tag(image_exists ? Util::FileManage.source_disk_file_url(subject) : '', height: 40, class: "w-100 preview-image subject-image-#{subject.id}", style: image_exists ? '' : 'display:none') %> <%= javascript_void_link image_exists ? '重新上传' : '上传图片', class: 'action upload-image-action', data: { source_id: subject.id, source_type: 'Subject', toggle: 'modal', target: '.admin-upload-file-modal' } %> </td> <td class="subject-setting-qrcode-image"> <% codeImageExists = Util::FileManage.exists?(subject, '_qrcode') %> <% imageUrl = codeImageExists ? Util::FileManage.source_disk_file_url(subject, '_qrcode') : '' %> <%= image_tag(imageUrl, width: 60, height: 40, class: "preview-image subject-weapp-image-#{subject.id}", data: { toggle: 'tooltip', title: '点击预览' }, style: codeImageExists ? '' : 'display:none') %> <%= raw '<br/>' if codeImageExists %> <%= javascript_void_link codeImageExists ? '重新上传' : '上传图片', class: 'action upload-subject-qrcode-image-action', data: { source_id: subject.id, source_type: 'Subject', suffix: '_qrcode', toggle: 'modal', target: '.admin-upload-file-modal' } %> </td> <td><%= subject.user.real_name %></td> <td><%= subject.user.school_name %></td> <td><%= subject.student_count %></td> <td><%= subject.created_at&.strftime('%Y-%m-%d %H:%M') %></td> <td> <%= display_subject_status(subject) %> </td> <td class="action-container"> <%= link_to('编辑', edit_admins_subject_path(subject), remote: true, class: 'edit-action') %> <%= javascript_void_link('隐藏', class: 'hide-action', data: { id: subject.id }, style: subject.hidden? ? 'display:none' : '') %> <%= javascript_void_link('取消隐藏', class: 'active-action', data: { id: subject.id }, style: subject.hidden? ? '' : 'display:none') %> <div class="d-inline"> <%= javascript_void_link('更多', class: 'action dropdown-toggle', 'data-toggle': 'dropdown', 'aria-haspopup': true, 'aria-expanded': false) %> <div class="dropdown-menu more-action-dropdown"> <% if subject.published? %> <%= javascript_void_link('首页展示', class: 'dropdown-item homepage-show-action', data: { id: subject.id }, style: subject.homepage_show? ? 'display:none' : '') %> <%= javascript_void_link('取消首页展示', class: 'dropdown-item homepage-hide-action', data: { id: subject.id }, style: subject.homepage_show? ? '' : 'display:none') %> <%= javascript_void_link('选为金课', class: 'dropdown-item excellent-action', data: { id: subject.id }, style: subject.excellent? ? 'display:none' : '') %> <%= javascript_void_link('取消金课', class: 'dropdown-item cancel-excellent-action', data: { id: subject.id }, style: subject.excellent? ? '' : 'display:none') %> <% end %> <%= delete_link '删除', admins_subject_path(subject, element: ".subject-item-#{subject.id}"), class: 'dropdown-item delete-subject-action' %> </div> </div> </td> </tr> <% end %> <% else %> <%= render 'admins/shared/no_data_for_table' %> <% end %> </tbody> </table> <%= render partial: 'admins/shared/paginate', locals: { objects: subjects } %>