esme-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhir...@apache.org
Subject svn commit: r825032 - /incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/StreamMgr.scala
Date Wed, 14 Oct 2009 06:57:36 GMT
Author: rhirsch
Date: Wed Oct 14 06:57:36 2009
New Revision: 825032

URL: http://svn.apache.org/viewvc?rev=825032&view=rev
Log:
[ESME-97] Add user links to streams page
Patch from Xuefeng Wu applied

Modified:
    incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/StreamMgr.scala

Modified: incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/StreamMgr.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/StreamMgr.scala?rev=825032&r1=825031&r2=825032&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/StreamMgr.scala (original)
+++ incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/StreamMgr.scala Wed Oct
14 06:57:36 2009
@@ -91,19 +91,23 @@
       val query = poolsQuery :::
                   resentQuery :::
                   List[QueryParam[Message]](OrderBy(Message.id, Descending), MaxRows(40))

-      
+                  
+      //XXX copy from lib.UserMgr
+      def nicknameWithProfileLink(u: User): NodeSeq = {
+    		  <a href={"/user/" + urlEncode(u.nickname.is)}>{u.niceName}</a>
+      	}
+        
       Message.findAll(query: _*) match {
         case Nil => NodeSeq.Empty
         case xs => bind("disp", in,
                         "item" -> 
                         (lst => xs.flatMap(i => bind("item", lst,
-                                                     "author" -> i.author.obj.map(_.nickname.is).openOr(""),
+                                                     "author" -> i.author.obj.map(nicknameWithProfileLink).openOr(Text("")),
                                                      "text" -> i.digestedXHTML,
                                                      "date" -> new java.util.Date(i.when.toLong).toString
                 ))))
       }
     }
-
     def updateSpan(): JsCmd = SetHtml(spanName, doRender())
 
     updateStream.set(updateSpan)



Mime
View raw message