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

indexes.twig « templates - github.com/phpmyadmin/phpmyadmin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 2122fbe68b48ec012f4f01829b46528a1ec60f93 (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
<fieldset class="pma-fieldset index_info">
  <legend id="index_header">
    {% trans 'Indexes' %}
    {{ show_mysql_docu('optimizing-database-structure') }}
  </legend>

  {% if indexes is not empty %}
    {{ indexes_duplicates|raw }}

    {{ include('modals/preview_sql_confirmation.twig') }}
    <div class="table-responsive jsresponsive">
      <table class="table table-striped table-hover table-sm w-auto align-middle" id="table_index">
        <thead>
        <tr>
            <th colspan="3" class="d-print-none">{% trans 'Action' %}</th>
            <th>{% trans 'Keyname' %}</th>
            <th>{% trans 'Type' %}</th>
            <th>{% trans 'Unique' %}</th>
            <th>{% trans 'Packed' %}</th>
            <th>{% trans 'Column' %}</th>
            <th>{% trans 'Cardinality' %}</th>
            <th>{% trans 'Collation' %}</th>
            <th>{% trans 'Null' %}</th>
            <th>{% trans 'Comment' %}</th>
          </tr>
        </thead>

        {% for index in indexes %}
          <tbody class="row_span">
            {% set columns_count = index.getColumnCount() %}
            <tr class="noclick">
              <td rowspan="{{ columns_count }}" class="edit_index d-print-none ajax">
                <a class="ajax" href="{{ url('/table/indexes') }}" data-post="{{ get_common(url_params|merge({'index': index.getName()}), '', false) }}">
                  {{ get_icon('b_edit', 'Edit'|trans) }}
                </a>
              </td>
              <td rowspan="{{ columns_count }}" class="rename_index d-print-none ajax" >
                <a class="ajax" href="{{ url('/table/indexes/rename') }}" data-post="{{ get_common(url_params|merge({'index': index.getName()}), '', false) }}">
                  {{ get_icon('b_rename', 'Rename'|trans) }}
                </a>
              </td>
              <td rowspan="{{ columns_count }}" class="d-print-none">
                {% if index.getName() == 'PRIMARY' %}
                  {% set index_params = {
                    'sql_query': 'ALTER TABLE ' ~ backquote(table) ~ ' DROP PRIMARY KEY;',
                    'message_to_show': 'The primary key has been dropped.'|trans
                  } %}
                {% else %}
                  {% set index_params = {
                    'sql_query': 'ALTER TABLE ' ~ backquote(table) ~ ' DROP INDEX ' ~ backquote(index.getName()) ~ ';',
                    'message_to_show': 'Index %s has been dropped.'|trans|format(index.getName())
                  } %}
                {% endif %}

                <input type="hidden" class="drop_primary_key_index_msg" value="{{ index_params.sql_query }}">
                {{ link_or_button(
                  url('/sql'),
                  url_params|merge(index_params),
                  get_icon('b_drop', 'Drop'|trans),
                  {'class': 'drop_primary_key_index_anchor ajax'}
                ) }}
              </td>
              <th rowspan="{{ columns_count }}">{{ index.getName() }}</th>
              <td rowspan="{{ columns_count }}">{{ index.getType()|default(index.getChoice()) }}</td>
              <td rowspan="{{ columns_count }}">{{ index.isUnique() ? 'Yes'|trans : 'No'|trans }}</td>
              <td rowspan="{{ columns_count }}">{{ index.isPacked()|raw }}</td>

              {% for column in index.getColumns() %}
                {% if column.getSeqInIndex() > 1 %}
                  <tr class="noclick">
                {% endif %}
                <td>
                  {% if column.hasExpression() %}{{ column.getExpression() }}{% else %}{{ column.getName() }}{% endif %}
                  {% if column.getSubPart() is not empty %}
                    ({{ column.getSubPart() }})
                  {% endif %}
                </td>
                <td>{{ column.getCardinality() }}</td>
                <td>{{ column.getCollation() }}</td>
                <td>{{ column.getNull(true) }}</td>

                {% if column.getSeqInIndex() == 1 %}
                  <td rowspan="{{ columns_count }}">{{ index.getComments() }}</td>
                {% endif %}
            </tr>
              {% endfor %}
          </tbody>
        {% endfor %}
      </table>
    </div>
  {% else %}
    <div class="no_indexes_defined">{{ 'No index defined!'|trans|notice }}</div>
  {% endif %}
</fieldset>