incubator-esme-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vdic...@apache.org
Subject svn commit: r786991 - in /incubator/esme/trunk/server/src/main: scala/org/apache/esme/model/Message.scala webapp/templates-hidden/message.html
Date Sun, 21 Jun 2009 10:52:32 GMT
Author: vdichev
Date: Sun Jun 21 10:52:32 2009
New Revision: 786991

URL: http://svn.apache.org/viewvc?rev=786991&view=rev
Log:
ESME-67 Pool name is displayed in user 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=786991&r1=786990&r2=786991&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 Sun Jun
21 10:52:32 2009
@@ -192,7 +192,10 @@
 
   object conversation extends MappedLongForeignKey(this, Message)
 
-  object pool extends MappedLongForeignKey(this, AccessPool)
+  object pool extends MappedLongForeignKey(this, AccessPool) {
+    override def asJs = 
+      List("pool" -> (obj.map(_.asJs) openOr JE.JsNull))
+  }
   
   private[model] def preload(users: Map[Long, User]) {
     author.can.foreach{

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=786991&r1=786990&r2=786991&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 Sun Jun 21 10:52:32
2009
@@ -50,6 +50,8 @@
             var msgDateObj = new Date(parseInt(cometMsg.when));
             var msgDateStr = msgDateObj.toLocaleDateString() +
               ' ' + msgDateObj.toLocaleTimeString();
+            var msgPool = '[public]';
+            if (cometMsg.pool) msgPool = cometMsg.pool.name;
             var msgSource = cometMsg.source;
             var msgTags = jQuery(cometMsg.text).find('tags > tag').get();
             for (var tagIndex=0; tagIndex < msgTags.length; tagIndex++) {
@@ -67,6 +69,7 @@
             .attr('alt',msgAuthor.firstname + ' ' + msgAuthor.lastname);
 
             newMsg.find('#body').html(msgBody);
+            newMsg.find('#pool').text(msgPool);
             newMsg.find('#source').text(msgSource);
             newMsg.find('#when').text(msgDateStr);
             for (var tagIndex=0; tagIndex < msgTags.length; tagIndex++) {
@@ -123,6 +126,7 @@
                               <th>Author</th>
                               <th>Message</th>
                               <th>Tags</th>
+                              <th>Pool</th>
                               <th>Source</th>
                               <th>Date</th>
                             </tr>
@@ -140,6 +144,7 @@
                                 <p id="tag"><a href="tag/tag1">tag1</a></p>
                                 <p id="tag"><a href="tag/tag2">tag2</a></p>
                               </td>
+                              <td id="pool">-</td>
                               <td id="source">web</td>
                               <td id="when" class="date">Jan 1, 2009 12:00</td>
                             </tr>
@@ -154,6 +159,7 @@
                                 <p id="tag"><a href="tag/tag1">tag1</a></p>
                                 <p id="tag"><a href="tag/tag3">tag3</a></p>
                               </td>
+                              <td id="pool">PUBLIC</td>
                               <td id="source">web</td>
                               <td id="when" class="date">Jan 1, 2009 11:58</td>
                             </tr>



Mime
View raw message