add site page

This commit is contained in:
呱呱呱
2023-08-10 14:29:26 +08:00
parent ba4c479cc2
commit 96936da9ac
78 changed files with 1158 additions and 78 deletions

View File

@@ -0,0 +1,131 @@
<%
define_admin_breadcrumbs do
add_admin_breadcrumb('用户管理', admins_identity_verifications_path)
add_admin_breadcrumb('用户身份审核详情')
end
%>
<div class="box identity_verification-edit-container">
<div class="identity_verification-info mb-4 row">
<%= link_to "/#{@identity_verification.user.login}", class: 'user-info-avatar col-md-1', target: '_blank', data: { toggle: 'tooltip', title: '个人中心' } do %>
<img src="/<%= url_to_avatar(@user) %>" class="rounded-circle" width="80" height="80" />
<% end %>
<div class="d-flex flex-column justify-content-between col-md-3 user-info-content">
<div class="user-info-name flex"><%= @user.real_name %> | <%= @user.id %> | <%= @user.login %></div>
<div class="d-flex flex-row user-info-auth">
<% if @user.authentication? %>
<i class="fa fa-user text-success" data-toggle="tooltip" data-placement="bottom" title="已实名认证"></i>
<% elsif @user.process_real_name_apply.present? %>
<i class="fa fa-user text-danger" data-toggle="tooltip" data-placement="bottom" title="实名认证中"></i>
<% else %>
<i class="fa fa-user text-muted" data-toggle="tooltip" data-placement="bottom" title="未实名认证"></i>
<% end %>
<% if @user.professional_certification %>
<i class="fa fa-list-alt text-success" data-toggle="tooltip" data-placement="bottom" title="已职业认证"></i>
<% elsif @user.process_professional_apply.present? %>
<i class="fa fa-list-alt text-danger" data-toggle="tooltip" data-placement="bottom" title="职业认证中"></i>
<% else %>
<i class="fa fa-list-alt text-muted" data-toggle="tooltip" data-placement="bottom" title="未职业认证"></i>
<% end %>
<% if @user.phone.present? %>
<i class="fa fa-mobile text-success" data-toggle="tooltip" data-placement="bottom" title="已绑定手机"></i>
<% else %>
<i class="fa fa-mobile text-muted" data-toggle="tooltip" data-placement="bottom" title="未绑定手机"></i>
<% end %>
<% if @user.mail.present? %>
<i class="fa fa-envelope text-success" data-toggle="tooltip" data-placement="bottom" title="已绑定邮箱"></i>
<% else %>
<i class="fa fa-envelope text-muted" data-toggle="tooltip" data-placement="bottom" title="未绑定邮箱"></i>
<% end %>
</div>
<div class="user-info-last-login">最近登录:<%= @user.last_login_on&.strftime('%Y-%m-%d %H:%M') %></div>
</div>
</div>
<%= simple_form_for(@identity_verification, url: admins_identity_verification_path(@identity_verification)) do |f| %>
<div class="mt-4">
<h6>审核信息</h6>
<label>当前身份审核状态为 <b><%=@identity_verification.state %></b></label>
<div class="form-row">
<%= f.input :name, label: '姓名', wrapper_html: { class: 'col-md-3' }, input_html: { readonly: true, class: 'col-md-11' , value: @identity_verification.name } %>
</div>
<div class="form-row">
<%= f.input :number, label: '身份证号', wrapper_html: { class: 'col-md-3' }, input_html: { readonly: true, class: 'col-md-11' , value: @identity_verification.number } %>
</div>
<label>身份证正面: </label>
<div class="form-row">
<td>
<% if @identity_verification.card_front_attachment.present? %>
<%= link_to "#{@identity_verification.card_front_attachment.try(:filename)}",attachment_path(@identity_verification.card_front_attachment), target: "_blank" %>
<%else%>
<p> 图片无法展示,图片已丢失</p>
<%end%>
</td>
</div>
<label>身份证背面: </label>
<div class="form-row">
<td>
<% if @identity_verification.card_back_attachment.present? %>
<%= link_to "#{@identity_verification.card_back_attachment.try(:filename)}",attachment_path(@identity_verification.card_back_attachment), target: "_blank" %>
<%else%>
<p> 图片无法展示,图片已丢失</p>
<%end%>
</td>
</div>
<label>手持身份证正面: </label>
<div class="form-row">
<td>
<% if @identity_verification.hold_card_front_attachment.present? %>
<%= link_to "#{@identity_verification.hold_card_front_attachment.try(:filename)}",attachment_path(@identity_verification.hold_card_front_attachment), target: "_blank" %>
<%else%>
<p> 图片无法展示,图片已丢失</p>
<%end%>
</td>
</div>
<label>手持身份证背面: </label>
<div class="form-row">
<td>
<% if @identity_verification.hold_card_back_attachment.present? %>
<%= link_to "#{@identity_verification.hold_card_back_attachment.try(:filename)}",attachment_path(@identity_verification.hold_card_back_attachment), target: "_blank" %>
<%else%>
<p> 图片无法展示,图片已丢失</p>
<%end%>
</td>
</div>
</br>
<div class="form-row">
<label><b>是否通过身份证审核: </b></label>
</div>
<b>
<% if @identity_verification.state == "已通过" %>
<div class="form-row">
<p> 用户身份审核已通过</p>
</div>
<%else%>
<div class="form-row">
<%= f.radio_button :state, '已通过' %> 通过  
<%= f.radio_button :state, '已拒绝' %> 拒绝
</div>
</br>
<div class="form-row">
<%= f.input :description, as: :text,label: '拒绝理由:(拒绝时请填写拒绝理由,可以为空)', wrapper_html: { class: 'col-md-12' }, input_html: { maxlength: 100, size: 40, class: 'col-md-11' , value: @identity_verification.description } %>
</div>
<div class="form-row mt-4">
<%= f.button :submit, value: '保存', class: 'btn-primary mr-3 px-4' %>
<%= link_to '取消', admins_identity_verifications_path, class: 'btn btn-secondary px-4' %>
</div>
<% end %>
</b>
</div>
<% end %>
</div>

