Skip to content

Commit

Permalink
Updated js Flash Fixture example (#914)
Browse files Browse the repository at this point in the history
* Update Flash Fixture doc

Updated fash fixture doc to actual behavior as #912

* Flash fixtures docs

Working example from python and js
  • Loading branch information
mbelletti authored Aug 27, 2024
1 parent 0ad7a36 commit 7e1a46e
Showing 1 changed file with 2 additions and 8 deletions.
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

0 comments on commit 7e1a46e

Please sign in to comment.