column_definitions_form.twig 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. <form method="post" action="{{ action }}" class="
  2. {{- action == 'tbl_create.php' ? 'create_table' : 'append_fields' -}}
  3. _form ajax lock-page">
  4. {{ get_hidden_inputs(form_params) }}
  5. {# happens when an index has been set on a column #}
  6. {# and a column is added to the table creation dialog #}
  7. {# This contains a JSON-encoded string #}
  8. <input type="hidden" name="primary_indexes" value="
  9. {{- primary_indexes is not empty ? primary_indexes : '[]' }}">
  10. <input type="hidden" name="unique_indexes" value="
  11. {{- unique_indexes is not empty ? unique_indexes : '[]' }}">
  12. <input type="hidden" name="indexes" value="
  13. {{- indexes is not empty ? indexes : '[]' }}">
  14. <input type="hidden" name="fulltext_indexes" value="
  15. {{- fulltext_indexes is not empty ? fulltext_indexes : '[]' }}">
  16. <input type="hidden" name="spatial_indexes" value="
  17. {{- spatial_indexes is not empty ? spatial_indexes : '[]' }}">
  18. {% if action == 'tbl_create.php' %}
  19. <div id="table_name_col_no_outer">
  20. <table id="table_name_col_no" class="tdblock">
  21. <tr class="vmiddle floatleft">
  22. <td>{% trans 'Table name' %}:
  23. <input type="text"
  24. name="table"
  25. size="40"
  26. maxlength="64"
  27. value="{{ table is defined ? table }}"
  28. class="textfield" autofocus required>
  29. </td>
  30. <td>
  31. {% trans 'Add' %}
  32. <input type="number"
  33. id="added_fields"
  34. name="added_fields"
  35. size="2"
  36. value="1"
  37. min="1"
  38. onfocus="this.select()">
  39. {% trans 'column(s)' %}
  40. <input class="btn btn-secondary" type="button"
  41. name="submit_num_fields"
  42. value="{% trans 'Go' %}">
  43. </td>
  44. </tr>
  45. </table>
  46. </div>
  47. {% endif %}
  48. {% if content_cells is iterable %}
  49. {% include 'columns_definitions/table_fields_definitions.twig' with {
  50. 'is_backup': is_backup,
  51. 'fields_meta': fields_meta,
  52. 'mimework': mimework,
  53. 'content_cells': content_cells,
  54. 'change_column': change_column,
  55. 'is_virtual_columns_supported': is_virtual_columns_supported,
  56. 'browse_mime': browse_mime,
  57. 'server_type': server_type,
  58. 'max_rows': max_rows,
  59. 'char_editing': char_editing,
  60. 'attribute_types': attribute_types,
  61. 'privs_available': privs_available,
  62. 'max_length': max_length,
  63. 'charsets': charsets
  64. } only %}
  65. {% endif %}
  66. {% if action == 'tbl_create.php' %}
  67. <div class="responsivetable">
  68. <table>
  69. <tr class="vtop">
  70. <th>{% trans 'Table comments:' %}</th>
  71. <td width="25">&nbsp;</td>
  72. <th>{% trans 'Collation:' %}</th>
  73. <td width="25">&nbsp;</td>
  74. <th>
  75. {% trans 'Storage Engine:' %}
  76. {{ show_mysql_docu('Storage_engines') }}
  77. </th>
  78. <td width="25">&nbsp;</td>
  79. <th>
  80. {% trans 'Connection:' %}
  81. {{ show_mysql_docu('federated-create-connection') }}
  82. </th>
  83. </tr>
  84. <tr>
  85. <td>
  86. <input type="text"
  87. name="comment"
  88. size="40"
  89. maxlength="60"
  90. value="{{ comment is defined ? comment }}"
  91. class="textfield">
  92. </td>
  93. <td width="25">&nbsp;</td>
  94. <td>
  95. <select lang="en" dir="ltr" name="tbl_collation">
  96. <option value=""></option>
  97. {% for charset in charsets %}
  98. <optgroup label="{{ charset.name }}" title="{{ charset.description }}">
  99. {% for collation in charset.collations %}
  100. <option value="{{ collation.name }}" title="{{ collation.description }}"
  101. {{- collation.name == tbl_collation ? ' selected' }}>
  102. {{- collation.name -}}
  103. </option>
  104. {% endfor %}
  105. </optgroup>
  106. {% endfor %}
  107. </select>
  108. </td>
  109. <td width="25">&nbsp;</td>
  110. <td>
  111. {{ get_html_select(
  112. 'tbl_storage_engine',
  113. null,
  114. tbl_storage_engine
  115. ) }}
  116. </td>
  117. <td width="25">&nbsp;</td>
  118. <td>
  119. <input type="text"
  120. name="connection"
  121. size="40"
  122. value="{{ connection is defined ? connection }}"
  123. placeholder="scheme://user_name[:password]@host_name[:port_num]/db_name/tbl_name"
  124. class="textfield"
  125. required="required">
  126. </td>
  127. </tr>
  128. {% if have_partitioning %}
  129. <tr class="vtop">
  130. <th colspan="5">
  131. {% trans 'PARTITION definition:' %}
  132. {{ show_mysql_docu('Partitioning') }}
  133. </th>
  134. </tr>
  135. <tr>
  136. <td colspan="5">
  137. {% include 'columns_definitions/partitions.twig' with {
  138. 'partition_details': partition_details
  139. } only %}
  140. </td>
  141. </tr>
  142. {% endif %}
  143. </table>
  144. </div>
  145. {% endif %}
  146. <fieldset class="tblFooters">
  147. <input class="btn btn-secondary preview_sql" type="button"
  148. value="{% trans 'Preview SQL' %}">
  149. <input class="btn btn-primary" type="submit"
  150. name="do_save_data"
  151. value="{% trans 'Save' %}">
  152. </fieldset>
  153. <div id="properties_message"></div>
  154. </form>