roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ghu...@apache.org
Subject svn commit: r1530969 - in /roller/trunk/app/src/main: java/org/apache/roller/weblogger/business/ java/org/apache/roller/weblogger/ui/rendering/model/ webapp/themes/frontpage/
Date Thu, 10 Oct 2013 13:21:44 GMT
Author: ghuber
Date: Thu Oct 10 13:21:43 2013
New Revision: 1530969

URL: http://svn.apache.org/r1530969
Log:
Add struts register methods to our url strategy.

Modified:
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/AbstractURLStrategy.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/URLStrategy.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/model/URLModel.java
    roller/trunk/app/src/main/webapp/themes/frontpage/_header.vm

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/AbstractURLStrategy.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/AbstractURLStrategy.java?rev=1530969&r1=1530968&r2=1530969&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/AbstractURLStrategy.java
(original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/AbstractURLStrategy.java
Thu Oct 10 13:21:43 2013
@@ -70,6 +70,24 @@ public abstract class AbstractURLStrateg
         return url.toString();
     }
     
+    /**
+     * Url to register page.
+     */
+    public String getRegisterURL(boolean absolute) {
+        
+        StringBuffer url = new StringBuffer();
+        
+        if(absolute) {
+            url.append(WebloggerRuntimeConfig.getAbsoluteContextURL());
+        } else {
+            url.append(WebloggerRuntimeConfig.getRelativeContextURL());
+        }
+        
+        url.append("/roller-ui/register.rol");
+        
+        return url.toString();
+    }
+    
     
     /**
      * Get a url to a UI action in a given namespace, optionally specifying

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/URLStrategy.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/URLStrategy.java?rev=1530969&r1=1530968&r2=1530969&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/URLStrategy.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/URLStrategy.java Thu
Oct 10 13:21:43 2013
@@ -49,6 +49,10 @@ public interface URLStrategy {
      */
     String getLogoutURL(boolean absolute);
     
+    /**
+     * Url to register page.
+     */
+    String getRegisterURL(boolean absolute);
     
     /**
      * Get a url to a UI action in a given namespace, optionally specifying

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/model/URLModel.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/model/URLModel.java?rev=1530969&r1=1530968&r2=1530969&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/model/URLModel.java
(original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/model/URLModel.java
Thu Oct 10 13:21:43 2013
@@ -111,6 +111,11 @@ public class URLModel implements Model {
         return urlStrategy.getLogoutURL(false);
     }
     
+    /** URL for registering */
+    public String getRegister() {
+        return urlStrategy.getRegisterURL(false);
+    }
+    
     
     /** URL for a specific UI action */
     public String action(String action, String namespace) {

Modified: roller/trunk/app/src/main/webapp/themes/frontpage/_header.vm
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/webapp/themes/frontpage/_header.vm?rev=1530969&r1=1530968&r2=1530969&view=diff
==============================================================================
--- roller/trunk/app/src/main/webapp/themes/frontpage/_header.vm (original)
+++ roller/trunk/app/src/main/webapp/themes/frontpage/_header.vm Thu Oct 10 13:21:43 2013
@@ -26,8 +26,12 @@
                 <td class="bannerRight">
                    <a href="$url.absoluteSite">$config.siteName</a> |
                    <a href="$url.absoluteSite/roller-ui/menu.rol">Main Menu</a>
|
-                   <a href="$url.login">Login</a> |
-                   <a href="$url.register">Register</a>
+                   #if(!$utils.isUserAuthenticated())
+                      <a href="$url.login">Login</a> |
+                     <a href="$url.register">Register</a>
+                   #else
+                     <a href="$url.logout">Logout</a>
+                   #end
                 </td>
             </tr>
         </table>



Mime
View raw message