You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@esme.apache.org by rh...@apache.org on 2010/03/26 08:54:05 UTC
svn commit: r927718 - in /incubator/esme/trunk/server/src/main:
scala/org/apache/esme/model/ scala/org/apache/esme/snippet/ webapp/
webapp/info_view/ webapp/scripts/ webapp/templates-hidden/ webapp/track_view/
Author: rhirsch
Date: Fri Mar 26 07:54:04 2010
New Revision: 927718
URL: http://svn.apache.org/viewvc?rev=927718&view=rev
Log:
[ESME-100] Finish web UI
Daily hour
Modified:
incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/User.scala
incubator/esme/trunk/server/src/main/scala/org/apache/esme/snippet/UserSnip.scala
incubator/esme/trunk/server/src/main/webapp/index.html
incubator/esme/trunk/server/src/main/webapp/info_view/public.html
incubator/esme/trunk/server/src/main/webapp/scripts/dialog_test.js
incubator/esme/trunk/server/src/main/webapp/scripts/display_messages.js
incubator/esme/trunk/server/src/main/webapp/scripts/display_single_message.js
incubator/esme/trunk/server/src/main/webapp/signup.html
incubator/esme/trunk/server/src/main/webapp/templates-hidden/base.html
incubator/esme/trunk/server/src/main/webapp/templates-hidden/timeline.html
incubator/esme/trunk/server/src/main/webapp/track_view/index.html
Modified: incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/User.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/User.scala?rev=927718&r1=927717&r2=927718&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/User.scala (original)
+++ incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/User.scala Fri Mar 26 07:54:04 2010
@@ -253,15 +253,15 @@ class User extends KeyedMapper[Long, Use
}
/**
- * URL to the image that the user has provided def image_url: String = new URL(imageUrl).toString
+ * URL to the image that the user has provided
*/
-
-
+
def image_url: String = (imageUrl.is) match {
case (f) if f.length > 1 => f
case (_) => "/images/avatar.jpg"
}
+
def needsChange_? : Boolean = this.nickname.is.startsWith("chang") &&
this.firstName.startsWith("Unkn") && this.lastName.startsWith("Unkn")
Modified: incubator/esme/trunk/server/src/main/scala/org/apache/esme/snippet/UserSnip.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/org/apache/esme/snippet/UserSnip.scala?rev=927718&r1=927717&r2=927718&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/org/apache/esme/snippet/UserSnip.scala (original)
+++ incubator/esme/trunk/server/src/main/scala/org/apache/esme/snippet/UserSnip.scala Fri Mar 26 07:54:04 2010
@@ -26,13 +26,21 @@ import org.apache.esme.actor._
import net.liftweb._
import http._
import js._
-import JsCmds._
+import js.jquery._
+import http.jquery._
+import JqJsCmds._
+import JsCmds._
+import SHtml._
import JE._
import util._
import common._
import Helpers._
import TimeHelpers.intToTimeSpanBuilder
import TimeHelpers.timeSpanToLong
+import Helpers.TimeSpan
+
+import net.liftweb.util.Helpers.pairToUnprefixed
+import scala.xml.MetaData
import scala.xml.{NodeSeq, Text, Node}
@@ -40,6 +48,7 @@ object JsonPoster extends JsonHandler{
def apply(in: Any): JsCmd = in match {
case JsonCmd("post", _, map: Map[String, Any], _) =>
println("Posting "+map)
+ DisplayMessage("messages", <b>Status updated</b>, 200, 200)
for (msgObj <- map.get("msg");
msg <- Box.asA[String](msgObj).map(_.trim) if msg.length > 0;
tagObj <- map.get("tags");
@@ -53,6 +62,10 @@ object JsonPoster extends JsonHandler{
case _ => None
}
+
+
+
+
Distributor !
Distributor.UserCreatedMessage(user.id, msg,
Tag.split(tags),
@@ -135,6 +148,10 @@ class UserSnip extends DispatchSnippet {
Text(User.currentUser.map(_.wholeName) openOr "")
}
+
+ // Image of user as part of an img tag
+ def image: MetaData = ("src" -> (User.currentUser.map(_.image_url)openOr "/images/avatar.jpg"))
+
def userImage(in: NodeSeq) = {
if (User.currentUser.map(_.needsChange_?) openOr false)
S.redirectTo("/user_mgt/edit")
@@ -198,7 +215,7 @@ class UserSnip extends DispatchSnippet {
}
case _ => NodeSeq.Empty
}
-
+
def links(in: NodeSeq): NodeSeq =
PopStatsActor !? PopStatsActor.TopStats(LinkClickedStat, 5, 1 week) match {
case Nil => NodeSeq.Empty
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=927718&r1=927717&r2=927718&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/webapp/index.html (original)
+++ incubator/esme/trunk/server/src/main/webapp/index.html Fri Mar 26 07:54:04 2010
@@ -60,7 +60,7 @@
<!--updates-box -->
<div class="gray-box">
<h1>Now on ESME</h1>
- <table>
+ <table class = "mesg-box">
<tbody id="timeline_messages">
<tr id="message">
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=927718&r1=927717&r2=927718&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 Mar 26 07:54:04 2010
@@ -21,41 +21,17 @@
<div id="left">
<!--updates-box -->
<lift:comet type="PublicTimeline"/>
- <div class="separator"> </div>
<table>
<tbody id="timeline_messages">
<tr id="message">
- <div id="timeline_messages">
- <div class="updates-box">
- <div class="avatar">
- <img id="avatar" src="/images/avatar.jpg" alt="Anonymous" width="50px"/>
- </div>
- <div class="update2">
- <div class="info2" >
- <a href="" id="author">-</a>
- </div>
- <div id="body">-</div>
- <div class="time">
- <table>
- <tr>
- <td>
- <div id="pool"> -</div>
- </td>
- <td> </td>
- <td>
- <div id="when"> -</div>
- </td>
- <td>
- <div id="reason"> -</div>
- </td>
- <td>
- <div id="source"> -</div>
- </td>
- </tr>
- </table>
- </div>
- <div class="actions">
- <a href="javascript:resend_msg();">
+
+ <div class="avatar"> <img id="avatar" src="/images/avatar.jpg" alt="Anonymous" width="50px"/></div>
+ <div class="update"> <div id="body">-</div>
+ <div class="info"><a href="" id="author">-</a><div class="time"><div id="supp_data"> -</div></div></div>
+ </div>
+ <div class="time"> </div>
+ <div class="actions">
+ <a href="#" id="resend">
<lift:loc>ui_messages_message_label_resend</lift:loc>
</a>
| <a href="#" id="reply">
@@ -64,10 +40,8 @@
<a id="conversation">
| <lift:loc>ui_messages_message_label_conversation</lift:loc>
</a>
- </div>
- </div>
- </div>
- </div>
+ </div>
+ <div class="separator"> </div>
</tr>
</tbody>
</table>
Modified: incubator/esme/trunk/server/src/main/webapp/scripts/dialog_test.js
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/webapp/scripts/dialog_test.js?rev=927718&r1=927717&r2=927718&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/webapp/scripts/dialog_test.js (original)
+++ incubator/esme/trunk/server/src/main/webapp/scripts/dialog_test.js Fri Mar 26 07:54:04 2010
@@ -64,7 +64,7 @@
if (bValid) {
//$('button[type=submit] .default').click();
- this.ownerDocument.forms[1].submit();
+ liftAjax.lift_ajaxHandler(jQuery("#track_new_dialog").serialize(), null, null, "javascript");
$(this).dialog('close');
}
Modified: incubator/esme/trunk/server/src/main/webapp/scripts/display_messages.js
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/webapp/scripts/display_messages.js?rev=927718&r1=927717&r2=927718&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/webapp/scripts/display_messages.js (original)
+++ incubator/esme/trunk/server/src/main/webapp/scripts/display_messages.js Fri Mar 26 07:54:04 2010
@@ -83,6 +83,8 @@ function displayMessages(msgArray, eleme
var newMsg = msgTemplate.clone(true).attr('id',msgId);
newMsg.find('#author').text(msgAuthor.nickname);
+ newMsg.find('#author').attr('href', "/user/" + msgAuthor.nickname );
+
// Dealing with users with no avatars
if (!msgAuthor.imageurl)
Modified: incubator/esme/trunk/server/src/main/webapp/scripts/display_single_message.js
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/webapp/scripts/display_single_message.js?rev=927718&r1=927717&r2=927718&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/webapp/scripts/display_single_message.js (original)
+++ incubator/esme/trunk/server/src/main/webapp/scripts/display_single_message.js Fri Mar 26 07:54:04 2010
@@ -131,8 +131,7 @@ function displayMessages(msgArray, eleme
// Remove any old tags from the template
newMsg.find('*[id=tag]').remove();
-
- // Insert the updated copy of the message into the page
+ // Insert the updated copy of the message into the page
newMsg.prependTo(msgInsertPt).show();
}
}
Modified: incubator/esme/trunk/server/src/main/webapp/signup.html
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/webapp/signup.html?rev=927718&r1=927717&r2=927718&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/webapp/signup.html (original)
+++ incubator/esme/trunk/server/src/main/webapp/signup.html Fri Mar 26 07:54:04 2010
@@ -1,137 +1,75 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
-<title>ESME</title>
-<meta http-equiv="Content-Language" content="en-US" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="imagetoolbar" content="no" />
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one *
+ or more contributor license agreements. See the NOTICE file *
+ distributed with this work for additional information *
+ regarding copyright ownership. The ASF licenses this file *
+ to you under the Apache License, Version 2.0 (the *
+ "License"); you may not use this file except in compliance *
+ with the License. You may obtain a copy of the License at *
+ *
+ http://www.apache.org/licenses/LICENSE-2.0 *
+ *
+ Unless required by applicable law or agreed to in writing, *
+ software distributed under the License is distributed on an *
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY *
+ KIND, either express or implied. See the License for the *
+ specific language governing permissions and limitations *
+ under the License. *
+-->
+
+<lift:surround with="default" at="login">
+ <div id="signup-box">
+ <div id="mid-signup">
+ <h2><label><lift:loc>ui_sign_up_intro</lift:loc> </label></h2>
+ <lift:signup form="post">
+ <div class="form">
+ <div>
+ <signup:credentials/>
+ </div>
+ <div>
+ <div class="post-form-row">
+ <label for="nickname">
+ <lift:loc>ui_sign_up_nickname</lift:loc>
+ <br/>
+ <signup:nickname class="inputBox2"/>
+ </label>
+ </div>
+ <label for="firstname">
+ <lift:loc>ui_sign_up_firstname</lift:loc>
+ <br/>
+ <signup:firstname/>
+ </label>
+ <br/>
+ <label for="lastname">
+ <lift:loc>ui_sign_up_lastname</lift:loc>
+ <br/>
+ <signup:lastname/>
+ </label>
+ <br/>
+ <label for="image_url">
+ <lift:loc>ui_sign_up_image_url</lift:loc>
+ <br/>
+ <signup:image_url/>
+ </label>
+ <br/>
+ <label for="timezone">
+ <lift:loc>ui_sign_up_timezone</lift:loc>
+ <br/>
+ <signup:timezone/>
+ </label>
+ <br/>
+ <label for="locale">
+ <lift:loc>ui_sign_up_locale</lift:loc>
+ <br/>
+ <signup:locale/>
+ </label>
+ </div>
+ </div>
+ <label for="submit">
+ <signup:submit id="submit"/>
+ </label>
+ </lift:signup>
+ </div>
-<meta name="keywords" content="ESME" lang="en-US" />
-<meta name="description" content="ESME" lang="en-US" />
-<meta name="copyright" content="ESME" lang="en-US" />
-<meta name="generator" content="" lang="en-US" />
-<meta name="author" content="ESME Designed by Joy Reyes" lang="en-US" />
-<meta name="Robots" content="index,follow,noodp" />
-<link rel="stylesheet" href="src/style.css" type="text/css" media="screen" />
-</head>
-
-<body id="home">
-
-<div id="container-bg">
-<div id="container">
-
-<div id="header">
- <div id="logo"><h1><a href="/">ESME</a></h1></div>
- <div id="top-menu">
- <ul>
- <li><a href="/">Home</a> | </li>
- <li><a href="">Getting Stated</a> | </li>
- <li><a href="">Blog</a></li>
- </ul>
- </div>
-</div>
-<!--// ENDS HEADER -->
-
-<div id="content">
- <div class="gray-box signup">
- <h1>Create a New Account</h1>
-
- <form action="" method="post" >
- <div id="form-signup">
- <div class="post-form-row">
- <label>Email</label>
- <input type="text" name="email" value="" class="inputBox2">
- </div>
-
- <div class="post-form-row">
- <label>Password</label>
- <input type="text" name="password" value="" class="inputBox2">
- </div>
-
- <div class="post-form-row">
- <label>Password (retype)</label>
- <input type="text" name="password2" value="" class="inputBox2">
- </div>
-
- <div class="post-form-row">
- <label>Nickname</label>
- <input type="text" name="nickname" value="" class="inputBox2">
- </div>
-
- <div class="post-form-row">
- <label>First Name</label>
- <input type="text" name="firstname" value="" class="inputBox2">
- </div>
-
- <div class="post-form-row">
- <label>Last Name</label>
- <input type="text" name="lastname" value="" class="inputBox2">
- </div>
-
- <div class="post-form-row">
- <label>New field 2</label>
- <input type="text" name="new2" value="" class="inputBox2">
- </div>
-
- <div class="post-form-row">
- <label>New field 3</label>
- <input type="text" name="new3" value="" class="inputBox2">
- </div>
-
- <div class="post-form-row">
- <label>Your Timezone</label>
- <select name="timezone" class="inputBox2">
- <option>Africa / Abidjan</option>
- <option>Some text</option>
- </select>
- </div>
-
- <div class="post-form-row">
- <label>Language</label>
- <select name="language" class="inputBox2">
- <option>English (United States)</option>
- <option>Some text</option>
- </select>
- </div>
-
- <div class="post-form-row">
- <div class="submit-btn">
- <input type="image" src="images/btn-signup-big.gif" />
- </div>
- </div>
-
- </div><!--form-signup-->
- </form>
-
- </div><!--gray-box-->
-
-
-
-
-</div><!--content-->
-
-
-</div><!--// ENDS CONTAINER -->
-</div><!--// ENDS CONTAINER-BG -->
-
-
-
-
-
-<div id="footer">
- <div class="ftr-links">
- <a href="index.html">home</a> |
- <a href="services.html">services</a> |
- <a href="mission.html">mission</a> |
- <br />
-
- Copyright © 2009 ESME<br />
-
- </div>
-
-
-</div>
-</body>
-</html>
\ No newline at end of file
+ </div>
+</lift:surround>
\ No newline at end of file
Modified: incubator/esme/trunk/server/src/main/webapp/templates-hidden/base.html
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/webapp/templates-hidden/base.html?rev=927718&r1=927717&r2=927718&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/webapp/templates-hidden/base.html (original)
+++ incubator/esme/trunk/server/src/main/webapp/templates-hidden/base.html Fri Mar 26 07:54:04 2010
@@ -63,7 +63,7 @@
<div id="right">
<div class="box-right-back">
<div class="avatar">
- <img src="../images/avatar2.gif" alt="" />
+ <img lift:snippet="UserSnip.image" alt="" />
</div><strong><lift:loc>ui_messages_message_label_welcome</lift:loc></strong>
<div class="info4">
<a href=""><span class="name"><lift:UserSnip.name/></span></a>
Modified: incubator/esme/trunk/server/src/main/webapp/templates-hidden/timeline.html
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/webapp/templates-hidden/timeline.html?rev=927718&r1=927717&r2=927718&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/webapp/templates-hidden/timeline.html (original)
+++ incubator/esme/trunk/server/src/main/webapp/templates-hidden/timeline.html Fri Mar 26 07:54:04 2010
@@ -47,9 +47,7 @@
</p>
</div>
<div class="metainfo">
- <span id="pool">-</span>
- <span id="reason">-</span>
- <span id="when" class="date">-</span>
+ <div id="supp_data"> -</div>
</div>
</div>
</td>
Modified: incubator/esme/trunk/server/src/main/webapp/track_view/index.html
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/webapp/track_view/index.html?rev=927718&r1=927717&r2=927718&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/webapp/track_view/index.html (original)
+++ incubator/esme/trunk/server/src/main/webapp/track_view/index.html Fri Mar 26 07:54:04 2010
@@ -60,7 +60,7 @@
</td>
<td>
<item:remove>
- <img src="/images/delete.png"/>
+ <img src="/images/deletenew.png"/>
</item:remove>
</td>
</tr>
@@ -74,14 +74,15 @@
<div id="dialog-form" title="Create new track">
<p class="validateTips">All form fields are required.</p>
- <lift:form>
+ <form id="track_new_dialog" onsubmit="false">
+
<lift:main>
<fieldset>
<label for="name"><lift:loc>ui_track_new_track_what</lift:loc></label>
<main:track class="text ui-widget-content ui-corner-all" />
</fieldset>
</lift:main>
- </lift:form>
+ </form>
</div>