On Jan 23, 7:56 am, Markus Gritsch <m.grit...@gmail.com> wrote:
> Dec 12 2008, 11:59 am, mdipierro <mdipie...@cs.depaul.edu> wrote:
> > could you give this a try?
> >http://web2py.appspot.com/survey
> The response.flash color should not be red to indicate successful
> operations.  Some nice shade of green would be more appropriate.

100% agreed :)
I patch my app's model to support different flash styles:
def shn_sessions(f):
    response.error=session.error
    response.confirmation=session.confirmation
    response.warning=session.warning
    session.error=[]
    session.confirmation=[]
    session.warning=[]
    return f()
response._caller=lambda f: shn_sessions(f)

In layout.html I have:
    {{if response.error:}}<div class="error">{{=response.error}}</div>
{{pass}}
    {{if response.warning:}}<div class="warning">{{=response.warning}}
</div>{{pass}}
    {{if response.information:}}<div class="information">
{{=response.information}}</div>{{pass}}
    {{if response.confirmation:}}<div class="confirmation">
{{=response.confirmation}}</div>{{pass}}
    {{if response.flash:}}<div class="confirmation">{{=response.flash}}
</div>{{pass}}

I can then customise whether I see a nice Green Confirmation or a Red
Error through my stylesheet & Controller functions like:
session.error=T("Unsupported format!")

I have therefore had to copy T2's login() to my modified T2 class to
catch the invalid_login message as a .error instead of .flash.

This leads to maintenance overheads, of course, so would love to see
this extra functionality added to the core as part of the Auth moving
from T2-> Core rewrite :)

F
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to