roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject svn commit: r426611 [2/2] - in /incubator/roller/branches/roller_3.0: metadata/database/ src/org/apache/roller/business/ src/org/apache/roller/model/ src/org/apache/roller/pojos/ src/org/apache/roller/ui/rendering/model/ src/org/apache/roller/ui/render...
Date Fri, 28 Jul 2006 17:16:19 GMT
Added: incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/WeblogsPager.java
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/WeblogsPager.java?rev=426611&view=auto
==============================================================================
--- incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/WeblogsPager.java
(added)
+++ incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/WeblogsPager.java
Fri Jul 28 10:16:17 2006
@@ -0,0 +1,102 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  The ASF licenses this file to You
+ * under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.  For additional information regarding
+ * copyright in this work, please see the NOTICE file in the top level
+ * directory of this distribution.
+ */
+
+package org.apache.roller.ui.rendering.model;
+
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.Iterator;
+import java.util.List;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.roller.model.Roller;
+import org.apache.roller.model.RollerFactory;
+import org.apache.roller.model.UserManager;
+import org.apache.roller.pojos.WeblogTemplate;
+import org.apache.roller.pojos.WebsiteData;
+import org.apache.roller.pojos.wrapper.WebsiteDataWrapper;
+
+/**
+ * Paging for weblogs.
+ */
+public class WeblogsPager extends AbstractPager {
+    private List weblogs;    
+    private String letter = null;
+    protected static Log log =
+            LogFactory.getFactory().getInstance(UsersPager.class);
+    
+    /** Creates a new instance of CommentPager */
+    public WeblogsPager(            
+            WebsiteData    weblog,             
+            WeblogTemplate weblogPage,
+            String         locale,
+            int            sinceDays,
+            int            page,
+            int            length) {
+        super(weblog, weblogPage, locale, sinceDays, page, length);
+        getWeblogs();
+    }
+    
+    /** Creates a new instance of CommentPager */
+    public WeblogsPager( 
+            String letter,
+            WebsiteData    weblog,             
+            WeblogTemplate weblogPage,
+            String         locale,
+            int            sinceDays,
+            int            page,
+            int            length) {
+        super(weblog, weblogPage, locale, sinceDays, page, length);
+        this.letter = letter;
+        getWeblogs();
+    }
+    
+    public List getWeblogs() {
+        if (weblogs == null) {
+            List results = new ArrayList();
+            Calendar cal = Calendar.getInstance();
+            cal.setTime(new Date());
+            cal.add(Calendar.DATE, -1 * sinceDays);
+            Date startDate = cal.getTime();
+            try {            
+                Roller roller = RollerFactory.getRoller();
+                UserManager umgr = roller.getUserManager();
+                List weblogs = null;
+                if (letter == null) {
+                    weblogs = umgr.getWebsites(null, Boolean.TRUE, Boolean.TRUE, startDate,
null, offset, length);
+                } else {
+                    weblogs = umgr.getWeblogsByLetter(letter.charAt(0), offset, length);
+                }
+                int count = 0;
+                for (Iterator it = weblogs.iterator(); it.hasNext();) {
+                    WebsiteData website = (WebsiteData) it.next();
+                    if (count++ < length) {
+                        results.add(WebsiteDataWrapper.wrap(website));
+                    } else {
+                        more = true;
+                    }                       
+                }
+            } catch (Exception e) {
+                log.error("ERROR: fetching weblog list", e);
+            }
+            weblogs = results;
+        }
+        return weblogs;
+    }
+}

Modified: incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/servlets/PageServlet.java
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/servlets/PageServlet.java?rev=426611&r1=426610&r2=426611&view=diff
==============================================================================
--- incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/servlets/PageServlet.java
(original)
+++ incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/servlets/PageServlet.java
Fri Jul 28 10:16:17 2006
@@ -185,6 +185,18 @@
             cacheKey = weblogPageCache.generateKey(pageRequest);
         }
         
