Commit 0e6c03df authored by alexpott's avatar alexpott

Issue #1968398 by joelpittet, Mark Carver, Les Lim, brunodbo: Convert Views () to ['attributes'] .

parent 102b8e40
......@@ -4,8 +4,10 @@
* Default theme implementation for a view template to display a list of rows.
*
* Available variables:
* - attributes: HTML attributes for the container.
* - rows: A list of rows for this list.
* - row_classes: The row's HTML attributes correlating with the row's 'id'.
* - attributes: The row's HTML attributes.
* - content: The row's contents.
* - title: The title of this group of rows. May be empty.
* - list: @todo.
* - type: Starting tag will be either a ul or ol.
......@@ -16,8 +18,8 @@
* @ingroup themeable
*/
#}
{% if wrapper_attributes -%}
<div{{ wrapper_attributes }}>
{% if attributes -%}
<div{{ attributes }}>
{% endif %}
{% if title %}
<h3>{{ title }}</h3>
......@@ -29,15 +31,15 @@
<ol{{ list.attributes }}>
{% endif %}
{% for id, row in rows %}
<li{{ row_classes[id] }}>{{ row }}</li>
{% endfor %}
{% for row in rows %}
<li{{ row.attributes }}>{{ row.content }}</li>
{% endfor %}
{% if list.type == 'ul' %}
</ul>
{% else %}
</ol>
{% endif %}
{% if wrapper_attributes -%}
{% if attributes -%}
</div>
{% endif %}
......@@ -8,8 +8,7 @@
* - url: The URL to this row's content.
* - count: The number of items this summary item represents.
* - separator: A separator between each row.
* - row_classes: HTML attributes for a row, either containing an 'active' class
* or no attributes, that correlate to each row by ID.
* - attributes: HTML attributes for a row.
* - options: Flags indicating how each row should be displayed. This contains:
* - count: A flag indicating whether the row's 'count' should be displayed.
* - inline: A flag indicating whether the item should be wrapped in an inline
......@@ -20,12 +19,12 @@
* @ingroup themeable
*/
#}
{% for id, row in rows %}
{% for row in rows %}
{{ options.inline ? '<span' : '<div' }} class="views-summary views-summary-unformatted">
{% if row.separator -%}
{{ row.separator }}
{%- endif %}
<a href="{{ row.url }}"{{ row_classes[id] }}>{{ row.link }}</a>
<a href="{{ row.url }}"{{ row.attributes }}>{{ row.link }}</a>
{% if options.count %}
({{ row.count }})
{% endif %}
......
......@@ -9,8 +9,7 @@
* - url: The summary link URL.
* - link: The summary link text.
* - count: The number of items under this grouping.
* - row_classes: HTML classes to apply to each row, indexed by row ID.
* This matches the index in rows.
* - attributes: HTML attributes to apply to each row.
* - options: Flags indicating how the summary should be displayed.
* This contains:
* - count: A flag indicating whether the count should be displayed.
......@@ -22,8 +21,8 @@
#}
<div class="item-list">
<ul class="views-summary">
{% for id, row in rows %}
<li><a href="{{ row.url }}"{{ row_classes[id] }}>{{ row.link }}</a>
{% for row in rows %}
<li><a href="{{ row.url }}"{{ row.attributes }}>{{ row.link }}</a>
{% if options.count %}
({{ row.count }})
{% endif %}
......
......@@ -7,21 +7,19 @@
* - attributes: Remaining HTML attributes for the element.
* - class: HTML classes that can be used to style contextually through CSS.
* - title : The title of this group of rows.
* - header: Header labels.
* - header_classes: HTML classes to apply to each header cell, indexed by
* - header: The table header columns.
* - attributes: Remaining HTML attributes for the element.
* - content: HTML classes to apply to each header cell, indexed by
* the header's key.
* - caption_needed: Is the caption tag needed.
* - caption: The caption for this table.
* - accessibility_description: Extended description for the table details.
* - accessibility_summary: Summary for the table details.
* - rows: Table row items. Rows are keyed by row number, fields within rows
* are keyed by field ID.
* - field: Table data field ID.
* - content: Table data content.
* - row_classes: HTML classes to apply to each row, indexed by row number.
* This matches the index in rows.
* - field_classes: HTML classes to apply to each row, indexed by row number.
* This matches the index in columns and rows.
* - rows: Table row items. Rows are keyed by row number.
* - attributes: HTML classes to apply to each row.
* - columns: Row column items. Columns are keyed by column number.
* - attributes: HTML classes to apply to each column.
* - content: The column content.
*
* @see template_preprocess_views_view_table()
*
......@@ -51,20 +49,20 @@
{% if header %}
<thead>
<tr>
{% for key, field in header %}
<th{{ header_classes[key] }} scope="col">
{{ field }}
{% for column in header %}
<th{{ column.attributes }} scope="col">
{{ column.content }}
</th>
{% endfor %}
</tr>
</thead>
{% endif %}
<tbody>
{% for row_count, row in rows %}
<tr{{ row_classes[row_count] }}>
{% for field, content in row %}
<td{{ field_classes[field][row_count] }}>
{{ content }}
{% for row in rows %}
<tr{{ row.attributes }}>
{% for column in row.columns %}
<td{{ column.attributes }}>
{{ column.content }}
</td>
{% endfor %}
</tr>
......
......@@ -6,7 +6,8 @@
* Available variables:
* - title: The title of this group of rows. May be empty.
* - rows: A list of the view's row items.
* - row_classes: A list of row class attributes keyed by the row's ID.
* - attributes: The row's HTML attributes.
* - content: The row's content.
*
* @see template_preprocess_views_view_unformatted()
*
......@@ -16,8 +17,8 @@
{% if title %}
<h3>{{ title }}</h3>
{% endif %}
{% for id, row in rows %}
<div{{ row_classes[id] }}>
{{ row }}
{% for row in rows %}
<div{{ row.attributes }}>
{{ row.content }}
</div>
{% endfor %}
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment