Add support for messaging system
This commit is contained in:
parent
d812e5465a
commit
7a22b11e2e
|
@ -26,7 +26,7 @@ def main(global_config, **settings):
|
||||||
|
|
||||||
# bring in rest of rattail-demo etc.
|
# bring in rest of rattail-demo etc.
|
||||||
pyramid_config.include('tailbone.static')
|
pyramid_config.include('tailbone.static')
|
||||||
pyramid_config.include('tailbone.subscribers')
|
pyramid_config.include('rattail_demo.web.subscribers')
|
||||||
pyramid_config.include('rattail_demo.web.views')
|
pyramid_config.include('rattail_demo.web.views')
|
||||||
|
|
||||||
# configure PostgreSQL some more
|
# configure PostgreSQL some more
|
||||||
|
|
11
rattail_demo/web/subscribers.py
Normal file
11
rattail_demo/web/subscribers.py
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
"""
|
||||||
|
Pyramid Event Subscribers
|
||||||
|
"""
|
||||||
|
|
||||||
|
from __future__ import unicode_literals, absolute_import
|
||||||
|
|
||||||
|
|
||||||
|
def includeme(config):
|
||||||
|
config.include('tailbone.subscribers')
|
||||||
|
config.add_subscriber('tailbone.subscribers.add_inbox_count', 'pyramid.events.BeforeRender')
|
|
@ -119,6 +119,7 @@
|
||||||
% elif request.is_admin:
|
% elif request.is_admin:
|
||||||
<li class="root-user">${h.link_to("Become root", url('become_root'))}</li>
|
<li class="root-user">${h.link_to("Become root", url('become_root'))}</li>
|
||||||
% endif
|
% endif
|
||||||
|
<li>${h.link_to("Messages{}".format(" ({})".format(inbox_count) if inbox_count else ''), url('messages.inbox'))}</li>
|
||||||
<li>${h.link_to("Change Password", url('change_password'))}</li>
|
<li>${h.link_to("Change Password", url('change_password'))}</li>
|
||||||
<li>${h.link_to("Logout", url('logout'))}</li>
|
<li>${h.link_to("Logout", url('logout'))}</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
|
@ -36,6 +36,7 @@ def includeme(config):
|
||||||
config.include('rattail_demo.web.views.email')
|
config.include('rattail_demo.web.views.email')
|
||||||
config.include('tailbone.views.employees')
|
config.include('tailbone.views.employees')
|
||||||
config.include('tailbone.views.families')
|
config.include('tailbone.views.families')
|
||||||
|
config.include('tailbone.views.messages')
|
||||||
config.include('rattail_demo.web.views.people')
|
config.include('rattail_demo.web.views.people')
|
||||||
config.include('tailbone.views.products')
|
config.include('tailbone.views.products')
|
||||||
config.include('tailbone.views.reportcodes')
|
config.include('tailbone.views.reportcodes')
|
||||||
|
|
Loading…
Reference in a new issue