tables.twig 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. {# Tracked tables exists#}
  2. {% if head_version_exists %}
  3. <div id="tracked_tables">
  4. <h3>{% trans 'Tracked tables' %}</h3>
  5. <form method="post" action="db_tracking.php" name="trackedForm"
  6. id="trackedForm" class="ajax">
  7. {{ get_hidden_inputs(db) }}
  8. <table id="versions" class="data">
  9. <thead>
  10. <tr>
  11. <th></th>
  12. <th>{% trans 'Table' %}</th>
  13. <th>{% trans 'Last version' %}</th>
  14. <th>{% trans 'Created' %}</th>
  15. <th>{% trans 'Updated' %}</th>
  16. <th>{% trans 'Status' %}</th>
  17. <th>{% trans 'Action' %}</th>
  18. <th>{% trans 'Show' %}</th>
  19. </tr>
  20. </thead>
  21. <tbody>
  22. {% for version in versions %}
  23. <tr>
  24. <td class="center">
  25. <input type="checkbox" name="selected_tbl[]"
  26. class="checkall" id="selected_tbl_{{ version.table_name }}"
  27. value="{{ version.table_name }}">
  28. </td>
  29. <th>
  30. <label for="selected_tbl_{{ version.table_name }}">
  31. {{ version.table_name }}
  32. </label>
  33. </th>
  34. <td class="right">
  35. {{ version.version }}
  36. </td>
  37. <td>
  38. {{ version.date_created }}
  39. </td>
  40. <td>
  41. {{ version.date_updated }}
  42. </td>
  43. <td>
  44. {{ version.status_button|raw }}
  45. </td>
  46. <td>
  47. <a class="delete_tracking_anchor ajax" href="db_tracking.php" data-post="
  48. {{- get_common({
  49. 'db': db,
  50. 'goto': 'tbl_tracking.php',
  51. 'back': 'db_tracking.php',
  52. 'table': version.table_name,
  53. 'delete_tracking': true
  54. }, '') }}">
  55. {{ get_icon('b_drop', 'Delete tracking'|trans) }}
  56. </a>
  57. </td>
  58. <td>
  59. <a href="tbl_tracking.php" data-post="
  60. {{- get_common({
  61. 'db': db,
  62. 'goto': 'tbl_tracking.php',
  63. 'back': 'db_tracking.php',
  64. 'table': version.table_name
  65. }, '') }}">
  66. {{ get_icon('b_versions', 'Versions'|trans) }}
  67. </a>
  68. <a href="tbl_tracking.php" data-post="
  69. {{- get_common({
  70. 'db': db,
  71. 'goto': 'tbl_tracking.php',
  72. 'back': 'db_tracking.php',
  73. 'table': version.table_name,
  74. 'report': true,
  75. 'version': version.version
  76. }, '') }}">
  77. {{ get_icon('b_report', 'Tracking report'|trans) }}
  78. </a>
  79. <a href="tbl_tracking.php" data-post="
  80. {{- get_common({
  81. 'db': db,
  82. 'goto': 'tbl_tracking.php',
  83. 'back': 'db_tracking.php',
  84. 'table': version.table_name,
  85. 'snapshot': true,
  86. 'version': version.version
  87. }, '') }}">
  88. {{ get_icon('b_props', 'Structure snapshot'|trans) }}
  89. </a>
  90. </td>
  91. </tr>
  92. {% endfor %}
  93. </tbody>
  94. </table>
  95. {% include 'select_all.twig' with {
  96. 'pma_theme_image': pma_theme_image,
  97. 'text_dir': text_dir,
  98. 'form_name': 'trackedForm'
  99. } only %}
  100. {{ get_button_or_image(
  101. 'submit_mult',
  102. 'mult_submit',
  103. 'Delete tracking'|trans,
  104. 'b_drop',
  105. 'delete_tracking'
  106. ) }}
  107. </form>
  108. </div>
  109. {% endif %}
  110. {% if untracked_tables_exists %}
  111. <h3>{% trans 'Untracked tables' %}</h3>
  112. <form method="post" action="db_tracking.php" name="untrackedForm"
  113. id="untrackedForm" class="ajax">
  114. {{ get_hidden_inputs(db) }}
  115. <table id="noversions" class="data">
  116. <thead>
  117. <tr>
  118. <th></th>
  119. <th>{% trans 'Table' %}</th>
  120. <th>{% trans 'Action' %}</th>
  121. </tr>
  122. </thead>
  123. <tbody>
  124. {% for table_name in untracked_tables %}
  125. {% if get_tracker_version(db, table_name) == -1 %}
  126. <tr>
  127. <td class="center">
  128. <input type="checkbox" name="selected_tbl[]"
  129. class="checkall" id="selected_tbl_{{ table_name }}"
  130. value="{{ table_name }}">
  131. </td>
  132. <th>
  133. <label for="selected_tbl_{{ table_name }}">
  134. {{ table_name }}
  135. </label>
  136. </th>
  137. <td>
  138. <a href="tbl_tracking.php{{ url_query|raw }}&amp;table={{ table_name }}">
  139. {{ get_icon('eye', 'Track table'|trans) }}
  140. </a>
  141. </td>
  142. </tr>
  143. {% endif %}
  144. {% endfor %}
  145. </tbody>
  146. </table>
  147. {% include 'select_all.twig' with {
  148. 'pma_theme_image': pma_theme_image,
  149. 'text_dir': text_dir,
  150. 'form_name': 'untrackedForm'
  151. } only %}
  152. {{ get_button_or_image(
  153. 'submit_mult',
  154. 'mult_submit',
  155. 'Track table'|trans,
  156. 'eye',
  157. 'track'
  158. ) }}
  159. </form>
  160. {% endif %}