Commits

Juan Carlos Picado Herrera  committed 0b6a5a0

Fixed all notifications UI

  • Participants
  • Parent commits 3e37a9b

Comments (0)

Files changed (8)

File enme-js/deps/src/main/resources/req/json_services.js

 encuestame.notification.load = {};
 encuestame.notification.load.limit = 100;
 
-encuestame.notification.buildURLDescription = function(type, description, url) {
-    var multi = dojo.doc.createElement("div");
-    var a = dojo.doc.createElement("a");
-    a.target = "_blank";
-    if (type == "TWEETPOLL_PUBLISHED") {
-        multi.innerHTML = description+ "<br/> ";
-        a.href = encuestame.contextDefault + url;
-        a.innerHTML = "See details here.";
-    } else if (type == "SOCIAL_MESSAGE_PUBLISHED") {
-        multi.innerHTML = "";
-        a.href = url;
-        a.innerHTML = description;
-    }
-    multi.appendChild(a);
-    return multi;
-};
+// encuestame.notification.buildURLDescription = function(type, description, url) {
+//     var multi = dojo.doc.createElement("div");
+//     var a = dojo.doc.createElement("a");
+//     a.target = "_blank";
+//     if (type == "TWEETPOLL_PUBLISHED") {
+//         multi.innerHTML = description+ "<br/> ";
+//         a.href = encuestame.contextDefault + url;
+//         a.innerHTML = "See details here.";
+//     } else if (type == "SOCIAL_MESSAGE_PUBLISHED") {
+//         multi.innerHTML = "";
+//         a.href = url;
+//         a.innerHTML = description;
+//     }
+//     multi.appendChild(a);
+//     return multi;
+// };
 
 encuestame.session.activity = {};
 

File enme-war/src/main/webapp/WEB-INF/views/notifications/web/notifications.jsp

 <%@ include file="/WEB-INF/jsp/includes/taglibs.jsp"%>
-<div class="defaultMarginWrapper">
+<div class="enme-auto-center">
     <div data-dojo-type="me/web/widget/notifications/NotificationList"></div>
 </div>

File enme-war/src/main/webapp/resource/css-compile/common.css

     user-select: none;
 }
 
+.web-sub-tittle {
+  background-color: white;
+  border: 1px solid #CCC;
+}
+
+.web-b-white-box {
+  padding-top: 5px;
+  padding-bottom: 5px;
+}
+
+.web-bottomborder {
+  border-left: none;
+  border-right: none;
+  border-top: none;
+}
+
 .clearfix {
     display: inline-block;
 }

File enme-war/src/main/webapp/resource/css-compile/web/components/notification-list.css

 /** notifilication list **/
