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 @@ - +
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
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..f8279be7 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 @@ - - +
序号昵称序号昵称 仓库站点状态站点状态 站点名 站点标识站点地址站点地址建站工具建站工具 主题上次构建时间上次部署时间 <%= 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')) %>