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

Templating support for flash #32

Closed
moschlar opened this issue Nov 28, 2012 · 8 comments
Closed

Templating support for flash #32

moschlar opened this issue Nov 28, 2012 · 8 comments

Comments

@moschlar
Copy link

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 in app_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? 😄

@amol-
Copy link
Member

amol- commented Nov 29, 2012

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.

@moschlar
Copy link
Author

I'm playing around here: https://github.com/moschlar/tgext.flash

@amol-
Copy link
Member

amol- commented Jan 12, 2013

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.

https://github.com/TurboGears/tg2/blob/workshop/tg/flash.py

@moschlar
Copy link
Author

Should be TG>=2.3 compatible in https://github.com/moschlar/tgext.flash/tree/38887b6b084c3e10cd58283c4d071c9941162ab3
I only use imports which are present in <2.3 and >=2.3 .

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!

@amol-
Copy link
Member

amol- commented Mar 1, 2014

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?

@moschlar
Copy link
Author

See also #52

@amol-
Copy link
Member

amol- commented Jul 22, 2014

@amol- amol- closed this as completed Jul 22, 2014
@moschlar
Copy link
Author

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants