Merge pull request '根据issue调整后端展示界面' (#127) from KingChan/forgeplus:chenjing into standalone_develop

This commit is contained in:
KingChan 2023-08-28 13:54:52 +08:00
commit a574216c18
7 changed files with 30 additions and 31 deletions

View File

@ -3,9 +3,7 @@ class Admins::IdentityVerificationsController < Admins::BaseController
def index
params[:sort_by] = params[:sort_by].presence || 'created_at'
params[:sort_direction] = params[:sort_direction].presence || 'desc'
identity_verifications = Admins::IdentityVerificationQuery.call(params)
@identity_verifications = paginate identity_verifications.preload(:user)
end
@ -16,9 +14,13 @@ class Admins::IdentityVerificationsController < Admins::BaseController
end
def update
@identity_verification.update(update_params)
flash[:success] = '保存成功'
render 'edit'
if @identity_verification.update(update_params)
redirect_to admins_identity_verifications_path
flash[:success] = "更新成功"
else
redirect_to admins_identity_verifications_path
flash[:danger] = "更新失败"
end
end
private

View File

@ -10,7 +10,7 @@ class Admins::IdentityVerificationQuery < ApplicationQuery
end
def call
state = params[:state].blank? ? [0,1,2] : params[:state].to_i
state = params[:state] == "all" ? [0,1,2] : params[:state].nil? ? [0] : params[:state].to_i
applies = IdentityVerification.where(state: state)
custom_sort(applies, params[:sort_by], params[:sort_direction])
end

View File

@ -99,16 +99,10 @@
</td>
</div>
</br>
<div class="form-row">
<label><b>是否通过身份证审核: </b></label>
</div>
<b>
<% unless @identity_verification.state == "已通过" %>
<div class="form-row">
<%= f.radio_button :state, '已通过' %> 通过  
<%= f.radio_button :state, '已拒绝' %> 拒绝
<%= radio_button_tag("identity_verification[state]","已通过", required: 'required') %>通过  
<%= radio_button_tag("identity_verification[state]","已拒绝", required: 'required') %>拒绝
</div>
</br>
<div class="form-row">

View File

@ -6,7 +6,7 @@
<%= form_tag(admins_identity_verifications_path, method: :get, class: 'form-inline search-form flex-1', remote: true) do %>
<div class="form-group mr-2">
<label for="state">状态:</label>
<% state_options = [['全部',nil], ['待审核', 0], ['已通过', 1], ['已拒绝', 2]] %>
<% state_options = [['待审核', 0], ['全部',"all"], ['已通过', 1], ['已拒绝', 2]] %>
<%= select_tag(:state, options_for_select(state_options), class: 'form-control') %>
</div>

View File

@ -1,4 +1,4 @@
<table class="table table-hover identity-verifications-list-table">
<table class="table table-hover identity-verifications-list-table">
<thead class="thead-light">
<tr>
<th width="10%">序号</th>

View File

@ -12,7 +12,7 @@
<% if type == "create"%>
<div class="form-group">
<label>
建站工具
建站工具 <span class="ml10 color-orange mr20">*</span>
</label>
<% state_options = [['hugo', "hugo"], ['jeklly', "jeklly"],['hexo',"hexo"]] %>
<%= select_tag('page_theme[language_frame]', options_for_select(state_options), class: 'form-control') %>
@ -26,9 +26,9 @@
</div>
<div class="form-group">
<label>
仓库url
仓库url <span class="ml10 color-orange mr20">*</span>
</label>
<%= p.text_field :clone_url, class: "form-control",placeholder: ""%>
<%= p.text_field :clone_url, class: "form-control",placeholder: "https://gitlink.org.cn/XXXX/xxxx.git",required: true, pattern: "https://gitlink.org.cn/.*"%>
</div>
<div class="form-group">
@ -41,12 +41,12 @@
<% logo_img = @page_theme.image %>
<div class="logo-item-left mr-3 <%= logo_img ? 'has-img' : '' %>">
<img class="logo-item-img nav-logo-img" src="<%= logo_img %>" style="<%= logo_img.present? ? '' : 'display: none' %>"/>
<%= file_field_tag(:image, accept: 'image/png,image/jpg,image/jpeg',style: "display: none", value: params[:image]) %>
<%= file_field_tag(:image, accept: 'image/png,image/jpg,image/jpeg',style: "display: none", value: params[:image], required: true) %>
<label for="image" class="logo-item-upload" data-toggle="tooltip" data-title="选择图片"></label>
</div>
<div class="logo-item-right">
<div class="logo-item-title flex-1">logo</div>
<div>格式PNG、JPG</div>
<div class="logo-item-title flex-1">logo <span class="ml10 color-orange mr20">*</span></div>
<div>格式PNG、JPG、JPEG、SVG</div>
</div>
</div>
</div>

View File

@ -1,21 +1,21 @@
<table class="table table-hover identity-verifications-list-table">
<thead class="thead-light">
<tr>
<th width="10%">序号</th>
<th width="10%" class="text-left">昵称</th>
<th width="5%">序号</th>
<th width="5%" class="text-left">昵称</th>
<th width="10%" class="text-left">仓库</th>
<th width="10%">站点状态</th>
<th width="5%">站点状态</th>
<th width="10%" class="text-left">站点名</th>
<th width="10%" class="text-left">站点标识</th>
<th width="20%" class="text-left">站点地址</th>
<th width="10%" class="text-left">站点地址</th>
<th width="10%" class="text-left">建站工具</th>
<th width="5%" class="text-left">建站工具</th>
<th width="10%" class="text-left">主题</th>
<th width="10%" class="text-left">上次构建时间</th>
<th width="10%" class="text-left">上次部署时间</th>
<th width="10%"><%= sort_tag('创建于', name: 'created_at', path: admins_site_pages_path) %></th>
<th width="14%">操作</th>
<th width="10%">操作</th>
</tr>
</thead>
<tbody>
@ -36,8 +36,11 @@
<td><%= display_text(site_page.state == true ? "正常" : "已关闭") %></td>
<td><%= display_text(site_page.site_name) %></td>
<td><%= display_text(site_page.identifier) %></td>
<td><%= link_to "#{site_page.url}", site_page.url, target: '_blank'%></td>
<td class="text-left">
<%= link_to "#{site_page.url}", target: '_blank' do %>
<%= overflow_hidden_span site_page.url, width: 120 %>
<% end %>
</td>
<td><%= display_text(site_page.language_frame) %></td>
<td><%= display_text(site_page.theme) %></td>
<td><%= display_text(site_page.last_build_at&.strftime('%Y-%m-%d %H:%M')) %></td>