From 024d3c19757d11b4d9823f8c08da39470f48d9e0 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Sun, 11 Dec 2016 19:16:24 -0600 Subject: [PATCH] Add mobile support for "become/stop root" feature --- tailbone/static/css/mobile.css | 9 +++++++++ tailbone/templates/mobile/base.mako | 12 +++++++++--- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/tailbone/static/css/mobile.css b/tailbone/static/css/mobile.css index 121213f9..e808a71b 100644 --- a/tailbone/static/css/mobile.css +++ b/tailbone/static/css/mobile.css @@ -3,6 +3,15 @@ * Global styles for mobile templates ****************************************/ +[data-role="header"] a.root-user, +[data-role="header"] a.root-user:hover { + background-color: red; +} + +#usermenu .root-user a { + background-color: red; +} + .replacement-header { display: none; } diff --git a/tailbone/templates/mobile/base.mako b/tailbone/templates/mobile/base.mako index e956b2c9..806ecae7 100644 --- a/tailbone/templates/mobile/base.mako +++ b/tailbone/templates/mobile/base.mako @@ -53,12 +53,13 @@ <%def name="mobile_header_link()"> + <% classes = 'ui-btn-left ui-btn ui-btn-inline ui-mini ui-corner-all ui-btn-icon-left ' %> % if request.user: - ${h.link_to(request.user.get_short_name(), '#usermenu', class_='ui-btn-left ui-btn ui-btn-inline ui-mini ui-corner-all ui-btn-icon-left ui-icon-user')} + ${h.link_to(request.user.get_short_name(), '#usermenu', class_=classes + 'ui-icon-user' + (' root-user' if request.is_root else ''))} % elif request.matched_route.name in ('mobile.login', 'mobile.about'): - ${h.link_to("Home", url('mobile.home'), class_='ui-btn-left ui-btn ui-btn-inline ui-mini ui-corner-all ui-btn-icon-left ui-icon-home')} + ${h.link_to("Home", url('mobile.home'), class_=classes + 'ui-icon-home')} % else: - ${h.link_to("Login", url('mobile.login'), class_='ui-btn-left ui-btn ui-btn-inline ui-mini ui-corner-all ui-btn-icon-left ui-icon-user')} + ${h.link_to("Login", url('mobile.login'), class_=classes + 'ui-icon-user')} % endif @@ -66,6 +67,11 @@