edit_table_row.twig 3.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <tr>
  2. <input name="orig_col_name[{{ row_num }}]" type="hidden" value="{{ row['col_name'] }}">
  3. <td name="col_name" class="nowrap">
  4. {% include 'columns_definitions/column_name.twig' with {
  5. 'column_number': row_num,
  6. 'ci': 0,
  7. 'ci_offset': 0,
  8. 'column_meta': {'Field': row['col_name']},
  9. 'cfg_relation': {'centralcolumnswork': false},
  10. 'max_rows': max_rows
  11. } only %}
  12. </td>
  13. <td name="col_type" class="nowrap">
  14. <select class="column_type" name="field_type[{{ row_num }}]" id="field_{{ row_num }}_1">
  15. {{ get_supported_datatypes(true, row['col_type']|upper) }}
  16. </select>
  17. </td>
  18. <td class="nowrap" name="col_length">
  19. <input id="field_{{ row_num }}_2" type="text" name="field_length[{{ row_num }}]" size="8" value="{{ row['col_length'] }}" class="textfield">
  20. <p class="enum_notice" id="enum_notice_{{ row_num }}_2">
  21. <a href="#" class="open_enum_editor">{% trans 'Edit ENUM/SET values' %}</a>
  22. </p>
  23. </td>
  24. <td class="nowrap" name="col_default">
  25. <select name="field_default_type[{{ row_num }}]" id="field_{{ row_num }}_3" class="default_type">
  26. <option value="NONE"{{ meta['DefaultType'] is defined and meta['DefaultType'] == 'NONE' ? ' selected' }}>
  27. {% trans %}None{% context %}for default{% endtrans %}
  28. </option>
  29. <option value="USER_DEFINED"{{ meta['DefaultType'] is defined and meta['DefaultType'] == 'USER_DEFINED' ? ' selected' }}>
  30. {% trans 'As defined:' %}
  31. </option>
  32. <option value="NULL"{{ meta['DefaultType'] is defined and meta['DefaultType'] == 'NULL' ? ' selected' }}>
  33. NULL
  34. </option>
  35. <option value="CURRENT_TIMESTAMP"{{ meta['DefaultType'] is defined and meta['DefaultType'] == 'CURRENT_TIMESTAMP' ? ' selected' }}>
  36. CURRENT_TIMESTAMP
  37. </option>
  38. </select>
  39. {% if char_editing == 'textarea' %}
  40. <textarea name="field_default_value[{{ row_num }}]" cols="15" class="textfield default_value"></textarea>
  41. {% else %}
  42. <input type="text" name="field_default_value[{{ row_num }}]" size="12" value="" class="textfield default_value">
  43. {% endif %}
  44. </td>
  45. <td name="collation" class="nowrap">
  46. <select lang="en" dir="ltr" name="field_collation[{{ row_num }}]" id="field_{{ row_num }}_4">
  47. <option value=""></option>
  48. {% for charset in charsets %}
  49. <optgroup label="{{ charset.getName() }}" title="{{ charset.getDescription() }}">
  50. {% for collation in collations[charset.getName()] %}
  51. <option value="{{ collation.getName() }}" title="{{ collation.getDescription() }}"{{ row['col_collation'] == collation.getName() ? ' selected' }}>
  52. {{ collation.getName() }}
  53. </option>
  54. {% endfor %}
  55. </optgroup>
  56. {% endfor %}
  57. </select>
  58. </td>
  59. <td class="nowrap" name="col_attribute">
  60. {% include 'columns_definitions/column_attribute.twig' with {
  61. 'column_number': row_num,
  62. 'ci': 5,
  63. 'ci_offset': 0,
  64. 'column_meta': [],
  65. 'extracted_columnspec': {'attribute': row['col_attribute']},
  66. 'submit_attribute': false,
  67. 'attribute_types': attribute_types
  68. } only %}
  69. </td>
  70. <td class="nowrap" name="col_isNull">
  71. <input name="field_null[{{ row_num }}]" id="field_{{ row_num }}_6" type="checkbox" value="YES" class="allow_null"
  72. {{- row['col_isNull'] is not empty and row['col_isNull'] != 'NO' and row['col_isNull'] != 'NOT NULL' ? ' checked' }}>
  73. </td>
  74. <td class="nowrap" name="col_extra">
  75. <input name="col_extra[{{ row_num }}]" id="field_{{ row_num }}_7" type="checkbox" value="auto_increment"
  76. {{- row['col_extra'] is not empty and row['col_extra'] == 'auto_increment' }}>
  77. </td>
  78. </tr>