View File

@@ -0,0 +1,21 @@
<% define_admin_breadcrumbs do %>
<% add_admin_breadcrumb('用户管理', admins_identity_verifications_path) %>
<% end %>
<div class="box search-form-container user-list-form">
<%= 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]] %>
<%= select_tag(:state, options_for_select(state_options), class: 'form-control') %>
</div>
<%= submit_tag('搜索', class: 'btn btn-primary ml-3', 'data-disable-with': '搜索中...') %>
<% end %>
</div>
<div class="box admin-list-container identity-verifications-list-container">
<%= render partial: 'admins/identity_verifications/shared/info_list', locals: { identity_verifications: @identity_verifications } %>
</div>

View File

@@ -0,0 +1 @@
$('.identity-verifications-list-container').html("<%= j( render partial: 'admins/identity_verifications/shared/info_list', locals: { identity_verifications: @identity_verifications } ) %>");

View File

@@ -0,0 +1,35 @@
<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="10%">审核状态</th>
<th width="10%"><%= sort_tag('创建于', name: 'created_at', path: admins_identity_verifications_path) %></th>
<th width="14%">操作</th>
</tr>
</thead>
<tbody>
<% if identity_verifications.present? %>
<% identity_verifications.each_with_index do |identity_verification, index| %>
<tr class="identity-verification-item-<%= identity_verification.id %>">
<td><%= list_index_no((params[:page] || 1).to_i, index) %></td>
<td class="text-left">
<%= link_to "/#{identity_verification.user.login}", target: '_blank' do %>
<%= overflow_hidden_span identity_verification.user.real_name, width: 100 %>
<% end %>
</td>
<td><%= display_text(identity_verification.state) %></td>
<td><%= display_text(identity_verification.created_at&.strftime('%Y-%m-%d %H:%M')) %></td>
<td class="action-container">
<%= link_to "#{ identity_verification.state == "待审核" ? '审核' : "查看"}", edit_admins_identity_verification_path(identity_verification), class: 'action' %>
</td>
</tr>
<% end %>
<% else %>
<%= render 'admins/shared/no_data_for_table' %>
<% end %>
</tbody>
</table>
<%= render partial: 'admins/shared/paginate', locals: { objects: identity_verifications } %>

View File

