<div class="modal fade page-themes-change-modal" tabindex="-1" role="dialog" aria-hidden="true">
  <div class="modal-dialog modal-dialog-centered" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <h5 class="modal-title"><%= type == "create" ? "新增" : "编辑" %></h5>
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <%= form_for @page_theme, url: {controller: "page_themes", action: "#{type}"}, html: { enctype: 'multipart/form-data' } do |p| %>
        <div class="modal-body">
          <% if  type == "create"%>
            <div class="form-group">
              <label>
                建站工具 <span class="ml10 color-orange mr20">*</span>
              </label>
              <% state_options = [['hugo', "hugo"], ['jeklly', "jeklly"],['hexo',"hexo"],['files',"files"]] %>
              <%= select_tag('page_theme[language_frame]', options_for_select(state_options), class: 'form-control') %>
            </div>
          <% end%>
          <div class="form-group">
            <label>
              主题名 <span class="ml10 color-orange mr20">*</span>
            </label>
            <%= p.text_field :name, class: "form-control input-lg",required: true, maxlength: 100, size: 100 %>
          </div>
          <div class="form-group">
            <label>
              仓库url <span class="ml10 color-orange mr20">*</span>
            </label>
            <%= 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">
            <label>
              排序等级 
            </label>
            <%= p.number_field :order_index, class: "form-control",placeholder: ""%>
          </div>
          <div class="logo-item">
            <% 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]) %>
              <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 <span class="ml10 color-orange mr20">*</span></div> 
              <div>格式：PNG、JPG、JPEG、SVG</div>
            </div>
          </div>
        </div>
        <div class="modal-footer">
          <button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
          <%= p.submit "确认", class: "btn btn-primary submit-btn" %>
        </div>
      <% end %>
    </div>
  </div>
</div>