esme-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vdic...@apache.org
Subject svn commit: r755759 - in /incubator/esme/trunk/server/src/main: scala/org/apache/esme/model/Message.scala webapp/templates-hidden/message.html
Date Wed, 18 Mar 2009 22:30:38 GMT
Author: vdichev
Date: Wed Mar 18 22:30:38 2009
New Revision: 755759

URL: http://svn.apache.org/viewvc?rev=755759&view=rev
Log:
User picture and nickname displayed in timeline

Modified:
    incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/Message.scala
    incubator/esme/trunk/server/src/main/webapp/templates-hidden/message.html

Modified: incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/Message.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/Message.scala?rev=755759&r1=755758&r2=755759&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/Message.scala (original)
+++ incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/Message.scala Wed Mar
18 22:30:38 2009
@@ -24,6 +24,7 @@
 import net.liftweb._
 import mapper._
 import util._
+import http.js._
 import Helpers._
 import java.util.logging._
 
@@ -166,7 +167,15 @@
 
   object id extends MappedLongIndex(this)
 
-  object author extends MappedLongForeignKey(this, User)
+  object author extends MappedLongForeignKey(this, User) {
+    override def asJs = {
+      val user = User.find(this.is) match {
+        case Full(u) => u.asJs
+        case Empty => JE.JsNull
+      }
+      List(("author", user))
+    }
+  }
 
   object viaGroup extends MappedLongForeignKey(this, Group)
 

Modified: incubator/esme/trunk/server/src/main/webapp/templates-hidden/message.html
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/webapp/templates-hidden/message.html?rev=755759&r1=755758&r2=755759&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/webapp/templates-hidden/message.html (original)
+++ incubator/esme/trunk/server/src/main/webapp/templates-hidden/message.html Wed Mar 18 22:30:38
2009
@@ -60,7 +60,11 @@
                 // Put the marshalled data into a copy of the template
                 var newMsg = msgTemplate.clone(true).attr('id',msgId);
 
-                newMsg.find('#author').text(msgAuthor);
+                var author = newMsg.find('#author');
+                author.html('<div>' + msgAuthor.nickname + '</div>');
+                author.prepend('<img src="' + msgAuthor.imageurl +
+                                  '" alt="' + msgAuthor.firstname +
+                                        ' ' + msgAuthor.lastname + '" width="50px"/>');
                 newMsg.find('#body').html(msgBody);
                 newMsg.find('#source').text(msgSource);
                 newMsg.find('#when').text(msgDateStr);



Mime
View raw message