Return-Path: Delivered-To: apmail-incubator-esme-commits-archive@minotaur.apache.org Received: (qmail 46031 invoked from network); 1 Feb 2010 09:29:16 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 1 Feb 2010 09:29:16 -0000 Received: (qmail 12853 invoked by uid 500); 1 Feb 2010 09:29:16 -0000 Delivered-To: apmail-incubator-esme-commits-archive@incubator.apache.org Received: (qmail 12818 invoked by uid 500); 1 Feb 2010 09:29:15 -0000 Mailing-List: contact esme-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: esme-dev@incubator.apache.org Delivered-To: mailing list esme-commits@incubator.apache.org Received: (qmail 12808 invoked by uid 99); 1 Feb 2010 09:29:15 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 01 Feb 2010 09:29:15 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 01 Feb 2010 09:29:14 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 95DD1238897F; Mon, 1 Feb 2010 09:28:54 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r905218 - in /incubator/esme/trunk/server/src/main: resources/ scala/bootstrap/liftweb/ scala/org/apache/esme/lib/ webapp/profile_view/ webapp/templates-hidden/ Date: Mon, 01 Feb 2010 09:28:54 -0000 To: esme-commits@incubator.apache.org From: vdichev@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100201092854.95DD1238897F@eris.apache.org> Author: vdichev Date: Mon Feb 1 09:28:53 2010 New Revision: 905218 URL: http://svn.apache.org/viewvc?rev=905218&view=rev Log: Added page for user profile editing Added: incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/ProfileMgr.scala (with props) incubator/esme/trunk/server/src/main/webapp/profile_view/ incubator/esme/trunk/server/src/main/webapp/profile_view/edit.html (with props) Modified: incubator/esme/trunk/server/src/main/resources/ESMEBase.properties incubator/esme/trunk/server/src/main/scala/bootstrap/liftweb/Boot.scala incubator/esme/trunk/server/src/main/webapp/templates-hidden/default.html incubator/esme/trunk/server/src/main/webapp/templates-hidden/message.html Modified: incubator/esme/trunk/server/src/main/resources/ESMEBase.properties URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/resources/ESMEBase.properties?rev=905218&r1=905217&r2=905218&view=diff ============================================================================== --- incubator/esme/trunk/server/src/main/resources/ESMEBase.properties (original) +++ incubator/esme/trunk/server/src/main/resources/ESMEBase.properties Mon Feb 1 09:28:53 2010 @@ -90,3 +90,4 @@ base_users_menu=Users +base_profile_menu=Edit Profile Modified: incubator/esme/trunk/server/src/main/scala/bootstrap/liftweb/Boot.scala URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/bootstrap/liftweb/Boot.scala?rev=905218&r1=905217&r2=905218&view=diff ============================================================================== --- incubator/esme/trunk/server/src/main/scala/bootstrap/liftweb/Boot.scala (original) +++ incubator/esme/trunk/server/src/main/scala/bootstrap/liftweb/Boot.scala Mon Feb 1 09:28:53 2010 @@ -136,7 +136,8 @@ AccessPoolMgr.menuItems ::: StreamMgr.menuItems ::: ConversationMgr.menuItems ::: - SearchMgr.menuItems + SearchMgr.menuItems ::: + ProfileMgr.menuItems LiftRules.setSiteMap(SiteMap(entries: _*)) Added: incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/ProfileMgr.scala URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/ProfileMgr.scala?rev=905218&view=auto ============================================================================== --- incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/ProfileMgr.scala (added) +++ incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/ProfileMgr.scala Mon Feb 1 09:28:53 2010 @@ -0,0 +1,71 @@ +/** + * Copyright 2008-2009 WorldWide Conferencing, LLC + * + * 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. + */ + +package org.apache.esme.lib + +import net.liftweb._ +import http._ +import SHtml._ +import js._ +import JsCmds._ +import JE._ + +import sitemap._ +import Loc._ + +import mapper._ + +import util._ +import common._ +import Helpers._ + +import model._ + +import scala.xml._ + +/** + * Manage the sitemap and related snippets for editing a user's profile + */ +object ProfileMgr { + def loggedIn_? = User.loggedIn_? + + val ifIsLoggedIn = If(loggedIn_? _, strFuncToFailMsg(() => S.?("base_error_not_logged_in"))) + + val menuItems = + Menu(Loc("profile", List("profile_view", "edit"), S.?("base_profile_menu"), ifIsLoggedIn, + Loc.Snippet("editProfile", editProfile))) :: + Nil + + def editProfile(in: NodeSeq): NodeSeq = { + + (for (user <- User.currentUser) yield { + bind("user", in, "nickname" -> text(user.nickname, {_ =>}, "disabled" -> "true"), + "lastName" -> user.lastName.toForm, + "imageURL" -> user.imageUrl.toForm, + "firstName" -> user.firstName.toForm, + "timezone" -> user.timezone.toForm, + "locale" -> user.locale.toForm, + "save" -> submit("Save", user.save)) + }).getOrElse(NodeSeq.Empty) + + } + +} Propchange: incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/ProfileMgr.scala ------------------------------------------------------------------------------ svn:executable = * Added: incubator/esme/trunk/server/src/main/webapp/profile_view/edit.html URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/webapp/profile_view/edit.html?rev=905218&view=auto ============================================================================== --- incubator/esme/trunk/server/src/main/webapp/profile_view/edit.html (added) +++ incubator/esme/trunk/server/src/main/webapp/profile_view/edit.html Mon Feb 1 09:28:53 2010 @@ -0,0 +1,15 @@ + + + + + + + + + + + + +
ui_sign_up_nickname
ui_sign_up_firstname
ui_sign_up_lastname
ui_sign_up_image_url
ui_sign_up_timezone
ui_sign_up_locale
+
+
Propchange: incubator/esme/trunk/server/src/main/webapp/profile_view/edit.html ------------------------------------------------------------------------------ svn:executable = * Modified: incubator/esme/trunk/server/src/main/webapp/templates-hidden/default.html URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/webapp/templates-hidden/default.html?rev=905218&r1=905217&r2=905218&view=diff ============================================================================== --- incubator/esme/trunk/server/src/main/webapp/templates-hidden/default.html (original) +++ incubator/esme/trunk/server/src/main/webapp/templates-hidden/default.html Mon Feb 1 09:28:53 2010 @@ -37,6 +37,9 @@
  • + +
  • +
  • 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=905218&r1=905217&r2=905218&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 Mon Feb 1 09:28:53 2010 @@ -37,6 +37,9 @@
  • + +
  • +