diff --git a/libraries/classes/Tracking.php b/libraries/classes/Tracking.php
index c40e9e0e31..dd73cc80f4 100644
--- a/libraries/classes/Tracking.php
+++ b/libraries/classes/Tracking.php
@@ -863,33 +863,9 @@ class Tracking
*/
public static function getHtmlForColumns(array $columns)
{
- $html = '
' . __('Structure') . '
';
- $html .= '';
- $html .= '';
- $html .= '';
- $html .= '| ' . __('#') . ' | ';
- $html .= '' . __('Column') . ' | ';
- $html .= '' . __('Type') . ' | ';
- $html .= '' . __('Collation') . ' | ';
- $html .= '' . __('Null') . ' | ';
- $html .= '' . __('Default') . ' | ';
- $html .= '' . __('Extra') . ' | ';
- $html .= '' . __('Comment') . ' | ';
- $html .= '
';
- $html .= '';
- $html .= '';
- $index = 1;
- foreach ($columns as $field) {
- $html .= Template::get('table/tracking/structure_snapshot_field')->render([
- 'index' => $index++,
- 'field' => $field,
- ]);;
- }
-
- $html .= '';
- $html .= '
';
-
- return $html;
+ return Template::get('table/tracking/structure_snapshot_columns')->render([
+ 'columns' => $columns,
+ ]);
}
/**
diff --git a/templates/table/tracking/structure_snapshot_columns.twig b/templates/table/tracking/structure_snapshot_columns.twig
new file mode 100644
index 0000000000..c98dfbe341
--- /dev/null
+++ b/templates/table/tracking/structure_snapshot_columns.twig
@@ -0,0 +1,56 @@
+{% trans 'Structure' %}
+
+
+
+ | {% trans %}#{% context %}Number{% endtrans %} |
+ {% trans 'Column' %} |
+ {% trans 'Type' %} |
+ {% trans 'Collation' %} |
+ {% trans 'Null' %} |
+ {% trans 'Default' %} |
+ {% trans 'Extra' %} |
+ {% trans 'Comment' %} |
+
+
+
+ {% set index = 1 %}
+ {% for field in columns %}
+
+ | {{ index }} |
+ {% set index = index + 1 %}
+
+
+ {{ field['Field'] }}
+ {% if field['Key'] == 'PRI' %}
+ {{ Util_getImage('b_primary', 'Primary'|trans) }}
+ {% elseif field['Key'] is not empty %}
+ {{ Util_getImage('bd_primary', 'Index'|trans) }}
+ {% endif %}
+
+ |
+ {{ field['Type'] }} |
+ {{ field['Collation'] }} |
+ {{ field['Null'] == 'YES' ? 'Yes'|trans : 'No'|trans }} |
+
+ {% if field['Default'] is defined %}
+ {% set extracted_columnspec = Util_extractColumnSpec(field['Type']) %}
+ {% if extracted_columnspec['type'] == 'bit' %}
+ {# here, $field['Default'] contains something like b'010' #}
+ {{ Util_convertBitDefaultValue(field['Default']) }}
+ {% else %}
+ {{ field['Default'] }}
+ {% endif %}
+ {% else %}
+ {% if field['Null'] == 'YES' %}
+ NULL
+ {% else %}
+ {% trans %}None{% context %}None for default{% endtrans %}
+ {% endif %}
+ {% endif %}
+ |
+ {{ field['Extra'] }} |
+ {{ field['Comment'] }} |
+
+ {% endfor %}
+
+
diff --git a/templates/table/tracking/structure_snapshot_field.twig b/templates/table/tracking/structure_snapshot_field.twig
deleted file mode 100644
index 1e00edbbac..0000000000
--- a/templates/table/tracking/structure_snapshot_field.twig
+++ /dev/null
@@ -1,35 +0,0 @@
-
- | {{ index }} |
-
-
- {{ field['Field'] }}
- {% if field['Key'] == 'PRI' %}
- {{ Util_getImage('b_primary', 'Primary'|trans) }}
- {% elseif field['Key'] is not empty %}
- {{ Util_getImage('bd_primary', 'Index'|trans) }}
- {% endif %}
-
- |
- {{ field['Type'] }} |
- {{ field['Collation'] }} |
- {{ field['Null'] == 'YES' ? 'Yes'|trans : 'No'|trans }} |
-
- {% if field['Default'] is defined %}
- {% set extracted_columnspec = Util_extractColumnSpec(field['Type']) %}
- {% if extracted_columnspec['type'] == 'bit' %}
- {# here, $field['Default'] contains something like b'010' #}
- {{ Util_convertBitDefaultValue(field['Default']) }}
- {% else %}
- {{ field['Default'] }}
- {% endif %}
- {% else %}
- {% if field['Null'] == 'YES' %}
- NULL
- {% else %}
- {% trans %}None{% context %}None for default{% endtrans %}
- {% endif %}
- {% endif %}
- |
- {{ field['Extra'] }} |
- {{ field['Comment'] }} |
-