From 72166b7941a75a535d86f35171a05d4fd2953004 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jana=20Deutschla=CC=88nder?= Date: Mon, 11 Mar 2019 16:08:20 +0100 Subject: [PATCH] #17: make header layout configurable --- conf/default.php | 2 +- conf/metadata.php | 9 +++++ css/area_header.less | 72 +++++++++++++++++++++++++++++++++++++ css/area_nav-usertools.less | 70 ++++++++++++++++++++++++++++++++++++ css/base_structure.less | 10 ++++++ detail.php | 2 +- lang/de/settings.php | 4 +++ lang/en/settings.php | 3 ++ main.php | 2 +- 9 files changed, 171 insertions(+), 3 deletions(-) diff --git a/conf/default.php b/conf/default.php index 9f1418e..1ca4c37 100755 --- a/conf/default.php +++ b/conf/default.php @@ -5,4 +5,4 @@ */ $conf['sidebar_sections'] = 'h1,h2,h3,h4,h5'; - +$conf['header_layout'] = 'header-default'; diff --git a/conf/metadata.php b/conf/metadata.php index 274f7c5..dd94e6f 100755 --- a/conf/metadata.php +++ b/conf/metadata.php @@ -9,3 +9,12 @@ $meta['sidebar_sections'] = array( 'li.level1 > .li', ), ); + +$meta['header_layout'] = array( + 'multichoice', + '_choices' => array( + 'header-default', + 'header-compact', + 'header-hidden', + ), + ); diff --git a/css/area_header.less b/css/area_header.less index f524543..0eb54dd 100755 --- a/css/area_header.less +++ b/css/area_header.less @@ -207,3 +207,75 @@ } } } + + +/* + + + + + layout option compact + + + + + */ +.header-compact { + #dokuwiki__header { + .main-title.desktop-only p.claim, + p.claim { + display: none; + } + + // desktop + @media @screen_min-md { + div.claim { + vertical-align: top; + } + + .main-title.desktop-only { + vertical-align: top; + } + + .main-title.desktop-only, + .logo { + padding-top: 0.4rem + } + } + + // mobile middle + @media @screen_max-md { + + .logo { + display: block; + position: absolute; + top: 0; + left: 3rem; + + .mobile-only { + margin: .4rem; + height: 1.75rem; + } + } + + .main-title:not([class*="desktop-only"]) { + display: inline-block; + vertical-align: top; + padding-left: 1.75rem; + } + + p.title { + font-size: 1rem; + } + } + + @media @screen_max-sm { + min-height: 2.7rem; + } + + @media @screen_max-xxs { + min-height: 70px; // needed for menu select toolbar + + .logo { + left: 2rem; + } + + .menu-tool-select { + padding-top: .3rem; + } + + } + + + } +} diff --git a/css/area_nav-usertools.less b/css/area_nav-usertools.less index 46aa165..c3e382b 100755 --- a/css/area_nav-usertools.less +++ b/css/area_nav-usertools.less @@ -297,3 +297,73 @@ } // a } // ul } // nav-usertools + + +/* + + + + + layout option compact + + + + + */ +.header-compact { + #dokuwiki__usertools.nav-usertools { + + // mobile + @media @screen_max-md { + left: 6rem; + + ul { + overflow: hidden; + + li.user { + color: @ini_background_site; + + bdi { + position: absolute; + width: 0; + padding: 0; + text-indent: -10000px; + + &:before { + transition: @transition background-color; + background-color: @ini_background_site; + color: @ini_nav_menu_color; + text-indent: 0; + } + } + + > a { + padding: 0 .2em; + color: @ini_nav_menu_hover_bg; + + bdi { + &:before { + background-color: @ini_nav_menu_hover_bg; + color: @ini_nav_menu_hover_color; + } + } + + &:hover { + color: @ini_nav_menu_hover_color; + + bdi { + &:before { + background-color: @ini_nav_menu_hover_color; + color: @ini_nav_menu_hover_bg; + } + } + } + } + + bdi + bdi { + display: none; + } + } + } + } + + @media @screen_max-sm { + ul li { + position: static; + float: right; + top: 0; right: 0; + } + } + } +} + diff --git a/css/base_structure.less b/css/base_structure.less index 0048ad4..1ef944e 100755 --- a/css/base_structure.less +++ b/css/base_structure.less @@ -166,6 +166,16 @@ } } + /* + + + + + layout option compact + + + + + */ + .header-compact { + .header { + .row > .col-xs-12 { + height: auto; + min-height: fit-content; + } + } + } + .tools { .row > .col-xs-12 { position: absolute; diff --git a/detail.php b/detail.php index fdc2afe..fa90150 100755 --- a/detail.php +++ b/detail.php @@ -65,7 +65,7 @@ include('tpl/favicon_tiles.php'); - +
.li'] = 'Top-level Listeneinträge in verschachtelten Listen'; + +$lang['header_layout'] = 'Layout des Headers anpassen:'; +$lang['header_layout_o_default'] = 'großer Header für langen Wiki Titel und Tagline'; +$lang['header_layout_o_compact'] = 'kompakter Header für kurzen Wiki Titel ohne Tagline'; diff --git a/lang/en/settings.php b/lang/en/settings.php index c210f07..b37442c 100755 --- a/lang/en/settings.php +++ b/lang/en/settings.php @@ -11,4 +11,7 @@ $lang['sidebar_sections_o_h1,h2'] = '1st and 2nd order headings'; $lang['sidebar_sections_o_h1,h2,h3,h4,h5'] = 'All headings'; $lang['sidebar_sections_o_li.level1 > .li'] = 'Top-level list items'; +$lang['header_layout'] = 'Adjust header layout:'; +$lang['header_layout_o_default'] = 'generous header layout for long wiki titel and tagline'; +$lang['header_layout_o_compact'] = 'compact header layout for short wiki title and hidden tagline'; diff --git a/main.php b/main.php index d3bc13e..990e4a8 100755 --- a/main.php +++ b/main.php @@ -69,7 +69,7 @@ $showSidebar = true; /* #dokuwiki__top used as anchor for "back to top" button/link links */ $classWideContent = ($ACT === "show") ? "": "wide-content "; ?> - +