From 5a7645a3025ad522798112be5ee34aea57d1a734 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maur=C3=ADcio=20Meneghini=20Fauth?= Date: Tue, 3 Oct 2017 22:06:49 -0300 Subject: [PATCH] Port table/search/rows_normal template to Twig MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: MaurĂ­cio Meneghini Fauth --- templates/table/search/fields_table.phtml | 8 ++-- templates/table/search/rows_normal.phtml | 46 ----------------------- templates/table/search/rows_normal.twig | 39 +++++++++++++++++++ 3 files changed, 43 insertions(+), 50 deletions(-) delete mode 100644 templates/table/search/rows_normal.phtml create mode 100644 templates/table/search/rows_normal.twig diff --git a/templates/table/search/fields_table.phtml b/templates/table/search/fields_table.phtml index 2d3d60986a..5176270b0e 100644 --- a/templates/table/search/fields_table.phtml +++ b/templates/table/search/fields_table.phtml @@ -16,10 +16,10 @@ render(array( 'self' => $self, - 'geomColumnFlag' => $geomColumnFlag, - 'columnNames' => $columnNames, - 'columnTypes' => $columnTypes, - 'columnCollations' => $columnCollations + 'geom_column_flag' => $geomColumnFlag, + 'column_names' => $columnNames, + 'column_types' => $columnTypes, + 'column_collations' => $columnCollations )) ?> diff --git a/templates/table/search/rows_normal.phtml b/templates/table/search/rows_normal.phtml deleted file mode 100644 index d609144409..0000000000 --- a/templates/table/search/rows_normal.phtml +++ /dev/null @@ -1,46 +0,0 @@ - - - - - render(array( - 'column_index' => $column_index, - 'column_types' => $columnTypes, - )); ?> - - - - - - getColumnProperties($column_index, $column_index); ?> - - - - - - - - - - - - - - - - - - - diff --git a/templates/table/search/rows_normal.twig b/templates/table/search/rows_normal.twig new file mode 100644 index 0000000000..ee24abd6c1 --- /dev/null +++ b/templates/table/search/rows_normal.twig @@ -0,0 +1,39 @@ +{% for column_index in 0..column_names|length - 1 %} + + {# If 'Function' column is present trying to change comment #} + {% if geom_column_flag %} + {% include 'table/search/geom_func.twig' with { + 'column_index': column_index, + 'column_types': column_types + } only %} + {% endif %} + {# Displays column's name, type, collation and value #} + + {{ column_names[column_index] }} + + {% set properties = self.getColumnProperties(column_index, column_index) %} + + {{ properties['type'] }} + + + {{ properties['collation'] }} + + + {{ properties['func'] }} + + {# here, the data-type attribute is needed for a date/time picker #} + + {{ properties['value'] }} + {# Displays hidden fields #} + + + + + +{% endfor %}