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:
3
app/views/admins/ec_templates/create_template.js.erb
Normal file
3
app/views/admins/ec_templates/create_template.js.erb
Normal file
@@ -0,0 +1,3 @@
|
||||
$(".ec-templates-new-add").modal("hide")
|
||||
$(".ec-templates-list-container").html("<%= j render partial: "admins/ec_templates/shared/list", locals: {templates: @templates} %>")
|
||||
show_success_flash()
|
||||
15
app/views/admins/ec_templates/index.html.erb
Normal file
15
app/views/admins/ec_templates/index.html.erb
Normal file
@@ -0,0 +1,15 @@
|
||||
<% define_admin_breadcrumbs do %>
|
||||
<% add_admin_breadcrumb('导入模板管理') %>
|
||||
<% end %>
|
||||
|
||||
<div class="box search-form-container ec-templates-list-form">
|
||||
<%= javascript_void_link '新增', class: 'btn btn-primary', data: { toggle: 'modal', target: '.ec-templates-new-add' } %>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="box admin-list-container ec-templates-list-container">
|
||||
<%= render(partial: 'admins/ec_templates/shared/list', locals: { templates: @templates }) %>
|
||||
</div>
|
||||
|
||||
<%= render partial: "admins/ec_templates/shared/templates_add_modal" %>
|
||||
<%#= render partial: "admins/auth_schools/shared/user_add_modal" %>
|
||||
1
app/views/admins/ec_templates/index.js.erb
Normal file
1
app/views/admins/ec_templates/index.js.erb
Normal file
@@ -0,0 +1 @@
|
||||
$(".ec-templates-list-container").html("<%= j render partial: "admins/ec_templates/shared/list", locals: {templates: @templates} %>")
|
||||
35
app/views/admins/ec_templates/shared/_list.html.erb
Normal file
35
app/views/admins/ec_templates/shared/_list.html.erb
Normal file
@@ -0,0 +1,35 @@
|
||||
<table class="table" cellspacing="0" cellpadding="0">
|
||||
<thead>
|
||||
<th width="8%">序号</th>
|
||||
<th width="40%">模板名称</th>
|
||||
<th width="40%">上传模板</th>
|
||||
<th width="10%">操作</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% if templates.size > 0 %>
|
||||
<% templates.each_with_index do |t, index| %>
|
||||
<% attachment = t.attachments.first %>
|
||||
<tr id="template-item-<%= t.id %>">
|
||||
<td><%= list_index_no(@params_page.to_i, index) %></td>
|
||||
<td><%= t.name %></td>
|
||||
<td>
|
||||
<% if attachment.present? %>
|
||||
<%= link_to "#{attachment.try(:filename)}",attachment_path(attachment), target: "_blank" %>
|
||||
<% end %>
|
||||
</td>
|
||||
<td>
|
||||
<%= link_to "<i class='fa fa-edit color-grey-c fa-fw font-18 padding10-5'></i>".html_safe,
|
||||
"javascript:void(0)", data: {"id": "#{t.id}", "template-id": "#{attachment.present? ? attachment.id : "-1"}",
|
||||
msg: "编辑", name: "#{t.name}", "template_name": "#{attachment.try(:filename)}"}, class: "edit-template-content" %>
|
||||
|
||||
<%= link_to "<i class='fa fa-trash-o color-grey-c fa-fw font-18 padding10-5'></i>".html_safe, admins_ec_template_path(t.id), method: :delete, data: {confirm: "确认删除吗?"}, remote: true, title: "删除" %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<%= render 'admins/shared/no_data_for_table' %>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<%= render partial: 'admins/shared/paginate', locals: { objects: templates } %>
|
||||
@@ -0,0 +1,44 @@
|
||||
<div class="modal fade ec-templates-new-add" 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"><span class="template_add_title">新建</span>导入模版</h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<%= form_tag(create_template_admins_ec_templates_path, method: :post, remote: true ) do %>
|
||||
<%= hidden_field_tag(:attachment_id,"-1",class:"template_attachment_id") %>
|
||||
<%= hidden_field_tag(:template_id,"-1",class:"template_show_id") %>
|
||||
<div class="modal-body">
|
||||
<div class="form-group d-flex">
|
||||
<label for="template_name" class="col-form-label mr10">模板名称:</label>
|
||||
<div class="d-flex flex-column-reverse w-75">
|
||||
<%= text_field_tag("name","",class: "form-control", placeholder: "请输入模版名称", id: 'template_name') %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group d-flex">
|
||||
<label for="template_name" class="col-form-label mr10">上传文件:</label>
|
||||
<div class="d-flex flex-column-reverse w-75">
|
||||
<div class="template-file-upload">
|
||||
<span class="template_file_show hide">
|
||||
<span class="template_file_show_title">
|
||||
</span>
|
||||
<i class="fa fa-trash-o color-grey padding5-10 ml-5 delete-template-icon" title="删除"></i>
|
||||
</span>
|
||||
<span class="template-file-input">
|
||||
<%= file_field_tag(:file, id: "upload_template_file") %>
|
||||
<i class="fa fa-plus-circle font-20"></i> 上传文件
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<%= submit_tag("提交",class:"btn btn-primary", 'data-disable-with': "提交中...") %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user