esme-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From esjew...@apache.org
Subject svn commit: r1031677 - in /incubator/esme/trunk/server/src/main: scala/org/apache/esme/lib/ scala/org/apache/esme/snippet/ webapp/ webapp/info_view/ webapp/templates-hidden/
Date Fri, 05 Nov 2010 17:36:08 GMT
Author: esjewett
Date: Fri Nov  5 17:36:07 2010
New Revision: 1031677

URL: http://svn.apache.org/viewvc?rev=1031677&view=rev
Log:
[ESME-302] Add update box to conversation, tag, and public timelines. All messages are now
rendered using message_core.html template.

Added:
    incubator/esme/trunk/server/src/main/webapp/info_view/messages.html
      - copied unchanged from r1031659, incubator/esme/trunk/server/src/main/webapp/templates-hidden/message.html
Removed:
    incubator/esme/trunk/server/src/main/webapp/templates-hidden/message.html
Modified:
    incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/ConversationMgr.scala
    incubator/esme/trunk/server/src/main/scala/org/apache/esme/snippet/TagDisplay.scala
    incubator/esme/trunk/server/src/main/webapp/index.html
    incubator/esme/trunk/server/src/main/webapp/info_view/conversation.html
    incubator/esme/trunk/server/src/main/webapp/info_view/public.html
    incubator/esme/trunk/server/src/main/webapp/info_view/tag.html
    incubator/esme/trunk/server/src/main/webapp/templates-hidden/message_core.html
    incubator/esme/trunk/server/src/main/webapp/templates-hidden/message_update_box.html
    incubator/esme/trunk/server/src/main/webapp/templates-hidden/timeline_personal.html

