Skip to content
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

Updated js Flash Fixture example #914

Merged
merged 2 commits into from
Aug 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions docs/chapter-06.rst
Original file line number Diff line number Diff line change
Expand Up @@ -345,13 +345,7 @@ and in the template:

.. code:: html

...
<div id="py4web-flash"></div>
...
<script src="js/utils.js"></script>
[[if globals().get('flash'):]]
<script>utils.flash([[=XML(flash)]]);</script>
[[pass]]
<flash-alerts class="padded" data-alert="[[=globals().get('flash','')]]"></flash-alerts>

By setting the value of the message in the flash helper, a flash
variable is returned by the action and this triggers the JS in the
Expand All @@ -369,7 +363,7 @@ The client can also set/add flash messages by calling:

::

utils.flash({'message': 'hello world', 'class': 'info'});
Q.flash({'message': 'hello world', 'class': 'info'});

py4web defaults to an alert class called ``info`` and most CSS
frameworks define classes for alerts called ``success``, ``error``,
Expand Down
Loading