@@ -24,6 +24,8 @@
<%= sidebar_item_group('#user-submenu', '用户', icon: 'user') do %>
<li><%= sidebar_item(admins_users_path, '用户列表', icon: 'user', controller: 'admins-users') %></li>
<li><%= sidebar_item(admins_organizations_path, '组织列表', icon: 'user', controller: 'admins-organizations') %></li>
<li><%= sidebar_item(admins_identity_verifications_path, '身份审核列表', icon: 'user', controller: 'admins-identity_verifications') %></li>
<li><%= sidebar_item(admins_site_pages_path, '用户站点列表', icon: 'user', controller: 'admins-site_pages') %></li>
<% end %>
</li>
<li>

View File

@@ -0,0 +1,99 @@
<%
define_admin_breadcrumbs do
add_admin_breadcrumb('用户管理', admins_site_pages_path)
add_admin_breadcrumb('站点列表')
end
%>
<div class="box site_page-edit-container">
<div class="site_page-info mb-4 row">
<%= link_to "/#{@site_page.user.login}", class: 'user-info-avatar col-md-1', target: '_blank', data: { toggle: 'tooltip', title: '个人中心' } do %>
<img src="/<%= url_to_avatar(@user) %>" class="rounded-circle" width="80" height="80" />
<% end %>
<div class="d-flex flex-column justify-content-between col-md-3 user-info-content">
<div class="user-info-name flex"><%= @user.real_name %> | <%= @user.id %> | <%= @user.login %></div>
<div class="d-flex flex-row user-info-auth">
<% if @user.authentication? %>
<i class="fa fa-user text-success" data-toggle="tooltip" data-placement="bottom" title="已实名认证"></i>
<% elsif @user.process_real_name_apply.present? %>
<i class="fa fa-user text-danger" data-toggle="tooltip" data-placement="bottom" title="实名认证中"></i>
<% else %>
<i class="fa fa-user text-muted" data-toggle="tooltip" data-placement="bottom" title="未实名认证"></i>
<% end %>
<% if @user.professional_certification %>
<i class="fa fa-list-alt text-success" data-toggle="tooltip" data-placement="bottom" title="已职业认证"></i>
<% elsif @user.process_professional_apply.present? %>
<i class="fa fa-list-alt text-danger" data-toggle="tooltip" data-placement="bottom" title="职业认证中"></i>
<% else %>
<i class="fa fa-list-alt text-muted" data-toggle="tooltip" data-placement="bottom" title="未职业认证"></i>
<% end %>
<% if @user.phone.present? %>
<i class="fa fa-mobile text-success" data-toggle="tooltip" data-placement="bottom" title="已绑定手机"></i>
<% else %>
<i class="fa fa-mobile text-muted" data-toggle="tooltip" data-placement="bottom" title="未绑定手机"></i>
<% end %>
<% if @user.mail.present? %>
<i class="fa fa-envelope text-success" data-toggle="tooltip" data-placement="bottom" title="已绑定邮箱"></i>
<% else %>
<i class="fa fa-envelope text-muted" data-toggle="tooltip" data-placement="bottom" title="未绑定邮箱"></i>
<% end %>
</div>
<div class="user-info-last-login">最近登录:<%= @user.last_login_on&.strftime('%Y-%m-%d %H:%M') %></div>
</div>
</div>
<%= simple_form_for(@site_page, url: admins_site_page_path(@site_page)) do |f| %>
<div class="mt-4">
<h6>审核信息</h6>
<label>当前身份审核状态为 <b><%=@site_page.state %></b></label>
<div class="form-row">
<%= f.input :identifier, label: '站点标识', wrapper_html: { class: 'col-md-3' }, input_html: { readonly: true, class: 'col-md-5' , value: @site_page.identifier } %>
</div>
<div class="form-row">
<%= f.input :site_name, label: '站点名', wrapper_html: { class: 'col-md-3' }, input_html: { readonly: true, class: 'col-md-5' , value: @site_page.site_name } %>
</div>
<div class="form-row">
<%= f.input :language_frame, label: '建站工具', wrapper_html: { class: 'col-md-3' }, input_html: { readonly: true, class: 'col-md-5' , value: @site_page.language_frame } %>
</div>
<div class="form-row">
<%= f.input :theme, label: '主题', wrapper_html: { class: 'col-md-3' }, input_html: { readonly: true, class: 'col-md-5' , value: @site_page.theme } %>
</div>
</br>
<div class="form-row">
<label>当前站点:</label>
<a href="<%= @site_page.url%>" target="_blank"> <%= @site_page.url%> </a>
</div>
</br>
<div class="form-row">
<label>是否关闭站点? </label>
<%= f.radio_button :state, 'false' %> 关闭
</div>
</br>
<div class="form-row">
<label>注意,因为关闭站点涉及操作另外一台服务器,所以站点关闭后<b>无法重新打开</b>,请谨慎操作, 关闭站点后该仓库再也不能进行 <b>开通站点、部署等</b>操作 </label>
</div>
</br>
<div class="form-row">
<%= f.input :state_description, as: :text,label: '关闭理由,如需关闭 理由不能为空', wrapper_html: { class: 'col-md-12' }, input_html: { maxlength: 100, size: 40, class: 'col-md-11' , value: @site_page.state_description } %>
</div>
<div class="form-row mt-4">
<%= f.button :submit, value: '保存', class: 'btn-primary mr-3 px-4' %>
<%= link_to '取消', admins_site_pages_path, class: 'btn btn-secondary px-4' %>
</div>
</div>
<% end %>
</div>

