From c34f2d4d8b2d0c4d746e58a55afc1bdce429fafa Mon Sep 17 00:00:00 2001 From: Matthew Date: Wed, 8 Mar 2017 01:55:18 +1100 Subject: [PATCH] Improve navbar on mobile devices (#16) * add button to show/hide menu items * ensure navigation fills the width of the viewport by moving it out of the main container element --- tsstats/templates/index.jinja2 | 61 +++++++++++++++++++++++++--------- tsstats/tests/test_template.py | 3 +- 2 files changed, 47 insertions(+), 17 deletions(-) diff --git a/tsstats/templates/index.jinja2 b/tsstats/templates/index.jinja2 index 3b7de11..2293605 100644 --- a/tsstats/templates/index.jinja2 +++ b/tsstats/templates/index.jinja2 @@ -14,6 +14,9 @@ a:hover { text-decoration: none; } + .navbar-toggler { + cursor: pointer; + } @media screen and (max-width: 767px) { .hint--medium--xs:after { white-space: normal; @@ -24,23 +27,30 @@ -
- + +
{% for server in servers %}

Server {{ server.sid }} @@ -49,5 +59,24 @@ {% endfor %} Generated by TeamspeakStats at {{ creation_time|frmttime }}

+ + diff --git a/tsstats/tests/test_template.py b/tsstats/tests/test_template.py index bec8877..b5f6ad4 100644 --- a/tsstats/tests/test_template.py +++ b/tsstats/tests/test_template.py @@ -28,7 +28,8 @@ def test_debug(output): logger.setLevel(logging.INFO) soup = BeautifulSoup(open(output), 'html.parser') # check debug-label presence - assert soup.find('nav').find('span').text == 'debug mode' + assert soup.find('nav').find('div', id='main-nav').find('span').text \ + == 'debug mode' for client_item in soup.find('ul', id='1.onlinetime').find_all('li'): nick = client_item.find('span').text # check for right identifier