From 484d769f1bb59c718d425b78bbb42e35ad6c9458 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=91=B1=E5=91=B1=E5=91=B1?= Date: Mon, 28 Aug 2023 10:19:20 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=B8=BA=E4=B8=BB=E9=A2=98=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E5=A2=9E=E5=8A=A0=E5=AD=97=E6=AE=B5=E9=AA=8C=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/admins/page_themes/_form_modal.html.erb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/views/admins/page_themes/_form_modal.html.erb b/app/views/admins/page_themes/_form_modal.html.erb index 720566d9..3308387e 100644 --- a/app/views/admins/page_themes/_form_modal.html.erb +++ b/app/views/admins/page_themes/_form_modal.html.erb @@ -12,7 +12,7 @@ <% if type == "create"%>
<% 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 @@
- <%= 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/.*"%>
@@ -41,12 +41,12 @@ <% logo_img = @page_theme.image %>
- <%= 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) %>
-
logo
-
格式:PNG、JPG
+
logo *
+
格式:PNG、JPG、JPEG、SVG
From d22a18a8fe9c0c35d2e4add378e417ad439a9429 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=91=B1=E5=91=B1=E5=91=B1?= Date: Mon, 28 Aug 2023 10:51:18 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E8=B0=83=E6=95=B4=E7=AB=99=E7=82=B9?= =?UTF-8?q?=E8=AF=A6=E6=83=85=E7=9A=84url=E5=B1=95=E7=A4=BA=E9=95=BF?= =?UTF-8?q?=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../site_pages/shared/_info_list.html.erb | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/app/views/admins/site_pages/shared/_info_list.html.erb b/app/views/admins/site_pages/shared/_info_list.html.erb index 6c2ca0f7..fdae0e88 100644 --- a/app/views/admins/site_pages/shared/_info_list.html.erb +++ b/app/views/admins/site_pages/shared/_info_list.html.erb @@ -1,21 +1,21 @@ - - + + - + - + - + - + @@ -36,8 +36,11 @@ - - + From d4d6751dc0d109ba147ca4279fc3a7a7f3e98199 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=91=B1=E5=91=B1=E5=91=B1?= Date: Mon, 28 Aug 2023 11:36:00 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E7=94=A8=E6=88=B7=E5=AE=A1=E6=A0=B8?= =?UTF-8?q?=E8=AF=A6=E6=83=85=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admins/identity_verifications_controller.rb | 12 +++++++----- app/queries/admins/identity_verification_query.rb | 2 +- .../admins/identity_verifications/edit.html.erb | 10 ++-------- .../admins/identity_verifications/index.html.erb | 2 +- .../shared/_info_list.html.erb | 2 +- .../admins/site_pages/shared/_info_list.html.erb | 2 +- 6 files changed, 13 insertions(+), 17 deletions(-) diff --git a/app/controllers/admins/identity_verifications_controller.rb b/app/controllers/admins/identity_verifications_controller.rb index f5d5a11e..51d5e423 100644 --- a/app/controllers/admins/identity_verifications_controller.rb +++ b/app/controllers/admins/identity_verifications_controller.rb @@ -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 diff --git a/app/queries/admins/identity_verification_query.rb b/app/queries/admins/identity_verification_query.rb index a0064ec0..7c0fd669 100644 --- a/app/queries/admins/identity_verification_query.rb +++ b/app/queries/admins/identity_verification_query.rb @@ -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 diff --git a/app/views/admins/identity_verifications/edit.html.erb b/app/views/admins/identity_verifications/edit.html.erb index 99f9f02a..580c86f3 100644 --- a/app/views/admins/identity_verifications/edit.html.erb +++ b/app/views/admins/identity_verifications/edit.html.erb @@ -99,16 +99,10 @@ -
-
- -
- - <% unless @identity_verification.state == "已通过" %>
- <%= f.radio_button :state, '已通过' %> 通过   - <%= f.radio_button :state, '已拒绝' %> 拒绝 + <%= radio_button_tag("identity_verification[state]","已通过", required: 'required') %>通过   + <%= radio_button_tag("identity_verification[state]","已拒绝", required: 'required') %>拒绝

diff --git a/app/views/admins/identity_verifications/index.html.erb b/app/views/admins/identity_verifications/index.html.erb index d5aef6dc..245ac94b 100644 --- a/app/views/admins/identity_verifications/index.html.erb +++ b/app/views/admins/identity_verifications/index.html.erb @@ -6,7 +6,7 @@ <%= form_tag(admins_identity_verifications_path, method: :get, class: 'form-inline search-form flex-1', remote: true) do %>
- <% state_options = [['全部',nil], ['待审核', 0], ['已通过', 1], ['已拒绝', 2]] %> + <% state_options = [['待审核', 0], ['全部',"all"], ['已通过', 1], ['已拒绝', 2]] %> <%= select_tag(:state, options_for_select(state_options), class: 'form-control') %>
diff --git a/app/views/admins/identity_verifications/shared/_info_list.html.erb b/app/views/admins/identity_verifications/shared/_info_list.html.erb index 486a4ec5..8ab17ad4 100644 --- a/app/views/admins/identity_verifications/shared/_info_list.html.erb +++ b/app/views/admins/identity_verifications/shared/_info_list.html.erb @@ -1,4 +1,4 @@ -
序号昵称序号昵称 仓库站点状态站点状态 站点名 站点标识站点地址站点地址建站工具建站工具 主题 上次构建时间 <%= sort_tag('创建于', name: 'created_at', path: admins_site_pages_path) %>操作操作
<%= display_text(site_page.state == true ? "正常" : "已关闭") %> <%= display_text(site_page.site_name) %> <%= display_text(site_page.identifier) %><%= link_to "#{site_page.url}", site_page.url, target: '_blank'%> + <%= link_to "#{site_page.url}", target: '_blank' do %> + <%= overflow_hidden_span site_page.url, width: 120 %> + <% end %> + <%= display_text(site_page.language_frame) %> <%= display_text(site_page.theme) %> <%= display_text(site_page.last_build_at&.strftime('%Y-%m-%d %H:%M')) %>
+
diff --git a/app/views/admins/site_pages/shared/_info_list.html.erb b/app/views/admins/site_pages/shared/_info_list.html.erb index fdae0e88..f8279be7 100644 --- a/app/views/admins/site_pages/shared/_info_list.html.erb +++ b/app/views/admins/site_pages/shared/_info_list.html.erb @@ -11,7 +11,7 @@ - +
序号建站工具 主题上次构建时间上次部署时间 <%= sort_tag('创建于', name: 'created_at', path: admins_site_pages_path) %>