Welcome to mirror list, hosted at ThFree Co, Russian Federation.

table.twig « results « display « templates - github.com/phpmyadmin/phpmyadmin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: dada31e3c958f24e9ab881bb3cc6a293bf82446e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
{% set navigation_html %}
  {% if navigation is not empty %}
    <table class="pma-table navigation print_ignore">
      <tr>
        <td class="navigation_separator"></td>

        {{ navigation.move_backward_buttons|raw }}
        {{ navigation.page_selector|raw }}
        {{ navigation.move_forward_buttons|raw }}

        {% if navigation.number_total_page > 1 %}
          <td><div class="navigation_separator">|</div></td>
        {% endif %}

        {% if navigation.has_show_all %}
          <td>
            <form action="{{ url('/sql') }}" method="post">
              {{ get_hidden_fields(navigation.hidden_fields|merge({
                'session_max_rows': navigation.session_max_rows,
                'pos': '0'
              })) }}
              <input type="checkbox" name="navig" id="showAll_{{ unique_id }}" class="showAllRows" value="all"
                {{- navigation.is_showing_all ? ' checked' }}>
              <label for="showAll_{{ unique_id }}">{% trans 'Show all' %}</label>
            </form>
          </td>
          <td><div class="navigation_separator">|</div></td>
        {% endif %}

        <td>
          <div class="save_edited hide">
            <input class="btn btn-link" type="submit" value="{% trans 'Save edited data' %}">
            <div class="navigation_separator">|</div>
          </div>
        </td>
        <td>
          <div class="restore_column hide">
            <input class="btn btn-link" type="submit" value="{% trans 'Restore column order' %}">
            <div class="navigation_separator">|</div>
          </div>
        </td>
        <td class="navigation_goto">
          <form action="{{ url('/sql') }}" method="post" class="maxRowsForm">
            {{ get_hidden_fields(navigation.hidden_fields|merge({
              'pos': navigation.pos,
              'unlim_num_rows': unlim_num_rows
            })) }}

            <label for="sessionMaxRowsSelect">{% trans 'Number of rows:' %}</label>
            <select class="autosubmit" name="session_max_rows" id="sessionMaxRowsSelect">
              {% if navigation.is_showing_all %}
                <option value="" disabled selected>{% trans 'All' %}</option>
              {% endif %}
              {% for option in ['25', '50', '100', '250', '500'] %}
                <option value="{{ option }}"{{ navigation.max_rows == option ? ' selected' }}>{{ option }}</option>
              {% endfor %}
            </select>
          </form>
        </td>
        <td class="navigation_separator"></td>
        <td class="largescreenonly">
          <span>{% trans 'Filter rows' %}:</span>
          <input type="text" class="filter_rows" placeholder="
          {%- trans 'Search this table' %}" data-for="{{ unique_id }}">
        </td>
        <td class="largescreenonly">
          {{ navigation.sort_by_key|raw }}
        </td>
        <td class="navigation_separator"></td>
      </tr>
    </table>
  {% endif %}
{% endset %}

{{ sql_query_message|raw }}

{{ navigation_html }}

<input class="save_cells_at_once" type="hidden" value="{{ save_cells_at_once }}">
<div class="common_hidden_inputs">
  {{ get_hidden_inputs(db, table) }}
</div>

{% if headers.column_order is not empty %}
  {% if headers.column_order.order %}
    <input class="col_order" type="hidden" value="{{ headers.column_order.order|join(',') }}">
  {% endif %}
  {% if headers.column_order.visibility %}
    <input class="col_visib" type="hidden" value="{{ headers.column_order.visibility|join(',') }}">
  {% endif %}
  {% if not headers.column_order.is_view %}
    <input class="table_create_time" type="hidden" value="{{ headers.column_order.table_create_time }}">
  {% endif %}
{% endif %}

