Mark Ramm wrote:
> I think this is a good idea. It adds a little bit of complexity to
> the template side of things, but we can use a widget in the
> master.html to do the flash message via javascript so things can just
> work out of the box.
>
Template wise, I hope it will turn out to be a js include and js call
away, something like:
<script src="...."></script>
<script type="text/javascript">
(new Flash({some options or none for sane
defaults})).render(some_id_or_dom_node)
</script>
As a helper, the JS call could be generated with python with something like
${flash(dom_node_id, **options)}
The API to generate messages from the controllers would be something like:
flash("mesage", status="info", webob_request_like, webob_response_like)
Of course, TG could wrap this call and partially apply both response and
request from the SOPs, resulting in the familiar:
flash("message", status="foo")
> If it's done right away, it can go into tg 2.0, if it takes a bit I'd
> support a switch from the current flash implementation to this in
> 2.1.
>
Right away like.. this weekend? (arrg I hate deadlines ;)
> I wonder if it could be put into webhelpers rather than into a seprate
> library, since its a generally useful pattern....
>
Hmm, I'm not using webhelpers in Rum so I'd rather not introduce a new
dependency. I prefer to have it at a standalone egg (not even depending
on TW, which would make it easier to implement). Besides that, it will
need some JS support code and AFAIK webhelpers is moving away from
bundling js in their package.
Alberto
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears Trunk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/turbogears-trunk?hl=en
-~----------~----~----~----~------~----~------~--~---