forked from matomo-org/matomo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refs matomo-org#4041, remove subtable_template property and _dataTabl…
…eActions_subDataTable.twig file.
- Loading branch information
Benaka Moorthi
committed
Sep 17, 2013
1 parent
2794144
commit 4bb2de9
Showing
7 changed files
with
73 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 0 additions & 28 deletions
28
plugins/CoreHome/templates/_dataTableActions_subDataTable.twig
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
72 changes: 44 additions & 28 deletions
72
plugins/CoreVisualizations/templates/_dataTableViz_htmlTable.twig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,50 @@ | ||
{%- set subtablesAreDisabled = properties.visualization_properties.show_goals_columns|default(false) | ||
and properties.visualization_properties.disable_subtable_when_show_goals|default(false) -%} | ||
<table cellspacing="0" class="dataTable"> | ||
{% include "@CoreHome/_dataTableHead.twig" %} | ||
{%- set showingEmbeddedSubtable = properties.visualization_properties.show_embedded_subtable is not empty | ||
and idSubtable is not empty -%} | ||
{% if error is defined %} | ||
{{ error.message }} | ||
{% else %} | ||
{%- if not showingEmbeddedSubtable -%} | ||
<table cellspacing="0" class="dataTable"> | ||
{% include "@CoreHome/_dataTableHead.twig" %} | ||
|
||
<tbody> | ||
{% for rowId, row in dataTable.getRows() %} | ||
{%- set rowHasSubtable = not subtablesAreDisabled and row.getIdSubDataTable() and properties.subtable_controller_action is not null -%} | ||
{%- set shouldHighlightRow = rowId == constant('Piwik\\DataTable::ID_SUMMARY_ROW') and properties.highlight_summary_row -%} | ||
<tbody> | ||
{%- endif -%} | ||
{% if showingEmbeddedSubtable and dataTable.getRowsCount() == 0 %} | ||
<tr> | ||
<td colspan="{{ properties.columns_to_display|length }}">{{ 'CoreHome_CategoryNoData'|translate }}</td> | ||
</tr> | ||
{% else %} | ||
{%- for rowId, row in dataTable.getRows() -%} | ||
{%- set rowHasSubtable = not subtablesAreDisabled and row.getIdSubDataTable() and properties.subtable_controller_action is not null -%} | ||
{%- set shouldHighlightRow = rowId == constant('Piwik\\DataTable::ID_SUMMARY_ROW') and properties.highlight_summary_row -%} | ||
|
||
{# display this row if it doesn't have a subtable or if we don't replace the row with the subtable #} | ||
{%- set showRow = subtablesAreDisabled | ||
or not rowHasSubtable | ||
or not properties.visualization_properties.show_expanded|default(false) | ||
or not properties.visualization_properties.replace_row_with_subtable|default(false) -%} | ||
{# display this row if it doesn't have a subtable or if we don't replace the row with the subtable #} | ||
{%- set showRow = subtablesAreDisabled | ||
or not rowHasSubtable | ||
or not properties.visualization_properties.show_expanded|default(false) | ||
or not properties.visualization_properties.replace_row_with_subtable|default(false) -%} | ||
|
||
{% if showRow %} | ||
<tr {% if rowHasSubtable %}id="{{ row.getIdSubDataTable() }}"{% endif %} | ||
class="{{ row.getMetadata('css_class') }} {% if rowHasSubtable %}subDataTable{% endif %}{% if shouldHighlightRow %} highlight{% endif %}"> | ||
{% for column in properties.columns_to_display %} | ||
<td> | ||
{% include "@CoreHome/_dataTableCell.twig" with properties %} | ||
</td> | ||
{% endfor %} | ||
</tr> | ||
{% if showRow %} | ||
<tr {% if rowHasSubtable %}id="{{ row.getIdSubDataTable() }}"{% endif %} | ||
class="{{ row.getMetadata('css_class') }} {% if rowHasSubtable %}subDataTable{% endif %}{% if shouldHighlightRow %} highlight{% endif %}"> | ||
{% for column in properties.columns_to_display %} | ||
<td> | ||
{% include "@CoreHome/_dataTableCell.twig" with properties %} | ||
</td> | ||
{% endfor %} | ||
</tr> | ||
{% endif %} | ||
|
||
{# display subtable if present and showing expanded datatable #} | ||
{% if properties.visualization_properties.show_expanded|default(false) and rowHasSubtable %} | ||
{% include "@CoreVisualizations/_dataTableViz_htmlTable.twig" with {'dataTable': row.getSubtable(), 'idSubtable': row.getIdSubDataTable()} %} | ||
{% endif %} | ||
{%- endfor -%} | ||
{% endif %} | ||
|
||
{# display subtable if present and showing expanded datatable #} | ||
{% if properties.visualization_properties.show_expanded|default(false) and rowHasSubtable %} | ||
{% include properties.visualization_properties.subtable_template with {'dataTable': row.getSubtable()} %} | ||
{% endif %} | ||
{% endfor %} | ||
</tbody> | ||
</table> | ||
{%- if not showingEmbeddedSubtable -%} | ||
</tbody> | ||
</table> | ||
{%- endif -%} | ||
{% endif %} |