Commits

Juan Carlos Picado Herrera committed ad6089b

Fixed ENCUESTAME-243, minor changes

Comments (0)

Files changed (12)

encuestame-mvc/src/main/java/org/encuestame/mvc/interceptor/EnMeSecurityInterceptor.java

 import org.apache.log4j.Logger;
 import org.encuestame.core.config.EnMePlaceHolderConfigurer;
 import org.encuestame.core.security.SecurityUtils;
+import org.encuestame.core.util.ConvertDomainBean;
 import org.encuestame.persistence.domain.security.UserAccount;
 import org.joda.time.DateTimeZone;
 import org.springframework.security.core.Authentication;
                 log.trace("session is valid");
                 final UserAccount user = getByUsername(getUserPrincipalUsername());
                 log.trace("Account User Interceptor "+user);
-                request.setAttribute("account", user);
+                request.setAttribute("account", ConvertDomainBean.convertBasicSecondaryUserToSignUpBean(user));
                 Cookie cookieName = WebUtils.getCookie(request, this.COOKIE_NAME);
                 if(cookieName != null){
                     log.debug("Cookie "+cookieName.getName());

encuestame-war/src/main/webapp/WEB-INF/jsp/includes/profile.jsp

 <div dojoType="encuestame.org.core.commons.profile.ProfileMenu"
-                                    contextPath="<%=request.getContextPath()%>"></div>
+         username="${account.username}" completeName="${account.fullName}"></div>
+
+

encuestame-war/src/main/webapp/WEB-INF/jsp/includes/web/menu.jsp

- <%@ include file="/WEB-INF/jsp/includes/taglibs.jsp"%>
- <div class="menuWrapper enme-auto-center">
-    <ul>
-        <li>
-            <a style="margin-left: 5px;">
-                <img src="<%=request.getContextPath()%>/resources/images/icons/enme_home.png" alt="Home" />
-            </a>
-        </li>
-        <li class="item"><a href="<%=request.getContextPath()%>/admon/members">
-                <spring:message code="menu.members" />
-                </a></li>
-        <li class="item"><a href="<%=request.getContextPath()%>/admon/location">
-                <spring:message code="menu.locations" />
-            </a></li>
-        <li class="item"><a href="<%=request.getContextPath()%>/admon/project">
-            <spring:message code="menu.project" />
-            </a></li>
-        <li class="item"><a href="<%=request.getContextPath()%>/user/tweetpoll/list">
-            <spring:message code="menu.tweetpoll" />
-            </a></li>
-        <li class="item"><a href="<%=request.getContextPath()%>/user/poll">
-            <spring:message code="menu.poll" />
-            </a></li>
-        <li class="item">
-            <a href="<%=request.getContextPath()%>/user/survey">
-                <spring:message code="menu.survey" /></a></li>
-    </ul>
-    <div style="float: right;">
-        <div dojoType="encuestame.org.core.commons.notifications.Notification"></div>
-    </div>
-    <br style="clear: left" />
+<%@ include file="/WEB-INF/jsp/includes/taglibs.jsp"%>
+<div class="menuWrapper enme-auto-center">
+    <span class="item"><a
+        href="<%=request.getContextPath()%>/admon/members"> <spring:message
+                code="menu.members" /> </a>
+    </span> <span class="item"><a
+        href="<%=request.getContextPath()%>/admon/location"> <spring:message
+                code="menu.locations" /> </a>
+    </span> <span class="item"><a
+        href="<%=request.getContextPath()%>/admon/project"> <spring:message
+                code="menu.project" /> </a>
+    </span> <span class="item"><a
+        href="<%=request.getContextPath()%>/user/tweetpoll/list"> <spring:message
+                code="menu.tweetpoll" /> </a>
+    </span> <span class="item"><a
+        href="<%=request.getContextPath()%>/user/poll"> <spring:message
+                code="menu.poll" /> </a>
+    </span> <span class="item"> <a
+        href="<%=request.getContextPath()%>/user/survey"> <spring:message
+                code="menu.survey" />
+    </a>
+    </span>
+    <div class="rightSide">
+        <c:if test="${logged}">
+            <span class="section">
+                <div
+                    dojoType="encuestame.org.core.commons.notifications.Notification"></div>
+            </span>
+            <span class="section"> <%@ include
+                    file="/WEB-INF/jsp/includes/profile.jsp"%>
+            </span>
+        </c:if>
     </div>
+</div>

encuestame-war/src/main/webapp/WEB-INF/layouts/standard/header.jsp

-<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
-<%@ taglib prefix="tiles" uri="http://tiles.apache.org/tags-tiles" %>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
+<%@ taglib prefix="tiles" uri="http://tiles.apache.org/tags-tiles"%>
 <%@ include file="/WEB-INF/jsp/includes/taglibs.jsp"%>
 <div class="web-header enme-auto-center">
-        <div class="web-header-wrapper enme-auto-center">
-            <div class="logo">
-                <a href="<%=request.getContextPath()%>/">
-                    <img alt="logo" src="<%=request.getContextPath()%>/resources/${logo}">
-                </a>
-            </div>
-            <div class="web-header-options">
-                <c:if test="${!logged}">
-                   <span class="link">
-                       <a href="<%=request.getContextPath()%>/user/signin">
-                        <spring:message code="header.signin" />
-                        </a>
-                   </span>
-                 </c:if>
-                 <c:if test="${logged}">
-                    <span class="link">
-                         <a href="<%=request.getContextPath()%>/home">
-                            <spring:message code="header.public.line" />
-                         </a>
-                    </span>
-                 </c:if>
-                 <c:if test="${logged}">
-                    <span class="link">
-                        <div dojoType="encuestame.org.core.commons.dashboard.DashBoardMenu"
-                             contextPath="<%=request.getContextPath()%>"></div>
-                    </span>
-                 </c:if>
-                 <c:if test="${logged}">
-                      <span class="link">
-                         <span id="navbar">
-                               <%@ include file="/WEB-INF/jsp/includes/profile.jsp" %>
-                         </span>
-                     </span>
-                 </c:if>
-                 <span class="link">
-                       <div dojoType="encuestame.org.core.commons.search.SearchMenu"></div>
-                 </span>
-            </div>
-     </div>
+    <div class="web-header-wrapper enme-auto-center">
+        <div class="logo">
+            <a href="<%=request.getContextPath()%>/"> <img alt="logo"
+                src="<%=request.getContextPath()%>/resources/${logo}"> </a>
+        </div>
+        <div class="web-header-options">
+            <c:if test="${!logged}">
+                <span class="link"> <a
+                    href="<%=request.getContextPath()%>/user/signin"> <spring:message
+                            code="header.signin" /> </a> </span>
+            </c:if>
+            <c:if test="${logged}">
+                <span class="link"> <a
+                    href="<%=request.getContextPath()%>/home"> <spring:message
+                            code="header.public.line" /> </a> </span>
+            </c:if>
+            <c:if test="${logged}">
+                <span class="link">
+                    <div dojoType="encuestame.org.core.commons.dashboard.DashBoardMenu"
+                        contextPath="<%=request.getContextPath()%>"></div> </span>
+            </c:if>
+            <span class="link">
+                <div dojoType="encuestame.org.core.commons.search.SearchMenu"></div>
+            </span>
+        </div>
+    </div>
 </div>

encuestame-war/src/main/webapp/resource/css/default.css

 div.web-tweetpolls-time{
 
 }
+
+
+/*** Profile **/
+
+/** profile menu **/
+div.profilePanel{
+    display: none;
+    position: absolute;
+    min-height: 120px;
+    min-width: 245px;
+    background-color: #444444;
+    right: 0px;
+    top: 30px;
+    z-index: 5px;
+    zoom: 1;
+    -moz-box-shadow: 1px 2px 3px #888888;
+    -webkit-box-shadow: 1px 2px 3px #888888;
+     box-shadow: 1px 2px 3px #888888;
+    -webkit-border-radius: 0px 0px 5px 5px;
+    -moz-border-radius: 0px 0px 5px 5px;
+     border-radius: 0px 0px 5px 5px;
+     z-index: 99999;
+}
+
+div.profileOpenPanel{
+    display: block;
+}
+div.profilePanel ul{
+    max-height: 350px;
+    overflow: hidden;
+}
+
+div.profilePanel li{
+    background-image: none;
+    clear: both;
+    display: block;
+    width: 215px;
+    float: left;
+    text-align: left;
+    list-style: none;
+    margin: 0px;
+    padding: 6px 15px;
+}
+div.profilePanel li:hover{
+    background-color: "#5F5F5F";
+}
+
+div.profilePanel li a:link{
+   color: #BABABA !important;
+   font-weight: normal;
+}
+
+div.profilePanel li a{
+    padding: 10px;
+    color: #BABABA !important;
+    font-weight: normal;
+}
+
+/** profile update wrapper **/
+
+div.accountUpdateWrapper{
+    padding: 10px;
+}
+
+/** Menu **/
+
+div.menuWrapper{
+    font-weight: bold;
+    -moz-box-shadow: 0px 2px 2px #888;
+    -webkit-box-shadow: 0px 2px 2px #888;
+     box-shadow: 0px 0px 2px #888;
+    -webkit-border-radius: 0px 0px 5px 5px;
+    -moz-border-radius: 0px 0px 5px 5px;
+     border-radius: 0px 0px 5px 5px;
+     background-color: #444444;
+     max-height : 30px;
+}
+
+div.menuWrapper .item {
+    display: inline-block;
+    border-radius: 4px 4px 4px 4px;
+}
+
+div.menuWrapper a:hover {
+    background-color: #555555;
+}
+
+div.menuWrapper .item a {
+    float: left;
+    text-decoration: none;
+    color: white;
+    padding: 7px 7px 7px 13px;
+    background-color: #444444;
+}
+
+div..menuWrapper .item a:visited {
+    color: white;
+}
+
+div..menuWrapper .item a:hover,.menuWrapper .item .current {
+    color: #444444;
+    background-color: #E8E8E8;
+    -moz-box-shadow: 0px 2px 2px #888;
+    -webkit-box-shadow: 0px 2px 2px #888;
+    box-shadow: 0px 0px 2px #888;
+}
+
+#profile_menu {
+    background: #aaaaaa;
+    border: solid 1px #666666;
+    width: 400px;
+    padding: 10px;
+    color: #FFFFFF;
+    position: absolute;
+    font-weight: bold;
+    font-size: 12px;
+    line-height: 18px;
+    min-height: 160px;
+    z-index: 500;
+   -webkit-border-radius: 0px 0px 10px 10px;
+    -moz-border-radius: 0px 0px 10px 10px;
+    border-radius: 0px 0px 10px 10px;
+    right: 120px !important;
+    top:37px;
+}
+
+#profile_menu li {
+    padding-bottom: 6px;
+    text-align: right;
+}
+
+#detail_profile {
+    padding-right: 10px;
+    border-right: 1px #DEDEDE solid;
+    height: 120px;
+    width: 230px;
+    float: left;
+    line-height: 12px;
+}
+
+#options_profile {
+    padding-left: 20px;
+    height: 120px;
+    width: 135px;
+    float: left;
+    line-height: 12px;
+    text-align: right;
+}
+
+#profile_menu label {
+    font-size: 11px;
+    font-weight: normal;
+}
+
+#profile_menu input {
+    font-size: 11px;
+    color: #333333;
+    margin-left: 10px;
+}
+
+#profile_menu button {
+    line-height: 24px;
+    float: right;
+    color: #FFFFFF;
+    font-size: 11px;
+    font-weight: bold;
+    text-align: center;
+    cursor: pointer;
+}
+
+div.menuWrapper div.rightSide {
+  float: right;
+  text-align: right;
+  width: 225px;
+}
+
+div.menuWrapper div.rightSide span {
+  display: inline-block;
+  margin-left: 3px;
+  margin-right: 3px;
+  overflow: auto;
+  vertical-align: middle;
+}
+
+/** web-profile-menu **/
+
+div.web-profile-menu {
+  color: #FFFFFF;
+  overflow: auto;
+  vertical-align: middle;
+  cursor: pointer;
+  min-width: 100px;
+}
+
+div.web-profile-menu:hover {
+    background-color: #555555;
+}
+
+div.web-profile-menu .image {
+  float: left;
+}
+
+div.web-profile-menu .real-name {
+  padding-top: 4px;
+  vertical-align: middle;
+  width: 100px;
+  padding-right: 4px;
+
+}
+/** notifications **/
+
+div.notificationWrapper {
+  min-height: 22px;
+  padding: 4px;
+}
+
+div.notificationWrapper:hover{
+    background-color: #5A5959;
+}
+
+div.livePanel{
+    display: none;
+    position: absolute;
+    min-height: 5px;
+    width: 400px;
+    background-color: #FFF;
+    right: 0px;
+    top: 30px;
+    -moz-box-shadow: 2px 2px 5px #888888;
+    -webkit-box-shadow: 2px 2px 5px #888888;
+     box-shadow: 2px 2px 5px #888888;
+    -webkit-border-radius: 0px 0px 5px 5px;
+    -moz-border-radius: 0px 0px 5px 5px;
+     border-radius: 0px 0px 5px 5px;
+     min-width: 345px;
+     max-width: 345px;
+     z-index: 20;
+}
+
+div.livePanel .panelItems{
+    min-height: 100%;
+}
+
+div.livePanel .final{
+    padding: 4px;
+    text-align: right;
+    font-weight: bold;
+    background-color: #E8E8E8;
+}
+div.livePanel .final a:link{
+    color: "#000";
+}
+
+div.openLivePanel{
+     display: block;
+}
+
+.notificationItem{
+    padding: 5px;
+    min-height: 30px;
+    text-align: left;
+}
+
+.notificationItem:hover{
+    background-color: #E8E8E8;
+    font-weight: bold;
+    cursor: pointer;
+}
+
+div.livePanel .notificationItem .left{
+    float: left;
+    min-height: 30px;
+    margin-left: 10px;
+    width: 50px;
+    background-position: left;
+    background-repeat: no-repeat;
+}
+
+div.livePanel .notificationItem .right{
+
+}
+
+div.livePanel .notificationItem .right .title{
+    font-size: 110%;
+}
+
+div.livePanel .notificationItem .right .description{
+    font-size: 80%;
+    color: grey;
+    font-weight: normal;
+    margin-left: 60px;
+}
+
+div.counter{
+    color: #FFF;
+    cursor: pointer;
+}
+
+div.notificationWrapper div.new{
+    color: red !important;
+}
+
+div.counter:hover{
+}
+

