From 9d9bc58a9969f34146cb5ef79145bd5b15f6cc02 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Sun, 11 Dec 2016 01:40:41 -0600 Subject: [PATCH] Add initial mobile template support Also add rattail-tempmon to list of packages on 'about' page --- rattail_demo/web/templates/mobile/home.mako | 7 +++++++ rattail_demo/web/views/__init__.py | 5 +++-- rattail_demo/web/views/common.py | 7 +++++++ 3 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 rattail_demo/web/templates/mobile/home.mako diff --git a/rattail_demo/web/templates/mobile/home.mako b/rattail_demo/web/templates/mobile/home.mako new file mode 100644 index 0000000..de5615c --- /dev/null +++ b/rattail_demo/web/templates/mobile/home.mako @@ -0,0 +1,7 @@ +## -*- coding: utf-8 -*- +<%inherit file="tailbone:templates/mobile/home.mako" /> + +
+ ${h.image(request.static_url('tailbone:static/img/home_logo.png'), "Rattail Logo", width='400')} +

Welcome to the Rattail Demo

+
diff --git a/rattail_demo/web/views/__init__.py b/rattail_demo/web/views/__init__.py index b4c2f3d..71b9c58 100644 --- a/rattail_demo/web/views/__init__.py +++ b/rattail_demo/web/views/__init__.py @@ -21,9 +21,10 @@ def includeme(config): # TODO: merge these views into core/common config.add_route('home', '/') 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_view(bogus_error, route_name='bogus_error', - permission='admin') + config.add_view(bogus_error, route_name='bogus_error', permission='admin') # core views config.include('rattail_demo.web.views.common') diff --git a/rattail_demo/web/views/common.py b/rattail_demo/web/views/common.py index 0098090..5139f24 100644 --- a/rattail_demo/web/views/common.py +++ b/rattail_demo/web/views/common.py @@ -15,6 +15,13 @@ class CommonView(base.CommonView): project_title = "Rattail Demo" 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): CommonView.defaults(config)