-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add flash messages #163
Merged
Merged
Add flash messages #163
Changes from 9 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
0680841
Show flash messages after creating, updating and deleting posts
voronkovich 12bd670
Update Russian and English translations
voronkovich a46c948
Use 'success' as the name of the messages related to success messages
javiereguiluz 7507a50
Simplified the template code used to render flash messages
javiereguiluz 51f7262
Restored the content database
javiereguiluz da04216
Fixed an issue with the translation file after the rebase
javiereguiluz f481eef
Refactored the template code related to macros
javiereguiluz d01311b
Transformed the macro() of the Flash messages into a regular include(…
javiereguiluz 9a8d43d
Check if the session exists before reading flash messages
javiereguiluz 3eefa76
Reworded the help note about flash messages
javiereguiluz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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,14 @@ | ||
{% if app.session.started %} | ||
<div class="messages"> | ||
{% for message in app.session.flashBag.get('success') %} | ||
{# Bootstrap alert, see http://getbootstrap.com/components/#alerts #} | ||
<div class="alert alert-dismissible alert-success" role="alert"> | ||
<button type="button" class="close" data-dismiss="alert" aria-label="Close"> | ||
<span aria-hidden="true">×</span> | ||
</button> | ||
|
||
{{ message|trans }} | ||
</div> | ||
{% endfor %} | ||
</div> | ||
{% endif %} |
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should improve this description like we did in the docs (flash messages last until they are retrieved from the bag).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where can I find the updated explanation? In http://symfony.com/doc/current/book/controller.html#flash-messages I read:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, it's not merged yet (see symfony/symfony-docs#5640).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the reference. I've just reworded this help note in 3eefa76.