diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2021-06-01 12:20:05 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2021-06-01 12:20:05 +0200 |
commit | eba9c7a64ad884c8a1fffd4f4b652e6dfff5101c (patch) | |
tree | fcb7ece5720cf3efb2bd31fc81174eb231ae1dd7 /ishtar_common/templates | |
parent | 0aa111a690b5c842614db3d7ba29a7c862e98136 (diff) | |
download | Ishtar-eba9c7a64ad884c8a1fffd4f4b652e6dfff5101c.tar.bz2 Ishtar-eba9c7a64ad884c8a1fffd4f4b652e6dfff5101c.zip |
Import: cleaner layout for match template
Diffstat (limited to 'ishtar_common/templates')
-rw-r--r-- | ishtar_common/templates/ishtar/formset_import_match.html | 98 |
1 files changed, 53 insertions, 45 deletions
diff --git a/ishtar_common/templates/ishtar/formset_import_match.html b/ishtar_common/templates/ishtar/formset_import_match.html index e35195791..acec95a65 100644 --- a/ishtar_common/templates/ishtar/formset_import_match.html +++ b/ishtar_common/templates/ishtar/formset_import_match.html @@ -25,58 +25,66 @@ {% for hidden in frm.hidden_fields %} {{ hidden }} {% endfor %} <div id="{{formset.prefix}}"> + {% if not formset %} + <p><em>{% trans "No more match left." %}</em></p> + {% endif %} {% for frm in formset %}{% ifchanged frm.target.value %} - {# <table> #}{% if not forloop.first%}</table>{% endif %} - <h4>{{ frm.target.field.choices.0.1 }}</h4> - {% if frm.admin_url %} - <p class="text-center"> - <a href="{{frm.admin_url}}" target="_blank"> - {% trans "Edit choices in admin" %}</a> - <i class="fa fa-question-circle" aria-hidden="true" - title="{% trans 'After type edition you may need to wait after cache update. Refresh this page after some time. Be patient.' %}"></i> - </p>{% endif %} - <table class='clean-table' id="form-{{forloop.counter0}}"> - <tr> - <th>{% trans "Key" %}</th> - <th>{% trans "Value" %}</th> - <th>{% trans "For" %}</th> - </tr> - <tr> - <td colspan="2"> - </td> - <td> - <select id="all-remember-{{forloop.counter0}}" - name="all-remember-{{forloop.counter0}}"> - <option value="">--</option> - {% for key, lbl in frm.remember_choices %} - <option value="{{key}}">{{lbl}}</option>{% endfor %} - </select> - </td> - </tr> - {% endifchanged %} - <tr> - <td> - {{frm.id}} - {{frm.target}} - {{frm.key}} - </td> - <td> - {{frm.value}} - </td> - <td class="remember"> - {{frm.remember}} - </td> - </tr> - {% if forloop.last %} - </table>{% endif %} + {# <div><table> #}{% if not forloop.first %}</table></div>{% endif %} + <div class="alert"> + <h4>{{ frm.target.field.choices.0.1 }}</h4> + {% if frm.admin_url %} + <p class="text-center"> + <a href="{{frm.admin_url}}" target="_blank"> + {% trans "Edit choices in admin" %}</a> + <i class="fa fa-question-circle" aria-hidden="true" + title="{% trans 'After type edition you may need to wait after cache update. Refresh this page after some time. Be patient.' %}"></i> + </p>{% endif %} + <table class='clean-table' id="form-{{forloop.counter0}}"> + <tr> + <th>{% trans "Key" %}</th> + <th>{% trans "Value" %}</th> + <th>{% trans "For" %}</th> + </tr> + <tr> + <td colspan="2"> + </td> + <td> + <select id="all-remember-{{forloop.counter0}}" + name="all-remember-{{forloop.counter0}}"> + <option value="">--</option> + {% for key, lbl in frm.remember_choices %} + <option value="{{key}}">{{lbl}}</option>{% endfor %} + </select> + </td> + </tr> + {% endifchanged %} + <tr> + <td> + {{frm.id}} + {{frm.target}} + {{frm.key}} + </td> + <td> + {{frm.value}} + </td> + <td class="remember"> + {{frm.remember}} + </td> + </tr> + {% if forloop.last %} + </table></div>{% endif %} + {% empty %} + <div class="alert alert-info"> + <em>{% trans "No more match left." %}</em> + </div> {% endfor %} + {% if frm.errors %}<ul>{% for error in frm.errors.values %} <li>{{error}}</li>{% endfor%}</ul>{% endif %} {% for field in frm %} {{field}} - {%endfor%} - + {% endfor %} </div> </div> <p class="text-center"> |