View File

@@ -0,0 +1,21 @@
<% define_admin_breadcrumbs do %>
<% add_admin_breadcrumb('用户管理', admins_site_pages_path) %>
<% end %>
<div class="box search-form-container user-list-form">
<%= form_tag(admins_site_pages_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], ['正常', true], ['已关闭', false]] %>
<%= select_tag(:state, options_for_select(state_options), class: 'form-control') %>
</div>
<%= text_field_tag(:keyword, params[:keyword], class: 'form-control col-sm-2 ml-3', placeholder: '输入用户 ID/姓名/邮箱/手机号 检索') %>
<%= submit_tag('搜索', class: 'btn btn-primary ml-3', 'data-disable-with': '搜索中...') %>
<% end %>
</div>
<div class="box admin-list-container identity-site-pages-list-container">
<%= render partial: 'admins/site_pages/shared/info_list', locals: { site_pages: @site_pages } %>
</div>

View File

@@ -0,0 +1 @@
$('.identity-site-pages-list-container').html("<%= j( render partial: 'admins/site_pages/shared/info_list', locals: { site_pages: @site_pages } ) %>");

View File

@@ -0,0 +1,58 @@
<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="10%" class="text-left">仓库</th>
<th width="10%">站点状态</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="10%" class="text-left">上次构建时间</th>
<th width="10%"><%= sort_tag('创建于', name: 'created_at', path: admins_site_pages_path) %></th>
<th width="14%">操作</th>
</tr>
</thead>
<tbody>
<% if site_pages.present? %>
<% site_pages.each_with_index do |site_page, index| %>
<tr class="identity-verification-item-<%= site_page.id %>">
<td><%= list_index_no((params[:page] || 1).to_i, index) %></td>
<td class="text-left">
<%= link_to "/#{site_page.user.login}", target: '_blank' do %>
<%= overflow_hidden_span site_page.user.real_name, width: 100 %>
<% end %>
</td>
<td class="text-left">
<%= link_to "/#{site_page.user.login}/#{site_page.project.identifier}", target: '_blank' do %>
<%= overflow_hidden_span site_page.project.name, width: 100 %>
<% end %>
</td>
<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><%= 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>
<td><%= display_text(site_page.created_at&.strftime('%Y-%m-%d %H:%M')) %></td>
<td class="action-container">
<%= link_to "查看", edit_admins_site_page_path(site_page), class: 'action' %>
</td>
</tr>
<% end %>
<% else %>
<%= render 'admins/shared/no_data_for_table' %>
<% end %>
</tbody>
</table>
<%= render partial: 'admins/shared/paginate', locals: { objects: site_pages } %>

View File

@@ -92,8 +92,15 @@
</div>
</div>
<% end %>
<% if @user.id_card_verify %>
<div class="form-group check_boxes optional">
<%= f.label :role, label: '站点权限' %>
<div class="d-flex">
<%= f.input :website_permission, as: :boolean, label: '开通站点', checked_value: 1, unchecked_value: 0 %>
</div>
</div>
<% end %>
<div class="form-row">
<%= f.input :password, as: :password, label: '修改密码', wrapper_html: { class: 'col-md-3' }, input_html: { class: 'col-sm-11', autocomplete: 'new-password' } %>
<%= f.input :password_confirmation, as: :password, label: '确认密码', wrapper_html: { class: 'col-md-3' }, input_html: { class: 'col-sm-11', autocomplete: 'new-password' } %>