浏览代码

[Web] fix iam attribute mapping ui

FreddleSpl0it 2 年之前
父节点
当前提交
61ab17d8a1
共有 1 个文件被更改,包括 6 次插入4 次删除
  1. 6 4
      data/web/templates/admin/tab-config-identity-provider.twig

+ 6 - 4
data/web/templates/admin/tab-config-identity-provider.twig

@@ -58,8 +58,8 @@
           </div>
           </div>
           {% for key, role in identity_provider_settings.mappers %}
           {% for key, role in identity_provider_settings.mappers %}
           <div class="offset-sm-3 col-4 d-flex mb-2">
           <div class="offset-sm-3 col-4 d-flex mb-2">
-            <input type="text" class="form-control me-2" name="mappers" value="{{ identity_provider_settings.mappers[key] }}">
-            <select data-live-search="true" name="templates" class="form-control" title="{{ lang.mailbox.template }}">
+            <input type="text" class="form-control me-2" name="mappers" value="{{ identity_provider_settings.mappers[key] }}" required>
+            <select data-live-search="true" name="templates" class="form-control" title="{{ lang.mailbox.template }}" required>
             {% for mbox_template in mbox_templates %}
             {% for mbox_template in mbox_templates %}
               <option{% if mbox_template.template == identity_provider_settings.templates[key] %} selected{% endif %}>
               <option{% if mbox_template.template == identity_provider_settings.templates[key] %} selected{% endif %}>
                 {{ mbox_template.template }}
                 {{ mbox_template.template }}
@@ -69,9 +69,10 @@
             <button class="iam_rolemap_del btn btn-sm d-block d-sm-inline btn-secondary ms-2"><i class="bi bi-x-lg"></i></button>
             <button class="iam_rolemap_del btn btn-sm d-block d-sm-inline btn-secondary ms-2"><i class="bi bi-x-lg"></i></button>
           </div>
           </div>
           {% endfor %}
           {% endfor %}
+          {% if not identity_provider_settings.mappers %}
           <div class="offset-sm-3 col-4 d-flex mb-2">
           <div class="offset-sm-3 col-4 d-flex mb-2">
-            <input type="text" class="form-control me-2" name="mappers" value="">
-            <select data-live-search="true" name="templates" class="form-control" title="{{ lang.mailbox.template }}">
+            <input type="text" class="form-control me-2" name="mappers" value="" required>
+            <select data-live-search="true" name="templates" class="form-control" title="{{ lang.mailbox.template }}" required>
             {% for mbox_template in mbox_templates %}
             {% for mbox_template in mbox_templates %}
               <option>
               <option>
                 {{ mbox_template.template }}
                 {{ mbox_template.template }}
@@ -80,6 +81,7 @@
             </select>
             </select>
             <button class="iam_rolemap_del btn btn-sm d-block d-sm-inline btn-secondary ms-2"><i class="bi bi-x-lg"></i></button>
             <button class="iam_rolemap_del btn btn-sm d-block d-sm-inline btn-secondary ms-2"><i class="bi bi-x-lg"></i></button>
           </div>
           </div>
+          {% endif %}
         </div>
         </div>
         <div class="row mt-4 mb-2">
         <div class="row mt-4 mb-2">
           <div class="offset-sm-3 col-sm-9">
           <div class="offset-sm-3 col-sm-9">