Created
June 23, 2014 14:40
-
-
Save hubertperron/be337c8c2105b21fb671 to your computer and use it in GitHub Desktop.
Unifik list with APYDataGrid
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
{% extends 'AlikiSystemBundle:Backend/Allergen:layout.html.twig' %} | |
{% block content_header %} | |
<h1>{% trans %}Allergens List{% endtrans %}</h1> | |
{% endblock %} | |
{% block content_main %} | |
{{ grid(grid, _self) }} | |
{% endblock content_main %} | |
{% block grid_titles %} | |
<thead> | |
<tr class="grid-row-titles"> | |
{% for column in grid.columns %} | |
{% if column.visible(grid.isReadyForExport) %} | |
<th class="{% if column.align != 'left'%}align-{{ column.align }}{% endif %}{% if column.class %} {{ column.class }}{% endif %}{% if loop.last %} last-column{% endif %}{% if loop.first %} name{% endif %}"{% if(column.size > -1) %} style="width:{{ column.size }}px;"{% endif %}> | |
{%- spaceless %} | |
{% if column.type == 'massaction' %} | |
<input type="checkbox" class="grid-mass-selector" onclick="{{ grid.hash }}_markVisible(this.checked);"/> | |
{% else %} | |
{% set columnTitle = grid.prefixTitle ~ column.title ~ '__abbr' %} | |
{% if columnTitle|trans == columnTitle %} | |
{% set columnTitle = grid.prefixTitle ~ column.title %} | |
{% endif %} | |
{% if (column.sortable) %} | |
<a class="order" href="{{ grid_url('order', grid, column) }}" title="{{ 'Order by'|trans }} {{ columnTitle|trans }}">{{ columnTitle|trans|capitalize }}</a> | |
{% if column.order == 'asc' %} | |
<div class="sort_up"></div> | |
{% elseif column.order == 'desc' %} | |
<div class="sort_down"></div> | |
{% endif %} | |
{% else %} | |
{{ columnTitle|trans|capitalize }} | |
{% endif %} | |
{% endif %} | |
{% endspaceless -%} | |
</th> | |
{% endif %} | |
{% endfor %} | |
</tr> | |
{% endblock grid_titles %} | |
{% block grid_filters %} | |
<tr class="grid-row-filters filters"> | |
{% for column in grid.columns %} | |
{% if column.visible(grid.isReadyForExport) %} | |
<th class="{% if column.class %}{{ column.class }}{% endif %}{% if loop.last %} last-column{% endif %}{% if loop.first %} name{% endif %}"{% if(column.size > -1) %} style="width:{{ column.size }}px;"{% endif %}>{% if column.filterable %}{{ grid_filter(column, grid)|raw }}{% endif %}</th> | |
{% endif %} | |
{% endfor %} | |
</tr> | |
</thead> | |
{% endblock grid_filters %} | |
{% block grid_rows %} | |
{% for row in grid.rows %} | |
{% set last_row = loop.last %} | |
{% spaceless %} | |
{% set gridColumns %} | |
{% for column in grid.columns %} | |
{% if column.visible(grid.isReadyForExport) %} | |
<td class="grid-column-{{ column.renderBlockId }}{% if column.class %} {{ column.class }}{% endif %}{% if column.align != 'left'%} align-{{ column.align }}{% endif %}{% if loop.last %} last-column{% endif %}{% if loop.first %} name{% endif %}{% if last_row %} last-row{% endif %}">{{ grid_cell(column, row, grid)|raw }}</td> | |
{% endif %} | |
{% endfor %} | |
{% endset %} | |
<tr{% if row.color != '' %} style="background-color:{{ row.color }};"{% endif %} class="grid-row-cells {{ cycle(['odd', 'even'], loop.index) }}{% if row.class != '' %} {{ row.class }}{% endif %}"> | |
{{ gridColumns }} | |
{% endspaceless %} | |
</tr> | |
{% else %} | |
{{ grid_no_result(grid) }} | |
{% endfor %} | |
{% endblock grid_rows %} | |
{% block grid %} | |
<div class="grid"> | |
{% if grid.totalCount > 0 or grid.isFiltered or grid.noDataMessage is sameas(false) %} | |
<form id="{{ grid.hash }}" action="{{ grid.routeUrl }}" method="post"> | |
<div class="grid_header"> | |
{% if grid.massActions|length > 0 %} | |
{{ grid_actions(grid) }} | |
{% endif %} | |
</div> | |
<div class="grid_body list_box"> | |
<table cellspacing="0"> | |
{% if grid.isTitleSectionVisible %} | |
{{ grid_titles(grid) }} | |
{% endif %} | |
{% if grid.isFilterSectionVisible %} | |
{{ grid_filters(grid) }} | |
{% endif %} | |
{{ grid_rows(grid) }} | |
</table> | |
</div> | |
<div class="grid_footer"> | |
{% if grid.isPagerSectionVisible %} | |
{{ grid_pager(grid) }} | |
{% endif %} | |
{% if grid.exports|length > 0 %} | |
{{ grid_exports(grid) }} | |
{% endif %} | |
{% if grid.tweaks|length > 0 %} | |
{{ grid_tweaks(grid) }} | |
{% endif %} | |
</div> | |
{% if withjs %} | |
{{ grid_scripts(grid) }} | |
{% endif %} | |
</form> | |
{% else %} | |
{{ grid_no_data(grid) }} | |
{% endif %} | |
</div> | |
{% endblock grid %} | |
{% block grid_pager %} | |
{% if pagerfanta %} | |
{{ grid_pagerfanta(grid) }} | |
{% else %} | |
<div class="pager paginator" style="float:left"> | |
{{ grid_pager_totalcount(grid) }} | |
{{ grid_pager_selectpage(grid) }} | |
{{ grid_pager_results_perpage(grid) }} | |
</div> | |
{% endif %} | |
{% endblock grid_pager %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment