Add support for messaging system

This commit is contained in:
Lance Edgar 2016-12-10 15:40:21 -06:00
parent d812e5465a
commit 7a22b11e2e
4 changed files with 14 additions and 1 deletions

View file

@ -26,7 +26,7 @@ def main(global_config, **settings):
# bring in rest of rattail-demo etc.
pyramid_config.include('tailbone.static')
pyramid_config.include('tailbone.subscribers')
pyramid_config.include('rattail_demo.web.subscribers')
pyramid_config.include('rattail_demo.web.views')
# configure PostgreSQL some more

View 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')

View file

@ -119,6 +119,7 @@
% elif request.is_admin:
<li class="root-user">${h.link_to("Become root", url('become_root'))}</li>
% 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("Logout", url('logout'))}</li>
</ul>

View file

@ -36,6 +36,7 @@ def includeme(config):
config.include('rattail_demo.web.views.email')
config.include('tailbone.views.employees')
config.include('tailbone.views.families')
config.include('tailbone.views.messages')
config.include('rattail_demo.web.views.people')
config.include('tailbone.views.products')
config.include('tailbone.views.reportcodes')