Merge table structure tamplates

Signed-off-by: Leonardo Strozzi <laps15@inf.ufpr.br>
This commit is contained in:
Leonardo Strozzi 2018-07-11 17:14:05 -03:00
parent 4e81d3f27d
commit 108f445ee6
10 changed files with 483 additions and 551 deletions

View File

@ -1,140 +0,0 @@
<td class="print_ignore"><ul class="table-structure-actions resizable-menu">
{% if hide_structure_actions %}
<li class="submenu shown">
<a href="#" class="tab nowrap">{{ Util_getIcon('b_more', 'More'|trans) }}</a>
<ul>
{% endif %}
{# Add primary #}
{% include 'table/structure/action_row_in_structure_table.twig' with {
'type': type,
'tbl_storage_engine': tbl_storage_engine,
'class': 'primary nowrap',
'has_field': primary and primary.hasColumn(field_name),
'has_link_class': true,
'url_query': url_query,
'primary': primary,
'syntax': 'ADD PRIMARY KEY',
'message': 'A primary key has been added on %s.'|trans,
'action': 'Primary',
'titles': titles,
'row': row,
'is_primary': true,
'table': table
} only %}
{# Add unique #}
{% include 'table/structure/action_row_in_structure_table.twig' with {
'type': type,
'tbl_storage_engine': tbl_storage_engine,
'class': 'add_unique unique nowrap',
'has_field': field_name in columns_with_unique_index,
'has_link_class': false,
'url_query': url_query,
'primary': primary,
'syntax': 'ADD UNIQUE',
'message': 'An index has been added on %s.'|trans,
'action': 'Unique',
'titles': titles,
'row': row,
'is_primary': false,
'table': table
} only %}
{# Add index #}
{% include 'table/structure/action_row_in_structure_table.twig' with {
'type': type,
'tbl_storage_engine': tbl_storage_engine,
'class': 'add_index nowrap',
'has_field': false,
'has_link_class': false,
'url_query': url_query,
'primary': primary,
'syntax': 'ADD INDEX',
'message': 'An index has been added on %s.'|trans,
'action': 'Index',
'titles': titles,
'row': row,
'is_primary': false,
'table': table
} only %}
{# Add spatial #}
{% set spatial_types = [
'geometry',
'point',
'linestring',
'polygon',
'multipoint',
'multilinestring',
'multipolygon',
'geomtrycollection'
] %}
{% include 'table/structure/action_row_in_structure_table.twig' with {
'type': type,
'tbl_storage_engine': tbl_storage_engine,
'class': 'spatial nowrap',
'has_field': type not in spatial_types and
(tbl_storage_engine == 'MYISAM' or mysql_int_version >= 50705),
'has_link_class': false,
'url_query': url_query,
'primary': primary,
'syntax': 'ADD SPATIAL',
'message': 'An index has been added on %s.'|trans,
'action': 'Spatial',
'titles': titles,
'row': row,
'is_primary': false,
'table': table
} only %}
{# FULLTEXT is possible on TEXT, CHAR and VARCHAR #}
<li class="fulltext nowrap">
{% if tbl_storage_engine is not empty and (
tbl_storage_engine == 'MYISAM'
or tbl_storage_engine == 'ARIA'
or tbl_storage_engine == 'MARIA'
or (tbl_storage_engine == 'INNODB' and mysql_int_version >= 50604)
) and ('text' in type or 'char' in type) %}
<a rel="samepage" class="ajax add_key add_fulltext_anchor" href="tbl_structure.php"
data-post="{{- url_query|raw }}&amp;add_key=1&amp;sql_query=
{{- ('ALTER TABLE ' ~ Util_backquote(table)
~ ' ADD FULLTEXT(' ~ Util_backquote(row['Field'])
~ ');')|url_encode }}&amp;message_to_show=
{{- ('An index has been added on %s.'|trans|format(row['Field']|e))|url_encode }}">
{{ titles['IdxFulltext']|raw }}
</a>
{% else %}
{{ titles['NoIdxFulltext']|raw }}
{% endif %}
</li>
{# Distinct value action #}
<li class="browse nowrap">
<a href="sql.php" data-post="{{ url_query|raw }}&amp;sql_query=
{{- ('SELECT COUNT(*) AS ' ~ Util_backquote('Rows'|trans)
~ ', ' ~ Util_backquote(row['Field'])
~ ' FROM ' ~ Util_backquote(table)
~ ' GROUP BY ' ~ Util_backquote(row['Field'])
~ ' ORDER BY ' ~ Util_backquote(row['Field']))|url_encode -}}
&amp;is_browse_distinct=1">
{{ titles['DistinctValues']|raw }}
</a>
</li>
{% if central_columns_work %}
<li class="browse nowrap">
{% if is_in_central_columns %}
<a href="#" class="central_columns remove_button">
{{ Util_getIcon('centralColumns_delete', 'Remove from central columns'|trans) }}
</a>
{% else %}
<a href="#" class="central_columns add_button">
{{ Util_getIcon('centralColumns_add', 'Add to central columns'|trans) }}
</a>
{% endif %}
</li>
{% endif %}
{% if hide_structure_actions %}
</ul>
</li>
{% endif %}
</ul></td>

View File

@ -1,24 +0,0 @@
<form method="post" action="tbl_addfield.php" id="addColumns" name="addColumns">
{{ Url_getHiddenInputs(db, table) }}
{% if Util_showIcons('ActionLinksMode') %}
{{ Util_getImage('b_insrow', 'Add column'|trans) }}&nbsp;
{% endif %}
{% set num_fields -%}
<input type="number" name="num_fields" value="1" onfocus="this.select()" min="1" required />
{%- endset %}
{{ 'Add %s column(s)'|trans|format(num_fields)|raw }}
<input type="hidden" name="field_where" value="after"/>&nbsp;
{# I tried displaying the drop-down inside the label but with Firefox the drop-down was blinking #}
<select name="after_field">
<option value="first" data-pos="first">
{% trans 'at beginning of table' %}
</option>
{% for one_column_name in columns_list %}
<option value="{{ one_column_name }}"
{{- loop.revindex0 == 0 ? ' selected="selected"' }}>
{{ 'after %s'|trans|format(one_column_name|e) }}
</option>
{% endfor %}
</select>
<input type="submit" value="{% trans 'Go' %}" />
</form>

View File

@ -1,93 +0,0 @@
<div class="print_ignore">
{% include 'select_all.twig' with {
'pma_theme_image': pma_theme_image,
'text_dir': text_dir,
'form_name': 'fieldsForm'
} only %}
{{ Util_getButtonOrImage(
'submit_mult',
'mult_submit',
'Browse'|trans,
'b_browse',
'browse'
) }}
{% if not tbl_is_view and not db_is_system_schema %}
{{ Util_getButtonOrImage(
'submit_mult',
'mult_submit change_columns_anchor ajax',
'Change'|trans,
'b_edit',
'change'
) }}
{{ Util_getButtonOrImage(
'submit_mult',
'mult_submit',
'Drop'|trans,
'b_drop',
'drop'
) }}
{% if tbl_storage_engine != 'ARCHIVE' %}
{{ Util_getButtonOrImage(
'submit_mult',
'mult_submit',
'Primary'|trans,
'b_primary',
'primary'
) }}
{{ Util_getButtonOrImage(
'submit_mult',
'mult_submit',
'Unique'|trans,
'b_unique',
'unique'
) }}
{{ Util_getButtonOrImage(
'submit_mult',
'mult_submit',
'Index'|trans,
'b_index',
'index'
) }}
{{ Util_getButtonOrImage(
'submit_mult',
'mult_submit',
'Fulltext'|trans,
'b_ftext',
'ftext'
) }}
{% if tbl_storage_engine is not empty and (
tbl_storage_engine == 'MYISAM'
or tbl_storage_engine == 'ARIA'
or tbl_storage_engine == 'MARIA') %}
{{ Util_getButtonOrImage(
'submit_mult',
'mult_submit',
'Fulltext'|trans,
'b_ftext',
'ftext'
) }}
{% endif %}
{% if central_columns_work %}
{{ Util_getButtonOrImage(
'submit_mult',
'mult_submit',
'Add to central columns'|trans,
'centralColumns_add',
'add_to_central_columns'
) }}
{{ Util_getButtonOrImage(
'submit_mult',
'mult_submit',
'Remove from central columns'|trans,
'centralColumns_delete',
'remove_from_central_columns'
) }}
{% endif %}
{% endif %}
{% endif %}
</div>

View File

@ -12,11 +12,27 @@
<div class="responsivetable">
<table id="tablestructure" class="data topmargin">
{# Table header #}
{% include 'table/structure/table_structure_header.twig' with {
'db_is_system_schema': db_is_system_schema,
'tbl_is_view': tbl_is_view,
'show_column_comments': show_column_comments
} only %}
<thead>
<tr>
<th class="print_ignore"></th>
<th>#</th>
<th>{% trans 'Name' %}</th>
<th>{% trans 'Type' %}</th>
<th>{% trans 'Collation' %}</th>
<th>{% trans 'Attributes' %}</th>
<th>{% trans 'Null' %}</th>
<th>{% trans 'Default' %}</th>
{% if show_column_comments -%}
<th>{% trans 'Comments' %}</th>
{%- endif %}
<th>{% trans 'Extra' %}</th>
{# @see tbl_structure.js, function moreOptsMenuResize() #}
{% if not db_is_system_schema and not tbl_is_view %}
<th colspan="{{ Util_showIcons('ActionLinksMode') ? '8' : '9' -}}
" class="action print_ignore">{% trans 'Action' %}</th>
{% endif %}
</tr>
</thead>
<tbody>
{# Table body #}
{% set rownum = 0 %}
@ -30,64 +46,325 @@
{# Underline commented fields and display a hover-title (CSS only) #}
<tr>
{% include 'table/structure/table_structure_row.twig' with {
'row': row,
'rownum': rownum,
'displayed_field': displayed_fields[rownum],
'type_nowrap': Util_getClassForType(extracted_columnspec['type']),
'extracted_columnspec': extracted_columnspec,
'attribute': attributes[rownum],
'tbl_is_view': tbl_is_view,
'db_is_system_schema': db_is_system_schema,
'url_query': url_query,
'titles': titles,
'table': table,
'tbl_storage_engine': tbl_storage_engine,
'field_charset': row['Collation'],
'comments': comments,
'show_column_comments': show_column_comments,
'relation_commwork': relation_commwork,
'relation_mimework': relation_mimework,
'browse_mime': browse_mime
} only %}
<td class="center print_ignore">
<input type="checkbox" class="checkall" name="selected_fld[]" value="{{ row['Field'] }}" id="checkbox_row_{{ rownum }}"/>
</td>
<td class="right">{{ rownum }}</td>
<th class="nowrap">
<label for="checkbox_row_{{ rownum }}">
{% if displayed_fields[rownum].comment is defined %}
<span class="commented_column" title="{{ displayed_fields[rownum].comment }}">{{ displayed_fields[rownum].text }}</span>
{% else %}
{{ displayed_fields[rownum].text }}
{% endif %}
{{ displayed_fields[rownum].icon|raw }}
</label>
</th>
<td {{ Util_getClassForType(extracted_columnspec['type']) }}>
<bdo dir="ltr" lang="en">
{{ extracted_columnspec['displayed_type']|raw }}
{% if relation_commwork and relation_mimework and browse_mime
and mime_map[row['Field']]['mimetype'] is defined %}
<br />MIME: {{ mime_map[row['Field']]['mimetype']|replace({'_': '/'})|lower }}
{% endif %}
</bdo>
</td>
<td>
{% if row['Collation'] is not empty %}
<dfn title="{{ Charsets_getCollationDescr(row['Collation']) }}">{{ row['Collation'] }}</dfn>
{% endif %}
</td>
<td class="column_attribute nowrap">{{ attributes[rownum] }}</td>
<td>{{ row['Null'] == 'YES' ? 'Yes'|trans : 'No'|trans }}</td>
<td class="nowrap">
{% if row['Default'] is not null %}
{% if extracted_columnspec['type'] == 'bit' %}
{{ Util_convertBitDefaultValue(row['Default']) }}
{% else %}
{{ row['Default']|raw }}
{% endif %}
{% else %}
<em>{% trans %}None{% context %}None for default{% endtrans %}</em>
{% endif %}
</td>
{% if show_column_comments %}
<td>
{{ comments }}
</td>
{% endif %}
<td class="nowrap">{{ row['Extra']|upper }}</td>
{% if not tbl_is_view and not db_is_system_schema %}
{% include 'table/structure/actions_in_table_structure.twig' with {
'row': row,
'rownum': rownum,
'extracted_columnspec': extracted_columnspec,
'type': extracted_columnspec['print_type'] is not empty ? extracted_columnspec['print_type'],
'tbl_storage_engine': tbl_storage_engine,
'primary': primary,
'field_name': field_name,
'url_query': url_query,
'titles': titles,
'columns_with_unique_index': columns_with_unique_index,
'is_in_central_columns': row['Field'] in central_list ? true : false,
'central_columns_work': central_columns_work,
'table': table,
'hide_structure_actions': hide_structure_actions,
'mysql_int_version': mysql_int_version
} only %}
<td class="edit center print_ignore">
<a class="change_column_anchor ajax" href="tbl_structure.php
{{- url_query }}&amp;field={{ row['Field']|url_encode }}&amp;change_column=1">
{{ titles['Change']|raw }}
</a>
</td>
<td class="drop center print_ignore">
<a class="drop_column_anchor ajax" href="sql.php" data-post="{{ url_query }}&amp;sql_query=
{{- ('ALTER TABLE ' ~ Util_backquote(table)
~ ' DROP ' ~ Util_backquote(row['Field']) ~ ';')|url_encode -}}
&amp;dropped_column={{ row['Field']|url_encode }}&amp;purge=1&amp;message_to_show=
{{- ('Column %s has been dropped.'|trans|format(row['Field']|e))|url_encode }}">
{{ titles['Drop']|raw }}
</a>
</td>
{% endif %}
{% if not tbl_is_view and not db_is_system_schema %}
{% set type = extracted_columnspec['print_type'] is not empty ? extracted_columnspec['print_type'] %}
<td class="print_ignore">
<ul class="table-structure-actions resizable-menu">
{% if hide_structure_actions %}
<li class="submenu shown">
<a href="#" class="tab nowrap">{{ Util_getIcon('b_more', 'More'|trans) }}</a>
<ul>
{% endif %}
{# Add primary #}
{% include 'table/structure/action_row_in_structure_table.twig' with {
'type': type,
'tbl_storage_engine': tbl_storage_engine,
'class': 'primary nowrap',
'has_field': primary and primary.hasColumn(field_name),
'has_link_class': true,
'url_query': url_query,
'primary': primary,
'syntax': 'ADD PRIMARY KEY',
'message': 'A primary key has been added on %s.'|trans,
'action': 'Primary',
'titles': titles,
'row': row,
'is_primary': true,
'table': table
} only %}
{# Add unique #}
{% include 'table/structure/action_row_in_structure_table.twig' with {
'type': type,
'tbl_storage_engine': tbl_storage_engine,
'class': 'add_unique unique nowrap',
'has_field': field_name in columns_with_unique_index,
'has_link_class': false,
'url_query': url_query,
'primary': primary,
'syntax': 'ADD UNIQUE',
'message': 'An index has been added on %s.'|trans,
'action': 'Unique',
'titles': titles,
'row': row,
'is_primary': false,
'table': table
} only %}
{# Add index #}
{% include 'table/structure/action_row_in_structure_table.twig' with {
'type': type,
'tbl_storage_engine': tbl_storage_engine,
'class': 'add_index nowrap',
'has_field': false,
'has_link_class': false,
'url_query': url_query,
'primary': primary,
'syntax': 'ADD INDEX',
'message': 'An index has been added on %s.'|trans,
'action': 'Index',
'titles': titles,
'row': row,
'is_primary': false,
'table': table
} only %}
{# Add spatial #}
{% set spatial_types = [
'geometry',
'point',
'linestring',
'polygon',
'multipoint',
'multilinestring',
'multipolygon',
'geomtrycollection'
] %}
{% include 'table/structure/action_row_in_structure_table.twig' with {
'type': type,
'tbl_storage_engine': tbl_storage_engine,
'class': 'spatial nowrap',
'has_field': type not in spatial_types and
(tbl_storage_engine == 'MYISAM' or mysql_int_version >= 50705),
'has_link_class': false,
'url_query': url_query,
'primary': primary,
'syntax': 'ADD SPATIAL',
'message': 'An index has been added on %s.'|trans,
'action': 'Spatial',
'titles': titles,
'row': row,
'is_primary': false,
'table': table
} only %}
{# FULLTEXT is possible on TEXT, CHAR and VARCHAR #}
<li class="fulltext nowrap">
{% if tbl_storage_engine is not empty and (
tbl_storage_engine == 'MYISAM'
or tbl_storage_engine == 'ARIA'
or tbl_storage_engine == 'MARIA'
or (tbl_storage_engine == 'INNODB' and mysql_int_version >= 50604)
) and ('text' in type or 'char' in type) %}
<a rel="samepage" class="ajax add_key add_fulltext_anchor" href="tbl_structure.php"
data-post="{{- url_query|raw }}&amp;add_key=1&amp;sql_query=
{{- ('ALTER TABLE ' ~ Util_backquote(table)
~ ' ADD FULLTEXT(' ~ Util_backquote(row['Field'])
~ ');')|url_encode }}&amp;message_to_show=
{{- ('An index has been added on %s.'|trans|format(row['Field']|e))|url_encode }}">
{{ titles['IdxFulltext']|raw }}
</a>
{% else %}
{{ titles['NoIdxFulltext']|raw }}
{% endif %}
</li>
{# Distinct value action #}
<li class="browse nowrap">
<a href="sql.php" data-post="{{ url_query|raw }}&amp;sql_query=
{{- ('SELECT COUNT(*) AS ' ~ Util_backquote('Rows'|trans)
~ ', ' ~ Util_backquote(row['Field'])
~ ' FROM ' ~ Util_backquote(table)
~ ' GROUP BY ' ~ Util_backquote(row['Field'])
~ ' ORDER BY ' ~ Util_backquote(row['Field']))|url_encode -}}
&amp;is_browse_distinct=1">
{{ titles['DistinctValues']|raw }}
</a>
</li>
{% if central_columns_work %}
<li class="browse nowrap">
{% if row['Field'] in central_list %}
<a href="#" class="central_columns remove_button">
{{ Util_getIcon('centralColumns_delete', 'Remove from central columns'|trans) }}
</a>
{% else %}
<a href="#" class="central_columns add_button">
{{ Util_getIcon('centralColumns_add', 'Add to central columns'|trans) }}
</a>
{% endif %}
</li>
{% endif %}
{% if hide_structure_actions %}
</ul>
</li>
{% endif %}
</ul>
</td>
{% endif %}
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% include 'table/structure/check_all_table_column.twig' with {
'pma_theme_image': pma_theme_image,
'text_dir': text_dir,
'tbl_is_view': tbl_is_view,
'db_is_system_schema': db_is_system_schema,
'tbl_storage_engine': tbl_storage_engine,
'central_columns_work': central_columns_work
} only %}
<div class="print_ignore">
{% include 'select_all.twig' with {
'pma_theme_image': pma_theme_image,
'text_dir': text_dir,
'form_name': 'fieldsForm'
} only %}
{{ Util_getButtonOrImage(
'submit_mult',
'mult_submit',
'Browse'|trans,
'b_browse',
'browse'
) }}
{% if not tbl_is_view and not db_is_system_schema %}
{{ Util_getButtonOrImage(
'submit_mult',
'mult_submit change_columns_anchor ajax',
'Change'|trans,
'b_edit',
'change'
) }}
{{ Util_getButtonOrImage(
'submit_mult',
'mult_submit',
'Drop'|trans,
'b_drop',
'drop'
) }}
{% if tbl_storage_engine != 'ARCHIVE' %}
{{ Util_getButtonOrImage(
'submit_mult',
'mult_submit',
'Primary'|trans,
'b_primary',
'primary'
) }}
{{ Util_getButtonOrImage(
'submit_mult',
'mult_submit',
'Unique'|trans,
'b_unique',
'unique'
) }}
{{ Util_getButtonOrImage(
'submit_mult',
'mult_submit',
'Index'|trans,
'b_index',
'index'
) }}
{{ Util_getButtonOrImage(
'submit_mult',
'mult_submit',
'Fulltext'|trans,
'b_ftext',
'ftext'
) }}
{% if tbl_storage_engine is not empty and (
tbl_storage_engine == 'MYISAM'
or tbl_storage_engine == 'ARIA'
or tbl_storage_engine == 'MARIA') %}
{{ Util_getButtonOrImage(
'submit_mult',
'mult_submit',
'Fulltext'|trans,
'b_ftext',
'ftext'
) }}
{% endif %}
{% if central_columns_work %}
{{ Util_getButtonOrImage(
'submit_mult',
'mult_submit',
'Add to central columns'|trans,
'centralColumns_add',
'add_to_central_columns'
) }}
{{ Util_getButtonOrImage(
'submit_mult',
'mult_submit',
'Remove from central columns'|trans,
'centralColumns_delete',
'remove_from_central_columns'
) }}
{% endif %}
{% endif %}
{% endif %}
</div>
</form>
<hr class="print_ignore"/>
{% include 'table/structure/move_columns_dialog.twig' with {
'db': db,
'table': table
} only %}
<div id="move_columns_dialog" class="hide" title="{% trans 'Move columns' %}">
<p>{% trans 'Move the columns by dragging them up and down.' %}</p>
<form action="tbl_structure.php" name="move_column_form" id="move_column_form">
<div>
{{ Url_getHiddenInputs(db, table) }}
<ul></ul>
</div>
</form>
</div>
{# Work on the table #}
<div id="structure-action-links">
{% if tbl_is_view and not db_is_system_schema %}
@ -96,20 +373,63 @@
Util_getIcon('b_edit', 'Edit view'|trans, true)
) }}
{% endif %}
{% include 'table/structure/optional_action_links.twig' with {
'url_query': url_query,
'tbl_is_view': tbl_is_view,
'db_is_system_schema': db_is_system_schema,
'table': table,
'is_active': is_active
} only %}
<a href="#" id="printView">{{ Util_getIcon('b_print', 'Print'|trans, true) }}</a>
{% if not tbl_is_view and not db_is_system_schema %}
<a href="sql.php" data-post="{{ url_query|raw }}&amp;session_max_rows=all&amp;sql_query=
{{- ('SELECT * FROM ' ~ Util_backquote(table) ~ ' PROCEDURE ANALYSE()')|url_encode -}}
" style="margin-right: 0;">
{{ Util_getIcon(
'b_tblanalyse',
'Propose table structure'|trans,
true
) }}
</a>
{{ Util_showMySQLDocu('procedure_analyse') }}
{% if is_active %}
<a href="tbl_tracking.php{{ url_query|raw }}">
{{ Util_getIcon('eye', 'Track table'|trans, true) }}
</a>
{% endif %}
<a href="#" id="move_columns_anchor">
{{ Util_getIcon('b_move', 'Move columns'|trans, true) }}
</a>
<a href="normalization.php{{ url_query|raw }}">
{{ Util_getIcon('normalize', 'Normalize'|trans, true) }}
</a>
{% endif %}
{% if tbl_is_view and not db_is_system_schema %}
{% if is_active %}
<a href="tbl_tracking.php{{ url_query|raw }}">
{{ Util_getIcon('eye', 'Track view'|trans, true) }}
</a>
{% endif %}
{% endif %}
</div>
{% if not tbl_is_view and not db_is_system_schema %}
{% include 'table/structure/add_column.twig' with {
'columns_list': columns_list,
'db': db,
'table': table
} only %}
<form method="post" action="tbl_addfield.php" id="addColumns" name="addColumns">
{{ Url_getHiddenInputs(db, table) }}
{% if Util_showIcons('ActionLinksMode') %}
{{ Util_getImage('b_insrow', 'Add column'|trans) }}&nbsp;
{% endif %}
{% set num_fields -%}
<input type="number" name="num_fields" value="1" onfocus="this.select()" min="1" required />
{%- endset %}
{{ 'Add %s column(s)'|trans|format(num_fields)|raw }}
<input type="hidden" name="field_where" value="after"/>&nbsp;
{# I tried displaying the drop-down inside the label but with Firefox the drop-down was blinking #}
<select name="after_field">
<option value="first" data-pos="first">
{% trans 'at beginning of table' %}
</option>
{% for one_column_name in columns_list %}
<option value="{{ one_column_name }}"
{{- loop.revindex0 == 0 ? ' selected="selected"' }}>
{{ 'after %s'|trans|format(one_column_name|e) }}
</option>
{% endfor %}
</select>
<input type="submit" value="{% trans 'Go' %}" />
</form>
{% endif %}
{# Displays indexes #}

View File

@ -67,13 +67,102 @@
</table>
{% endif %}
{% include 'table/structure/row_stats_table.twig' with {
'showtable': showtable,
'tbl_collation': tbl_collation,
'is_innodb': is_innodb,
'mergetable': mergetable,
'avg_size': avg_size is defined ? avg_size : null,
'avg_unit': avg_unit is defined ? avg_unit : null
} only %}
{% set avg_size = avg_size is defined ? avg_size : null %}
{% set avg_unit = avg_unit is defined ? avg_unit : null %}
<table id="tablerowstats" class="width100 data">
<caption class="tblHeaders">{% trans 'Row statistics' %}</caption>
<tbody>
{% if showtable['Row_format'] is defined %}
<tr>
<th class="name">{% trans 'Format' %}</th>
{% if showtable['Row_format'] == 'Fixed' %}
<td class="value">{% trans 'static' %}</td>
{% elseif showtable['Row_format'] == 'Dynamic' %}
<td class="value">{% trans 'dynamic' %}</td>
{% else %}
<td class="value">{{ showtable['Row_format'] }}</td>
{% endif %}
</tr>
{% endif %}
{% if showtable['Create_options'] is not empty %}
<tr>
<th class="name">{% trans 'Options' %}</th>
{% if showtable['Create_options'] == 'partitioned' %}
<td class="value">{% trans 'partitioned' %}</td>
{% else %}
<td class="value">{{ showtable['Create_options'] }}</td>
{% endif %}
</tr>
{% endif %}
{% if tbl_collation is not empty %}
<tr>
<th class="name">{% trans 'Collation' %}</th>
<td class="value">
<dfn title="{{ Charsets_getCollationDescr(tbl_collation) }}">
{{ tbl_collation }}
</dfn>
</td>
</tr>
{% endif %}
{% if not is_innodb and showtable['Rows'] is defined %}
<tr>
<th class="name">{% trans 'Rows' %}</th>
<td class="value">{{ Util_formatNumber(showtable['Rows'], 0) }}</td>
</tr>
{% endif %}
{% if not is_innodb
and showtable['Avg_row_length'] is defined
and showtable['Avg_row_length'] > 0 %}
<tr>
<th class="name">{% trans 'Row length' %}</th>
{% set avg_row_length = Util_formatByteDown(showtable['Avg_row_length'], 6, 1) %}
<td class="value">{{ avg_row_length[0] }} {{ avg_row_length[1] }}</td>
</tr>
{% endif %}
{% if not is_innodb
and showtable['Data_length'] is defined
and showtable['Rows'] is defined
and showtable['Rows'] > 0
and mergetable == false %}
<tr>
<th class="name">{% trans 'Row size' %}</th>
<td class="value">{{ avg_size }} {{ avg_unit }}</td>
</tr>
{% endif %}
{% if showtable['Auto_increment'] is defined %}
<tr>
<th class="name">{% trans 'Next autoindex' %}</th>
<td class="value">{{ Util_formatNumber(showtable['Auto_increment'], 0) }}</td>
</tr>
{% endif %}
{% if showtable['Create_time'] is defined %}
<tr>
<th class="name">{% trans 'Creation' %}</th>
<td class="value">{{ Util_localisedDate(showtable['Create_time']|date('U')) }}</td>
</tr>
{% endif %}
{% if showtable['Update_time'] is defined %}
<tr>
<th class="name">{% trans 'Last update' %}</th>
<td class="value">{{ Util_localisedDate(showtable['Update_time']|date('U')) }}</td>
</tr>
{% endif %}
{% if showtable['Check_time'] is defined %}
<tr>
<th class="name">{% trans 'Last check' %}</th>
<td class="value">{{ Util_localisedDate(showtable['Check_time']|date('U')) }}</td>
</tr>
{% endif %}
</tbody>
</table>
</fieldset>
</div>

View File

@ -1,9 +0,0 @@
<div id="move_columns_dialog" class="hide" title="{% trans 'Move columns' %}">
<p>{% trans 'Move the columns by dragging them up and down.' %}</p>
<form action="tbl_structure.php" name="move_column_form" id="move_column_form">
<div>
{{ Url_getHiddenInputs(db, table) }}
<ul></ul>
</div>
</form>
</div>

View File

@ -1,31 +0,0 @@
<a href="#" id="printView">{{ Util_getIcon('b_print', 'Print'|trans, true) }}</a>
{% if not tbl_is_view and not db_is_system_schema %}
<a href="sql.php" data-post="{{ url_query|raw }}&amp;session_max_rows=all&amp;sql_query=
{{- ('SELECT * FROM ' ~ Util_backquote(table) ~ ' PROCEDURE ANALYSE()')|url_encode -}}
" style="margin-right: 0;">
{{ Util_getIcon(
'b_tblanalyse',
'Propose table structure'|trans,
true
) }}
</a>
{{ Util_showMySQLDocu('procedure_analyse') }}
{% if is_active %}
<a href="tbl_tracking.php{{ url_query|raw }}">
{{ Util_getIcon('eye', 'Track table'|trans, true) }}
</a>
{% endif %}
<a href="#" id="move_columns_anchor">
{{ Util_getIcon('b_move', 'Move columns'|trans, true) }}
</a>
<a href="normalization.php{{ url_query|raw }}">
{{ Util_getIcon('normalize', 'Normalize'|trans, true) }}
</a>
{% endif %}
{% if tbl_is_view and not db_is_system_schema %}
{% if is_active %}
<a href="tbl_tracking.php{{ url_query|raw }}">
{{ Util_getIcon('eye', 'Track view'|trans, true) }}
</a>
{% endif %}
{% endif %}

View File

@ -1,95 +0,0 @@
<table id="tablerowstats" class="width100 data">
<caption class="tblHeaders">{% trans 'Row statistics' %}</caption>
<tbody>
{% if showtable['Row_format'] is defined %}
<tr>
<th class="name">{% trans 'Format' %}</th>
{% if showtable['Row_format'] == 'Fixed' %}
<td class="value">{% trans 'static' %}</td>
{% elseif showtable['Row_format'] == 'Dynamic' %}
<td class="value">{% trans 'dynamic' %}</td>
{% else %}
<td class="value">{{ showtable['Row_format'] }}</td>
{% endif %}
</tr>
{% endif %}
{% if showtable['Create_options'] is not empty %}
<tr>
<th class="name">{% trans 'Options' %}</th>
{% if showtable['Create_options'] == 'partitioned' %}
<td class="value">{% trans 'partitioned' %}</td>
{% else %}
<td class="value">{{ showtable['Create_options'] }}</td>
{% endif %}
</tr>
{% endif %}
{% if tbl_collation is not empty %}
<tr>
<th class="name">{% trans 'Collation' %}</th>
<td class="value">
<dfn title="{{ Charsets_getCollationDescr(tbl_collation) }}">
{{ tbl_collation }}
</dfn>
</td>
</tr>
{% endif %}
{% if not is_innodb and showtable['Rows'] is defined %}
<tr>
<th class="name">{% trans 'Rows' %}</th>
<td class="value">{{ Util_formatNumber(showtable['Rows'], 0) }}</td>
</tr>
{% endif %}
{% if not is_innodb
and showtable['Avg_row_length'] is defined
and showtable['Avg_row_length'] > 0 %}
<tr>
<th class="name">{% trans 'Row length' %}</th>
{% set avg_row_length = Util_formatByteDown(showtable['Avg_row_length'], 6, 1) %}
<td class="value">{{ avg_row_length[0] }} {{ avg_row_length[1] }}</td>
</tr>
{% endif %}
{% if not is_innodb
and showtable['Data_length'] is defined
and showtable['Rows'] is defined
and showtable['Rows'] > 0
and mergetable == false %}
<tr>
<th class="name">{% trans 'Row size' %}</th>
<td class="value">{{ avg_size }} {{ avg_unit }}</td>
</tr>
{% endif %}
{% if showtable['Auto_increment'] is defined %}
<tr>
<th class="name">{% trans 'Next autoindex' %}</th>
<td class="value">{{ Util_formatNumber(showtable['Auto_increment'], 0) }}</td>
</tr>
{% endif %}
{% if showtable['Create_time'] is defined %}
<tr>
<th class="name">{% trans 'Creation' %}</th>
<td class="value">{{ Util_localisedDate(showtable['Create_time']|date('U')) }}</td>
</tr>
{% endif %}
{% if showtable['Update_time'] is defined %}
<tr>
<th class="name">{% trans 'Last update' %}</th>
<td class="value">{{ Util_localisedDate(showtable['Update_time']|date('U')) }}</td>
</tr>
{% endif %}
{% if showtable['Check_time'] is defined %}
<tr>
<th class="name">{% trans 'Last check' %}</th>
<td class="value">{{ Util_localisedDate(showtable['Check_time']|date('U')) }}</td>
</tr>
{% endif %}
</tbody>
</table>

View File

@ -1,21 +0,0 @@
<thead>
<tr>
<th class="print_ignore"></th>
<th>#</th>
<th>{% trans 'Name' %}</th>
<th>{% trans 'Type' %}</th>
<th>{% trans 'Collation' %}</th>
<th>{% trans 'Attributes' %}</th>
<th>{% trans 'Null' %}</th>
<th>{% trans 'Default' %}</th>
{% if show_column_comments -%}
<th>{% trans 'Comments' %}</th>
{%- endif %}
<th>{% trans 'Extra' %}</th>
{# @see tbl_structure.js, function moreOptsMenuResize() #}
{% if not db_is_system_schema and not tbl_is_view %}
<th colspan="{{ Util_showIcons('ActionLinksMode') ? '8' : '9' -}}
" class="action print_ignore">{% trans 'Action' %}</th>
{% endif %}
</tr>
</thead>

View File

@ -1,64 +0,0 @@
<td class="center print_ignore">
<input type="checkbox" class="checkall" name="selected_fld[]" value="{{ row['Field'] }}" id="checkbox_row_{{ rownum }}"/>
</td>
<td class="right">{{ rownum }}</td>
<th class="nowrap">
<label for="checkbox_row_{{ rownum }}">
{% if displayed_field.comment is defined %}
<span class="commented_column" title="{{ displayed_field.comment }}">{{ displayed_field.text }}</span>
{% else %}
{{ displayed_field.text }}
{% endif %}
{{ displayed_field.icon|raw }}
</label>
</th>
<td {{ type_nowrap }}>
<bdo dir="ltr" lang="en">
{{ extracted_columnspec['displayed_type']|raw }}
{% if relation_commwork and relation_mimework and browse_mime
and mime_map[row['Field']]['mimetype'] is defined %}
<br />MIME: {{ mime_map[row['Field']]['mimetype']|replace({'_': '/'})|lower }}
{% endif %}
</bdo>
</td>
<td>
{% if field_charset is not empty %}
<dfn title="{{ Charsets_getCollationDescr(field_charset) }}">{{ field_charset }}</dfn>
{% endif %}
</td>
<td class="column_attribute nowrap">{{ attribute }}</td>
<td>{{ row['Null'] == 'YES' ? 'Yes'|trans : 'No'|trans }}</td>
<td class="nowrap">
{% if row['Default'] is not null %}
{% if extracted_columnspec['type'] == 'bit' %}
{{ Util_convertBitDefaultValue(row['Default']) }}
{% else %}
{{ row['Default']|raw }}
{% endif %}
{% else %}
<em>{% trans %}None{% context %}None for default{% endtrans %}</em>
{% endif %}
</td>
{% if show_column_comments %}
<td>
{{ comments }}
</td>
{% endif %}
<td class="nowrap">{{ row['Extra']|upper }}</td>
{% if not tbl_is_view and not db_is_system_schema %}
<td class="edit center print_ignore">
<a class="change_column_anchor ajax" href="tbl_structure.php
{{- url_query }}&amp;field={{ row['Field']|url_encode }}&amp;change_column=1">
{{ titles['Change']|raw }}
</a>
</td>
<td class="drop center print_ignore">
<a class="drop_column_anchor ajax" href="sql.php" data-post="{{ url_query }}&amp;sql_query=
{{- ('ALTER TABLE ' ~ Util_backquote(table)
~ ' DROP ' ~ Util_backquote(row['Field']) ~ ';')|url_encode -}}
&amp;dropped_column={{ row['Field']|url_encode }}&amp;purge=1&amp;message_to_show=
{{- ('Column %s has been dropped.'|trans|format(row['Field']|e))|url_encode }}">
{{ titles['Drop']|raw }}
</a>
</td>
{% endif %}