-div.web-notification-list {
+.web-notification-list {
 
 }
 
-div.web-notification-list list {
+.web-notification-list .list {
+    background: white;
+    padding: 10px 10px 0 10px;
+}
+
+.web-notification-list .list a:link, .web-notification-list .list a:visited {
+    color: #4A52AC;
+    text-decoration: underline;
+}
 
+.web-notification-list .list .web-sub-tittle {
+    padding: 10px;
+    font-weight: bold;
 }
 
-div.web-notification-list div.web-notification-list-item {
+.web-notification-list ul {
+    margin: 0;
+}
+
+.web-notification-list .web-notification-list-item {
     clear: both;
-    padding: 9px;
-    font-size: 100%;
+    padding: 5px 0;
     text-align: left;
     border-bottom: 1px solid #E9E9E9;
+    list-style: none;
+    font-size: 11px;
+}
+.web-notification-list .web-notification-list-item:last-child {
+    border-bottom: 0px;
 }
 
-div.web-notification-list div.web-notification-list-item span {
+.web-notification-list .web-notification-list-item span {
     margin-left: 5px;
     margin-right: 10px;
-    font-size: 100%;
+    line-height: 15px;
 }
 
-div.web-notification-list div.web-notification-list-item .icon {
+.web-notification-list .web-notification-list-item .icon {
     width: 16px;
     background-repeat: no-repeat;
     display: inline-block;
 }
 
-div.web-notification-list div.web-notification-list-item .title {
-    font-weight: bold;
+.web-notification-list .web-notification-list-item .title {
+    font-weight: normal;
     padding: 4px;
     min-width: 265px;
     max-width: 265px;
     display: inline-block;
 }
 
-div.web-notification-list div.web-notification-list-item .description {
+.web-notification-list .web-notification-list-item .description {
     padding: 4px;
     min-width: 405px;
     display: inline-block;
     max-width: 405px;
 }
 
-div.web-notification-list div.web-notification-list-item .date {
+.web-notification-list .web-notification-list-item .date {
     padding-left: 10px;
     color: gray;
     padding: 4px;
     display: inline-block;
+    width: 100px;
+}
+
+.web-notification-list .web-notification-list-item .options{
+    display: none;
+}
+
+.web-notification-list .web-notification-list-item:hover .options{
+    display: inline-block;
 }

File enme-war/src/main/webapp/resource/js/me/web/widget/notifications/NotificationList.js

 define([
          "dojo",
          'dojo/_base/json',
+         "dojo/dom-construct",
          "dojo/_base/declare",
          "dijit/_WidgetBase",
          "dijit/_TemplatedMixin",
         function(
                 dojo,
                 json,
+                domConstruct,
                 declare,
                 _WidgetBase,
                 _TemplatedMixin,
          *
          * @property _limit
          */
-        _limit :  _ENME.config('activity').limit,
+        _limit :  600,
 
         /**
          *
              var section = dojo.doc.createElement("div");
              dojo.addClass(section, "section");
 
-             var title = dojo.doc.createElement("h3");
-             title.innerHTML = name;
+             var title = domConstruct.create("div"),
+             inner_title = domConstruct.create("span");
+             dojo.addClass(title, 'web-sub-tittle');
+             dojo.addClass(title, 'web-b-top-bottom');
+             dojo.addClass(title, 'web-bottomborder');
+             inner_title.innerHTML = name;
              //add title
+             title.appendChild(inner_title);
              section.appendChild(title);
              //add content
              section.appendChild(content);
          */
         _showListCategories : function() {
             var today = this.arrayNotifications.TODAY;
-            var items = dojo.doc.createElement("div");
+            var items = dojo.doc.createElement("ul");
             if (today.length > 0) {
                 dojo.forEach(today,
                         dojo.hitch(this, function(item, index) {

File enme-war/src/main/webapp/resource/js/me/web/widget/notifications/NotificationListItem.js

          */
         category : null,
 
+
+        formatDate : "",
+
+
+        /**
+         *
+         * @method buildURLDescription
+         */
+        buildURLDescription : function(type, description, url) {
+            var multi = dojo.doc.createElement("div");
+            var a = dojo.doc.createElement("a");
+            a.target = "_blank";
+            if (type == "TWEETPOLL_PUBLISHED") {
+                multi.innerHTML = description+ " ";
+                a.href = _ENME.config('contextPath') + url;
+                a.innerHTML = "see detail";
+            } else if (type == "SOCIAL_MESSAGE_PUBLISHED") {
+                multi.innerHTML = "";
+                a.href = url;
+                a.innerHTML = description;
+            }
+            multi.appendChild(a);
+            return multi;
+        },
+
+        /**
+         *
+         * @method
+         */
+        postMixInProperties : function () {
+            //console.log("juan", this.item);
+             var _time = this.item.date + this.item.hour;
+            this.formatDate = _ENME.fromNow(_time, "YYYY-MM-DD");
+        },
+
         /**
          *
          * @method
          */
         postCreate : function() {
             if (this.item.url != null) {
-                this._description
-                .appendChild(encuestame.notification
-                .buildURLDescription(
+                this._description.appendChild(this.buildURLDescription(
                         this.item.type,
                         this.item.additionalDescription,
                         this.item.url));

File enme-war/src/main/webapp/resource/js/me/web/widget/notifications/template/notificationListItem.html

-<div class="web-notification-list-item">
-    <span class="icon">
+<li class="web-notification-list-item">
+<!--     <span class="icon">
         <img alt="icon" data-dojo-attach-point="_list">
-    </span>
+    </span> -->
     <span class="title">
         ${item.description}
     </span>
     <span class="description" data-dojo-attach-point="_description">
     </span>
     <span class="date">
-          ${item.date} | ${item.hour}
+          ${formatDate}
     </span>
      <span class="options">
         <span class="">
             </a>
         </span>
      </span>
-</div>
+</li>

File enme-war/src/main/webapp/resource/js/me/web/widget/social/LinksPublishedItem.js

 
 
   });
-});
-
-//
-//dojo.declare(
-//        "encuestame.org.core.commons.social.LinksPublishedItem",
-//        [encuestame.org.main.EnmeMainLayoutWidget],{
-//
-//        	/**
-//        	 * Template.
-//        	 */
-//            templatePath: dojo.moduleUrl("encuestame.org.core.commons.social", "templates/linksPublishedItem.html"),
-//
-
-//
-//});
+});