﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
3995	Give the Message model a type (success/failure/generic)	joe4444	Tim Graham	"The message system is just a bit too light for me.  Rather than assume all messages indicate a successful action I think they should also be able to point out errors (unrelated to form validation obviously) or just display generic notices.  This patch makes it possible to create 3 types of messages: success (default), failure, and generic.  Normal messages will remain the same (always success).  For a failure/error or generic message you simply pass an extra argument like so:
{{{
    user.message_set.create(message=u'Something went wrong!', category='F')    # failure or error
    user.message_set.create(message=u'This is just a notice', category='G')    # generic message
    user.message_set.create(message=u'It worked!', category='S')    # explicit success
    user.message_set.create(message=u'It worked!')    # implicit success
}}}

[[BR]]

Now in your template you can distinguish messages by type, and then use CSS to style them differently.
{{{
{% if messages %}
  <ul id=""messages"">
{% for message in messages %}
    <li class=""{{ message.get_category_display }}"">{{ message }}</li>
{% endfor %}
  </ul>
{% endif %}
}}}
"		closed	Core (Other)	dev		wontfix	auth message	django@… ross@… xerdcire@… jwm@…	Accepted	1	0	0	1	0	0
