formOrder.dtml 3.51 KB
<dtml-var manage_page_header>
<dtml-var manage_tabs>

<main class="container-fluid">
<p class="form-help lead">
Change the display order and grouping of the fields in this form.
</p>

<table class="table table-bordered">
<dtml-let all_groups="get_groups(include_empty=1)"
          group_length="get_largest_group_length()"
          first_group="all_groups and all_groups[0] or None">
<dtml-in "get_group_rows()">
<tr>
<dtml-let groups=sequence-item>
<dtml-in groups>
<dtml-let group=sequence-item>
  <td>
  <table class="table">
  <form action="." method="POST">
  <input type="hidden" name="group" value="&dtml-group;">
  <tr><td>
    <div class="font-weight-bold">
      <dtml-var group html_quote>
    </div>
    </td></tr>

  <tr><td>
    <dtml-let fields="get_fields_in_group(group)" fields_amount="_.len(fields)">
    <table class="table table-borderless table-sm">
    <dtml-in fields>
    <dtml-let field=sequence-item field_id="field.id">
      <tr><td>
      <input type="checkbox" name="&dtml-field_id;">&nbsp;<a href="&dtml-field_id;/manage_main"><img src="&dtml-BASEPATH1;/&dtml-icon;" alt="&dtml-meta_type;" title="&dtml-meta_type;" border="0"></a>&nbsp;<a href="&dtml-field_id;/manage_main"><dtml-var field_id></a>
	  </td></tr>
    </dtml-let>
    </dtml-in>
    <dtml-in "_.range(group_length - fields_amount)">
       <tr><td></td></tr>
    </dtml-in>
    </dtml-let>
    </table>
  </td></tr>

  <tr><td>
    <input class="btn btn-secondary" type="submit" name="manage_move_field_up:method"
           value="Move Up">
    <input class="btn btn-secondary" type="submit" name="manage_move_field_down:method"
           value="Move Dn">
  </td></tr>

  <tr><td>
    <div class="form-group">
    <select class="form-control mb-2" name="to_group" size="1">
      <option>Transfer Selected Fields to:</option>
      <dtml-in all_groups>
        <option><dtml-var sequence-item html_quote></option>
      </dtml-in>
    </select>
    <input type="submit"  class="btn btn-secondary mb-2" name="manage_move_group:method"
           value="Transfer">
    </div>
  </td></tr>


  <dtml-if "group != first_group">
  <tr><td>
    <div class="form-group">
      <input class="btn btn-secondary" type="submit" name="manage_move_group_up:method"
             value="Move Group Up">
      <input class="btn btn-secondary" type="submit" name="manage_move_group_down:method"
             value="Move Group Down">
    </div>
  </td></tr>

  <tr><td>
    <div class="form-group">
      <input type="text" class="form-control form-control-sm"  name="new_name" value="" size="10">
      <input class="btn btn-secondary" type="submit" name="manage_rename_group:method"
             value="Rename Group">
    </div>
  </td></tr>
  <tr><td>
    <input class="btn btn-secondary" type="submit" name="manage_remove_group:method"
           value="Remove Group">
  </td></tr>

  <dtml-else>

  <tr><td>
    <div class="form-group">
      <input type="text" class="form-control form-control-sm" name="new_group" value="" size="10">
      <input type="submit" class="btn btn-secondary" name="manage_add_group:method" value="Create Group">
    </div>
  </td></tr>

  <tr><td>
    <div class="form-group">
      <input type="text" class="form-control form-control-sm" name="new_name" value="" size="10">
      <input class="btn btn-secondary" type="submit" name="manage_rename_group:method"
           value="Rename Group">
     </div>
  </td></tr>

  </dtml-if>

  </form>
  </table>
  </td>
</dtml-let>
</dtml-in>
</dtml-let>
</tr>
</dtml-in>
</dtml-let>
</table>
</main>
<dtml-var manage_page_footer>