+        // TODO 3.0: this is a hack, but we need to provide some way for 
+        // templates to use arbitrary request parameters.
+        if (request.getParameter("letter") != null) {
+            cacheKey += "_" + request.getParameter("letter");
+        }
+        if (request.getParameter("weblog") != null) {
+            cacheKey += "_" + request.getParameter("weblog");
+        }
+        if (request.getParameter("userName") != null) {
+            cacheKey += "_" + request.getParameter("userName");
+        }
+        
         // cached content checking
         if((!this.excludeOwnerPages || !pageRequest.isLoggedIn()) &&
                 request.getAttribute("skipCache") == null) {
@@ -225,7 +237,7 @@
             if(page == null) {
                 page = new WeblogTemplate("templates/weblog/popupcomments.vm", weblog,
                         "Comments", "Comments", "dummy_link",
-                        "dummy_template", new Date(), "velocity", true, null);
+                        "dummy_template", new Date(), "velocity", true, false, null);
             }
             
         // If request specified the page, then go with that

Modified: incubator/roller/branches/roller_3.0/web/WEB-INF/velocity/site.vm
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/web/WEB-INF/velocity/site.vm?rev=426611&r1=426610&r2=426611&view=diff
==============================================================================
--- incubator/roller/branches/roller_3.0/web/WEB-INF/velocity/site.vm (original)
+++ incubator/roller/branches/roller_3.0/web/WEB-INF/velocity/site.vm Fri Jul 28 10:16:17
2006
@@ -20,19 +20,19 @@
 
    Contents
       #showEntry($entry)
-      #showEnriesPager($entries $maxResults)
+      #showEnriesPager($pager)
       #showWeblogProfile($weblog)
       #showWeblogDirectory()
       #showUserProfile($user)
       #showUserDirectory()
-      #showCommentsPager($comments $maxResults)
+      #showCommentsPager($pager)
 *#
 ##-----------------------------------------------------------------------------
 #macro( showEntry $entry )
 <div class="entry">
     <span class="entryDetails">
-        <a href="$utilities.textToHTML($entry.permaLink)">
-        <b>$utilities.removeHTML($entry.title)</b></a><br /> 
+        <a href="$utils.escapeHTML($entry.permalink)">
+        <b>$utils.removeHTML($entry.title)</b></a><br /> 
         $entry.website.name 
         #if($entry.category.name)| $entry.category.name #end
         #if($entry.pubTime)| #formatDate($text.get("macro.weblog.date.toStringFormat") $entry.pubTime)
#end
@@ -40,33 +40,33 @@
         <br/> 
     </span>
     <span class="entryDescription">
-        #set($content = $utilities.removeHTML($entry.text))
-        $utilities.truncateNicely($content, 240, 260, "...")
+        #set($content = $utils.removeHTML($entry.text))
+        $utils.truncateNicely($content, 240, 260, "...")
     </span>
 </div>
 #end
 
 ##-----------------------------------------------------------------------------
-#macro(showEntriesPager $entries $maxResults)
-    #if($entries.size() > 0)
-        #set($entryCount = $entries.size() - 1)
-        #set($startDate = $entries.get(0).pubTime)
+#macro(showEntriesPager $pager)
+    #if($pager.entries.size() > 0)
+        #set($entryCount = $pager.entries.size() - 1)
+        #set($startDate = $pager.entries.get(0).pubTime)
         #set($endDate = $entries.get($entryCount).pubTime)
     #end
-    #foreach($entry in $entries)
+    #foreach($entry in $pager.entries)
         #if($velocityCount < $maxResults)
             #showEntry($entry)
         #end
     #end
     <div class="nextPrev">
-    #if($offset >= $maxResults - 1)
-       #set($prevOffset = $offset - ($maxResults - 1))
-       <a href="?offset=$prevOffset">&lt; Newer</a>
-    #end
-    &nbsp;
-    #if($entries.size() > $maxResults - 1)
-       #set($nextOffset = $offset + $maxResults - 1)
-       <a href="?offset=$nextOffset">Older &gt;</a>
+    #if($pager.nextLink)
+       <a href="$pager.nextLink">&lt; $pager.nextName</a>
+    #end
+    #if($pager.nextLink && $pager.prevLink())
+       &nbsp;|&nbsp;
+    #end
+    #if($pager.prevLink)
+       <a href="$pager.prevLink">$pager.prevName &gt;</a>
     #end
     </div>
 #end
@@ -119,8 +119,8 @@
     </table>
 
     <h2 class="pageTitle">Recent posts</h2>
