Skip to content

Commit d01311b

Browse files
committed
Transformed the macro() of the Flash messages into a regular include() template
1 parent f481eef commit d01311b

File tree

4 files changed

+14
-39
lines changed

4 files changed

+14
-39
lines changed

app/Resources/views/admin/blog/edit.html.twig

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,11 @@
11
{% extends 'admin/layout.html.twig' %}
22

3-
{#
4-
Import macros used for displaying flash messages.
5-
See http://twig.sensiolabs.org/doc/tags/import.html
6-
#}
7-
{% import 'helper/messages.html.twig' as helper %}
8-
93
{% block body_id 'admin_post_edit' %}
104

115
{% block main %}
126
<h1>{{ 'title.edit_post'|trans({'%id%': post.id}) }}</h1>
137

14-
{{ helper.render_flash_messages() }}
8+
{{ include('default/_flash_messages.html.twig') }}
159

1610
{{ include('admin/blog/_form.html.twig', {
1711
form: edit_form,

app/Resources/views/admin/blog/index.html.twig

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,11 @@
11
{% extends 'admin/layout.html.twig' %}
22

3-
{#
4-
Import macros used for displaying flash messages.
5-
See http://twig.sensiolabs.org/doc/tags/import.html
6-
#}
7-
{% import 'helper/messages.html.twig' as helper %}
8-
93
{% block body_id 'admin_post_index' %}
104

115
{% block main %}
126
<h1>{{ 'title.post_list'|trans }}</h1>
137

14-
{{ helper.render_flash_messages() }}
8+
{{ include('default/_flash_messages.html.twig') }}
159

1610
<table class="table table-striped">
1711
<thead>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<div class="messages">
2+
{% for message in app.session.flashBag.get('success') %}
3+
{# Bootstrap alert, see http://getbootstrap.com/components/#alerts #}
4+
<div class="alert alert-dismissible alert-success" role="alert">
5+
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
6+
<span aria-hidden="true">&times;</span>
7+
</button>
8+
9+
{{ message|trans }}
10+
</div>
11+
{% endfor %}
12+
</div>

app/Resources/views/helper/messages.html.twig

Lines changed: 0 additions & 25 deletions
This file was deleted.

0 commit comments

Comments
 (0)