encuestame-war/src/main/webapp/resource/css/livePanel.css

-div.notificationWrapper{
-    padding: 13px 15px 10px 10px;
-    min-height: 15px;
-}
-
-div.notificationWrapper:hover{
-    background-color: #5A5959;
-}
-
-div.livePanel{
-    display: none;
-    position: absolute;
-    min-height: 5px;
-    width: 400px;
-    background-color: #FFF;
-    right: 4%;
-    top: 85px;
-    -moz-box-shadow: 2px 2px 5px #888888;
-    -webkit-box-shadow: 2px 2px 5px #888888;
-     box-shadow: 2px 2px 5px #888888;
-    -webkit-border-radius: 0px 0px 5px 5px;
-    -moz-border-radius: 0px 0px 5px 5px;
-     border-radius: 0px 0px 5px 5px;
-     min-width: 345px;
-     max-width: 345px;
-     z-index: 20;
-}
-
-div.livePanel .panelItems{
-    min-height: 100%;
-}
-
-div.livePanel .final{
-    padding: 4px;
-    text-align: right;
-    font-weight: bold;
-    background-color: #E8E8E8;
-}
-div.livePanel .final a:link{
-    color: "#000";
-}
-
-div.openLivePanel{
-     display: block;
-}
-
-.notificationItem{
-    padding: 5px;
-    min-height: 30px;
-}
-
-.notificationItem:hover{
-    background-color: #E8E8E8;
-    font-weight: bold;
-    cursor: pointer;
-}
-
-div.livePanel .notificationItem .left{
-    float: left;
-    min-height: 30px;
-    margin-left: 10px;
-    width: 50px;
-    background-position: left;
-    background-repeat: no-repeat;
-}
-
-div.livePanel .notificationItem .right{
-
-}
-
-div.livePanel .notificationItem .right .title{
-    font-size: 110%;
-}
-
-div.livePanel .notificationItem .right .description{
-    font-size: 80%;
-    color: grey;
-    font-weight: normal;
-    margin-left: 60px;
-}
-
-div.counter{
-    color: #FFF;
-    cursor: pointer;
-}
-
-div.notificationWrapper div.new{
-    color: red !important;
-}
-
-div.counter:hover{
-}

