Another possible approach:
In a model or module:
def flash(message, classes=None):
return CAT(message,
SCRIPT('jQuery(".flash").addClass("%s");' % classes) if
classes else '')
Then to create a flash message:
response.flash = flash('Congratulations, it worked!', 'success')
A
Ok here it goes, brace yourself.
First in layout.html replace the original flash div with:
{{if
response.flash:}}{{=response.flash}}{{pass}}
This will be enough to put some color in it using response.flash_status in
a controller for example:
response.flash = 'Form Accepted'
response.flash_st
Yes i also used bootstrap.
I just think that the flash message should include it.
2014-11-20 11:01 GMT+00:00 Leonel Câmara :
> Not really I added that functionality to one of my applications using
> bootstrap alerts, it's a little complicated but I can share the solution if
> you want.
>
> --
Not really I added that functionality to one of my applications using
bootstrap alerts, it's a little complicated but I can share the solution if
you want.
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.g
4 matches
Mail list logo