Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 6a8f6ae

Browse files
committed
doc: Don't hide the "Up" link when it is the same as "Home"
The original stylesheets seemed to think this was a good idea, but our users find it confusing and unhelpful, so undo that logic. Reported-by: Fabien COELHO <coelho@cri.ensmp.fr> Discussion: https://www.postgresql.org/message-id/flat/alpine.DEB.2.22.394.2006210914370.859381%40pseudo
1 parent 4e10c0c commit 6a8f6ae

File tree

1 file changed

+159
-4
lines changed

1 file changed

+159
-4
lines changed

doc/src/sgml/stylesheet.xsl

Lines changed: 159 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ Customization of header
5252
<xsl:variable name="row1" select="$navig.showtitles != 0"/>
5353
<xsl:variable name="row2" select="count($prev) &gt; 0
5454
or (count($up) &gt; 0
55-
and generate-id($up) != generate-id($home)
5655
and $navig.showtitles != 0)
5756
or count($next) &gt; 0"/>
5857

@@ -90,8 +89,7 @@ Customization of header
9089
</td>
9190
<td width="10%" align="{$direction.align.start}">
9291
<xsl:choose>
93-
<xsl:when test="count($up)&gt;0
94-
and generate-id($up) != generate-id($home)">
92+
<xsl:when test="count($up)&gt;0">
9593
<a accesskey="u">
9694
<xsl:attribute name="href">
9795
<xsl:call-template name="href.target">
@@ -112,7 +110,6 @@ Customization of header
112110
<th width="60%" align="center">
113111
<xsl:choose>
114112
<xsl:when test="count($up) > 0
115-
and generate-id($up) != generate-id($home)
116113
and $navig.showtitles != 0">
117114
<xsl:apply-templates select="$up" mode="object.title.markup"/>
118115
</xsl:when>
@@ -171,4 +168,162 @@ Customization of header
171168
</xsl:if>
172169
</xsl:template>
173170

