You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by ne...@apache.org on 2007/05/03 14:24:23 UTC
svn commit: r534819 - in /lenya/trunk/src: pubs/default/sitemap.xmap
webapp/lenya/xslt/menu/menu2xhtml.xsl
Author: nettings
Date: Thu May 3 05:24:22 2007
New Revision: 534819
URL: http://svn.apache.org/viewvc?view=rev&rev=534819
Log:
an alternative approach to bug 42295 (tab links making no sense going
from "site->trash" etc. to "authoring". i think this fixes the root
cause.
please review, i'm not too familiar with menu2xhtml.xsl and may have
broken some corner cases!
Modified:
lenya/trunk/src/pubs/default/sitemap.xmap
lenya/trunk/src/webapp/lenya/xslt/menu/menu2xhtml.xsl
Modified: lenya/trunk/src/pubs/default/sitemap.xmap
URL: http://svn.apache.org/viewvc/lenya/trunk/src/pubs/default/sitemap.xmap?view=diff&rev=534819&r1=534818&r2=534819
==============================================================================
--- lenya/trunk/src/pubs/default/sitemap.xmap (original)
+++ lenya/trunk/src/pubs/default/sitemap.xmap Thu May 3 05:24:22 2007
@@ -360,9 +360,6 @@
<map:serialize status-code="404" />
</map:match>
- <map:match pattern="*">
- <map:redirect-to uri="{1}/"/>
- </map:match>
</map:pipeline>
Modified: lenya/trunk/src/webapp/lenya/xslt/menu/menu2xhtml.xsl
URL: http://svn.apache.org/viewvc/lenya/trunk/src/webapp/lenya/xslt/menu/menu2xhtml.xsl?view=diff&rev=534819&r1=534818&r2=534819
==============================================================================
--- lenya/trunk/src/webapp/lenya/xslt/menu/menu2xhtml.xsl (original)
+++ lenya/trunk/src/webapp/lenya/xslt/menu/menu2xhtml.xsl Thu May 3 05:24:22 2007
@@ -152,15 +152,33 @@
<xsl:variable name="tab-documenturl">
<xsl:choose>
- <!-- index.html for link from/to admin area -->
- <xsl:when test="$tab-area = 'admin' or $area = 'admin'">/index.html</xsl:when>
- <xsl:when test="($currentTab = 'site') and $documentid = '/'">/index.html</xsl:when>
+ <!--
+ Document URLs are not meaningful in some areas. In that case, set the URL to
+ "/". The publication sitemap currently takes care of mapping that to a default page (index.html).
+ FIXME: that solution is sub-optimal, because it breaks when a user deletes the /index page.
+ There should be a mapper from "/" to "first entry in sitetree", and if that does not exist, to a
+ "create document?" message.
+ -->
+ <!-- from or to the admin area, there's no concept of "document" (it's all usecases) -->
+ <xsl:when test="$tab-area = 'admin' or $area = 'admin'">/</xsl:when>
+ <!-- FIXME: what is documentid? -->
+ <xsl:when test="($currentTab = 'site') and $documentid = '/'">/</xsl:when>
+ <!-- you can't do anything with trashed or archived pages except in the "site" tab. -->
+ <xsl:when test="$area = 'trash' or $area = 'archive'">/</xsl:when>
+ <!-- catch missing trailing slash in urls with just the area: -->
+ <xsl:when test="not($documenturl)">/</xsl:when>
+ <!-- the default case is: use the current $documenturl for the new tab link. -->
<xsl:otherwise><xsl:value-of select="$documenturl"/></xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:choose>
<xsl:when test="$tabName = $currentTab">
+ <!--
+ FIXME: why do we normalize-space here? fiddling with uris is none of our business.
+ Looks like a workaround for a real bug that should be fixed. Sure, we don't allow spaces
+ in document URLs, but that policy decision is made elsewhere.
+ -->
<li id="area-{$tab-area}-active" class="area-active"><a href="{$contextprefix}/{$publicationid}/{$tab-area}{normalize-space($tab-documenturl)}{$queryString}" target="{$target}"><span><i18n:text><xsl:value-of select="$tabName"/></i18n:text></span></a></li>
</xsl:when>
<xsl:otherwise>
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@lenya.apache.org
For additional commands, e-mail: commits-help@lenya.apache.org