From f4ea95be872e2aebcf5ac6b46b5d504d35c078be Mon Sep 17 00:00:00 2001 From: Valerie R Young Date: Fri, 15 Jul 2016 11:10:45 -0400 Subject: reproducible debian: first pass at main navigation improvements Reshuffled links, added headers, added hover text, small changes in highlighting of links. Signed-off-by: Holger Levsen --- bin/reproducible_common.py | 16 ++- bin/reproducible_common.sh | 10 +- bin/templates/main_navigation.mustache | 196 +++++++++++++++++------------- bin/templates/project_links.mustache | 33 +++-- userContent/reproducible/static/style.css | 20 +-- 5 files changed, 159 insertions(+), 116 deletions(-) diff --git a/bin/reproducible_common.py b/bin/reproducible_common.py index 6701db26..de60cbd3 100755 --- a/bin/reproducible_common.py +++ b/bin/reproducible_common.py @@ -258,13 +258,25 @@ def convert_into_hms_string(duration): # See bash equivelent: reproducible_common.sh's "write_page_header()" def create_main_navigation(page_title, suite, arch, displayed_page=None): + suite_list = [] + for s in SUITES: + suite_list.append({ + 's': s, + 'class': 'current' if s == suite else '' + }) + arch_list = [] + for a in ARCHS: + arch_list.append({ + 'a': a, + 'class': 'current' if a == arch else '' + }) context = { 'page_title': page_title, 'suite': suite, 'arch': arch, 'project_links_html': renderer.render(project_links_template), - 'suite_list': [{'s': s} for s in SUITES], - 'arch_list': [{'a': a} for a in ARCHS], + 'suite_list': suite_list, + 'arch_list': arch_list, 'debian_uri': DEBIAN_DASHBOARD_URI, } if suite != 'experimental': diff --git a/bin/reproducible_common.sh b/bin/reproducible_common.sh index 06134eb9..ac5116ba 100755 --- a/bin/reproducible_common.sh +++ b/bin/reproducible_common.sh @@ -188,7 +188,7 @@ write_page_header() { fi # Used to highlight the link for the current page - if [ "$1" = "dashboard" ] || [ "$1" = "performance" ] || [ "$1" = "repositories" ] || [ "$1" = "variations" ] ; then + if [ "$1" = "dashboard" ] || [ "$1" = "performance" ] || [ "$1" = "repositories" ] || [ "$1" = "variations" ] || [ "$1" = "suite_arch_stats" ]; then displayed_page="\"$1\": \"true\"" else displayed_page='' @@ -198,8 +198,8 @@ write_page_header() { suite_links="\"suite_list\": [" comma=0 for i in $SUITES ; do - if [ "$1" = "suite_arch_stats" ] && [ "$i" = "$SUITE" ] ; then - class="class='active'" + if [ "$i" = "$SUITE" ] ; then + class="current" else class='' fi @@ -216,8 +216,8 @@ write_page_header() { arch_links="\"arch_list\": [" comma=0 for i in ${ARCHS} ; do - if [ "$1" = "suite_arch_stats" ] && [ "$i" = "$ARCH" ] ; then - class="class='active'" + if [ "$i" = "$ARCH" ] ; then + class="current" else class='' fi diff --git a/bin/templates/main_navigation.mustache b/bin/templates/main_navigation.mustache index 63075a39..1846a2e7 100644 --- a/bin/templates/main_navigation.mustache +++ b/bin/templates/main_navigation.mustache @@ -1,20 +1,58 @@

Debian Dashboard

+ {{{project_links_html}}} diff --git a/bin/templates/project_links.mustache b/bin/templates/project_links.mustache index 1e125921..b457982e 100644 --- a/bin/templates/project_links.mustache +++ b/bin/templates/project_links.mustache @@ -1,18 +1,17 @@ -