diff --git a/app/controllers/site_pages_controller.rb b/app/controllers/site_pages_controller.rb index 319cacfb5..8f6b9af51 100644 --- a/app/controllers/site_pages_controller.rb +++ b/app/controllers/site_pages_controller.rb @@ -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 diff --git a/app/views/admins/identity_verifications/edit.html.erb b/app/views/admins/identity_verifications/edit.html.erb index 4719b01f0..eff4fbd08 100644 --- a/app/views/admins/identity_verifications/edit.html.erb +++ b/app/views/admins/identity_verifications/edit.html.erb @@ -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 @@
<% 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%>

图片无法展示,图片已丢失

<%end%> @@ -72,7 +72,7 @@
<% 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%>

图片无法展示,图片已丢失

<%end%> @@ -82,7 +82,7 @@
<% 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%>

图片无法展示,图片已丢失

<%end%> @@ -92,23 +92,20 @@
<% 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%>

图片无法展示,图片已丢失

<%end%>
+
- <% if @identity_verification.state == "已通过" %> -
-

用户身份审核已通过

-
- <%else%> + <% unless @identity_verification.state == "已通过" %>
<%= f.radio_button :state, '已通过' %> 通过   <%= f.radio_button :state, '已拒绝' %> 拒绝 @@ -124,8 +121,5 @@ <% end %>
- - - <% end %>
diff --git a/app/views/admins/page_themes/index.html.erb b/app/views/admins/page_themes/index.html.erb index 72ea4088a..4b4392d88 100644 --- a/app/views/admins/page_themes/index.html.erb +++ b/app/views/admins/page_themes/index.html.erb @@ -1,5 +1,5 @@ <% define_admin_breadcrumbs do %> - <% add_admin_breadcrumb('主题管理') %> + <% add_admin_breadcrumb('站点主题配置') %> <% end %>
diff --git a/app/views/admins/site_pages/edit.html.erb b/app/views/admins/site_pages/edit.html.erb index 84b69f683..b159b851e 100644 --- a/app/views/admins/site_pages/edit.html.erb +++ b/app/views/admins/site_pages/edit.html.erb @@ -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 @@
审核信息
- +
<%= 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 @@
- <%= 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 } %>
diff --git a/app/views/admins/site_pages/index.html.erb b/app/views/admins/site_pages/index.html.erb index 8197ae6ee..449bc7f54 100644 --- a/app/views/admins/site_pages/index.html.erb +++ b/app/views/admins/site_pages/index.html.erb @@ -1,5 +1,5 @@ <% define_admin_breadcrumbs do %> - <% add_admin_breadcrumb('用户管理', admins_site_pages_path) %> + <% add_admin_breadcrumb('用户站点列表', admins_site_pages_path) %> <% end %>