-    #set($entries = $site.getWeblogEntries($weblog.handle, 'nil', 'nil', 90, 0, 5)) 
-    #if($entries.size() > 0)  
+    #set($entriesPager = $site.getWeblogEntriesPager($weblog, $null, $null, 90, 5)) 
+    #if($entriesPager.entries.size() > 0)  
         <table class="rollertable"> 
         <thead>
             <tr>
@@ -129,12 +129,12 @@
                 <th>Title</th>
             </tr>
         </thead>  
-        #foreach($entry in $entries)
+        #foreach($entry in $entriesPager.entries)
             <tr>
                 <td>$entry.creator.userName</td>
                 <td>#formatDate($text.get("macro.weblog.date.toStringFormat") $entry.pubTime)</td>
-                <td><a href="$utilities.textToHTML($entry.permaLink)">
-                    $utilities.removeHTML($entry.title)</a></td>
+                <td><a href="$utils.escapeHTML($entry.permaLink)">
+                    $utils.removeHTML($entry.title)</a></td>
             </tr>
         #end
         </table>
@@ -146,7 +146,7 @@
 
 
 ##-----------------------------------------------------------------------------
-#macro(showWeblogDirectory)
+#macro(showWeblogDirectory $pageLength)
     #if($pageModel.getRequestParameter("letter"))
         #set($chosenLetter = $pageModel.getRequestParameter("letter"))
     #else
@@ -167,15 +167,9 @@
     #end
     </div>
 
-    #if($pageModel.getRequestParameter("offset"))
-        #set($offset = $pageModel.getIntRequestParameter("offset"))
-    #else
-        #set($offset = 0)
-    #end
-
     #if($chosenLetter)
         <h2 class="pageTitle">Weblogs starting with $chosenLetter</h2>
-        #set($weblogs = $site.getWeblogsByLetter($chosenLetter, $offset, $maxResults))
+        #set($weblogsPager = $site.getWeblogsByLetterPager($chosenLetter, $since, $pageLength))
         <table class="rollertable">
             <thead>
                 <tr>
@@ -184,24 +178,22 @@
                     <th>Name</th>
                 </tr>
             </thead>
-        #foreach($weblog in $weblogs)
-            #if($velocityCount < $maxResults)
+        #foreach($weblog in $weblogsPager.weblogs)
                <tr>
-                  <td><a href="$baseURL/page/$weblog.handle">$weblog.handle</a></td>
+                  <td><a href="$baseURL/$weblog.handle">$weblog.handle</a></td>
                   <td><a href="?weblog=$weblog.handle">Profile</a></td>
                   <td>$weblog.name</td>
                </tr>
-            #end
         #end 
         </table>
-        #if($offset >= $maxResults - 1)
-           #set($prevOffset = $offset - ($maxResults - 1))
-           <a href="?letter=$chosenLetter&offset=$prevOffset">&lt;prev</a>
-        #end
-        #if(($offset >= $maxResults - 1) && ($weblogs.size() > $maxResults
- 1)) &nbsp;|&nbsp; #end
-        #if($weblogs.size() > $maxResults - 1)
-           #set($nextOffset = $offset + $maxResults - 1)
-           <a href="?letter=$chosenLetter&offset=$nextOffset">next &gt;</a>
+        #if($weblogsPager.prevLink)
+           <a href="$weblogsPager.prevLink?letter=$chosenLetter">&lt; $weblogsPager.prevName</a>
+        #end
+        #if($pager.nextLink && $pager.prevLink())
+           &nbsp;|&nbsp;
+        #end
+        #if($weblogsPager.nextLink)
+           <a href="$weblogsPager.nextLink?letter=$chosenLetter">$weblogsPager.nextLink
&gt;</a>
         #end
     #end
 #end
@@ -250,8 +242,8 @@
     #end
 
     <h2 class="pageTitle">User's recent posts</h2>
-    #set($entries = $site.getWeblogEntries('nil', $user.userName, 'nil', 90, 0, 5)) 
-    #if($entries.size() > 0)  
+    #set($entriesPager = $site.getWeblogEntriesPager($null, $user, $null, 90, 5)) 
+    #if($entriesPager.entries.size() > 0)  
         <table class="rollertable"> 
         <thead>
             <tr>
@@ -260,12 +252,12 @@
                 <th>Title</th>
             </tr>
         </thead>  
