summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Williams <andy@andywilliams.me>2017-11-20 10:03:25 +0000
committerAndy Williams <andy@andywilliams.me>2017-11-20 10:11:35 +0000
commitd108a64283409b73747b9b84088141fc3c1e2e18 (patch)
treebbd454cdb925f4bf2197dba06cc498c6838ebd07
parenta8805c626e605f382d326f1f3e8f0c0c65ddc281 (diff)
template: Add table of contents to the page sidebar.
Also, when we have a large enough margin let's fix it to the top right so it is always visible
-rw-r--r--public_html/lib/tpl/e/css/modifications.css54
-rw-r--r--public_html/lib/tpl/e/main.php24
2 files changed, 49 insertions, 29 deletions
diff --git a/public_html/lib/tpl/e/css/modifications.css b/public_html/lib/tpl/e/css/modifications.css
index 8f150950..984aa528 100644
--- a/public_html/lib/tpl/e/css/modifications.css
+++ b/public_html/lib/tpl/e/css/modifications.css
@@ -43,11 +43,6 @@ h1, h2, h3, h4, h5, h6,
43 padding: 15px 0; 43 padding: 15px 0;
44} 44}
45 45
46.bs-sidebar {
47 padding-top: 15px;
48 position: fixed;
49}
50
51.bs-sidenav { 46.bs-sidenav {
52 margin-top: 30px; 47 margin-top: 30px;
53 margin-bottom: 30px; 48 margin-bottom: 30px;
@@ -58,26 +53,45 @@ h1, h2, h3, h4, h5, h6,
58 border-radius: 4px; 53 border-radius: 4px;
59} 54}
60 55
61.bs-sidebar .nav > li > a { 56#dokuwiki__aside h4 {
57 margin-bottom: 0;
58 padding-left: 10px;
59}
60
61#dokuwiki__aside ul {
62 list-style: none;
63 padding-left: 0;
64 margin-bottom: 10px;
65}
66
67#dokuwiki__aside ul ul {
68 padding-left: 20px;
69}
70
71#dokuwiki__aside .nav li a {
62 display: block; 72 display: block;
63 padding: 5px 20px; 73 padding: 5px 10px;
74
75 white-space: nowrap;
76 overflow: hidden;
77 text-overflow: ellipsis;
64} 78}
65 79
66.bs-sidebar .nav li a:visited { 80#dokuwiki__aside .nav li a:visited {
67 border-bottom: none; 81 border-bottom: none;
68 border-bottom-color: #202020; 82 border-bottom-color: #202020;
69} 83}
70 84
71.bs-sidebar .nav > li > a:hover, 85#dokuwiki__aside .nav li a:hover,
72.bs-sidebar .nav > li > a:focus { 86#dokuwiki__aside .nav li a:focus {
73 border-bottom: none; 87 border-bottom: none;
74 background-color: #202020; 88 background-color: #202020;
75 border-right: 1px solid #505050; 89 border-right: 1px solid #505050;
76} 90}
77 91
78.bs-sidebar .nav > .active > a, 92#dokuwiki__aside .nav > .active > a,
79.bs-sidebar .nav > .active:hover > a, 93#dokuwiki__aside .nav > .active:hover > a,
80.bs-sidebar .nav > .active:focus > a { 94#dokuwiki__aside .nav > .active:focus > a {
81 font-weight: bold; 95 font-weight: bold;
82 background-color: transparent; 96 background-color: transparent;
83 border-right: 1px; 97 border-right: 1px;
@@ -85,14 +99,12 @@ h1, h2, h3, h4, h5, h6,
85 99
86.bs-sidebar .nav .nav { 100.bs-sidebar .nav .nav {
87 display: none; 101 display: none;
88 margin-bottom: 8px;
89} 102}
90 103
91.bs-sidebar .nav .nav > li > a { 104.bs-sidebar .nav .nav > li > a {
92 padding-top: 3px; 105 padding-top: 3px;
93 padding-bottom: 3px; 106 padding-bottom: 3px;
94 padding-left: 30px; 107 padding-left: 30px;
95 font-size: 90%;
96} 108}
97 109
98.bs-sidebar .nav > .active > ul { 110.bs-sidebar .nav > .active > ul {
@@ -119,9 +131,17 @@ h1, h2, h3, h4, h5, h6,
119 background-color: #282828; 131 background-color: #282828;
120 padding-left: 10px; 132 padding-left: 10px;
121 padding-right: 10px; 133 padding-right: 10px;
134 padding-bottom: 10px;
122 border-left: 15px solid #303030; 135 border-left: 15px solid #303030;
123 border-bottom: 15px solid #303030; 136 border-bottom: 15px solid #303030;
124 min-width: 250px; 137 width: 280px;
138}
139
140@media (min-width: 1700px) {
141 #dokuwiki__aside {
142 position: fixed;
143 right: 0;
144 }
125} 145}
126 146
127#dokuwiki__aside a:visited { 147#dokuwiki__aside a:visited {
@@ -162,7 +182,7 @@ h1, h2, h3, h4, h5, h6,
162 background-color: #202020; 182 background-color: #202020;
163} 183}
164 184
165.nav > li > a { 185.nav li a {
166 padding-left: 6px; 186 padding-left: 6px;
167 padding-right: 6px; 187 padding-right: 6px;
168 text-shadow: none; 188 text-shadow: none;
diff --git a/public_html/lib/tpl/e/main.php b/public_html/lib/tpl/e/main.php
index 2f1fd48c..4d3b0575 100644
--- a/public_html/lib/tpl/e/main.php
+++ b/public_html/lib/tpl/e/main.php
@@ -86,17 +86,7 @@ $showSidebar = $hasSidebar && ($ACT=='show');
86 <!-- ********** SIDE BAR for TOCIFY ********** --> 86 <!-- ********** SIDE BAR for TOCIFY ********** -->
87 <div class="row"> 87 <div class="row">
88 88
89
90 <?php /* when in Show Mode we render the TOC, if not, use full width for content */
91 if ($showTOC) { ?>
92 <!-- Make side bar 3 "md's" wide -->
93 <div class="col-md-3">
94 <?php _tpl_toc_to_twitter_bootstrap(); ?>
95 </div>
96 <div class="col-md-8" id="dokuwiki__content">
97 <?php } else { ?>
98 <div class="col-md-11" id="dokuwiki__content"> 89 <div class="col-md-11" id="dokuwiki__content">
99 <?php } ?>
100 90
101 <?php if($showSidebar): ?> 91 <?php if($showSidebar): ?>
102 <!-- ********** ASIDE ********** --> 92 <!-- ********** ASIDE ********** -->
@@ -107,11 +97,21 @@ $showSidebar = $hasSidebar && ($ACT=='show');
107 <?php tpl_includeFile('sidebarheader.html') ?> 97 <?php tpl_includeFile('sidebarheader.html') ?>
108 <?php tpl_include_page($conf['sidebar'], true, true) ?> 98 <?php tpl_include_page($conf['sidebar'], true, true) ?>
109 <?php tpl_includeFile('sidebarfooter.html') ?> 99 <?php tpl_includeFile('sidebarfooter.html') ?>
100 </div></div>
101 <?php /* when in Show Mode we render the TOC */
102 if ($showTOC) { ?>
103 <h3 class="toggle">Page Contents</h3>
104 <div class="content">
105 <?php _tpl_toc_to_twitter_bootstrap(); ?>
106 <div class="nav"><ul><li>
107 <a href="#top">Top of Page</a>
108 </li></ul></div>
110 </div> 109 </div>
111 </div></div><!-- /aside --> 110 <?php } ?>
111 </div><!-- /aside -->
112 <?php endif; ?> 112 <?php endif; ?>
113 113
114 <div class="page"> 114 <div class="page">
115 <?php tpl_flush(); ?> 115 <?php tpl_flush(); ?>
116 <?php tpl_content(false); ?> 116 <?php tpl_content(false); ?>
117 <div class="clearer"></div> 117 <div class="clearer"></div>