Translated using Weblate (Czech)
[phpmyadmin.git] / templates / indexes.twig
blobf3c80503a377431e10bbbcbf5cb6cb220e03a266
1 <fieldset class="index_info">
2   <legend id="index_header">
3     {% trans 'Indexes' %}
4     {{ show_mysql_docu('optimizing-database-structure') }}
5   </legend>
7   {% if indexes is not empty %}
8     {{ indexes_duplicates|raw }}
10     <div class="responsivetable jsresponsive">
11       <table id="table_index">
12         <thead>
13           <tr>
14             <th colspan="2" class="print_ignore">{% trans 'Action' %}</th>
15             <th>{% trans 'Keyname' %}</th>
16             <th>{% trans 'Type' %}</th>
17             <th>{% trans 'Unique' %}</th>
18             <th>{% trans 'Packed' %}</th>
19             <th>{% trans 'Column' %}</th>
20             <th>{% trans 'Cardinality' %}</th>
21             <th>{% trans 'Collation' %}</th>
22             <th>{% trans 'Null' %}</th>
23             <th>{% trans 'Comment' %}</th>
24           </tr>
25         </thead>
27         {% for index in indexes %}
28           <tbody class="row_span">
29             {% set columns_count = index.getColumnCount() %}
30             <tr class="noclick">
31               <td rowspan="{{ columns_count }}" class="edit_index print_ignore ajax">
32                 <a class="ajax" href="{{ url('/table/indexes') }}" data-post="{{ get_common(url_params|merge({'index': index.getName()}), '') }}">
33                   {{ get_icon('b_edit', 'Edit'|trans) }}
34                 </a>
35               </td>
36               <td rowspan="{{ columns_count }}" class="print_ignore">
37                 {% if index.getName() == 'PRIMARY' %}
38                   {% set index_params = {
39                     'sql_query': 'ALTER TABLE ' ~ backquote(table) ~ ' DROP PRIMARY KEY;',
40                     'message_to_show': 'The primary key has been dropped.'|trans
41                   } %}
42                 {% else %}
43                   {% set index_params = {
44                     'sql_query': 'ALTER TABLE ' ~ backquote(table) ~ ' DROP INDEX ' ~ backquote(index.getName()) ~ ';',
45                     'message_to_show': 'Index %s has been dropped.'|trans|format(index.getName())
46                   } %}
47                 {% endif %}
49                 <input type="hidden" class="drop_primary_key_index_msg" value="{{ index_params.sql_query|js_format(false) }}">
50                 {{ link_or_button(
51                   url('/sql', url_params|merge(index_params)),
52                   get_icon('b_drop', 'Drop'|trans),
53                   {'class': 'drop_primary_key_index_anchor ajax'}
54                 ) }}
55               </td>
56               <th rowspan="{{ columns_count }}">{{ index.getName() }}</th>
57               <td rowspan="{{ columns_count }}">{{ index.getType()|default(index.getChoice()) }}</td>
58               <td rowspan="{{ columns_count }}">{{ index.isUnique() ? 'Yes'|trans : 'No'|trans }}</td>
59               <td rowspan="{{ columns_count }}">{{ index.isPacked()|raw }}</td>
61               {% for column in index.getColumns() %}
62                 {% if column.getSeqInIndex() > 1 %}
63                   <tr class="noclick">
64                 {% endif %}
65                 <td>
66                   {{ column.getName() }}
67                   {% if column.getSubPart() is not empty %}
68                     ({{ column.getSubPart() }})
69                   {% endif %}
70                 </td>
71                 <td>{{ column.getCardinality() }}</td>
72                 <td>{{ column.getCollation() }}</td>
73                 <td>{{ column.getNull(true) }}</td>
75                 {% if column.getSeqInIndex() == 1 %}
76                   <td rowspan="{{ columns_count }}">{{ index.getComments() }}</td>
77                 {% endif %}
78             </tr>
79               {% endfor %}
80           </tbody>
81         {% endfor %}
82       </table>
83     </div>
84   {% else %}
85     <div class="no_indexes_defined">{{ 'No index defined!'|trans|notice }}</div>
86   {% endif %}
87 </fieldset>