技术体系

dev_video
daiao 5 years ago
parent ba19c7395e
commit beb1a85f95

@ -0,0 +1,15 @@
class Admins::RepertoiresController < Admins::BaseController
def index
@repertoires = Repertoire.all
end
def edit
@repertoire = current_repertoire
end
private
def current_repertoire
@_current_repertoire = Repertoire.find params[:id]
end
end

@ -0,0 +1,2 @@
$('.admin-modal-container').html("<%= j( render partial: 'admins/repertoires/shared/edit_repertoire_modal', locals: { repertoire: @repertoire } ) %>");
$('.modal.admin-edit-repertoires-modal').modal('show');

@ -0,0 +1,15 @@
<% define_admin_breadcrumbs do %>
<% add_admin_breadcrumb('技术体系', admins_repertoires_path) %>
<% end %>
<div class="box search-form-container repertoires-list-form rig">
<div class="flex-1">
<%= javascript_void_link '新增', class: 'btn btn-primary', data: { toggle: 'modal', target: '.admin-create-repertoires-modal' } %>
</div>
</div>
<div class="box admin-list-container repertoires-list-container">
<%= render(partial: 'admins/repertoires/shared/list') %>
</div>
<%= render 'admins/repertoires/shared/create_repertoire_modal' %>

@ -0,0 +1,23 @@
<div class="modal fade admin-edit-repertoire-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">&times;</span>
</button>
</div>
<div class="modal-body">
<%= simple_form_for([:admins, repertoire], html: { class: 'admin-edit-repertoire-form' }, defaults: { wrapper_html: { class: 'offset-md-1 col-md-10' } }) do |f| %>
<%= f.input :name, as: :string, label: '名称' %>
<div class="error text-danger"></div>
<% end %>
</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>

@ -0,0 +1,27 @@
<table class="table table-hover text-center repertoires-list-table">
<thead class="thead-light">
<tr>
<th width="6%">序号</th>
<th width="54%" class="text-left">技术体系</th>
<th width="16%">操作</th>
</tr>
</thead>
<tbody>
<% if @repertoires.present? %>
<% @repertoires.each_with_index do |repertoire, index| %>
<tr class="repertoire-item discipline-item-<%= repertoire.id %>">
<td><%= index + 1 %></td>
<td class="text-left">
<span><%= link_to repertoire.name, admins_sub_repertoires_path(repertoire_id: repertoire), :title => repertoire.name %></span>
</td>
<td>
<%= link_to '编辑', edit_admins_repertoire_path(repertoire), remote: true, class: 'action' %>
<%= delete_link '删除', admins_repertoire_path(repertoire, element: ".repertoire-item-#{repertoire.id}"), class: 'delete-repertoire-action' %>
</td>
</tr>
<% end %>
<% else %>
<%= render 'admins/shared/no_data_for_table' %>
<% end %>
</tbody>
</table>

@ -86,6 +86,12 @@
<% end %>
</li>
<li>
<%= sidebar_item_group('#other-submenu', '其他', icon: 'list-alt') do %>
<li><%= sidebar_item(admins_repertoires_path, '技术体系', icon: 'sitemap', controller: 'admins-repertoire') %></li>
<% end %>
</li>
<li>
<%= sidebar_item_group('#major-identification-submenu', '工程认证', icon: 'anchor') do %>
<li><%= sidebar_item(admins_major_informations_path, '本科专业目录', icon: 'outdent', controller: 'admins-major_informations') %></li>

@ -1329,6 +1329,9 @@ Rails.application.routes.draw do
resources :disciplines, only: [:index, :create, :edit, :update, :destroy]
resources :sub_disciplines, only: [:index, :create, :edit, :update, :destroy]
resources :tag_disciplines, only: [:index, :create, :edit, :update, :destroy]
resources :repertoires, only: [:index, :create, :edit, :update, :destroy]
resources :sub_repertoires, only: [:index, :create, :edit, :update, :destroy]
end
namespace :cooperative do

Loading…
Cancel
Save