mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-03 03:40:49 +08:00
init project
This commit is contained in:
8
app/views/admins/mirror_scripts/edit.html.erb
Normal file
8
app/views/admins/mirror_scripts/edit.html.erb
Normal file
@@ -0,0 +1,8 @@
|
||||
<% define_admin_breadcrumbs do %>
|
||||
<% add_admin_breadcrumb('镜像管理', admins_mirror_repositories_path) %>
|
||||
<% add_admin_breadcrumb(current_mirror.type_name, edit_admins_mirror_repository_path(current_mirror)) %>
|
||||
<% add_admin_breadcrumb('脚本列表', admins_mirror_repository_mirror_scripts_path(current_mirror)) %>
|
||||
<% add_admin_breadcrumb('编辑脚本') %>
|
||||
<% end %>
|
||||
|
||||
<%= render partial: 'admins/mirror_scripts/shared/form', locals: { mirror: current_mirror, script: @script, form_action: 'update' } %>
|
||||
14
app/views/admins/mirror_scripts/index.html.erb
Normal file
14
app/views/admins/mirror_scripts/index.html.erb
Normal file
@@ -0,0 +1,14 @@
|
||||
<% define_admin_breadcrumbs do %>
|
||||
<% add_admin_breadcrumb('镜像管理', admins_mirror_repositories_path) %>
|
||||
<% add_admin_breadcrumb(current_mirror.type_name, edit_admins_mirror_repository_path(current_mirror)) %>
|
||||
<% add_admin_breadcrumb('脚本列表') %>
|
||||
<% end %>
|
||||
|
||||
<div class="box search-form-container mirror-script-list-form">
|
||||
<form class="flex-1"></form>
|
||||
<%= link_to '新建', new_admins_mirror_repository_mirror_script_path(current_mirror), class: 'btn btn-primary' %>
|
||||
</div>
|
||||
|
||||
<div class="box admin-list-container mirror-script-list-container">
|
||||
<%= render partial: 'admins/mirror_scripts/shared/list', locals: { mirror: current_mirror, scripts: @scripts } %>
|
||||
</div>
|
||||
8
app/views/admins/mirror_scripts/new.html.erb
Normal file
8
app/views/admins/mirror_scripts/new.html.erb
Normal file
@@ -0,0 +1,8 @@
|
||||
<% define_admin_breadcrumbs do %>
|
||||
<% add_admin_breadcrumb('镜像管理', admins_mirror_repositories_path) %>
|
||||
<% add_admin_breadcrumb(current_mirror.type_name, edit_admins_mirror_repository_path(current_mirror)) %>
|
||||
<% add_admin_breadcrumb('脚本列表', admins_mirror_repository_mirror_scripts_path(current_mirror)) %>
|
||||
<% add_admin_breadcrumb('新建脚本') %>
|
||||
<% end %>
|
||||
|
||||
<%= render partial: 'admins/mirror_scripts/shared/form', locals: { mirror: current_mirror, script: @script, form_action: 'create' } %>
|
||||
12
app/views/admins/mirror_scripts/shared/_form.html.erb
Normal file
12
app/views/admins/mirror_scripts/shared/_form.html.erb
Normal file
@@ -0,0 +1,12 @@
|
||||
<div class="box edit-mirror-script-container">
|
||||
<%= simple_form_for([:admins, mirror, script], url: { action: form_action }, html: { class: 'script-form' }) do |f| %>
|
||||
<%= f.input :script_type, label: '名称', input_html: { class: 'col-md-6' } %>
|
||||
<%= f.input :description, as: :text, label: '说明', input_html: { class: 'col-md-6' } %>
|
||||
<%= f.input :script, as: :text, label: '评测脚本' %>
|
||||
|
||||
<div class="form-row">
|
||||
<%= f.button :submit, value: '保存', class: 'btn-primary mr-3 px-4', 'data-disable-with': '保存中...' %>
|
||||
<%= link_to '取消', admins_mirror_repository_mirror_scripts_path(mirror), class: 'btn btn-secondary px-4' %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
32
app/views/admins/mirror_scripts/shared/_list.html.erb
Normal file
32
app/views/admins/mirror_scripts/shared/_list.html.erb
Normal file
@@ -0,0 +1,32 @@
|
||||
<table class="table table-hover text-center mirror-script-list-table">
|
||||
<thead class="thead-light">
|
||||
<tr>
|
||||
<th width="10%">ID</th>
|
||||
<th width="20%" class="text-left">名称</th>
|
||||
<th width="34%" class="text-left">说明</th>
|
||||
<th width="16%">更新时间</th>
|
||||
<th width="20%">操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% if scripts.present? %>
|
||||
<% scripts.each do |script| %>
|
||||
<tr class="mirror-script-item-<%= script.id %>">
|
||||
<td><%= script.id %></td>
|
||||
<td class="text-left"><%= overflow_hidden_span script.script_type, width: 200 %></td>
|
||||
<td class="text-left"><%= overflow_hidden_span script.description, width: 400 %></td>
|
||||
<td><%= script.updated_at.strftime('%Y-%m-%d %H:%M') %></td>
|
||||
<td class="action-container">
|
||||
<%= link_to '编辑', edit_admins_mirror_repository_mirror_script_path(mirror, script), class: 'action edit-action' %>
|
||||
|
||||
<%= delete_link '删除', admins_mirror_repository_mirror_script_path(mirror, script, element: ".mirror-script-item-#{script.id}"), class: 'delete-mirror-script-action' %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<%= render 'admins/shared/no_data_for_table' %>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<%= render partial: 'admins/shared/paginate', locals: { objects: scripts } %>
|
||||
Reference in New Issue
Block a user