为主题配置增加字段验证

This commit is contained in:
呱呱呱 2023-08-28 10:19:20 +08:00
parent 94d0862868
commit 484d769f1b
1 changed files with 6 additions and 6 deletions

View File

@ -12,7 +12,7 @@
<% if type == "create"%>
<div class="form-group">
<label>
建站工具
建站工具 <span class="ml10 color-orange mr20">*</span>
</label>
<% 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 @@
</div>
<div class="form-group">
<label>
仓库url
仓库url <span class="ml10 color-orange mr20">*</span>
</label>
<%= 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/.*"%>
</div>
<div class="form-group">
@ -41,12 +41,12 @@
<% logo_img = @page_theme.image %>
<div class="logo-item-left mr-3 <%= logo_img ? 'has-img' : '' %>">
<img class="logo-item-img nav-logo-img" src="<%= logo_img %>" style="<%= logo_img.present? ? '' : 'display: none' %>"/>
<%= 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) %>
<label for="image" class="logo-item-upload" data-toggle="tooltip" data-title="选择图片"></label>
</div>
<div class="logo-item-right">
<div class="logo-item-title flex-1">logo</div>
<div>格式PNG、JPG</div>
<div class="logo-item-title flex-1">logo <span class="ml10 color-orange mr20">*</span></div>
<div>格式PNG、JPG、JPEG、SVG</div>
</div>
</div>
</div>