Commits

Juan Carlos Picado Herrera  committed b391eb3

Poll preview on poll navigation
Fixed poll all service
Removed debug code

  • Participants
  • Parent commits cb736b1

Comments (0)

Files changed (9)

File enme-business/src/main/java/org/encuestame/business/service/PollService.java

                             getUserAccount(getUserPrincipalUsername()), max,
                             start)));
         } else if (TypeSearch.ALL.equals(typeSearch)) {
-            list.addAll(ConvertDomainBean.convertListToPollBean(this
-                    .getPollsByRange(max, start, null)));
+            list.addAll(ConvertDomainBean.convertListToPollBean(getPollDao().retrievePollsByUserId(getUserAccountonSecurityContext(), max, start)));
         } else {
             throw new EnMeExpcetion("operation not valid");
         }
      * (non-Javadoc)
      * @see org.encuestame.core.service.imp.IPollService#getPolls(java.lang.Integer, java.lang.Integer, java.util.Date)
      */
-    public List<Poll> getPollsByRange(final Integer maxResults,
-            final Integer start, final Date range) {
+    public List<Poll> getPollsByRange(
+            final Integer maxResults,
+            final Integer start,
+            final Date range) {
         final List<Poll> polls = getPollDao().getPolls(
                 maxResults, start, range);
         return polls;

File enme-css/src/css/resource/css/web/components/poll-admon.css

 /**
  * expand zone of detail of list POLL
  **/
-.web-item-row .web-list-more .web-poll-item-detail {
+.web-item-row .web-list-detail-more .web-poll-item-detail {
 	border: 1px solid #EEEEEE;
 	border-radius: 5px 5px 5px 5px;
 	margin: 5px;
 	-webkit-box-shadow: inset 0px 0px 4px #E0E0E0;
 }
 
-.web-item-row .web-list-more .web-poll-info {
+.web-item-row .web-list-detail-more .web-poll-info {
 	clear: both;
 	overflow: auto;
 	position: relative;
 }
 
-.web-item-row .web-list-more .web-poll-info .web-poll-char-detail {
+.web-item-row .web-list-detail-more .web-poll-info .web-poll-char-detail {
 	float: left;
 	min-width: 280px;
 	max-width: 280px;
 	min-height: 308px;
 }
 
-.web-item-row .web-list-more .web-poll-info .web-poll-char-detail .no_results {
+.web-item-row .web-list-detail-more .web-poll-info .web-poll-char-detail .no_results {
   border: 1px solid #CFCBCB;
   font-size: 18px;
   line-height: 221px;
   border-radius : 3px;
 }
 
-.web-item-row .web-list-more .web-poll-info .web-poll-options {
+.web-item-row .web-list-detail-more .web-poll-info .web-poll-options {
 	margin-left: 340px;
 	margin-top: 35px;
 	padding: 6px;
 }
 
-.web-item-row .web-list-more .web-poll-info .web-poll-options-answer {
+.web-item-row .web-list-detail-more .web-poll-info .web-poll-options-answer {
 	float: right;
 	padding: 6px;
 	width: 355px;
 	margin-top: 40px;
 }
 
-.web-item-row .web-list-more .web-poll-info .web-poll-options-answer>div
+.web-item-row .web-list-detail-more .web-poll-info .web-poll-options-answer>div
 	{
 	max-height: 265px;
 	overflow: auto;
 }
 
-.web-item-row .web-list-more .web-poll-info .web-poll-options-answer .web-poll-answer-no-results
+.web-item-row .web-list-detail-more .web-poll-info .web-poll-options-answer .web-poll-answer-no-results
 	{
 	border: 1px solid #EBEBEB;
 	border-radius: 6px 6px 6px 6px;
 	text-align: center;
 }
 
-.web-item-row .web-list-more .web-poll-info .web-poll-options-answer .web-poll-answer-row
+.web-item-row .web-list-detail-more .web-poll-info .web-poll-options-answer .web-poll-answer-row
 	{
 	border-bottom: 1px dotted #DED8D8;
 	overflow: auto;
 	padding: 120px;
 }
 
-.web-item-row .web-list-more .web-poll-info .web-poll-options-answer .web-poll-answer-row .web-poll-answer-row-color
+.web-item-row .web-list-detail-more .web-poll-info .web-poll-options-answer .web-poll-answer-row .web-poll-answer-row-color
 	{
 	border-radius: 11px 11px 11px 11px;
 	float: left;
 	width: 20px;
 }
 
-.web-item-row .web-list-more .web-poll-info .web-poll-options-answer .web-poll-answer-row .web-poll-answer-row-label
+.web-item-row .web-list-detail-more .web-poll-info .web-poll-options-answer .web-poll-answer-row .web-poll-answer-row-label
 	{
 	color: #9C9B99;
 	float: left;
 	width: 165px;
 }
 
-.web-item-row .web-list-more .web-poll-info .web-poll-options-answer .web-poll-answer-row .web-poll-answer-row-percent
+.web-item-row .web-list-detail-more .web-poll-info .web-poll-options-answer .web-poll-answer-row .web-poll-answer-row-percent
 	{
 	color: #70706F;
 	font-weight: bold;
     float: left;
 }
 
-.web-item-row .web-list-more .web-poll-info h2 {
+.web-item-row .web-list-detail-more .web-poll-info h2 {
 	border-bottom: 1px solid #AEACA3;
 	margin: 0 0 10px 5px;
 }
 
-.web-item-row .web-list-more .web-poll-info .web-poll-options .rownDetail {
+.web-item-row .web-list-detail-more .web-poll-info .web-poll-options .rownDetail {
 	border-bottom: 1px dotted #E0E0E0;
 	padding: 5px;
-	overflow: auto;
+	overflow: hidden;
+	text-align: left;
 }
 
 .web-item-row .web-poll-switch {
   text-shadow: 1px 1px 1px rgba(255, 255, 255, 0.5);
 }
 
-.web-item-row .web-list-more .web-poll-info .web-poll-options .rownDetail .label
+.web-item-row .web-list-detail-more .web-poll-info .web-poll-options .rownDetail .label
 	{
 	float: left;
 	font-weight: bold;
 	width: 180px;
 }
 
-.web-item-row .web-list-more .web-poll-info .web-poll-options .rownDetail .data {
+.web-item-row .web-list-detail-more .web-poll-info .web-poll-options .rownDetail .data {
   float: left;
   width: 30px;
 }
 
-.web-item-row .web-list-more .web-poll-detail-bttm-bar {
+.web-item-row .web-list-detail-more .web-poll-detail-bttm-bar {
 	background-color: #E6E6E6;
 	border: 1px solid #D6D6D6;
 	border-radius: 3px 3px 3px 3px;
 	padding: 4px;
 }
 
-.web-item-row .web-list-more .web-poll-detail-bttm-bar .web-poll-detail-info {
+.web-item-row .web-list-detail-more .web-poll-detail-bttm-bar .web-poll-detail-info {
 	float: left;
 	padding: 7px;
 	color: #1E1D1D;
     opacity:.50;
 }
 
-.web-item-row .web-list-more .web-poll-detail-bttm-bar .web-poll-detail-info > div{
+.web-item-row .web-list-detail-more .web-poll-detail-bttm-bar .web-poll-detail-info > div{
     width: 30px !important;
 }
 
-.web-item-row .web-list-more .web-poll-detail-bttm-bar .web-poll-detail-info img{
+.web-item-row .web-list-detail-more .web-poll-detail-bttm-bar .web-poll-detail-info img{
 	opacity : 0.8;
 }
 
-.web-item-row .web-list-more .web-poll-detail-bttm-bar .web-poll-detail-info>div
+.web-item-row .web-list-detail-more .web-poll-detail-bttm-bar .web-poll-detail-info>div
 	{
 
 }
 
-.web-item-row .web-list-more .web-poll-detail-bttm-bar .web-poll-detail-remove {
+.web-item-row .web-list-detail-more .web-poll-detail-bttm-bar .web-poll-detail-remove {
 	text-align: right;
 }

File enme-js/resources-enme-war/src/main/resources/resource/js/me/core/enme.js

            }
       },
 
+      /**
+       *
+       * @method
+       */
+      pollDetailContext : function(id, slug) {
+         if (id != null && slug != null) {
+                // http://jsperf.com/concat-test-jc
+                var url = this.config("contextPath");
+                url +="/poll/";
+                url += id;
+                url += "/";
+                url += slug;
+                return url;
+            } else {
+                throw new Error("poll id is required");
+           }
+      },
+
+      /**
+       *
+       * @method
+       */
       shortAmmount : function(quantity){
         if (typeof(quantity) === "number") {
               quantity = ( quantity < 0 ? 0  : quantity);

File enme-js/resources-enme-war/src/main/resources/resource/js/me/web/widget/poll/PollNavigate.js

            */
           i18nMessage : {
             detail_manage_by_account : _ENME.getMessage("detail_manage_by_account"),
-            detail_manage_today : ENME.getMessage("detail_manage_today"),
+            detail_manage_today : _ENME.getMessage("detail_manage_today"),
             detail_manage_last_week : _ENME.getMessage("detail_manage_last_week"),
             detail_manage_favorites : _ENME.getMessage("detail_manage_favorites"),
             detail_manage_scheduled : _ENME.getMessage("detail_manage_scheduled"),

File enme-js/resources-enme-war/src/main/resources/resource/js/me/web/widget/poll/PollNavigateItem.js

             var panel = new PanelWipe(this._more, null, null, 390);
             //add event on click edit link
             panel.connect(this._edit, dojo.hitch(this, this._callEditInfo));
+            if (this._preview) {
+                dojo.connect(this._preview, "onclick", dojo.hitch(this, function(event) {
+                    var url = _ENME.pollDetailContext(this.data.id, this.data.question.slug);
+                    window.open(url, '_blank');
+                    //console.log("this.", this.data);
+                }));
+            }
             panel.preWipe = dojo.hitch(this, function() {
                 dojo.addClass(this.domNode, "selected-row");
             });

File enme-js/resources-enme-war/src/main/resources/resource/js/me/web/widget/poll/templates/pollListItem.html

            <a data-dojo-attach-point="_edit">
                 ${i18nMessage.poll_admon_poll_edit}
             </a>|
-           <a>
+           <a data-dojo-attach-point="_preview">
                 ${i18nMessage.poll_admon_poll_preview}
            </a> |
            <a>
 
      </div>
      <div class="web-item-row-section web-item-row-section-options"></div>
-     <div data-dojo-attach-point="_more" id="more_${id}" class="web-list-more" style="clear: both;"></div>
+     <div data-dojo-attach-point="_more" id="more_${id}" class="web-list-detail-more" style="clear: both;"></div>
 </section>

File enme-js/resources-enme-war/src/main/resources/resource/js/me/web/widget/poll/templates/pollNavigate.html

                             ${i18nMessage.detail_manage_all}
                         </span>
                     </div>
-                    <div class="optionItem" data-dojo-attach-event="onclick:_searchByAll"
-                        type="ALL">
-                        <span>
-                            ${i18nMessage.detail_manage_published}
-                        </span>
-                    </div>
-                    <div class="optionItem" data-dojo-attach-event="onclick:_searchByAll"
-                        type="ALL">
-                        <span>
-                            ${i18nMessage.detail_manage_unpublished}
-                        </span>
-                    </div>
-                    <div class="optionItem" data-dojo-attach-event="onclick:_searchByAll"
-                        type="ALL">
-                        <span>
-                            ${i18nMessage.detail_manage_only_completed}
-                        </span>
-                    </div>
                 </div>
                 <div data-dojo-attach-point="_folder"></div>
             </div>

File enme-js/resources-enme-war/src/main/resources/resource/js/me/web/widget/stream/FrontEnd.js

             _loadItems : function() {
               var load = dojo.hitch(this, function(data) {
                     var items = data.success.frontendItems;
-                    console.log('items', items.length);
                     this.items += items.length;
                     if(items.length > 0) {
                         this._printItems(items);
                     console.debug("error", error);
                 };
                 var query = _ENME.getURLParametersAsObject();
-                 console.log('items more_max', this.more.pagination.more_max);
                 this.getURLService().get("encuestame.service.stream",
                         {
                             period : query.period || "all",

File enme-mvc/src/main/java/org/encuestame/mvc/controller/PollController.java

         addi18nProperty(model, "commons_confirm");
         addi18nProperty(model, "commons_no");
         addi18nProperty(model, "commons_yes");
+        addi18nProperty(model, "detail_manage_today");
         return "poll/list";
     }
 
         addi18nProperty(model, "social_picker_filter_selected");
         addi18nProperty(model, "publish_social");
         addi18nProperty(model, "loading_message");
+        addi18nProperty(model, "counter_zero");
         return "poll/new";
     }