encuestame-war/src/main/webapp/resource/css/menu.css

-div.menuWrapper{
-    font-weight: bold;
-    -moz-box-shadow: 0px 2px 2px #888;
-    -webkit-box-shadow: 0px 2px 2px #888;
-     box-shadow: 0px 0px 2px #888;
-    -webkit-border-radius: 0px 0px 5px 5px;
-    -moz-border-radius: 0px 0px 5px 5px;
-     border-radius: 0px 0px 5px 5px;
-}
-
-.menuWrapper ul {
-    margin: 0;
-    padding: 0;
-    float: left;
-}
-
-.menuWrapper ul li {
-    display: inline;
-        border-radius: 4px;
-    -moz-border-radius: 4px;
-    -webkit-border-radius: 4px;
-}
-
-.menuWrapper ul li a {
-    float: left;
-    text-decoration: none;
-    color: white;
-    padding: 10.5px 11px;
-    background-color: #444444;
-}
-
-.menuWrapper ul li a:visited {
-    color: white;
-}
-
-.menuWrapper ul li.item a:hover,.menuWrapper ul li .current {
-    color: #444444;
-    background-color: #E8E8E8;
-    -moz-box-shadow: 0px 2px 2px #888;
-    -webkit-box-shadow: 0px 2px 2px #888;
-    box-shadow: 0px 0px 2px #888;
-}
-
-.menuWrapper {
-    background-color: #444444;
-    border-radius: 0px 0px 2px 2px;
-    -moz-border-radius: 0px 0px 2px 2px;
-    -webkit-border-radius: 0px 0px 2px 2px;
-    min-height: 37px;
-}
-
-
-#profile_menu {
-    background: #aaaaaa;
-    border: solid 1px #666666;
-    width: 400px;
-    padding: 10px;
-    color: #FFFFFF;
-    position: absolute;
-    font-weight: bold;
-    font-size: 12px;
-    line-height: 18px;
-    min-height: 160px;
-    z-index: 500;
-   -webkit-border-radius: 0px 0px 10px 10px;
-    -moz-border-radius: 0px 0px 10px 10px;
-    border-radius: 0px 0px 10px 10px;
-    right: 120px !important;
-    top:37px;
-}
-
-#profile_menu li {
-    padding-bottom: 6px;
-    text-align: right;
-}
-
-#detail_profile {
-    padding-right: 10px;
-    border-right: 1px #DEDEDE solid;
-    height: 120px;
-    width: 230px;
-    float: left;
-    line-height: 12px;
-}
-
-#options_profile {
-    padding-left: 20px;
-    height: 120px;
-    width: 135px;
-    float: left;
-    line-height: 12px;
-    text-align: right;
-}
-
-#profile_menu label {
-    font-size: 11px;
-    font-weight: normal;
-}
-
-#profile_menu input {
-    font-size: 11px;
-    color: #333333;
-    margin-left: 10px;
-}
-
-#profile_menu button {
-    line-height: 24px;
-    float: right;
-    color: #FFFFFF;
-    font-size: 11px;
-    font-weight: bold;
-    text-align: center;
-    cursor: pointer;
-}
-
-.green-button {
-    background: url(pic/button.png);
-    display: block;
-    color: #FFFFFF;
-    font-size: 11px;
-    text-decoration: none;
-    width: 81px;
-    height: 26px;
-    line-height: 24px;
-    text-align: center;
-}
-
-.spacer {
-    clear: both;
-    height: 1px;
-}

