New issue 40 by neutrinus: please add {% get_inbox_count as var1 %}
http://code.google.com/p/django-messages/issues/detail?id=40
We would like to bold the counter if there are unread messages.
example code:
{% load inbox %}{% ifequal inbox_count 0 %}<b>{% endifequal %}({%
inbox_count %}){% ifnotequal inbox_count 0 %}</b>{% endifnotequal %}
This of course doesnt work, because inbox_count is a function ( prints the
value) instead of being a variable. So, we need something like {%
get_inbox_count as var1 %}.
--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings
good idea. In the meantime (if you show the inbox count on the majority of
your
site's pages) you might want to try the context-processor.
add "messages.context_processors.inbox" to
settings.TEMPLATE_CONTEXT_PROCESSORS
and get a {{ messages_inbox_count }} variable in your templates.
Patch proposal in attachement.
Thx for comment but I'm using this on only few pages - so I don't want to
have this
in TEMPLATE_CONTEXT_PROCESSOR.
Attachments:
get_inbox_count.diff 838 bytes
Comment #3 on issue 40 by a...@rcs4u.de: please add {% get_inbox_count as
var1 %}
http://code.google.com/p/django-messages/issues/detail?id=40
This issue was closed by revision r118.
instead of adding a second templatetag I have added an option to the
existing
inbox_count tag to specify an 'as varname' option. This change is fully
backwards-compatible and should fix this issue. Anyway, thank you very much
for the
attached patch and bringing up this issue.