171+
172+
<!--
173+
Customization of footer
174+
- don't hide redundant Up link
175+
- add tool tips to links
176+
177+
(overrides html/chunk-common.xsl)
178+
-->
179+
<xsl:template name="footer.navigation">
180+
<xsl:param name="prev" select="/foo"/>
181+
<xsl:param name="next" select="/foo"/>
182+
<xsl:param name="nav.context"/>
183+
184+
<xsl:variable name="home" select="/*[1]"/>
185+
<xsl:variable name="up" select="parent::*"/>
186+
187+
<xsl:variable name="row1" select="count($prev) &gt; 0
188+
or count($up) &gt; 0
189+
or count($next) &gt; 0"/>
190+
191+
<xsl:variable name="row2" select="($prev and $navig.showtitles != 0)
192+
or (generate-id($home) != generate-id(.)
193+
or $nav.context = 'toc')
194+
or ($chunk.tocs.and.lots != 0
195+
and $nav.context != 'toc')
196+
or ($next and $navig.showtitles != 0)"/>
197+
198+
<xsl:if test="$suppress.navigation = '0' and $suppress.footer.navigation = '0'">
199+
<div class="navfooter">
200+
<xsl:if test="$footer.rule != 0">
201+
<hr/>
202+
</xsl:if>
203+
204+
<xsl:if test="$row1 or $row2">
205+
<table width="100%" summary="Navigation footer">
206+
<xsl:if test="$row1">
207+
<tr>
208+
<td width="40%" align="{$direction.align.start}">
209+
<xsl:if test="count($prev)>0">
210+
<a accesskey="p">
211+
<xsl:attribute name="href">
212+
<xsl:call-template name="href.target">
213+
<xsl:with-param name="object" select="$prev"/>
214+
</xsl:call-template>
215+
</xsl:attribute>
216+
<xsl:attribute name="title">
217+
<xsl:apply-templates select="$prev" mode="object.title.markup"/>
218+
</xsl:attribute>
219+
<xsl:call-template name="navig.content">
220+
<xsl:with-param name="direction" select="'prev'"/>
221+
</xsl:call-template>
222+
</a>
223+
</xsl:if>
224+
<xsl:text>&#160;</xsl:text>
225+
</td>
226+
<td width="20%" align="center">
227+
<xsl:choose>
228+
<xsl:when test="count($up)&gt;0">
229+
<a accesskey="u">
230+
<xsl:attribute name="href">
231+
<xsl:call-template name="href.target">
232+
<xsl:with-param name="object" select="$up"/>
233+
</xsl:call-template>
234+
</xsl:attribute>
235+
<xsl:attribute name="title">
236+
<xsl:apply-templates select="$up" mode="object.title.markup"/>
237+
</xsl:attribute>
238+
<xsl:call-template name="navig.content">
239+
<xsl:with-param name="direction" select="'up'"/>
240+
</xsl:call-template>
241+
</a>
242+
</xsl:when>
243+
<xsl:otherwise>&#160;</xsl:otherwise>
244+
</xsl:choose>
245+
</td>
246+
<td width="40%" align="{$direction.align.end}">
247+
<xsl:text>&#160;</xsl:text>
248+
<xsl:if test="count($next)>0">
249+
<a accesskey="n">
250+
<xsl:attribute name="href">
251+
<xsl:call-template name="href.target">
252+
<xsl:with-param name="object" select="$next"/>
253+
</xsl:call-template>
254+
</xsl:attribute>
255+
<xsl:attribute name="title">
256+
<xsl:apply-templates select="$next" mode="object.title.markup"/>
257+
</xsl:attribute>
258+
<xsl:call-template name="navig.content">
259+
<xsl:with-param name="direction" select="'next'"/>
260+
</xsl:call-template>
261+
</a>
262+
</xsl:if>
263+
</td>
264+
</tr>
265+
</xsl:if>
266+
267+
<xsl:if test="$row2">
268+
<tr>
269+
<td width="40%" align="{$direction.align.start}" valign="top">
270+
<xsl:if test="$navig.showtitles != 0">
271+
<xsl:apply-templates select="$prev" mode="object.title.markup"/>
272+
</xsl:if>
273+
<xsl:text>&#160;</xsl:text>
274+
</td>
275+
<td width="20%" align="center">
276+
<xsl:choose>
277+
<xsl:when test="$home != . or $nav.context = 'toc'">
278+
<a accesskey="h">
279+
<xsl:attribute name="href">
280+
<xsl:call-template name="href.target">
281+
<xsl:with-param name="object" select="$home"/>
282+
</xsl:call-template>
283+
</xsl:attribute>
284+
<xsl:attribute name="title">
285+
<xsl:apply-templates select="$home" mode="object.title.markup"/>
286+
</xsl:attribute>
287+
<xsl:call-template name="navig.content">
288+
<xsl:with-param name="direction" select="'home'"/>
289+
</xsl:call-template>
290+
</a>
291+
<xsl:if test="$chunk.tocs.and.lots != 0 and $nav.context != 'toc'">
292+
<xsl:text>&#160;|&#160;</xsl:text>
293+
</xsl:if>
294+
</xsl:when>
295+
<xsl:otherwise>&#160;</xsl:otherwise>
296+
</xsl:choose>
297+
298+
<xsl:if test="$chunk.tocs.and.lots != 0 and $nav.context != 'toc'">
299+
<a accesskey="t">
300+
<xsl:attribute name="href">
301+
<xsl:value-of select="$chunked.filename.prefix"/>
302+
<xsl:apply-templates select="/*[1]"
303+
mode="recursive-chunk-filename">
304+
<xsl:with-param name="recursive" select="true()"/>
305+
</xsl:apply-templates>
306+
<xsl:text>-toc</xsl:text>
307+
<xsl:value-of select="$html.ext"/>
308+
</xsl:attribute>
309+
<xsl:call-template name="gentext">
310+
<xsl:with-param name="key" select="'nav-toc'"/>
311+
</xsl:call-template>
312+
</a>
313+
</xsl:if>
314+
</td>
315+
<td width="40%" align="{$direction.align.end}" valign="top">
316+
<xsl:text>&#160;</xsl:text>
317+
<xsl:if test="$navig.showtitles != 0">
318+
<xsl:apply-templates select="$next" mode="object.title.markup"/>
319+
</xsl:if>
320+
</td>
321+
</tr>
322+
</xsl:if>
323+
</table>
324+
</xsl:if>
325+
</div>
326+
</xsl:if>
327+
</xsl:template>
328+
174329
</xsl:stylesheet>

0 commit comments

Comments
 (0)