Modified: incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/ConversationMgr.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/ConversationMgr.scala?rev=1031677&r1=1031676&r2=1031677&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/ConversationMgr.scala (original)
+++ incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/ConversationMgr.scala Fri
Nov  5 17:36:07 2010
@@ -55,13 +55,14 @@ object ConversationMgr {
 
     val cid = S.param("cid").map(toLong).openOr(-1L)
     val messages = Message.findMessages(List(cid))   
-    val user = User.currentUser  
+    val user = User.currentUser 
+    var msgPool:Long = 0 
 
     def followOrUnfollow: NodeSeq = {          
       val ret: Box[NodeSeq] = for { 
         u <- user
         m = messages.values.toList.first
-      } yield {                 
+      } yield {         
         if (!m.followers.contains(u)) {
           ajaxButton("Follow conversation", () => {  
             m.followers += u
@@ -84,7 +85,9 @@ object ConversationMgr {
                            
     def updateFollow: JsCmd = SetHtml("following", followOrUnfollow)
 
-    bind("conv", in, 
+    bind("conv", in,       
+         "conversationId" -> cid,
+         "messagePool" -> messages.values.toList.first.pool.is,
          "cometTimeline" -> cometTimeline,
          "followButton" -> followOrUnfollow )       
   }                                

Modified: incubator/esme/trunk/server/src/main/scala/org/apache/esme/snippet/TagDisplay.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/org/apache/esme/snippet/TagDisplay.scala?rev=1031677&r1=1031676&r2=1031677&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/org/apache/esme/snippet/TagDisplay.scala (original)
+++ incubator/esme/trunk/server/src/main/scala/org/apache/esme/snippet/TagDisplay.scala Fri
Nov  5 17:36:07 2010
@@ -80,7 +80,8 @@ object TagDisplay {
       <lift:comet type="TagTimeline" name={"tag"+t.id.is} />
     }}.getOrElse(Text(""))
 
-    bind("tag", in, "name" -> name,
+    bind("tag", in,
+         "name" -> name,
          "each" -> MessageUtils.bindMessages(messageList) _,   
          "cometTimeline" -> cometTimeline,
          "followButton" -> followOrUnfollow )

Modified: incubator/esme/trunk/server/src/main/webapp/index.html
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/webapp/index.html?rev=1031677&r1=1031676&r2=1031677&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/webapp/index.html (original)
+++ incubator/esme/trunk/server/src/main/webapp/index.html Fri Nov  5 17:36:07 2010
@@ -19,7 +19,7 @@
 
 <lift:UserSnip.loggedIn>
 	<logged:in>
-		<lift:surround with="message" at="content"/>
+		<lift:surround with="info_view/messages" at="content"/>
 		<div id="messages"></div>
 		<lift:Msgs>
 			<lift:error_class>error_major</lift:error_class>

Modified: incubator/esme/trunk/server/src/main/webapp/info_view/conversation.html
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/webapp/info_view/conversation.html?rev=1031677&r1=1031676&r2=1031677&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/webapp/info_view/conversation.html (original)
+++ incubator/esme/trunk/server/src/main/webapp/info_view/conversation.html Fri Nov  5 17:36:07
2010
@@ -17,16 +17,22 @@
  under the License.                                           *
 -->
 <lift:surround with="base" at="left">    
-  <link rel="stylesheet" type="text/css" href="../style/style.css" />
-  <div id="back-header">  
-    <h1><lift:loc>ui_default_conversation</lift:loc></h1>
-	</div>                                                 
-	<div class="container-aux">   
-	  <lift:conv_info>   
-	    <span id="following"><conv:followButton/></span>   
-	  </lift:conv_info>                                             
-    <lift:embed what="templates-hidden/timeline_conversation"/>   
-  </div>
+  <link rel="stylesheet" type="text/css" href="../style/style.css" />  
+  <lift:conv_info>
+    <div id="back-header">  
+      <h1>
+        <lift:loc>ui_default_conversation</lift:loc>        
+        <span id="following"><conv:followButton/></span>              
                 
+      </h1>
+      <lift:embed what="templates-hidden/message_update_box"/>     
+      <script> 
+        setReplyTo(<conv:conversationId/>,"...",<conv:messagePool/>,"");
+      </script>
+  	</div>                                                 
+  	<div class="container-aux">                                              
+      <lift:embed what="templates-hidden/timeline_conversation"/>   
+    </div>   
+  </lift:conv_info>
 </lift:surround>
 
 

Modified: incubator/esme/trunk/server/src/main/webapp/info_view/public.html
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/webapp/info_view/public.html?rev=1031677&r1=1031676&r2=1031677&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/webapp/info_view/public.html (original)
+++ incubator/esme/trunk/server/src/main/webapp/info_view/public.html Fri Nov  5 17:36:07
2010
@@ -19,7 +19,8 @@
 
 <lift:surround with="base" at="left">
 	<div id="back-header"> 
-	  <h1><lift:loc>ui_public_title</lift:loc></h1>  
+	  <h1><lift:loc>ui_public_title</lift:loc></h1>
+	  <lift:embed what="templates-hidden/message_update_box"/>   
 	</div>
   <div class="container-aux"> 
     <div id="public_timeline_messages">  

Modified: incubator/esme/trunk/server/src/main/webapp/info_view/tag.html
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/webapp/info_view/tag.html?rev=1031677&r1=1031676&r2=1031677&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/webapp/info_view/tag.html (original)
+++ incubator/esme/trunk/server/src/main/webapp/info_view/tag.html Fri Nov  5 17:36:07 2010
@@ -20,11 +20,17 @@
   <link rel="stylesheet" type="text/css" href="../style/style.css" />
   <lift:tag_display>                                              
     <div id="back-header">  
-      <h1><lift:loc>ui_tag_title</lift:loc> '<tag:name/>'</h1>
+      <h1>
+        <lift:loc>ui_tag_title</lift:loc> '<tag:name/>' 
+        <span id="following"><tag:followButton/></span>
+      </h1>
+      <lift:embed what="templates-hidden/message_update_box"/> 
   	</div>                                                 
-  	<div class="container-aux">     
-  	    <span id="following"><tag:followButton/></span>   
+  	<div class="container-aux">        
   	  <lift:embed what="templates-hidden/timeline_tag"/>   
-    </div>                                                          
+    </div>                                 
+    <script> 
+      jQuery('#vMsg').val("#<tag:name/>")
+    </script>                         
   </lift:tag_display>                                             
 </lift:surround>
\ No newline at end of file

Modified: incubator/esme/trunk/server/src/main/webapp/templates-hidden/message_core.html
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/webapp/templates-hidden/message_core.html?rev=1031677&r1=1031676&r2=1031677&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/webapp/templates-hidden/message_core.html (original)
+++ incubator/esme/trunk/server/src/main/webapp/templates-hidden/message_core.html Fri Nov
 5 17:36:07 2010
@@ -18,27 +18,37 @@
 -->
 
 <div>
-    <head>
-        <script src="../scripts/display_messages_top.js" type="text/javascript" />
-        <script src="../scripts/pretty.js" type="text/javascript" />
-    </head>
-  	<div class="updates-box" id="message">
-  		<div class="avatar">
-  			<img id="avatar" width="40px"/>
-  		</div> <!--end avatar-->
-  		<div class="update2">
+  <head>
+      <script src="../scripts/display_messages_top.js" type="text/javascript" />
+      <script src="../scripts/pretty.js" type="text/javascript" />
+  </head>
+	<div class="updates-box" id="message">
+		<div class="avatar">
+			<img id="avatar" width="40px"/>
+		</div> <!--end avatar-->
+		<div class="update2">
 
-  			<div class="info2">
-  				<a href="" id="author"/>
-  				<div id="msgbody"/>
-  				<div class="supp_data_class" id="supp_data"/>
-  			</div> <!--end info2--> 				
+			<div class="info2">
+				<a href="" id="author"/>
+				<div id="msgbody"/>
+				<div class="supp_data_class" id="supp_data"/>
+			</div> <!--end info2--> 				
 
-  			<div class="actions"></div> <!--end actions-->                   
                           
-  		</div> <!--end update2-->
+			<div class="actions">
+				<a href="#"  id="resend">
+					<lift:loc>ui_messages_message_label_resend</lift:loc>
+				</a><span id="resend">| </span>
+				<a href="#" id="reply">
+					<lift:loc>ui_messages_message_label_reply</lift:loc>
+				</a>
+				<span id="conversation">| </span>
+				<a id="conversation">
+				<lift:loc>ui_messages_message_label_conversation</lift:loc>
+				</a>
+			</div> <!--end actions-->                                                
                 
+		</div> <!--end update2-->
 
-  	</div> <!--end updates-box-->
-    <!-- <div id="msgsep" class="separator"/> seprator should be here but doesn't
work-->
+	</div> <!--end updates-box-->                                              
            
 </div>
 				
 

Modified: incubator/esme/trunk/server/src/main/webapp/templates-hidden/message_update_box.html
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/webapp/templates-hidden/message_update_box.html?rev=1031677&r1=1031676&r2=1031677&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/webapp/templates-hidden/message_update_box.html (original)
+++ incubator/esme/trunk/server/src/main/webapp/templates-hidden/message_update_box.html Fri
Nov  5 17:36:07 2010
@@ -45,7 +45,7 @@
   				</select>
   			</div>
   			<div class="update-btn">
-  				<input type="image" onclick="javascript:post_msg();" src="images/btn-update.gif"
/>
+  				<input type="image" onclick="javascript:post_msg();" src="/images/btn-update.gif"
/>
   			</div>
   		</div>   
   		<div class="post-form-row clear" style="display: none" id="reply-to-div">
@@ -64,12 +64,18 @@
                                     function setReplyTo(id, text, msgPool, author){
                                         currentConvNumber = id;
                                         document.getElementById('reply-to-div').style.display
= "block";
-                                        jQuery('#message_request').html("Reply to: " + author);
+                                        if (author.length > 0) {
+                                          jQuery('#message_request').html("Reply to: " +
author);
+                                        } else {
+                                          jQuery('#message_request').html("Reply to conversation");
+                                        }
                                         var rep_msg = text
                                         if (text.length > 50)
                                          rep_msg = text.substr(0, 47) + "..."
                                         jQuery('#reply-to-span').html(rep_msg);
-                                        jQuery('#vMsg').val("@" + author + " ")	
+                                        if (author.length > 0) {
+                                          jQuery('#vMsg').val("@" + author + " ")	
+                                        }
                                         jQuery('#vMsg').focus()
   		                                  jQuery('#vPool').val(msgPool);
                                     }

Modified: incubator/esme/trunk/server/src/main/webapp/templates-hidden/timeline_personal.html
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/webapp/templates-hidden/timeline_personal.html?rev=1031677&r1=1031676&r2=1031677&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/webapp/templates-hidden/timeline_personal.html (original)
+++ incubator/esme/trunk/server/src/main/webapp/templates-hidden/timeline_personal.html Fri
Nov  5 17:36:07 2010
@@ -23,35 +23,6 @@
     <script src="../scripts/pretty.js" type="text/javascript"/>
     <lift:UserSnip.resendScript/>  
     <lift:comet type="PersonalTimeline"/>    
-  </head>
-
-	<div class="updates-box" id="message">
-		<div class="avatar">
-			<img id="avatar" width="40px"/>
-		</div> <!--end avatar-->
-		<div class="update2">
-			
-			<div class="info2">
-				<a href="" id="author"/>
-				<div id="msgbody"/>
-				<div class="supp_data_class" id="supp_data"/>
-			</div> <!--end info2--> 				
-
-			<div class="actions">
-				<a href="#"  id="resend">
-					<lift:loc>ui_messages_message_label_resend</lift:loc>
-				</a><span id="resend">| </span>
-				<a href="#" id="reply">
-					<lift:loc>ui_messages_message_label_reply</lift:loc>
-				</a>
-				<span id="conversation">| </span>
-				<a id="conversation">
-				<lift:loc>ui_messages_message_label_conversation</lift:loc>
-				</a>
-			</div> <!--end actions-->                                                
                 
-		</div> <!--end update2-->
-	            	
-	</div> <!--end updates-box-->
-	<!-- <div id="msgsep" class="separator"/> seprator should be here but doesn't work-->

-	   	
+  </head>                                                                         
           
+  <lift:embed what="templates-hidden/message_core"/>                              
           
 </div>          
\ No newline at end of file



Mime
View raw message