mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-13 00:06:01 +08:00
init project
This commit is contained in:
44
app/views/admins/carousels/index.html.erb
Normal file
44
app/views/admins/carousels/index.html.erb
Normal file
@@ -0,0 +1,44 @@
|
||||
<%
|
||||
define_admin_breadcrumbs do
|
||||
add_admin_breadcrumb('云上实验室', admins_laboratories_path)
|
||||
add_admin_breadcrumb('轮播图')
|
||||
end
|
||||
%>
|
||||
|
||||
<div class="card mb-5 carousels-card">
|
||||
<div class="card-header d-flex justify-content-between align-items-center">
|
||||
<span class="flex-1">首页轮播图<span class="text-secondary font-12">(拖动排序)</span></span>
|
||||
<%= javascript_void_link '添加', class: 'btn btn-primary btn-sm add-btn', data: { toggle: 'modal', target: '.admin-add-carousel-modal' } %>
|
||||
</div>
|
||||
<div class="card-body row" id="carousels-container" data-laboratory-id="<%= current_laboratory.id %>">
|
||||
<% @images.each_with_index do |image, index| %>
|
||||
<div class="col-12 custom-carousel-item custom-carousel-item-<%= image.id %>" data-id="<%= image.id %>">
|
||||
<div class="border rounded relative p-3 mb-3 drag row align-items-center <%= image.online? ? '' : 'not_active' %>">
|
||||
<div class="col-2 col-md-1 custom-carousel-item-no"><%= index + 1 %></div>
|
||||
<div class="col-10 col-md-3 custom-carousel-item-img" data-source-id="<%= image.id %>" data-source-type="PortalImage" data-toggle="modal" data-target=".admin-upload-file-modal">
|
||||
<img src="<%= Util::FileManage.exist?('PortalImage', image.id) ? Util::FileManage.disk_file_url('PortalImage', image.id) : '' %>" data-toggle="tooltip" data-title="重新上传"/>
|
||||
</div>
|
||||
<div class="col-10 col-md-7">
|
||||
<div class="input-group">
|
||||
<input type="text" value="<%= image.name %>" class="form-control name-input" placeholder="请输入名称" />
|
||||
<input type="text" value="<%= image.link %>" class="form-control link-input" placeholder="请输入跳转地址">
|
||||
<div class="input-group-prepend">
|
||||
<button class="input-group-text save-data-btn" data-id="<%= image.id %>">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-2 col-md-1 operate-box">
|
||||
<%= check_box_tag(:online, 1, image.online?, id: nil, class: 'online-check-box', data: { id: image.id, toggle: 'tooltip', title: '首页展示' }) %>
|
||||
<%= delete_link '删除', admins_laboratory_carousel_path(image, laboratory_id: image.laboratory_id, element: ".custom-carousel-item-#{image.id}", not_refresh: true), class: 'delete-btn' do %>
|
||||
<i class="fa fa-trash-o" data-id="<%= image.id %>"></i>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<%= render partial: 'admins/carousels/shared/add_carousel_modal', locals: { laboratory_id: current_laboratory } %>
|
||||
<%= render partial: 'admins/shared/modal/upload_file_modal' %>
|
||||
@@ -0,0 +1,36 @@
|
||||
<div class="modal fade admin-add-carousel-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">
|
||||
<%= simple_form_for(PortalImage.new, url: admins_laboratory_carousels_path(laboratory_id: laboratory_id), html: { class: 'admin-add-carousel-form', enctype: 'multipart/form-data' }) do |f| %>
|
||||
<div class="form-group">
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text">图片</span>
|
||||
</div>
|
||||
<div class="custom-file flex-row-reverse" style="overflow: hidden">
|
||||
<input type="file" name="portal_image[image]" class="img-file-input" id="img-file-input" accept="image/*">
|
||||
<label class="custom-file-label file-names" for="img-file-input">选择文件</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%= f.input :name, label: '名称', placeholder: '请输入名称' %>
|
||||
<%= f.input :link, as: :url, label: '跳转地址', placeholder: '请输入跳转地址' %>
|
||||
|
||||
<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>
|
||||
Reference in New Issue
Block a user