{% if headers.options is not empty %}
  <form method="post" action="{{ url('/sql') }}" name="displayOptionsForm" class="ajax print_ignore">
    {{ get_hidden_inputs({
      'db': db,
      'table': table,
      'sql_query': sql_query,
      'goto': goto,
      'display_options_form': 1
    }) }}

    <div{% if default_sliders_state != 'disabled' -%}
      {{- default_sliders_state == 'closed' ? ' style="display: none; overflow:auto;"' }} class="pma_auto_slider" title="{% trans 'Options' %}"
    {%- endif %}>

      <fieldset class="pma-fieldset">
        <div class="formelement">
          <div>
            <input type="radio" name="pftext" id="partialFulltextRadioP{{ unique_id }}" value="P"{{ headers.options.pftext == 'P' ? ' checked' }}>
            <label for="partialFulltextRadioP{{ unique_id }}">{% trans 'Partial texts' %}</label>
          </div>
          <div>
            <input type="radio" name="pftext" id="partialFulltextRadioF{{ unique_id }}" value="F"{{ headers.options.pftext == 'F' ? ' checked' }}>
            <label for="partialFulltextRadioF{{ unique_id }}">{% trans 'Full texts' %}</label>
          </div>
        </div>

        {% if relwork and displaywork %}
          <div class="formelement">
            <div>
              <input type="radio" name="relational_display" id="relationalDisplayRadioK{{ unique_id }}" value="K"{{ headers.options.relational_display == 'K' ? ' checked' }}>
              <label for="relationalDisplayRadioK{{ unique_id }}">{% trans 'Relational key' %}</label>
            </div>
            <div>
              <input type="radio" name="relational_display" id="relationalDisplayRadioD{{ unique_id }}" value="D"{{ headers.options.relational_display == 'D' ? ' checked' }}>
              <label for="relationalDisplayRadioD{{ unique_id }}">{% trans 'Display column for relationships' %}</label>
            </div>
          </div>
        {% endif %}

        <div class="formelement">
          <input type="checkbox" name="display_binary" id="display_binary_{{ unique_id }}"
            {{- headers.options.display_binary is not empty ? ' checked' }}>
          <label for="display_binary_{{ unique_id }}">{% trans 'Show binary contents' %}</label>

          <input type="checkbox" name="display_blob" id="display_blob_{{ unique_id }}"
            {{- headers.options.display_blob is not empty ? ' checked' }}>
          <label for="display_blob_{{ unique_id }}">{% trans 'Show BLOB contents' %}</label>
        </div>

        {# I would have preferred to name this "display_transformation".
           This is the only way I found to be able to keep this setting sticky
           per SQL query, and at the same time have a default that displays
           the transformations. #}
        <div class="formelement">
          <input type="checkbox" name="hide_transformation" id="hide_transformation_{{ unique_id }}"
            {{- headers.options.hide_transformation is not empty ? ' checked' }}>
          <label for="hide_transformation_{{ unique_id }}">{% trans 'Hide browser transformation' %}</label>
        </div>

        <div class="formelement">
          {% if headers.options.possible_as_geometry %}
            <div>
              <input type="radio" name="geoOption" id="geoOptionRadioGeom{{ unique_id }}" value="GEOM"{{ headers.options.geo_option == 'GEOM' ? ' checked' }}>
              <label for="geoOptionRadioGeom{{ unique_id }}">{% trans 'Geometry' %}</label>
            </div>
          {% endif %}
          <div>
            <input type="radio" name="geoOption" id="geoOptionRadioWkt{{ unique_id }}" value="WKT"{{ headers.options.geo_option == 'WKT' ? ' checked' }}>
            <label for="geoOptionRadioWkt{{ unique_id }}">{% trans 'Well Known Text' %}</label>
          </div>
          <div>
            <input type="radio" name="geoOption" id="geoOptionRadioWkb{{ unique_id }}" value="WKB"{{ headers.options.geo_option == 'WKB' ? ' checked' }}>
            <label for="geoOptionRadioWkb{{ unique_id }}">{% trans 'Well Known Binary' %}</label>
          </div>
        </div>
        <div class="clearfloat"></div>
      </fieldset>

      <fieldset class="pma-fieldset tblFooters">
        <input class="btn btn-primary" type="submit" value="{% trans 'Go' %}">
      </fieldset>
    </div>
  </form>
{% endif %}

{% if headers.has_bulk_actions_form %}
  <form method="post" name="resultsForm" id="resultsForm_{{ unique_id }}" class="ajax">
    {{ get_hidden_inputs(db, table, 1) }}
    <input type="hidden" name="goto" value="{{ url('/sql') }}">
{% endif %}

  <div class="table-responsive-md">
    <table class="table table-light table-striped table-hover table-sm table_results data ajax w-auto" data-uniqueId="{{ unique_id }}">

      {{ headers.button|raw }}
      {{ headers.table_headers_for_columns|raw }}
      {{ headers.column_at_right_side|raw }}

        </tr>
      </thead>

      <tbody>
        {{ body|raw }}
      </tbody>
    </table>
  </div>

{% if bulk_links is not empty %}
    <div class="print_ignore">
      <img class="selectallarrow" src="{{ image('arrow_' ~ text_dir ~ '.png') }}" width="38" height="22" alt="{% trans 'With selected:' %}">
      <input type="checkbox" id="resultsForm_{{ unique_id }}_checkall" class="checkall_box" title="{% trans 'Check all' %}">
      <label for="resultsForm_{{ unique_id }}_checkall">{% trans 'Check all' %}</label>
      <em class="with-selected">{% trans 'With selected:' %}</em>

      <button class="btn btn-link mult_submit" type="submit" name="submit_mult" value="edit" title="{% trans 'Edit' %}">
        {{ get_icon('b_edit', 'Edit'|trans) }}
      </button>

      <button class="btn btn-link mult_submit" type="submit" name="submit_mult" value="copy" title="{% trans 'Copy' %}">
        {{ get_icon('b_insrow', 'Copy'|trans) }}
      </button>

      <button class="btn btn-link mult_submit" type="submit" name="submit_mult" value="delete" title="{% trans 'Delete' %}">
        {{ get_icon('b_drop', 'Delete'|trans) }}
      </button>

      {% if bulk_links.has_export_button %}
        <button class="btn btn-link mult_submit" type="submit" name="submit_mult" value="export" title="{% trans 'Export' %}">
          {{ get_icon('b_tblexport', 'Export'|trans) }}
        </button>
      {% endif %}
    </div>

    <input type="hidden" name="clause_is_unique" value="{{ bulk_links.clause_is_unique }}">
    <input type="hidden" name="sql_query" value="{{ sql_query }}">
  </form>
{% endif %}

{{ navigation_html }}

{% if operations is not empty %}
  <fieldset class="pma-fieldset print_ignore">
    <legend>{% trans 'Query results operations' %}</legend>

    {% if operations.has_print_link %}
      {{ link_or_button(
        '#',
        get_icon('b_print', 'Print'|trans, true),
        {'id': 'printView', 'class': 'btn'},
        'print_view'
      ) }}

      {{ link_or_button(
        '#',
        get_icon('b_insrow', 'Copy to clipboard'|trans, true),
        {'id': 'copyToClipBoard', 'class': 'btn'}
      ) }}
    {% endif %}

    {% if not operations.has_procedure %}
      {% if operations.has_export_link %}
        {{ link_or_button(
          url('/table/export', operations.url_params),
          get_icon('b_tblexport', 'Export'|trans, true),
          {'class': 'btn'}
        ) }}

        {{ link_or_button(
          url('/table/chart', operations.url_params),
          get_icon('b_chart', 'Display chart'|trans, true),
          {'class': 'btn'}
        ) }}

        {% if operations.has_geometry %}
          {{ link_or_button(
            url('/table/gis-visualization', operations.url_params),
            get_icon('b_globe', 'Visualize GIS data'|trans, true),
            {'class': 'btn'}
          ) }}
        {% endif %}
      {% endif %}

      <span>
        {{ link_or_button(
          url('/view/create', {'db': db, 'table': table, 'sql_query': sql_query, 'printview': true}),
          get_icon('b_view_add', 'Create view'|trans, true),
          {'class': 'btn create_view ajax'}
        ) }}
      </span>
    {% endif %}
  </fieldset>
{% endif %}