encuestame-war/src/main/webapp/resource/css/profile.css

-/** profile menu **/
-div.profilePanel{
-    display: none;
-    position: absolute;
-    min-height: 120px;
-    min-width: 245px;
-    background-color: #444444;
-    right: 220px;
-    top: 37px;
-    z-index: 5px;
-    zoom: 1;
-    -moz-box-shadow: 1px 2px 3px #888888;
-    -webkit-box-shadow: 1px 2px 3px #888888;
-     box-shadow: 1px 2px 3px #888888;
-    -webkit-border-radius: 0px 0px 5px 5px;
-    -moz-border-radius: 0px 0px 5px 5px;
-     border-radius: 0px 0px 5px 5px;
-     z-index: 99999;
-}
-
-div.profileOpenPanel{
-    display: block;
-}
-div.profilePanel ul{
-    max-height: 350px;
-    overflow: hidden;
-}
-
-div.profilePanel li{
-    background-image: none;
-    clear: both;
-    display: block;
-    width: 215px;
-    float: left;
-    text-align: left;
-    list-style: none;
-    margin: 0px;
-    padding: 6px 15px;
-}
-div.profilePanel li:hover{
-    background-color: "#5F5F5F";
-}
-
-div.profilePanel li a:link{
-   color: #BABABA !important;
-   font-weight: normal;
-}
-
-div.profilePanel li a{
-    padding: 10px;
-    color: #BABABA !important;
-    font-weight: normal;
-}
-
-/** profile update wrapper **/
-
-div.accountUpdateWrapper{
-    padding: 10px;
-}

