update admins identity_verifications site_pages
This commit is contained in:
parent
890c826685
commit
c4222f1d65
|
@ -10,13 +10,13 @@ class SitePagesController < ApplicationController
|
|||
end
|
||||
|
||||
def show
|
||||
@page = Page.find_by(user_id: current_user.id, project_id: @project.id)
|
||||
@page = Page.find_by(project_id: @project.id)
|
||||
return render_ok({data:nil}) unless @page.present?
|
||||
end
|
||||
|
||||
def create
|
||||
return normal_status(-1, "您还未通过身份认证,无法开通Page") unless current_user.id_card_verify
|
||||
return normal_status(-1, "您还未开通Page服务,无法进行部署") unless current_user.website_permission
|
||||
return normal_status(-1, "你还未通过身份认证,无法开通Page") unless current_user.id_card_verify
|
||||
return normal_status(-1, "你还未开通Page服务,无法进行部署") unless current_user.website_permission
|
||||
return normal_status(-1, "你已使用了 #{params[:identifier]} 作为page标识") if Page.exists?(identifier: params[:identifier], user: current_user)
|
||||
return normal_status(-1, "该仓库已开通Page服务") if Page.exists?(project: @project)
|
||||
@page = Page.new(create_params)
|
||||
|
@ -26,7 +26,7 @@ class SitePagesController < ApplicationController
|
|||
end
|
||||
|
||||
def build
|
||||
return normal_status(-1, "您还未开通Page服务,无法进行部署") unless current_user.website_permission
|
||||
return normal_status(-1, "你还未开通Page服务,无法进行部署") unless current_user.website_permission
|
||||
return normal_status(-1, "该仓库还未开通Page服务,无法进行部署") unless Page.exists?(project: @project)
|
||||
@page = Page.find params[:id]
|
||||
return normal_status(-1, @page.state_description) unless @page.state
|
||||
|
@ -42,7 +42,7 @@ class SitePagesController < ApplicationController
|
|||
def softbot_build
|
||||
branch = params[:ref].split("/").last
|
||||
user = User.find_by_login params[:repository][:owner][:login]
|
||||
return normal_status(-1, "您还未开通Page服务,无法进行部署") unless user.website_permission
|
||||
return normal_status(-1, "你还未开通Page服务,无法进行部署") unless user.website_permission
|
||||
|
||||
project = Project.where(identifier: params[:repository][:name],user_id: user.id)
|
||||
return normal_status(-1, "你没有权限操作") if project.owner?(user)
|
||||
|
@ -60,9 +60,9 @@ class SitePagesController < ApplicationController
|
|||
|
||||
private
|
||||
def authenticate_user!
|
||||
return if @project.is_public
|
||||
return if @project.owner?(current_user)
|
||||
render_forbidden('你没有权限操作')
|
||||
unless @project.manager?(current_user) || current_user.admin?
|
||||
return render_forbidden('你不是管理员,没有权限操作')
|
||||
end
|
||||
end
|
||||
|
||||
def theme_params
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<%
|
||||
define_admin_breadcrumbs do
|
||||
add_admin_breadcrumb('用户管理', admins_identity_verifications_path)
|
||||
add_admin_breadcrumb('身份审核列表', admins_identity_verifications_path)
|
||||
add_admin_breadcrumb('用户身份审核详情')
|
||||
end
|
||||
%>
|
||||
|
@ -62,7 +62,7 @@
|
|||
<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" %>
|
||||
<%= image_tag("#{@identity_verification.card_front_attachment.try(:filename)}", width: 100, height: 100, class: 'preview-image auth-image', data: { toggle: 'tooltip', title: '点击预览' }) %>
|
||||
<%else%>
|
||||
<p> 图片无法展示,图片已丢失</p>
|
||||
<%end%>
|
||||
|
@ -72,7 +72,7 @@
|
|||
<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" %>
|
||||
<%= image_tag("#{@identity_verification.card_back_attachment.try(:filename)}", width: 100, height: 100, class: 'preview-image auth-image', data: { toggle: 'tooltip', title: '点击预览' }) %>
|
||||
<%else%>
|
||||
<p> 图片无法展示,图片已丢失</p>
|
||||
<%end%>
|
||||
|
@ -82,7 +82,7 @@
|
|||
<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" %>
|
||||
<%= image_tag("#{@identity_verification.hold_card_front_attachment.try(:filename)}", width: 100, height: 100, class: 'preview-image auth-image', data: { toggle: 'tooltip', title: '点击预览' }) %>
|
||||
<%else%>
|
||||
<p> 图片无法展示,图片已丢失</p>
|
||||
<%end%>
|
||||
|
@ -92,23 +92,20 @@
|
|||
<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" %>
|
||||
<%= image_tag("#{@identity_verification.hold_card_back_attachment.try(:filename)}", width: 100, height: 100, class: 'preview-image auth-image', data: { toggle: 'tooltip', title: '点击预览' }) %>
|
||||
<%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%>
|
||||
<% unless @identity_verification.state == "已通过" %>
|
||||
<div class="form-row">
|
||||
<%= f.radio_button :state, '已通过' %> 通过
|
||||
<%= f.radio_button :state, '已拒绝' %> 拒绝
|
||||
|
@ -124,8 +121,5 @@
|
|||
<% end %>
|
||||
</b>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<% end %>
|
||||
</div>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<% define_admin_breadcrumbs do %>
|
||||
<% add_admin_breadcrumb('主题管理') %>
|
||||
<% add_admin_breadcrumb('站点主题配置') %>
|
||||
<% end %>
|
||||
|
||||
<div class="box search-form-container project-list-form">
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<%
|
||||
define_admin_breadcrumbs do
|
||||
add_admin_breadcrumb('用户管理', admins_site_pages_path)
|
||||
add_admin_breadcrumb('站点列表')
|
||||
add_admin_breadcrumb('用户站点列表', admins_site_pages_path)
|
||||
add_admin_breadcrumb('站点详情')
|
||||
end
|
||||
%>
|
||||
|
||||
|
@ -51,7 +51,7 @@
|
|||
|
||||
<div class="mt-4">
|
||||
<h6>审核信息</h6>
|
||||
<label>当前身份审核状态为 <b><%=@site_page.state %></b></label>
|
||||
<label>当前身份审核状态为 <b><%=@site_page.state == true ? "已通过" : "未通过" %></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 } %>
|
||||
|
@ -62,7 +62,7 @@
|
|||
</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 } %>
|
||||
<%= f.input :language_frame, label: '建站工具', wrapper_html: { class: 'col-md-3' }, input_html: { readonly: true, type:'text', class: 'col-md-5' , value: @site_page.language_frame } %>
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<% define_admin_breadcrumbs do %>
|
||||
<% add_admin_breadcrumb('用户管理', admins_site_pages_path) %>
|
||||
<% add_admin_breadcrumb('用户站点列表', admins_site_pages_path) %>
|
||||
<% end %>
|
||||
|
||||
<div class="box search-form-container user-list-form">
|
||||
|
|
Loading…
Reference in New Issue