-
Notifications
You must be signed in to change notification settings - Fork 78
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
Templating support for flash #32
Comments
I think it's a good feature, but not one that should involve too much changes, we should try to avoid adding something too complex for a feature that the user can implement by himself in a bunch of lines of code. the tg.flash.TGFlash class can probably be modified to use a template instead of plain string substitution and also make possible to pass a dictionary as the message instead of a string. Would that be a good enough solution? In that case we can probably manage to make something that is fully backward compatible but also makes possible to render templates inside the flash. |
I'm playing around here: https://github.com/moschlar/tgext.flash |
The workshop branch has a different implementation that doesn't rely anymore on webflash and supports python3, if you want to experiment there we can easily merge a proposed patch that keeps backward compatibility. |
Should be TG>=2.3 compatible in https://github.com/moschlar/tgext.flash/tree/38887b6b084c3e10cd58283c4d071c9941162ab3 Maybe we can merge it after some more refinements, I'll tell the mailing list about it, maybe someone has ideas ;). I'd like to keep it available as an extension so it is usable for <2.3, too! |
This is something which looks great to have but is missing some core features. Can we extend tgext.flash with the missing JS support (which is foundamental when used with caching) or should we provide a custom implementation in TurboGears itself? |
See also #52 |
Solved by 07fc5e2 documented at http://turbogears.readthedocs.org/en/development/turbogears/webflash.html#flash-options |
👍 |
I really would like to be able to customize the looks of the flash element, and I think using "real" templates would be the best approach (think ToscaWidgets style).
I would try to wrap it around the current implementation using
WebFlash
so that it needs to be actively activated and configured inapp_config
but would otherwise be non-disruptive to the current implementation.Are there any objections if I were to implement it and make a pull request? I.e. would you consider merging it, if it's done properly, or can I spend my time more useful? 😄
The text was updated successfully, but these errors were encountered: