table.twig 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287
  1. {% set navigation_html %}
  2. {% if navigation is not empty %}
  3. <table class="pma-table navigation nospacing nopadding print_ignore">
  4. <tr>
  5. <td class="navigation_separator"></td>
  6. {{ navigation.move_backward_buttons|raw }}
  7. {{ navigation.page_selector|raw }}
  8. {{ navigation.move_forward_buttons|raw }}
  9. {% if navigation.number_total_page > 1 %}
  10. <td><div class="navigation_separator">|</div></td>
  11. {% endif %}
  12. {% if navigation.has_show_all %}
  13. <td>
  14. <form action="{{ url('/sql') }}" method="post">
  15. {{ get_hidden_fields(navigation.hidden_fields|merge({
  16. 'session_max_rows': navigation.session_max_rows,
  17. 'pos': '0'
  18. })) }}
  19. <input type="checkbox" name="navig" id="showAll_{{ unique_id }}" class="showAllRows" value="all"
  20. {{- navigation.is_showing_all ? ' checked' }}>
  21. <label for="showAll_{{ unique_id }}">{% trans 'Show all' %}</label>
  22. </form>
  23. </td>
  24. <td><div class="navigation_separator">|</div></td>
  25. {% endif %}
  26. <td>
  27. <div class="save_edited hide">
  28. <input class="btn btn-link" type="submit" value="{% trans 'Save edited data' %}">
  29. <div class="navigation_separator">|</div>
  30. </div>
  31. </td>
  32. <td>
  33. <div class="restore_column hide">
  34. <input class="btn btn-link" type="submit" value="{% trans 'Restore column order' %}">
  35. <div class="navigation_separator">|</div>
  36. </div>
  37. </td>
  38. <td class="navigation_goto">
  39. <form action="{{ url('/sql') }}" method="post" id="maxRowsForm">
  40. {{ get_hidden_fields(navigation.hidden_fields|merge({
  41. 'pos': navigation.pos,
  42. 'unlim_num_rows': unlim_num_rows
  43. })) }}
  44. <label for="sessionMaxRowsSelect">{% trans 'Number of rows:' %}</label>
  45. <select class="autosubmit" name="session_max_rows" id="sessionMaxRowsSelect">
  46. {% if navigation.is_showing_all %}
  47. <option value="" disabled selected>{% trans 'All' %}</option>
  48. {% endif %}
  49. {% for option in ['25', '50', '100', '250', '500'] %}
  50. <option value="{{ option }}"{{ navigation.max_rows == option ? ' selected' }}>{{ option }}</option>
  51. {% endfor %}
  52. </select>
  53. </form>
  54. </td>
  55. <td class="navigation_separator"></td>
  56. <td class="largescreenonly">
  57. <span>{% trans 'Filter rows' %}:</span>
  58. <input type="text" class="filter_rows" placeholder="
  59. {%- trans 'Search this table' %}" data-for="{{ unique_id }}">
  60. </td>
  61. <td class="largescreenonly">
  62. {{ navigation.sort_by_key|raw }}
  63. </td>
  64. <td class="navigation_separator"></td>
  65. </tr>
  66. </table>
  67. {% endif %}
  68. {% endset %}
  69. {{ sql_query_message|raw }}
  70. {{ navigation_html }}
  71. <input class="save_cells_at_once" type="hidden" value="{{ save_cells_at_once }}">
  72. <div class="common_hidden_inputs">
  73. {{ get_hidden_inputs(db, table) }}
  74. </div>
  75. {% if headers.column_order is not empty %}
  76. {% if headers.column_order.order %}
  77. <input class="col_order" type="hidden" value="{{ headers.column_order.order|join(',') }}">
  78. {% endif %}
  79. {% if headers.column_order.visibility %}
  80. <input class="col_visib" type="hidden" value="{{ headers.column_order.visibility|join(',') }}">
  81. {% endif %}
  82. {% if not headers.column_order.is_view %}
  83. <input class="table_create_time" type="hidden" value="{{ headers.column_order.table_create_time }}">
  84. {% endif %}
  85. {% endif %}
  86. {% if headers.options is not empty %}
  87. <form method="post" action="{{ url('/sql') }}" name="displayOptionsForm" class="ajax print_ignore">
  88. {{ get_hidden_inputs({
  89. 'db': db,
  90. 'table': table,
  91. 'sql_query': sql_query,
  92. 'goto': goto,
  93. 'display_options_form': 1
  94. }) }}
  95. <div{% if default_sliders_state != 'disabled' -%}
  96. {{- default_sliders_state == 'closed' ? ' style="display: none; overflow:auto;"' }} class="pma_auto_slider" title="{% trans 'Options' %}"
  97. {%- endif %}>
  98. <fieldset>
  99. <div class="formelement">
  100. <div>
  101. <input type="radio" name="pftext" id="partialFulltextRadioP{{ unique_id }}" value="P"{{ headers.options.pftext == 'P' ? ' checked' }}>
  102. <label for="partialFulltextRadioP{{ unique_id }}">{% trans 'Partial texts' %}</label>
  103. </div>
  104. <div>
  105. <input type="radio" name="pftext" id="partialFulltextRadioF{{ unique_id }}" value="F"{{ headers.options.pftext == 'F' ? ' checked' }}>
  106. <label for="partialFulltextRadioF{{ unique_id }}">{% trans 'Full texts' %}</label>
  107. </div>
  108. </div>
  109. {% if relwork and displaywork %}
  110. <div class="formelement">
  111. <div>
  112. <input type="radio" name="relational_display" id="relationalDisplayRadioK{{ unique_id }}" value="K"{{ headers.options.relational_display == 'K' ? ' checked' }}>
  113. <label for="relationalDisplayRadioK{{ unique_id }}">{% trans 'Relational key' %}</label>
  114. </div>
  115. <div>
  116. <input type="radio" name="relational_display" id="relationalDisplayRadioD{{ unique_id }}" value="D"{{ headers.options.relational_display == 'D' ? ' checked' }}>
  117. <label for="relationalDisplayRadioD{{ unique_id }}">{% trans 'Display column for relationships' %}</label>
  118. </div>
  119. </div>
  120. {% endif %}
  121. <div class="formelement">
  122. <input type="checkbox" name="display_binary" id="display_binary_{{ unique_id }}"
  123. {{- headers.options.display_binary is not empty ? ' checked' }}>
  124. <label for="display_binary_{{ unique_id }}">{% trans 'Show binary contents' %}</label>
  125. <input type="checkbox" name="display_blob" id="display_blob_{{ unique_id }}"
  126. {{- headers.options.display_blob is not empty ? ' checked' }}>
  127. <label for="display_blob_{{ unique_id }}">{% trans 'Show BLOB contents' %}</label>
  128. </div>
  129. {# I would have preferred to name this "display_transformation".
  130. This is the only way I found to be able to keep this setting sticky
  131. per SQL query, and at the same time have a default that displays
  132. the transformations. #}
  133. <div class="formelement">
  134. <input type="checkbox" name="hide_transformation" id="hide_transformation_{{ unique_id }}"
  135. {{- headers.options.hide_transformation is not empty ? ' checked' }}>
  136. <label for="hide_transformation_{{ unique_id }}">{% trans 'Hide browser transformation' %}</label>
  137. </div>
  138. <div class="formelement">
  139. {% if headers.options.possible_as_geometry %}
  140. <div>
  141. <input type="radio" name="geoOption" id="geoOptionRadioGeom{{ unique_id }}" value="GEOM"{{ headers.options.geo_option == 'GEOM' ? ' checked' }}>
  142. <label for="geoOptionRadioGeom{{ unique_id }}">{% trans 'Geometry' %}</label>
  143. </div>
  144. {% endif %}
  145. <div>
  146. <input type="radio" name="geoOption" id="geoOptionRadioWkt{{ unique_id }}" value="WKT"{{ headers.options.geo_option == 'WKT' ? ' checked' }}>
  147. <label for="geoOptionRadioWkt{{ unique_id }}">{% trans 'Well Known Text' %}</label>
  148. </div>
  149. <div>
  150. <input type="radio" name="geoOption" id="geoOptionRadioWkb{{ unique_id }}" value="WKB"{{ headers.options.geo_option == 'WKB' ? ' checked' }}>
  151. <label for="geoOptionRadioWkb{{ unique_id }}">{% trans 'Well Known Binary' %}</label>
  152. </div>
  153. </div>
  154. <div class="clearfloat"></div>
  155. </fieldset>
  156. <fieldset class="tblFooters">
  157. <input class="btn btn-primary" type="submit" value="{% trans 'Go' %}">
  158. </fieldset>
  159. </div>
  160. </form>
  161. {% endif %}
  162. {% if headers.has_bulk_actions_form %}
  163. <form method="post" name="resultsForm" id="resultsForm_{{ unique_id }}" class="ajax">
  164. {{ get_hidden_inputs(db, table, 1) }}
  165. <input type="hidden" name="goto" value="{{ url('/sql') }}">
  166. {% endif %}
  167. <div class="table-responsive-md">
  168. <table class="table table-light table-striped table-hover table-sm table_results data ajax w-auto" data-uniqueId="{{ unique_id }}">
  169. {{ headers.button|raw }}
  170. {{ headers.table_headers_for_columns|raw }}
  171. {{ headers.column_at_right_side|raw }}
  172. </tr>
  173. </thead>
  174. <tbody>
  175. {{ body|raw }}
  176. </tbody>
  177. </table>
  178. </div>
  179. {% if bulk_links is not empty %}
  180. <div class="print_ignore">
  181. <img class="selectallarrow" src="{{ select_all_arrow }}" width="38" height="22" alt="{% trans 'With selected:' %}">
  182. <input type="checkbox" id="resultsForm_{{ unique_id }}_checkall" class="checkall_box" title="{% trans 'Check all' %}">
  183. <label for="resultsForm_{{ unique_id }}_checkall">{% trans 'Check all' %}</label>
  184. <em class="with-selected">{% trans 'With selected:' %}</em>
  185. <button class="btn btn-link mult_submit" type="submit" name="submit_mult" value="edit" title="{% trans 'Edit' %}">
  186. {{ get_icon('b_edit', 'Edit'|trans) }}
  187. </button>
  188. <button class="btn btn-link mult_submit" type="submit" name="submit_mult" value="copy" title="{% trans 'Copy' %}">
  189. {{ get_icon('b_insrow', 'Copy'|trans) }}
  190. </button>
  191. <button class="btn btn-link mult_submit" type="submit" name="submit_mult" value="delete" title="{% trans 'Delete' %}">
  192. {{ get_icon('b_drop', 'Delete'|trans) }}
  193. </button>
  194. {% if bulk_links.has_export_button %}
  195. <button class="btn btn-link mult_submit" type="submit" name="submit_mult" value="export" title="{% trans 'Export' %}">
  196. {{ get_icon('b_tblexport', 'Export'|trans) }}
  197. </button>
  198. {% endif %}
  199. </div>
  200. <input type="hidden" name="clause_is_unique" value="{{ bulk_links.clause_is_unique }}">
  201. <input type="hidden" name="sql_query" value="{{ sql_query }}">
  202. </form>
  203. {% endif %}
  204. {{ navigation_html }}
  205. {% if operations is not empty %}
  206. <fieldset class="print_ignore">
  207. <legend>{% trans 'Query results operations' %}</legend>
  208. {% if operations.has_print_link %}
  209. {{ link_or_button(
  210. '#',
  211. get_icon('b_print', 'Print'|trans, true),
  212. {'id': 'printView', 'class': 'btn'},
  213. 'print_view'
  214. ) }}
  215. {{ link_or_button(
  216. '#',
  217. get_icon('b_insrow', 'Copy to clipboard'|trans, true),
  218. {'id': 'copyToClipBoard', 'class': 'btn'}
  219. ) }}
  220. {% endif %}
  221. {% if not operations.has_procedure %}
  222. {% if operations.has_export_link %}
  223. {{ link_or_button(
  224. url('/table/export', operations.url_params),
  225. get_icon('b_tblexport', 'Export'|trans, true),
  226. {'class': 'btn'}
  227. ) }}
  228. {{ link_or_button(
  229. url('/table/chart', operations.url_params),
  230. get_icon('b_chart', 'Display chart'|trans, true),
  231. {'class': 'btn'}
  232. ) }}
  233. {% if operations.has_geometry %}
  234. {{ link_or_button(
  235. url('/table/gis-visualization', operations.url_params),
  236. get_icon('b_globe', 'Visualize GIS data'|trans, true),
  237. {'class': 'btn'}
  238. ) }}
  239. {% endif %}
  240. {% endif %}
  241. <span>
  242. {{ link_or_button(
  243. url('/view/create', {'db': db, 'table': table, 'sql_query': sql_query, 'printview': true}),
  244. get_icon('b_view_add', 'Create view'|trans, true),
  245. {'class': 'btn create_view ajax'}
  246. ) }}
  247. </span>
  248. {% endif %}
  249. </fieldset>
  250. {% endif %}