You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@roller.apache.org by sn...@apache.org on 2005/08/19 18:03:16 UTC
svn commit: r233499 - in /incubator/roller/trunk/web:
WEB-INF/classes/weblog.vm website/edit-page.jsp
Author: snoopdave
Date: Fri Aug 19 09:03:05 2005
New Revision: 233499
URL: http://svn.apache.org/viewcvs?rev=233499&view=rev
Log:
fixing ROL-780: next/prev links link to single entry
Modified:
incubator/roller/trunk/web/WEB-INF/classes/weblog.vm
incubator/roller/trunk/web/website/edit-page.jsp
Modified: incubator/roller/trunk/web/WEB-INF/classes/weblog.vm
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/web/WEB-INF/classes/weblog.vm?rev=233499&r1=233498&r2=233499&view=diff
==============================================================================
--- incubator/roller/trunk/web/WEB-INF/classes/weblog.vm (original)
+++ incubator/roller/trunk/web/WEB-INF/classes/weblog.vm Fri Aug 19 09:03:05 2005
@@ -240,38 +240,6 @@
#end
#**
- * Display link to chronologically previous entry in the
- * same category (if specified).
-**#
-#macro( showPreviousEntryLink $category)
- <span id="previousEntry">
- #if( $pageModel.previousEntry )
- #if ( $category != 'nil' )#set( $catPath = $category )#end ## was a category supplied?
- #set( $previousEntry = $pageModel.previousEntry )
- <a href="$ctxPath$previousEntry.getPermaLink($catPath)"
- title="Previous Entries"
- >« $utilities.truncateNicely($previousEntry.title, 30, 30, "...")</a>
- #end
- </span>
-#end
-
-#**
- * Display link to chronologically next entry in the
- * same category (if specified).
-**#
-#macro( showNextEntryLink $category)
- <span id="nextEntry">
- #if( $pageModel.nextEntry )
- #if ( $category != 'nil' )#set( $catPath = $category )#end ## was a category supplied?
- #set( $nextEntry = $pageModel.nextEntry )
- <a href="$ctxPath$nextEntry.getPermaLink($catPath)"
- title="Next Entries"
- >$utilities.truncateNicely($nextEntry.title, 30, 30, "...") »</a>
- #end
- </span>
-#end
-
-#**
* Shows weblog entries from specified category
* using specified page as a "day template" for the display of each day.
* If a specific weblog entry is specified by the current request (using
@@ -318,11 +286,6 @@
#if( $searchResults )
#showSearchPager()
#end
-
- <div class="next-previous">
- #showPreviousEntryLink($category)
- #showNextEntryLink($category)
- </div>
#end
#end
@@ -431,27 +394,55 @@
* display link to "main" page if either is present.
**#
#macro( showNextPreviousLinks )
+ #set( $npcat = 'nil' )
#set( $catLink = "" )
- #if ( $catPath ) #set( $catLink = "?catname=$catPath" ) #end
+ #if ( $catPath && $catPath != "")
+ #set( $npcat = $catPath )
+ #set( $catLink = "?catname=$catPath" )
+ #end
<div class="next-previous">
#if ($pageModel.previousEntry)
- #set( $previousEntry = $pageModel.previousEntry )
- <a href="$ctxPath/page/$userName/$page.link/$utilities.encode($previousEntry.anchor)$catLink"
- title="$previousEntry.title"
- >« $utilities.truncateNicely($previousEntry.title, 30, 30, "...")</a> |
+ #showPrevEntryLink($npcat) |
#end
-
#if ( $pageModel.previousEntry || $pageModel.nextEntry)
<a href="$ctxPath/page/$userName/$page.link$catLink">$page.name</a>
#end
-
#if ($pageModel.nextEntry)
- #set( $nextEntry = $pageModel.nextEntry )
- | <a href="$ctxPath/page/$userName/$page.link/$utilities.encode($nextEntry.anchor)$catLink"
- title="$nextEntry.title"
- >$utilities.truncateNicely($nextEntry.title, 30, 30, "...") »</a>
+ | #showNextEntryLink($npcat)
#end
</div>
+#end
+
+#**
+ * Display link to chronologically previous entry in the
+ * same category (if specified).
+**#
+#macro( showPrevEntryLink $category)
+ <span id="previousEntry">
+ #if( $pageModel.previousEntry )
+ #set( $prev = $pageModel.previousEntry )
+ #set( $prevURL = "$baseURL/page/${prev.website.user.userName}/#formatDate($plainFormat ${prev.pubTime})" )
+ #if ( $category != 'nil' ) #set( $prevURL = "$prevURL?catname=$category" )#end
+ <a href="$prevURL" title="Previous Entries"
+ >« $utilities.truncateNicely($prev.title, 30, 30, "...")</a>
+ #end
+ </span>
+#end
+
+#**
+ * Display link to chronologically next entry in the
+ * same category (if specified).
+**#
+#macro( showNextEntryLink $category)
+ <span id="nextEntry">
+ #if( $pageModel.nextEntry )
+ #set( $next = $pageModel.nextEntry )
+ #set( $nextURL = "$baseURL/page/${next.website.user.userName}/#formatDate($plainFormat ${next.pubTime})" )
+ #if ( $category != 'nil' ) #set( $nextURL = "$nextURL?catname=$category" )#end
+ <a href="$nextURL" title="Next Entries"
+ >$utilities.truncateNicely($next.title, 30, 30, "...") »</a>
+ #end
+ </span>
#end
#**
Modified: incubator/roller/trunk/web/website/edit-page.jsp
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/web/website/edit-page.jsp?rev=233499&r1=233498&r2=233499&view=diff
==============================================================================
--- incubator/roller/trunk/web/website/edit-page.jsp (original)
+++ incubator/roller/trunk/web/website/edit-page.jsp Fri Aug 19 09:03:05 2005
@@ -23,12 +23,14 @@
</td>
</tr>
<tr>
- <td><fmt:message key="pageForm.template" /><br />
- <html:textarea property="contents" cols="80" rows="30" style="width: 100%" />
+
</td>
</tr>
</table>
-
+
+ <fmt:message key="pageForm.template" /><br />
+ <html:textarea property="contents" cols="80" rows="30" style="width: 100%" />
+
<html:hidden property="id"/>
<html:hidden property="name"/>