roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject svn commit: r423713 - in /incubator/roller/branches/roller_3.0: src/org/apache/roller/pojos/ src/org/apache/roller/ui/rendering/model/ web/WEB-INF/classes/ web/WEB-INF/velocity/
Date Thu, 20 Jul 2006 02:12:24 GMT
Author: snoopdave
Date: Wed Jul 19 19:12:23 2006
New Revision: 423713

URL: http://svn.apache.org/viewvc?rev=423713&view=rev
Log:

- Changed list macros to take collections of items instead of querying for
  those items. Also, fixed bugs in bookmark and category macros.

- Added new macro #showCommonJavascript() for use in HTML head to import 
  common Javascript code needed for macros.

- Added I18N support in weblog entries pager and and support for displaying
  dates in the link names, but still not entirely happy with pager appearance.

Modified:
    incubator/roller/branches/roller_3.0/src/org/apache/roller/pojos/WebsiteData.java
    incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/UtilitiesModel.java
    incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/WeblogEntriesPagerImpl.java
    incubator/roller/branches/roller_3.0/web/WEB-INF/classes/ApplicationResources.properties
    incubator/roller/branches/roller_3.0/web/WEB-INF/velocity/weblog.vm

Modified: incubator/roller/branches/roller_3.0/src/org/apache/roller/pojos/WebsiteData.java
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/src/org/apache/roller/pojos/WebsiteData.java?rev=423713&r1=423712&r2=423713&view=diff
==============================================================================
--- incubator/roller/branches/roller_3.0/src/org/apache/roller/pojos/WebsiteData.java (original)
+++ incubator/roller/branches/roller_3.0/src/org/apache/roller/pojos/WebsiteData.java Wed
Jul 19 19:12:23 2006
@@ -1260,7 +1260,7 @@
      *
      * @roller.wrapPojoMethod type="pojo" class="org.apache.roller.pojos.FolderData"
      */