-        #foreach($entry in $entries)
+        #foreach($entry in $entriesPager.entries)
             <tr>
                 <td><a href="$entry.website.url">$entry.website.handle</a></td>
                 <td>#formatDate($text.get("macro.weblog.date.toStringFormat") $entry.pubTime)</td>
-                <td><a href="$utilities.textToHTML($entry.permaLink)">
-                    $utilities.removeHTML($entry.title)</a></td>
+                <td><a href="$utils.textToHTML($entry.permaLink)">
+                    $utils.removeHTML($entry.title)</a></td>
             </tr>
         #end
         </table>
@@ -275,7 +267,7 @@
 #end
 
 ##-----------------------------------------------------------------------------
-#macro(showUserDirectory)
+#macro(showUserDirectory $pageLength)
     #if($pageModel.getRequestParameter("letter"))
         #set($chosenLetter = $pageModel.getRequestParameter("letter"))
     #else
@@ -296,15 +288,9 @@
     #end
     </div>
 
-    #if($pageModel.getRequestParameter("offset"))
-        #set($offset = $pageModel.getIntRequestParameter("offset"))
-    #else
-        #set($offset = 0)
-    #end
-
     #if($chosenLetter)
         <h2 class="pageTitle">Users starting with $chosenLetter</h2>
-        #set($users = $site.getUsersByLetter($chosenLetter, $offset, $maxResults))
+        #set($usersPager= $site.getUsersByLetterPager($chosenLetter, $since, $pageLength))
         <table class="rollertable">
             <thead>
                 <tr>
@@ -313,64 +299,60 @@
                     <th>Full name</th>
                 </tr>
             </thead>
-        #foreach($u in $users)
-            #if($velocityCount < $maxResults)
+        #foreach($u in $usersPager.users)
                <tr>
                   <td>$u.userName</td>
                   <td><a href="?userName=$u.userName">Profile</a></td>
                   <td>$u.fullName</td>
                </tr>
-            #end
         #end 
         </table>
-        #if($offset >= $maxResults - 1)
-           #set($prevOffset = $offset - ($maxResults - 1))
-           <a href="?letter=$chosenLetter&offset=$prevOffset">&lt;prev</a>
-        #end
-        #if(($offset >= $maxResults - 1) && ($weblogs.size() > $maxResults
- 1)) &nbsp;|&nbsp; #end
-        #if($users.size() > $maxResults - 1)
-           #set($nextOffset = $offset + $maxResults - 1)
-           <a href="?letter=$chosenLetter&offset=$nextOffset">next &gt;</a>
+        #if($usersPager.prevLink)
+           <a href="$usersPager.prevLink?letter=$chosenLetter">&lt;$usersPager.prevName</a>
+        #end
+        #if($pager.nextLink && $pager.prevLink())
+           &nbsp;|&nbsp;
+        #end
+        #if($usersPager.nextLink)
+           <a href="$usersPager.nextLink?letter=$chosenLetter">$usersPager.nextName
&gt;</a>
         #end
     #end
 #end
 
 ##-----------------------------------------------------------------------------
-#macro(showCommentsPager $comments $maxResults)
-    #if($comments.size() > 0)
-        #set($commentCount = $comments.size() - 1)
-        #set($startDate = $comments.get(0).postTime)
-        #set($endDate = $comments.get($commentCount).postTime)
+#macro(showCommentsPager $commentsPager)
+    #if($commentsPager.comments.size() > 0)
+        #set($commentCount = $commentsPager.comments.size() - 1)
+        #set($startDate = $commentsPager.comments.get(0).postTime)
+        #set($endDate = $commentsPager.comments.get($commentCount).postTime)
     #end
 
-    #foreach($comment in $comments)
-        #if($velocityCount < $maxResults)
+    #foreach($comment in $commentsPager.comments)
             <div class="entry">
                 <span class="entryDetails">
-                    <a href="${baseURL}$utilities.textToHTML($comment.weblogEntry.permaLink)">
-                        <b>Re: $utilities.removeHTML($comment.weblogEntry.title)</b></a><br
/> 
+                    <a href="${baseURL}$utils.escapeHTML($comment.weblogEntry.permaLink)">
+                        <b>Re: $utils.removeHTML($comment.weblogEntry.title)</b></a><br
/> 
                     Posted on <a href="$baseURL/$comment.weblogEntry.website.handle">
