-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Template Events] Part of new UI bundle events
- Loading branch information
1 parent
a5ac159
commit 1243098
Showing
13 changed files
with
152 additions
and
98 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
20 changes: 20 additions & 0 deletions
20
src/Sylius/Bundle/UiBundle/Resources/views/Grid/Filter/_content.html.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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{% import '@SyliusUi/Macro/buttons.html.twig' as buttons %} | ||
|
||
{% if definition.enabledFilters|length > 0 %} | ||
<div class="ui hidden divider"></div> | ||
<div class="ui styled fluid accordion"> | ||
<div class="content {% if criteria is not null %}active{% endif %}"> | ||
<form method="get" action="{{ path }}" class="ui loadable form" novalidate> | ||
<div class="sylius-filters"> | ||
{% for filter in definition.enabledFilters|filter(filter => filter.enabled)|sort_by('position') %} | ||
<div class="sylius-filters__field"> | ||
{{ sylius_grid_render_filter(grid, filter) }} | ||
</div> | ||
{% endfor %} | ||
</div> | ||
{{ buttons.filter() }} | ||
{{ buttons.resetFilters(path) }} | ||
</form> | ||
</div> | ||
</div> | ||
{% endif %} |
5 changes: 5 additions & 0 deletions
5
src/Sylius/Bundle/UiBundle/Resources/views/Grid/Filter/_title.html.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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<div class="title {% if criteria is not null %}active{% endif %}"> | ||
<i class="dropdown icon"></i> | ||
<i class="filter icon"></i> | ||
{{ 'sylius.ui.filters'|trans }} | ||
</div> |
12 changes: 12 additions & 0 deletions
12
src/Sylius/Bundle/UiBundle/Resources/views/Grid/_content.html.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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{% set definition = grid.definition %} | ||
{% set data = grid.data %} | ||
|
||
{% set path = path(app.request.attributes.get('_route'), app.request.attributes.get('_route_params')) %} | ||
{% set criteria = app.request.query.get('criteria') %} | ||
|
||
{{ sylius_template_event('sylius.admin.grid.filters', _context) }} | ||
|
||
<div class="ui hidden divider"></div> | ||
<div class="sylius-grid-wrapper"> | ||
{{ sylius_template_event('sylius.admin.grid.body', _context) }} | ||
</div> |
78 changes: 1 addition & 77 deletions
78
src/Sylius/Bundle/UiBundle/Resources/views/Grid/_default.html.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,77 +1 @@ | ||
{% import '@SyliusUi/Macro/pagination.html.twig' as pagination %} | ||
{% import '@SyliusUi/Macro/buttons.html.twig' as buttons %} | ||
{% import '@SyliusUi/Macro/messages.html.twig' as messages %} | ||
{% import '@SyliusUi/Macro/table.html.twig' as table %} | ||
|
||
{% set definition = grid.definition %} | ||
{% set data = grid.data %} | ||
|
||
{% set path = path(app.request.attributes.get('_route'), app.request.attributes.get('_route_params')) %} | ||
{% set criteria = app.request.query.get('criteria') %} | ||
|
||
{% if definition.enabledFilters|length > 0 %} | ||
<div class="ui hidden divider"></div> | ||
<div class="ui styled fluid accordion"> | ||
<div class="title {% if criteria is not null %}active{% endif %}"> | ||
<i class="dropdown icon"></i> | ||
<i class="filter icon"></i> | ||
{{ 'sylius.ui.filters'|trans }} | ||
</div> | ||
<div class="content {% if criteria is not null %}active{% endif %}"> | ||
<form method="get" action="{{ path }}" class="ui loadable form" novalidate> | ||
<div class="sylius-filters"> | ||
{% for filter in definition.enabledFilters|filter(filter => filter.enabled)|sort_by('position') %} | ||
<div class="sylius-filters__field"> | ||
{{ sylius_grid_render_filter(grid, filter) }} | ||
</div> | ||
{% endfor %} | ||
</div> | ||
{{ buttons.filter() }} | ||
{{ buttons.resetFilters(path) }} | ||
</form> | ||
</div> | ||
</div> | ||
{% endif %} | ||
|
||
<div class="ui hidden divider"></div> | ||
<div class="sylius-grid-wrapper"> | ||
<div class="sylius-grid-nav"> | ||
{% if data|length > 0 and definition.actionGroups.bulk is defined and definition.getEnabledActions('bulk')|length > 0 %} | ||
<div class="sylius-grid-nav__bulk"> | ||
{% for action in definition.getEnabledActions('bulk') %} | ||
{{ sylius_grid_render_bulk_action(grid, action, null) }} | ||
{% endfor %} | ||
</div> | ||
{% endif %} | ||
<div class="sylius-grid-nav__pagination"> | ||
{{ pagination.simple(data) }} | ||
</div> | ||
{% if definition.limits|length > 1 and data|length > min(definition.limits) %} | ||
<div class="sylius-grid-nav__perpage"> | ||
<div class="ui fluid one menu sylius-paginate"> | ||
{{ pagination.perPage(data, definition.limits) }} | ||
</div> | ||
</div> | ||
{% endif %} | ||
</div> | ||
|
||
{% if data|length > 0 %} | ||
<div class="ui segment spaceless sylius-grid-table-wrapper"> | ||
<table class="ui sortable stackable very basic celled table" {{ sylius_test_html_attribute('grid-table') }}> | ||
<thead> | ||
<tr> | ||
{{ table.headers(grid, definition, app.request.attributes) }} | ||
</tr> | ||
</thead> | ||
<tbody {{ sylius_test_html_attribute('grid-table-body') }}> | ||
{% for row in data %} | ||
{{ table.row(grid, definition, row) }} | ||
{% endfor %} | ||
</tbody> | ||
</table> | ||
</div> | ||
{% else %} | ||
{{ messages.info('sylius.ui.no_results_to_display') }} | ||
{% endif %} | ||
{{ pagination.simple(data) }} | ||
</div> | ||
{{ sylius_template_event('sylius.admin.grid.content', _context) }} |
21 changes: 21 additions & 0 deletions
21
src/Sylius/Bundle/UiBundle/Resources/views/Grid/_navigation.html.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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{% import '@SyliusUi/Macro/pagination.html.twig' as pagination %} | ||
|
||
<div class="sylius-grid-nav"> | ||
{% if data|length > 0 and definition.actionGroups.bulk is defined and definition.getEnabledActions('bulk')|length > 0 %} | ||
<div class="sylius-grid-nav__bulk"> | ||
{% for action in definition.getEnabledActions('bulk') %} | ||
{{ sylius_grid_render_bulk_action(grid, action, null) }} | ||
{% endfor %} | ||
</div> | ||
{% endif %} | ||
<div class="sylius-grid-nav__pagination"> | ||
{{ pagination.simple(data) }} | ||
</div> | ||
{% if definition.limits|length > 1 and data|length > min(definition.limits) %} | ||
<div class="sylius-grid-nav__perpage"> | ||
<div class="ui fluid one menu sylius-paginate"> | ||
{{ pagination.perPage(data, definition.limits) }} | ||
</div> | ||
</div> | ||
{% endif %} | ||
</div> |
3 changes: 3 additions & 0 deletions
3
src/Sylius/Bundle/UiBundle/Resources/views/Grid/_pagination.html.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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{% import '@SyliusUi/Macro/pagination.html.twig' as pagination %} | ||
|
||
{{ pagination.simple(data) }} |
21 changes: 21 additions & 0 deletions
21
src/Sylius/Bundle/UiBundle/Resources/views/Grid/_table.html.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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{% import '@SyliusUi/Macro/table.html.twig' as table %} | ||
{% import '@SyliusUi/Macro/messages.html.twig' as messages %} | ||
|
||
{% if data|length > 0 %} | ||
<div class="ui segment spaceless sylius-grid-table-wrapper"> | ||
<table class="ui sortable stackable very basic celled table" {{ sylius_test_html_attribute('grid-table') }}> | ||
<thead> | ||
<tr> | ||
{{ table.headers(grid, definition, app.request.attributes) }} | ||
</tr> | ||
</thead> | ||
<tbody {{ sylius_test_html_attribute('grid-table-body') }}> | ||
{% for row in data %} | ||
{{ table.row(grid, definition, row) }} | ||
{% endfor %} | ||
</tbody> | ||
</table> | ||
</div> | ||
{% else %} | ||
{{ messages.info('sylius.ui.no_results_to_display') }} | ||
{% endif %} |
4 changes: 4 additions & 0 deletions
4
src/Sylius/Bundle/UiBundle/Resources/views/Security/Form/_credentials.html.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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{{ form_row(form._username, {'value': last_username|default('')}) }} | ||
{{ form_row(form._password) }} | ||
{{ form_row(form._remember_me) }} | ||
<input type="hidden" name="_csrf_admin_security_token" value="{{ csrf_token('admin_authenticate') }}"> |
1 change: 1 addition & 0 deletions
1
src/Sylius/Bundle/UiBundle/Resources/views/Security/Form/_submit.html.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 |
---|---|---|
@@ -0,0 +1 @@ | ||
<button type="submit" class="ui fluid large primary submit button">Login</button> |
7 changes: 7 additions & 0 deletions
7
src/Sylius/Bundle/UiBundle/Resources/views/Security/_error.html.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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{% import '@SyliusUi/Macro/messages.html.twig' as messages %} | ||
|
||
{% if last_error %} | ||
<div class="ui left aligned basic segment"> | ||
{{ messages.error(last_error.messageKey) }} | ||
</div> | ||
{% endif %} |
25 changes: 4 additions & 21 deletions
25
src/Sylius/Bundle/UiBundle/Resources/views/Security/_login.html.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,17 @@ | ||
{% form_theme form '@SyliusUi/Form/theme.html.twig' %} | ||
|
||
{% import '@SyliusUi/Macro/messages.html.twig' as messages %} | ||
|
||
<div class="ui middle aligned center aligned grid"> | ||
<div class="column"> | ||
{{ sylius_template_event('sylius.admin.login.before_form', {'form': form}) }} | ||
|
||
{% if paths.logo is defined %} | ||
<div style="max-width: 270px; margin: 0 auto; margin-bottom: 40px;"> | ||
<img src="{{ asset(paths.logo) }}" class="ui fluid image" id="logo"> | ||
</div> | ||
{% endif %} | ||
{{ sylius_template_event('sylius.admin.login.logo', _context) }} | ||
|
||
{% if last_error %} | ||
<div class="ui left aligned basic segment"> | ||
{{ messages.error(last_error.messageKey) }} | ||
</div> | ||
{% endif %} | ||
{{ sylius_template_event('sylius.admin.login.error', _context) }} | ||
|
||
{{ form_start(form, {'action': action|default('/'), 'attr': {'class': 'ui large loadable form', 'novalidate': 'novalidate'}}) }} | ||
<div class="ui left aligned very padded segment"> | ||
{{ form_row(form._username, {'value': last_username|default('')}) }} | ||
{{ form_row(form._password) }} | ||
{{ form_row(form._remember_me) }} | ||
<input type="hidden" name="_csrf_admin_security_token" value="{{ csrf_token('admin_authenticate') }}"> | ||
<button type="submit" class="ui fluid large primary submit button">Login</button> | ||
{{ sylius_template_event('sylius.admin.login.form.content', _context) }} | ||
</div> | ||
|
||
{{ sylius_template_event('sylius.admin.login.form', {'form': form}) }} | ||
|
||
{{ form_end(form, {'render_rest': false}) }} | ||
{{ form_end(form) }} | ||
</div> | ||
</div> |
5 changes: 5 additions & 0 deletions
5
src/Sylius/Bundle/UiBundle/Resources/views/Security/_logo.html.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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{% if paths.logo is defined %} | ||
<div style="max-width: 270px; margin: 0 auto; margin-bottom: 40px;"> | ||
<img src="{{ asset(paths.logo) }}" class="ui fluid image" id="logo"> | ||
</div> | ||
{% endif %} |