-    public FolderData getFolder(String folderName) {
+    public FolderData getBookmarkFolder(String folderName) {
         FolderData ret = null;
         try {
             Roller roller = RollerFactory.getRoller();

Modified: incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/UtilitiesModel.java
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/UtilitiesModel.java?rev=423713&r1=423712&r2=423713&view=diff
==============================================================================
--- incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/UtilitiesModel.java
(original)
+++ incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/UtilitiesModel.java
Wed Jul 19 19:12:23 2006
@@ -98,7 +98,7 @@
     
     /** Template context name to be used for model */
     public String getModelName() {
-        return "utilities";
+        return "utils";
     }
     
     

Modified: incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/WeblogEntriesPagerImpl.java
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/WeblogEntriesPagerImpl.java?rev=423713&r1=423712&r2=423713&view=diff
==============================================================================
--- incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/WeblogEntriesPagerImpl.java
(original)
+++ incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/WeblogEntriesPagerImpl.java
Wed Jul 19 19:12:23 2006
@@ -18,6 +18,7 @@
 
 package org.apache.roller.ui.rendering.model;
 
+import java.text.MessageFormat;
 import java.text.ParsePosition;
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
@@ -28,6 +29,7 @@
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
+import java.util.ResourceBundle;
 import java.util.TreeMap;
 import org.apache.commons.collections.comparators.ReverseComparator;
 import org.apache.commons.lang.StringUtils;
@@ -43,6 +45,7 @@
 import org.apache.roller.pojos.WebsiteData;
 import org.apache.roller.pojos.wrapper.WeblogEntryDataWrapper;
 import org.apache.roller.util.DateUtil;
+import org.apache.roller.util.Utilities;
 
 
 /**
@@ -70,7 +73,14 @@
     protected int                length = 0;
         
     protected static Log log =
-            LogFactory.getFactory().getInstance(WeblogEntriesPagerImpl.class); 
+            LogFactory.getFactory().getInstance(WeblogEntriesPagerImpl.class);
+    
+    private static ResourceBundle bundle =
+            ResourceBundle.getBundle("ApplicationResources");
+    private SimpleDateFormat dayFormat = new SimpleDateFormat(
+            bundle.getString("weblogEntriesPager.day.dateFormat"));
+    private SimpleDateFormat monthFormat = new SimpleDateFormat(
+            bundle.getString("weblogEntriesPager.month.dateFormat"));
     
     public WeblogEntriesPagerImpl(
             WebsiteData        weblog, 
@@ -172,7 +182,7 @@
         }
         
         public String getHomeName() {
-            return "Main"; // TODO: I18N
+            return bundle.getString("weblogEntriesPager.latest.home");
         }
         
         public String getNextLink() {
@@ -184,7 +194,7 @@
 
         public String getNextName() {
             if (getNextLink() != null) {
-                return "Next"; // TODO: I18N
+                return bundle.getString("weblogEntriesPager.latest.next");
             }
             return null;
         }
@@ -198,7 +208,7 @@
 
         public String getPrevName() {
             if (getNextLink() != null) {
-                return "Prev"; // TODO: I18N
+                return bundle.getString("weblogEntriesPager.latest.prev");
             }
             return null;
         }
@@ -262,7 +272,7 @@
         }
         
         public String getHomeName() {
-            return "Main"; // TODO: I18N
+            return bundle.getString("weblogEntriesPager.single.home");
         }
                 
         public String getNextLink() {
@@ -274,7 +284,9 @@
 
         public String getNextName() {
             if (getNextEntry() != null) {
-                return getNextEntry().getTitle();
+                String title = Utilities.truncateNicely(getNextEntry().getTitle(), 15, 20,
"...");
+                String msg = bundle.getString("weblogEntriesPager.singleEntry.next");
+                return MessageFormat.format(msg, new Object[] {title});
             }
             return null;
         }
@@ -288,7 +300,9 @@
 
         public String getPrevName() {
             if (getPrevEntry() != null) {
-                return getPrevEntry().getTitle();
+                String title = Utilities.truncateNicely(getPrevEntry().getTitle(), 15, 20,
"...");
+                String msg = bundle.getString("weblogEntriesPager.singleEntry.prev");
+                return MessageFormat.format(msg, new Object[] {title});
             }
             return null;
         }
@@ -393,7 +407,7 @@
         }
         
         public String getHomeName() {
-            return "Main"; // TODO: I18N
+            return bundle.getString("weblogEntriesPager.day.home");
         }
         
         public String getNextLink() {
@@ -405,7 +419,8 @@
 
         public String getNextName() {
             if (getNextLink() != null) {
-                return "Next"; // TODO: I18N
+                String msg = bundle.getString("weblogEntriesPager.day.next");
+                return MessageFormat.format(msg, new Object[] {dayFormat.format(day)});
             }
             return null;
         }
@@ -418,8 +433,9 @@
         }
 
         public String getPrevName() {
-            if (getNextLink() != null) {
-                return "Prev"; // TODO: I18N
+            if (getPrevLink() != null) {
+                String msg = bundle.getString("weblogEntriesPager.day.prev");
+                return MessageFormat.format(msg, new Object[] {dayFormat.format(day)});
             }
             return null;
         }
@@ -434,7 +450,8 @@
 
         public String getNextCollectionName() {
             if (nextDay != null) {
-                return DateUtil.format8chars(nextDay);
+                String msg = bundle.getString("weblogEntriesPager.day.prevCollection");
+                return MessageFormat.format(msg, new Object[] {dayFormat.format(nextDay)});
             }
             return null;
         }
@@ -449,7 +466,8 @@
 
         public String getPrevCollectionName() {
             if (prevDay != null) {
-                return DateUtil.format8chars(prevDay);
+                String msg = bundle.getString("weblogEntriesPager.day.prevCollection");
+                return MessageFormat.format(msg, new Object[] {dayFormat.format(prevDay)});
             }
             return null;
         }
@@ -501,7 +519,7 @@
         }
         
         public String getHomeName() {
-            return "Main"; // TODO: I18N
+            return bundle.getString("weblogEntriesPager.month.home");
         }
         
         public String getNextLink() {
@@ -513,7 +531,8 @@
 
         public String getNextName() {
             if (getNextLink() != null) {
-                return "Next"; // TODO: I18N
+                String msg = bundle.getString("weblogEntriesPager.month.next");
+                return MessageFormat.format(msg, new Object[] {monthFormat.format(month)});
             }
             return null;
         }
@@ -528,8 +547,9 @@
         }
 
         public String getPrevName() {
-            if (getNextLink() != null) {
-                return "Prev"; // TODO: I18N
+            if (getPrevLink() != null) {
+                String msg = bundle.getString("weblogEntriesPager.month.prev");
+                return MessageFormat.format(msg, new Object[] {monthFormat.format(month)});
             }
             return null;
         }
@@ -544,7 +564,8 @@
 
         public String getNextCollectionName() {
             if (nextMonth != null) {
-                return DateUtil.format6chars(nextMonth);
+                String msg = bundle.getString("weblogEntriesPager.month.nextCollection");
+                return MessageFormat.format(msg, new Object[] {monthFormat.format(nextMonth)});
             }
             return null;
         }
@@ -559,7 +580,8 @@
 
         public String getPrevCollectionName() {
             if (prevMonth != null) {
-                return DateUtil.format6chars(prevMonth);
+                String msg = bundle.getString("weblogEntriesPager.month.prevCollection");
+                return MessageFormat.format(msg, new Object[] {monthFormat.format(prevMonth)});
             }
             return null;
         }        

Modified: incubator/roller/branches/roller_3.0/web/WEB-INF/classes/ApplicationResources.properties
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/web/WEB-INF/classes/ApplicationResources.properties?rev=423713&r1=423712&r2=423713&view=diff
==============================================================================
--- incubator/roller/branches/roller_3.0/web/WEB-INF/classes/ApplicationResources.properties
(original)
+++ incubator/roller/branches/roller_3.0/web/WEB-INF/classes/ApplicationResources.properties
Wed Jul 19 19:12:23 2006
@@ -807,6 +807,33 @@
 pageRemove.pageId=Page ID
 pageRemove.pageName=Page Name
 
+# ------------------------------------------------------------------------ Pager 
+
+weblogEntriesPager.latest.home=Main
+weblogEntriesPager.latest.next=Next page
+weblogEntriesPager.latest.prev=Previous page
+
+weblogEntriesPager.singleEntry.home=Main
+# argument ${0} is truncated title of weblog entry
+weblogEntriesPager.singleEntry.next={0}
+weblogEntriesPager.singleEntry.prev={0}
+
+weblogEntriesPager.day.home=Main
+# argument ${0} is date of next day
+weblogEntriesPager.day.next=Next page of day ({0})
+weblogEntriesPager.day.prev=Previous page of day ({0})
+weblogEntriesPager.day.nextCollection=Next day ({0})
+weblogEntriesPager.day.prevCollection=Previous day ({0})
+weblogEntriesPager.day.dateFormat=MMM d, yyyy
+
+weblogEntriesPager.month.home=Main
+# argument ${0} is date of next month
+weblogEntriesPager.month.next=Next page of month ({0})
+weblogEntriesPager.month.prev=Previous page of month ({0})
+weblogEntriesPager.month.nexCollection=Next month ({0})
+weblogEntriesPager.month.prevCollection=Previous month ({0})
+weblogEntriesPager.month.dateFormat=MMM yyyy
+
 # ---------------------------------------------------- Ping Target Admin/Editing
 
 commonPingTargets.subtitle=Manage common weblog ping targets for all weblogs.

Modified: incubator/roller/branches/roller_3.0/web/WEB-INF/velocity/weblog.vm
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/web/WEB-INF/velocity/weblog.vm?rev=423713&r1=423712&r2=423713&view=diff
==============================================================================
--- incubator/roller/branches/roller_3.0/web/WEB-INF/velocity/weblog.vm (original)
+++ incubator/roller/branches/roller_3.0/web/WEB-INF/velocity/weblog.vm Wed Jul 19 19:12:23
2006
@@ -1,19 +1,25 @@
 
 #** Set of essential macros needed in Roller velocity templates.
 
+    #includeTemplate($weblog $pageName)
+    #showAutodiscoveryLinks($weblog)
+    #showTrackbackAutodiscoveryRDF($entry)
+    #showCommonJavascript()
+
     #showWeblogEntriesPager($pager)
     #showNextPrevControl($pager)
+
     #showWeblogEntryComments($entry)
     #showWeblogEntryCommentForm($entry)
-    #showWeblogEntryLinksList($weblog $category $max)
-    #showBookmarkLinksList($weblog $folder $expanding $subfolders)
-    #showWeblogCategoryLinksList($weblog $category $expanding $subcats)
-    #showPageLinksList($weblog)
-    #showTrackbackAutodiscoveryRDF($entry)
-    #showAutodiscoveryLinks($weblog)
+
+    #showWeblogEntryLinksList($entries)
+    #showBookmarkLinksList($folderObj $expanding $subfolders)
+    #showWeblogCategoryLinksList($categoryObj $expanding $subcats)
+
     #showWeblogEntryCalendar($weblog $category)
+    #showPageMenu($weblog)
     #showAuthorMenu($vertical)
-    #includeTemplate($weblog $pageName)
+
 Todo:
     #showSearchForm()
     #showSearchAgainForm()
@@ -23,6 +29,63 @@
 
 
 #** 
+Parse and include page template from weblog.
+*#
+#macro(includeTemplate $weblog $pageName)
+    #set($iPageId = false)## This is required for such constructs; see Velocity docs and
ROL-689
+    #set($iPageId = $weblog.findPageIdByName($pageName))
+    #if (!$iPageId) ## no page found, parse pageName
+        #set($iPageId = $pageName)
+    #end
+    #parse($iPageId)
+#end
+
+
+#** 
+Show RSS, Atom and RSD auto-discovery links as HTML link elements.
+*#
+#macro(showAutodiscoveryLinks $weblog)
+    <link rel="alternate" type="application/atom+xml" title="Atom Entries"  href="$weblog.URL/feeds/entries/atom"
/>
+    <link rel="alternate" type="application/atom+xml" title="Atom Comments" href="$weblog.URL/feeds/comments/atom"
/>
+    <link rel="alternate" type="application/rss+xml"  title="RSS Entries"   href="$weblog.URL/feeds/entries/rss"
/>
+    <link rel="alternate" type="application/rss+xml"  title="RSS Comments"  href="$weblog.URL/feeds/comments/rss"
/>
+    #if ($weblog.enableBloggerApi)
+       <link rel="EditURI"   type="application/rsd+xml" title="RSD" href="$weblog.URL/rsd"/>
+    #end
+#end
+
+
+#** 
+Show trackback discovery code for one weblog entry, appears as an HTML comment.
+*#
+#macro(showTrackbackAutodiscoveryRDF $entry)
+<!--
+<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+         xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/"
+         xmlns:dc="http://purl.org/dc/elements/1.1/">
+<rdf:Description
+    rdf:about="$entry.permalink"
+    trackback:ping="$entry.trackbackURL"
+    dc:title="$entry.title"
+    dc:identifier="$entry.permalink"
+    dc:subject="$entry.category.name"
+    dc:description="$entry.title"
+    dc:creator="$entry.creator.userName"
+    dc:date="$entry.pubTime" />
+</rdf:RDF>
+-->
+#end
+
+
+#**
+Include Javascript code needed for standard macros, for use in HTML head.
+*#
+#macro(showCommonJavascript)
+<script type="text/javascript" src="$config.getContextURL()/theme/scripts/roller.js"></script>
+#end
+
+
+#** 
 Shows weblog entries pager via default day template 
 *#
 #macro(showWeblogEntriesPager $pager)
@@ -37,14 +100,30 @@
 
 #** Show next/prev control for specified pager *#
 #macro(showNextPrevControl $pager)
+    #set($prevLink = false)
+    #set($nextLink = false)
     #if ($pager.prevLink)
-        &laquo; <a href="$pager.prevLink">$pager.prevName</a> |  
+        #set($prevLink = $pager.prevLink)
+        #set($prevName = $pager.prevName)
+    #elseif ($pager.prevCollectionLink)
+        #set($prevLink = $pager.prevCollectionLink)
+        #set($prevName = $pager.prevCollectionName)
+    #end
+    #if ($pager.nextLink)
+        #set($nextLink = $pager.nextLink)
+        #set($nextName = $pager.nextName)
+    #elseif ($pager.nextCollectionLink)
+        #set($nextLink = $pager.nextCollectionLink)
+        #set($nextName = $pager.nextCollectionName)
     #end
-    #if ($pager.prevLink || $pager.nextLink)
+    #if ($prevLink)
+        &laquo; <a href="$prevLink">$prevName</a> |  
+    #end
+    #if ($prevLink || $nextLink)
         <a href="$pager.getHomeLink()">$pager.getHomeName()</a>
     #end
-    #if ($pager.nextLink)
-        | <a href="$pager.nextLink">$pager.nextName</a> &raquo;
+    #if ($nextLink)
+        | <a href="$nextLink">$nextName</a> &raquo;
     #end
 #end
 
@@ -236,10 +315,9 @@
 #** 
 Show recent weblog entries in specified category. 
 *#
-#macro(showWeblogEntryLinksList $weblog $category $max)
-   #set($recentEntries = $weblog.getRecentWeblogEntries($category, $max))
-   <ul class="recentposts">
-   #foreach ($var in $recentEntries)
+#macro(showWeblogEntryLinksList $entriesList)
+   <ul class="entriesList">
+   #foreach ($var in $entriesList)
        <li class="recentposts"><a href="$var.permalink">$var.title</a></li>
    #end
    </ul>
@@ -249,29 +327,30 @@
 #** 
 Show bookmarks as a HTML ul list.
 *#
-#macro(showBookmarkLinksList $weblog $folder $expanding $subfolders)
-    #set($folderObj = $weblog.getFolder($folder))
-    #if ($folderObj)
-        #_showFolder($folderObj $expanding $subfolders)
-    #else
-        <span class="error">$text.get("macro.bookmark.error", [$folder])</span>
-    #end
+#macro(showBookmarkLinksList $folderObject $subfolders $expanding )
+<ul class="rFolder">
+#_showBookmarkLinksList($folderObject $subfolders $expanding)
+</ul>
 #end
 
-#**
-Show one bookmark folder as an HTML ul list, options for expanding and 
-recursion (private).
- *#
-#macro(_showFolder $folderObject $expanding $subfolders)
+
+#** 
+Show bookmarks as a HTML ul list (private).
+*#
+#macro(_showBookmarkLinksList $folderObject $subfolders $expanding )
     #set($bookmarks = $folderObject.getBookmarks())
+    #set($folders = $folderObject.getFolders())
     #set($divId = $utils.replace($folderObject.name, " ", "_" ))
-    #if ($expanding && $folderObject.name != "root")
-    <div class="rFolder">
+    #if ($folderObject.name != "root" && $expanding && $subfolders &&
($folderObject.getBookmarks().size() > 0 || $folderObject.getFolders().size() > 0))
+        <div class="rFolder">
         <li class="rFolderItem"><a href="javascript:toggleFolder('$divId')">
             <span id="i$divId">+</span></a>$folderObject.Name</li>
-        <ul id="$divId" style="display:none">
-    #else
+        <ul id="$divId" class="rFolder" style="display:none">
+    #elseif ($folderObject.name != "root" && $subfolders && ($folderObject.getBookmarks().size()
> 0 || $folderObject.getFolders().size() > 0))
+        <li class="rFolderItem">$folderObject.Name</li>
         <ul class="rFolder">
+    #elseif ($folderObject.name != "root")
+        <li class="rFolderItem">$folderObject.Name</li>
     #end
     #foreach($bookmark in $bookmarks)
         <li class="rFolderItem">
@@ -299,18 +378,20 @@
     #end
     ## show sub-folders
     #if ($subfolders)
-        #foreach($sFolder in $folderObject.folders)
-            #_showFolder($sFolder $expanding $subfolders)
+        #foreach($sFolder in $folders)
+            #_showBookmarkLinksList($sFolder $subfolders $expanding )
         #end
     #end
+    #if ($folderObject.name != "root" && $subfolders && ($folderObject.getBookmarks().size()
> 0 || $folderObject.getFolders().size() > 0))
         </ul>
-    #if($expanding)
-    </div>
-    <script type="text/javascript">
-    <!-- 
-    folderPreference("$divId");
-    // -->
-    </script>
+    #end
+    #if ($folderObject.name != "root" && $expanding && $subfolders &&
($folderObject.getBookmarks().size() > 0 || $folderObject.getFolders().size() > 0))
+        </div>
+        <script type="text/javascript">
+        <!-- 
+        folderPreference("$divId");
+        // -->
+        </script>
     #end
 #end
 
@@ -318,67 +399,66 @@
 #** 
 Show weblog's categories in specified parent category.
 *#
-#macro(showWeblogCategoryLinksList $weblog $category $expanding $subcats)
-    #set($categoryObject = $weblog.getWeblogCategory($category))
+#macro(showWeblogCategoryLinksList $categoryObject $subcats $expanding )
     #if(!$expanding && !$subcats)
         <ul class="rCategory">
-        #set($selectedCat = "")
-        #if($model.weblogCategory)
-           #set($selectedCat = $model.weblogCategory)
-           <li><a href="$weblog.URL">$text.get("macro.weblog.allcategories")</a></li>
+        #if ($model.weblogCategory)
+           <li><a href="$categoryObject.website.URL">$text.get("macro.weblog.allcategories")</a></li>
         #else
-           <li class="selected"><a href="$weblog.URL">$text.get("macro.weblog.allcategories")</a></li>
+           <li class="selected">$text.get("macro.weblog.allcategories")</li>
         #end
-        #set($cats = $weblog.getWeblogCategories($category))
+        #set($cats = $categoryObject.getWeblogCategories())
         #foreach($cat in $cats)
             #set($catParam = "?cat=$utilities.encode($cat.path)")
-            #set($weblogUrl = "$weblog.URL$catParam")
-            #if($selectedCat.path == $cat.path)
-                <li class="selected"><a href="$weblogUrl">$cat.name</a></li>
+            #set($catURL = "$cat.website.URL$catParam")
+            #if($model.weblogCategory && $model.weblogCategory.path == $cat.path)
+                <li class="selected"><a href="$categoryObject.website.URL/category$cat.path">$cat.name</a></li>
             #else
-                <li><a href="$weblogUrl">$cat.name</a></li>
+                <li><a href="$categoryObject.website.URL/category$cat.path">$cat.name</a></li>
             #end
         #end
         </ul>
-    #else 
+    #else
         <ul class="rCategory">
-        #_showWeblogCategory($categoryObject $expanding $subcats)
+        #_showWeblogCategoryLinksList($categoryObject $subcats $expanding )
         </ul>
     #end
 #end
 
 
-#** 
-Show one weblog category's links as an HTML ul list, options for expanding and 
-recursion (private).
+#**
 *#
-#macro(_showWeblogCategory $categoryObject $expanding $subcats)
-    #set($catParam = "?cat=$utils.encode($cat.path)")
-    #set($weblogUrl = "$categoryObject.website.URL$catParam")
-    #if ($expanding && $categoryObject.name != "root" && $categoryObject.weblogCategories.size()
> 0)
-        #set($divId = "div_$categoryObject.name")
-        <div class="rCategory">
-        <li><a href="javascript:toggleFolder('$divId')">
-            <span id="i$divId">+</span></a><a href="$weblogUrl">$categoryObject.name</a></li>
-        <ul id="$divId" style="display:none">
-    #elseif ($categoryObject.name != "root" && $categoryObject.weblogCategories.size()
> 0)
-        <ul class="rCategory">
-    #elseif ($categoryObject.name != "root")
-        #if($selectedCat.path == $categoryObject.path)
-        <li class="selected"><a href="$weblogUrl">categoryObject.name</a>
+#macro(_showWeblogCategoryLinksList $categoryObject $subcats $expanding )
+    #set($catParam = "?cat=$utils.encode($categoryObject.path)")
+    #set($catURL = "$categoryObject.website.URL$catParam")
+    #if ($categoryObject.name != "root")
+        #if ($expanding && $subcats && $categoryObject.weblogCategories.size()
> 0)
+            #set($divId = "div_$categoryObject.name")
+            <div class="rCategory">
+            <li><a href="javascript:toggleFolder('$divId')">
+                <span id="i$divId">+</span></a><a href="$catURL">$categoryObject.name</a></li>
+            <ul id="$divId" class="rCategory" style="display:none">
+        #elseif ($subcats && $categoryObject.weblogCategories.size() > 0)
+            <li><a href="$catURL">$categoryObject.name</a></li>
+            <ul class="rCategory">
         #else
-        <li><a href="$weblogUrl">$categoryObject.name</a>
+            #if ($model.weblogCategory && $model.weblogCategory.path == $categoryObject.path)
+                <li class="selected"><a href="$catURL">categoryObject.name</a></li>
+            #else
+                <li><a href="$catURL">$categoryObject.name</a></li>
+            #end
         #end
-        </li>
     #end
-    #set($cats = $categoryObject.getWeblogCategories())
-    #foreach($cat in $cats)
-        #_showWeblogCategory($cat $expanding $subcats)
+    #if ($subcats || $categoryObject.name == "root") 
+        #set($cats = $categoryObject.getWeblogCategories())
+        #foreach($cat in $cats)
+            #_showWeblogCategoryLinksList($cat $subcats $expanding)
+        #end
     #end
-    #if ($categoryObject.name != "root" && $categoryObject.weblogCategories.size()
> 0)
+    #if ($categoryObject.name != "root" && $subcats && $categoryObject.weblogCategories.size()
> 0)
         </ul>
     #end
-    #if($expanding && $categoryObject.name != "root" && $categoryObject.weblogCategories.size()
> 0)
+    #if ($expanding && $subcats && $categoryObject.weblogCategories.size()
> 0)
     </div>
     <script type="text/javascript">
     <!-- 
@@ -392,7 +472,7 @@
 #**
  * Show Roller Page Navigation Bar, includes links to all pages.
  *#
-#macro(showPageLinksList $weblog)
+#macro(showPageMenu $weblog)
     <ul class="rNavigationBar">
         <li class="rNavItem">
             <a href="$config.getContextURL()">$config.getProperty("site.shortName")</a>
@@ -402,10 +482,12 @@
             #if (!$invisible)
                 #set($isSelected = false)
                 #if ($page && $iPage.Id == $page.Id) #set($isSelected = true) #end
-                #if (!$isSelected)
-                    <li class="rNavItem"><a href="$weblog.URL/page/$iPage.Link">$iPage.Name</a></li>
+                #if (!$isSelected && $iPage.name == "Weblog")
+                    <li class="rNavItem"><a href="$weblog.URL">$iPage.name</a></li>
+                #elseif (!$isSelected)
+                    <li class="rNavItem"><a href="$weblog.URL/page/$iPage.link">$iPage.name</a></li>
                 #else
-                    <li class="rNavItem">$iPage.Name</li>
+                    <li class="rNavItem">$iPage.name</li>
                 #end
             #end
         #end
@@ -437,42 +519,6 @@
 
 
 #** 
-Show trackback discovery code for one weblog entry, appears as an HTML comment.
-*#
-#macro(showTrackbackAutodiscoveryRDF $entry)
-<!--
-<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-         xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/"
-         xmlns:dc="http://purl.org/dc/elements/1.1/">
-<rdf:Description
-    rdf:about="$entry.permalink"
-    trackback:ping="$entry.trackbackURL"
-    dc:title="$entry.title"
-    dc:identifier="$entry.permalink"
-    dc:subject="$entry.category.name"
-    dc:description="$entry.title"
-    dc:creator="$entry.creator.userName"
-    dc:date="$entry.pubTime" />
-</rdf:RDF>
--->
-#end
-
-
-#** 
-Show RSS, Atom and RSD auto-discovery links as HTML link elements.
-*#
-#macro(showAutodiscoveryLinks $weblog)
-    <link rel="alternate" type="application/atom+xml" title="Atom Entries"  href="$weblog.URL/feeds/entries/atom"
/>
-    <link rel="alternate" type="application/atom+xml" title="Atom Comments" href="$weblog.URL/feeds/comments/atom"
/>
-    <link rel="alternate" type="application/rss+xml"  title="RSS Entries"   href="$weblog.URL/feeds/entries/rss"
/>
-    <link rel="alternate" type="application/rss+xml"  title="RSS Comments"  href="$weblog.URL/feeds/comments/rss"
/>
-    #if ($weblog.enableBloggerApi)
-       <link rel="EditURI"   type="application/rsd+xml" title="RSD" href="$weblog.URL/rsd"/>
-    #end
-#end
-
-
-#** 
 Show weblog entry calendar, with optional category restriction.
 *#
 #macro(showWeblogEntryCalendar $weblog $category)
@@ -485,19 +531,6 @@
 *#
 #macro(showAuthorMenu $vertical)
 $menuModel.showAuthorMenu($vertical)
-#end
-
-
-#** 
-Parse and inlued page template from weblog.
-*#
-#macro(includeTemplate $weblog $pageName)
-    #set($iPageId = false )## This is required for such constructs; see Velocity docs and
ROL-689
-    #set($iPageId = $weblog.findPageIdByName($pageName))
-    #if (!$iPageId) ## no page found, parse pageName
-        #set($iPageId = $pageName)
-    #end
-    #parse($iPageId)
 #end
 
 



Mime
View raw message