encuestame-war/src/main/webapp/resource/css/tweetpoll.css

 
 div.tweetPollWrapper div.previewAbsolute {
      position: absolute !important;
-     top: 73px;
+     top: 60px;
 }
 
 div.tweetPollWrapper div.previewFixed {

encuestame-war/src/main/webapp/resource/js/encuestame/org/core/commons/profile/ProfileMenu.js

 
         _openBox : false,
 
-        contextPath : "",
+        contextPath : encuestame.contextDefault,
+
+        completeName : "",
+
+        username : "",
 
         /*
          *

encuestame-war/src/main/webapp/resource/js/encuestame/org/core/commons/profile/templates/profile.html

 <div class="accountUpdateWrapper">
-
        <h2>User Profile </h2>
        <div dojoType="dijit.form.Form" id="profileForm" class="formDefault" style="display=none;" dojoAttachPoint="_form">
            <div>

encuestame-war/src/main/webapp/resource/js/encuestame/org/core/commons/profile/templates/profileMenu.html

-<span>
-    <a href="#" dojoAttachEvent="onclick:_open">Profile</a>
+<div class="web-profile-menu">
+     <div class="image">
+        <img alt="${username}" dojoAttachEvent="onclick:_open" height="24" width="24"
+             src="${contextPath}/picture/profile/${username}/thumbnail">
+     </div>
+    <div class="real-name">${completeName}</div>
     <div class="profilePanel" dojoAttachPoint="_profileBox">
-        <ul>
             <li><a href="${contextPath}/settings/configuration">Configuration</a></li>
             <li><a href="${contextPath}/settings/social">Social Accounts</a></li>
             <li><a href="${contextPath}/user/help">Help</a></li>
             <li>
               <a href="${contextPath}/user/logout">Log out</a>
             </li>
-          </ul>
     </div>
-</span>
+</div>