-                        $utilities.removeHTML($comment.weblogEntry.website.name)</a>

+                        $utils.removeHTML($comment.weblogEntry.website.name)</a> 
                     #if($comment.name) | Posted by $comment.name #end
                     | $comment.postTime<br/> 
                 </span>
                 <span class="entryDescription">
-                    #set($content = $utilities.removeHTML($comment.content))
-                    $utilities.truncateNicely($content, 240, 260, "...")
+                    #set($content = $utils.removeHTML($comment.content))
+                    $utils.truncateNicely($content, 240, 260, "...")
                 </span>
             </div>
-        #end
     #end
  
     <div class="nextPrev">
-    #if($offset >= $maxResults - 1)
-       #set($prevOffset = $offset - ($maxResults - 1))
-       <a href="?offset=$prevOffset">&lt; Newer</a>
-    #end
-    &nbsp;
-    #if($comments.size() > $maxResults - 1)
-       #set($nextOffset = $offset + $maxResults - 1)
-       <a href="?offset=$nextOffset">Older &gt;</a>
+    #if($commentsPager.nextLink)
+       <a href="$commentsPager.nextLink">&lt; $commentsPager.nextName</a>
+    #end
+    #if($pager.nextLink && $pager.prevLink())
+       &nbsp;|&nbsp;
+    #end
+    #if($commentsPager.nextLink)
+       <a href="$commentsPager.nextLink">$commentsPager.nextName &gt;</a>
     #end
     </div>
 

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=426611&r1=426610&r2=426611&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 Fri Jul 28 10:16:17
2006
@@ -497,8 +497,7 @@
             <a href="$url.site">$config.siteName</a>
         </li>
         #foreach($iPage in $weblog.pages)
-            #set($invisible = $iPage.Name.startsWith("_"))
-            #if (!$invisible)
+            #if (!$iPage.hidden && $iPage.navbar)
                 #set($isSelected = false)
                 #if ($page && $iPage.Id == $page.Id) #set($isSelected = true) #end
                 #if (!$isSelected && $iPage.name == "Weblog")

Modified: incubator/roller/branches/roller_3.0/web/themes/atlas/Weblog.vm
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/web/themes/atlas/Weblog.vm?rev=426611&r1=426610&r2=426611&view=diff
==============================================================================
--- incubator/roller/branches/roller_3.0/web/themes/atlas/Weblog.vm (original)
+++ incubator/roller/branches/roller_3.0/web/themes/atlas/Weblog.vm Fri Jul 28 10:16:17 2006
@@ -1,20 +1,14 @@
-#includePage("_header")
-#tabbedMenu("frontpage") 
-#set($maxResults = 7)
-
+#includePage("_header") 
+#set($selected = "frontpage") 
+#includePage("_tabbedMenu") 
+  
 <div class="entriesBox">
    <div class="entriesBoxInner">
       <div class="entryBox">
 
-    <h2 class="pageTitle">Most recent posts on site</h2>
-    #if($pageModel.getRequestParameter("offset"))
-        #set($offset = $pageModel.getIntRequestParameter("offset"))
-    #else
-        #set($offset = 0)
-    #end
-    
-    #set($entries = $sitePageModel.getWeblogEntries('nil', 'nil', 'nil', 30, $offset, $maxResults))
-    #showEntriesPager($entries $maxResults)
+    <h2 class="pageTitle">Most recent posts on SITE</h2>   
+    #set($pager = $site.getWeblogEntriesPager($since, $maxResults))
+    #showEntriesPager($pager)
 
       </div>
    </div>
