Add initial mobile template support

Also add rattail-tempmon to list of packages on 'about' page
This commit is contained in:
Lance Edgar 2016-12-11 01:40:41 -06:00
parent fcb21b9671
commit 9d9bc58a99
3 changed files with 17 additions and 2 deletions

View file

@ -0,0 +1,7 @@
## -*- coding: utf-8 -*-
<%inherit file="tailbone:templates/mobile/home.mako" />
<div style="text-align: center;">
${h.image(request.static_url('tailbone:static/img/home_logo.png'), "Rattail Logo", width='400')}
<h3>Welcome to the Rattail Demo</h3>
</div>

View file

@ -21,9 +21,10 @@ def includeme(config):
# TODO: merge these views into core/common # TODO: merge these views into core/common
config.add_route('home', '/') config.add_route('home', '/')
config.add_view(base.home, route_name='home', renderer='/home.mako') config.add_view(base.home, route_name='home', renderer='/home.mako')
config.add_route('mobile.home', '/mobile/')
config.add_view(base.home, route_name='mobile.home', renderer='/mobile/home.mako')
config.add_route('bogus_error', '/bogus-error') config.add_route('bogus_error', '/bogus-error')
config.add_view(bogus_error, route_name='bogus_error', config.add_view(bogus_error, route_name='bogus_error', permission='admin')
permission='admin')
# core views # core views
config.include('rattail_demo.web.views.common') config.include('rattail_demo.web.views.common')

View file

@ -15,6 +15,13 @@ class CommonView(base.CommonView):
project_title = "Rattail Demo" project_title = "Rattail Demo"
project_version = rattail_demo.__version__ project_version = rattail_demo.__version__
def get_packages(self):
import rattail_tempmon
packages = super(CommonView, self).get_packages()
packages['rattail-tempmon'] = rattail_tempmon.__version__
return packages
def includeme(config): def includeme(config):
CommonView.defaults(config) CommonView.defaults(config)