@@ -30,7 +24,7 @@
 
                     <h3>Hot blogs (today's hits)</h3>
                     <hr size="1" noshade="noshade" />
-                    #set($hotblogs = $sitePageModel.getHotWeblogs(7, 0, 20))
+                    #set($hotblogs = $site.getHotWeblogs($since, 20))
                     <ul>
                         #foreach($blog in $hotblogs)
                         <li>$blog.subjectNameShort | $blog.count</li>

Modified: incubator/roller/branches/roller_3.0/web/themes/atlas/_blogs.vm
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/web/themes/atlas/_blogs.vm?rev=426611&r1=426610&r2=426611&view=diff
==============================================================================
--- incubator/roller/branches/roller_3.0/web/themes/atlas/_blogs.vm (original)
+++ incubator/roller/branches/roller_3.0/web/themes/atlas/_blogs.vm Fri Jul 28 10:16:17 2006
@@ -1,6 +1,7 @@
 #includePage("_header")
-#tabbedMenu("blogs")
-#set($maxResults = 15)
+#set($selected = "blogs") 
+#includePage("_tabbedMenu") 
+#set($maxResults = 15) 
 
 <div class="entriesBox">
     <div class="entriesBoxInner">  
@@ -9,10 +10,10 @@
         #if($pageModel.getRequestParameter("weblog"))
             #set($handle = $pageModel.getRequestParameter("weblog"))
             <a href="?letter=$stringUtils.left($handle,1)">Back to blog directory</a>
-            #set($weblog = $sitePageModel.getWeblog($handle))
+            #set($weblog = $site.getWeblog($handle))
             #showWeblogProfile($weblog)
         #else 
-            #showWeblogDirectory()    
+            #showWeblogDirectory($maxResults)    
         #end
         </div>
     </div>
@@ -28,7 +29,7 @@
              <h3>Newest blogs</h3>
              <hr size="1" noshade="noshade" />	
 
-             #set($newblogs = $sitePageModel.getWeblogs(30, 0, 20))
+             #set($newblogs = $site.getWeblogs(30, 20))
              <ul>
              #foreach($blog in $newblogs)
                 <li>$blog.name (<a href="?weblog=$blog.handle" title="$blog.dateCreated">$blog.handle</a>)</li>

Modified: incubator/roller/branches/roller_3.0/web/themes/atlas/_comments.vm
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/web/themes/atlas/_comments.vm?rev=426611&r1=426610&r2=426611&view=diff
==============================================================================
--- incubator/roller/branches/roller_3.0/web/themes/atlas/_comments.vm (original)
+++ incubator/roller/branches/roller_3.0/web/themes/atlas/_comments.vm Fri Jul 28 10:16:17
2006
@@ -1,10 +1,11 @@
 #includePage("_header")
-#tabbedMenu("comments")
+#set($selected = "comments") 
+#includePage("_tabbedMenu") 
 #set($maxResults = 7)
 
 <div class="entriesBox">
    <div class="entriesBoxInner">
-      <div class="entryBox">
+      <div class="entryBox"> 
 
     <h2 class="pageTitle">Most recent comments posted to site</h2>
 
@@ -14,8 +15,8 @@
         #set($offset = 0)
     #end
     
-    #set($comments = $sitePageModel.getComments(7, $offset, $maxResults))
-    #showCommentsPager($comments $maxResults)
+    #set($commentsPager = $site.getCommentsPager($since, $maxResults))
+    #showCommentsPager($commentsPager)
 
       </div>
    </div>

Modified: incubator/roller/branches/roller_3.0/web/themes/atlas/_planet.vm
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/web/themes/atlas/_planet.vm?rev=426611&r1=426610&r2=426611&view=diff
==============================================================================
--- incubator/roller/branches/roller_3.0/web/themes/atlas/_planet.vm (original)
+++ incubator/roller/branches/roller_3.0/web/themes/atlas/_planet.vm Fri Jul 28 10:16:17 2006
@@ -1,5 +1,6 @@
 #includePage("_header")
-#tabbedMenu("planet")
+#set($selected = "planet") 
+#includePage("_tabbedMenu") 
 #set($maxResults = 7)
 
 <div class="entriesBox">
@@ -7,15 +8,9 @@
       <div class="entryBox">
 
     <h2 class="pageTitle">Most recent posts on and off site</h2>
-
-    #if($pageModel.getRequestParameter("offset"))
-        #set($offset = $pageModel.getIntRequestParameter("offset"))
-    #else
-        #set($offset = 0)
-    #end
-    
-    #set($entries = $planetPageModel.getAggregation(30, $offset, $maxResults))
-    #showEntriesPager($entries $maxResults)
+   
+    #set($planetPager = $planetPageModel.getAggregationPager($since, $maxResults))
+    #showEntriesPager($planetPager)
 
       </div>
    </div>
@@ -32,7 +27,7 @@
              <h3>Ranked blogs</h3>
              <hr size="1" noshade="noshade" />	
 
-    #set($subs = $planetPageModel.getRankedSubscriptions(30, 0, 20))
+    #set($subs = $planetPageModel.getRankedSubscriptions($since, 20))
     <ul>
     #foreach($sub in $subs)
         <li><a href="$sub.siteUrl">$sub.title</a> | $sub.inboundlinks</li>

Copied: incubator/roller/branches/roller_3.0/web/themes/atlas/_tabbedMenu.vm (from r426577,
incubator/roller/branches/roller_3.0/web/themes/atlas/_macros.vm)
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/web/themes/atlas/_tabbedMenu.vm?p2=incubator/roller/branches/roller_3.0/web/themes/atlas/_tabbedMenu.vm&p1=incubator/roller/branches/roller_3.0/web/themes/atlas/_macros.vm&r1=426577&r2=426611&rev=426611&view=diff
==============================================================================
--- incubator/roller/branches/roller_3.0/web/themes/atlas/_macros.vm (original)
+++ incubator/roller/branches/roller_3.0/web/themes/atlas/_tabbedMenu.vm Fri Jul 28 10:16:17
2006
@@ -1,13 +1,12 @@
+## expects $selected to be set
 
-##-----------------------------------------------------------------------------
-#macro( tabbedMenu $selected )
 #set($menus = ["frontpage", "planet", "comments", "users", "blogs"])
 <table class="menuTabTable" cellspacing="0"><tbody><tr>
 #foreach($menu in $menus)
    #if($menu == "frontpage")
-      #set($link = "")
+      #set($link = "$url.home")
    #else
-      #set($link = $menu)
+      #set($link = "$url.home/page/$menu")
    #end
    #if($menu == $selected)
    <td class="menuTabSelected">
@@ -16,7 +15,7 @@
    #end
       <div class="menu-tr">
          <div class="menu-tl">
-            &nbsp;&nbsp;<a href="$baseURL/page/frontpage/$link">$menu</a>&nbsp;&nbsp;

+            &nbsp;&nbsp;<a href="$link">$menu</a>&nbsp;&nbsp;

          </div>
       </div>
    </td>	    
@@ -30,5 +29,5 @@
 </td>
 </tr>
 </tbody></table>
-#end 
+
 

Modified: incubator/roller/branches/roller_3.0/web/themes/atlas/_users.vm
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/web/themes/atlas/_users.vm?rev=426611&r1=426610&r2=426611&view=diff
==============================================================================
--- incubator/roller/branches/roller_3.0/web/themes/atlas/_users.vm (original)
+++ incubator/roller/branches/roller_3.0/web/themes/atlas/_users.vm Fri Jul 28 10:16:17 2006
@@ -1,8 +1,9 @@
 #includePage("_header")
-#tabbedMenu("users")  
-#set($maxResults = 15)
+#set($selected = "users") 
+#includePage("_tabbedMenu")   
+#set($maxResults = 15) 
 
-<div class="entriesBox">
+<div class="entriesBox"> 
    <div class="entriesBoxInner">
       <div class="entryBox">
 
@@ -12,10 +13,10 @@
 #if($pageModel.getRequestParameter("userName"))
     #set($userName = $pageModel.getRequestParameter("userName"))
     <a href="?letter=$stringUtils.left($userName,1)">Back to user directory</a>
-    #set($user = $sitePageModel.getUser($userName))
+    #set($user = $site.getUser($userName))
     #showUserProfile($user)
 #else 
-    #showUserDirectory()    
+    #showUserDirectory($maxResults)    
 #end
 
       </div>
@@ -34,9 +35,9 @@
         <div class="menu-tl">
             <div class="sidebarBody">
 
-             <h3>Newest users</h3>
+             <h3>Newest XXX users</h3>
              <hr size="1" noshade="noshade" />	
-             #set($newusers = $sitePageModel.getUsers(30, 0, 20))
+             #set($newusers = $site.getNewUsers($since, 20))
              <ul>
              #foreach($user in $newusers)
                 <li>$user.fullName (<a href="?userName=$user.userName" title="$user.dateCreated">$user.userName</a>)</li>



Mime
View raw message