Commit 7ef5f6b3953ae634517fca0f7853e3ced21b5a89

Authored by Victor Costa
2 parents 29490ac8 00fa212f

Merge branch 'AI3220_proposals' into rails3_stable

plugins/proposals_discussion/lib/proposals_discussion_plugin/proposals_list_helper.rb
1 1 module ProposalsDiscussionPlugin::ProposalsListHelper
2 2  
3 3 def more_proposals(text, holder, order, page=1)
4   - link_to '', url_for({:controller => 'proposals_discussion_plugin_public', :action => 'load_proposals', :holder_id => holder.id, :profile => profile.identifier, :order => order, :page => page })
  4 + link_to text, url_for({:controller => 'proposals_discussion_plugin_public', :action => 'load_proposals', :holder_id => holder.id, :profile => profile.identifier, :order => order, :page => page })
5 5 end
6 6  
7 7 end
... ...
plugins/proposals_discussion/lib/proposals_discussion_plugin/topic.rb
... ... @@ -24,7 +24,7 @@ class ProposalsDiscussionPlugin::Topic < Folder
24 24  
25 25 def to_html(options = {})
26 26 proc do
27   - render :file => 'content_viewer/topic'
  27 + render :file => 'content_viewer/topic', :locals => {:topic => @page}
28 28 end
29 29 end
30 30  
... ...
plugins/proposals_discussion/public/perfect-scrollbar.min.css 0 → 100644
... ... @@ -0,0 +1,5 @@
  1 +/*! perfect-scrollbar - v0.4.11
  2 +* http://noraesae.github.com/perfect-scrollbar/
  3 +* Copyright (c) 2014 Hyeonje Alex Jun; Licensed MIT */
  4 +
  5 +.ps-container .ps-scrollbar-x-rail{position:absolute;bottom:3px;height:8px;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;opacity:0;filter:alpha(opacity=0);-o-transition:background-color .2s linear,opacity .2s linear;-webkit-transition:background-color .2s linear,opacity .2s linear;-moz-transition:background-color .2s linear,opacity .2s linear;transition:background-color .2s linear,opacity .2s linear}.ps-container:hover .ps-scrollbar-x-rail,.ps-container.hover .ps-scrollbar-x-rail{opacity:.6;filter:alpha(opacity=60)}.ps-container .ps-scrollbar-x-rail:hover,.ps-container .ps-scrollbar-x-rail.hover{background-color:#eee;opacity:.9;filter:alpha(opacity=90)}.ps-container .ps-scrollbar-x-rail.in-scrolling{background-color:#eee;opacity:.9;filter:alpha(opacity=90)}.ps-container .ps-scrollbar-y-rail{position:absolute;right:3px;width:8px;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;opacity:0;filter:alpha(opacity=0);-o-transition:background-color .2s linear,opacity .2s linear;-webkit-transition:background-color .2s linear,opacity .2s linear;-moz-transition:background-color .2s linear,opacity .2s linear;transition:background-color .2s linear,opacity .2s linear}.ps-container:hover .ps-scrollbar-y-rail,.ps-container.hover .ps-scrollbar-y-rail{opacity:.6;filter:alpha(opacity=60)}.ps-container .ps-scrollbar-y-rail:hover,.ps-container .ps-scrollbar-y-rail.hover{background-color:#eee;opacity:.9;filter:alpha(opacity=90)}.ps-container .ps-scrollbar-y-rail.in-scrolling{background-color:#eee;opacity:.9;filter:alpha(opacity=90)}.ps-container .ps-scrollbar-x{position:absolute;bottom:0;height:8px;background-color:#aaa;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-o-transition:background-color .2s linear;-webkit-transition:background-color.2s linear;-moz-transition:background-color .2s linear;transition:background-color .2s linear}.ps-container.ie6 .ps-scrollbar-x{font-size:0}.ps-container .ps-scrollbar-x-rail:hover .ps-scrollbar-x,.ps-container .ps-scrollbar-x-rail.hover .ps-scrollbar-x{background-color:#999}.ps-container .ps-scrollbar-y{position:absolute;right:0;width:8px;background-color:#aaa;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-o-transition:background-color .2s linear;-webkit-transition:background-color.2s linear;-moz-transition:background-color .2s linear;transition:background-color .2s linear}.ps-container.ie6 .ps-scrollbar-y{font-size:0}.ps-container .ps-scrollbar-y-rail:hover .ps-scrollbar-y,.ps-container .ps-scrollbar-y-rail.hover .ps-scrollbar-y{background-color:#999}.ps-container.ie .ps-scrollbar-x,.ps-container.ie .ps-scrollbar-y{visibility:hidden}.ps-container.ie:hover .ps-scrollbar-x,.ps-container.ie:hover .ps-scrollbar-y,.ps-container.ie.hover .ps-scrollbar-x,.ps-container.ie.hover .ps-scrollbar-y{visibility:visible}
0 6 \ No newline at end of file
... ...
plugins/proposals_discussion/public/perfect-scrollbar.min.js 0 → 100644
... ... @@ -0,0 +1,4 @@
  1 +/*! perfect-scrollbar - v0.4.11
  2 +* http://noraesae.github.com/perfect-scrollbar/
  3 +* Copyright (c) 2014 Hyeonje Alex Jun; Licensed MIT */
  4 +(function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof exports?e(require("jquery")):e(jQuery)})(function(e){"use strict";var t={wheelSpeed:10,wheelPropagation:!1,minScrollbarLength:null,maxScrollbarLength:null,useBothWheelAxes:!1,useKeyboard:!0,suppressScrollX:!1,suppressScrollY:!1,scrollXMarginOffset:0,scrollYMarginOffset:0,includePadding:!1},o=function(){var e=0;return function(){var t=e;return e+=1,".perfect-scrollbar-"+t}}();e.fn.perfectScrollbar=function(r,n){return this.each(function(){var l=e.extend(!0,{},t),s=e(this);if("object"==typeof r?e.extend(!0,l,r):n=r,"update"===n)return s.data("perfect-scrollbar-update")&&s.data("perfect-scrollbar-update")(),s;if("destroy"===n)return s.data("perfect-scrollbar-destroy")&&s.data("perfect-scrollbar-destroy")(),s;if(s.data("perfect-scrollbar"))return s.data("perfect-scrollbar");s.addClass("ps-container");var a,c,i,u,d,p,f,h,v,b,g=e("<div class='ps-scrollbar-x-rail'></div>").appendTo(s),m=e("<div class='ps-scrollbar-y-rail'></div>").appendTo(s),w=e("<div class='ps-scrollbar-x'></div>").appendTo(g),T=e("<div class='ps-scrollbar-y'></div>").appendTo(m),L=parseInt(g.css("bottom"),10),y=L===L,I=y?null:parseInt(g.css("top"),10),S=parseInt(m.css("right"),10),x=S===S,C=x?null:parseInt(m.css("left"),10),P="rtl"===s.css("direction"),D=o(),X=parseInt(g.css("borderLeftWidth"),10)+parseInt(g.css("borderRightWidth"),10),Y=parseInt(g.css("borderTopWidth"),10)+parseInt(g.css("borderBottomWidth"),10),k=function(e,t){var o=e+t,r=u-v;b=0>o?0:o>r?r:o;var n=parseInt(b*(p-u)/(u-v),10);s.scrollTop(n),y?g.css({bottom:L-n}):g.css({top:I+n})},M=function(e,t){var o=e+t,r=i-f;h=0>o?0:o>r?r:o;var n=parseInt(h*(d-i)/(i-f),10);s.scrollLeft(n),x?m.css({right:S-n}):m.css({left:C+n})},W=function(e){return l.minScrollbarLength&&(e=Math.max(e,l.minScrollbarLength)),l.maxScrollbarLength&&(e=Math.min(e,l.maxScrollbarLength)),e},j=function(){var e={width:i,display:a?"inherit":"none"};e.left=P?s.scrollLeft()+i-d:s.scrollLeft(),y?e.bottom=L-s.scrollTop():e.top=I+s.scrollTop(),g.css(e);var t={top:s.scrollTop(),height:u,display:c?"inherit":"none"};x?t.right=P?d-s.scrollLeft()-S-T.outerWidth():S-s.scrollLeft():t.left=P?s.scrollLeft()+2*i-d-C-T.outerWidth():C+s.scrollLeft(),m.css(t),w.css({left:h,width:f-X}),T.css({top:b,height:v-Y}),a?s.addClass("ps-active-x"):s.removeClass("ps-active-x"),c?s.addClass("ps-active-y"):s.removeClass("ps-active-y")},E=function(){i=l.includePadding?s.innerWidth():s.width(),u=l.includePadding?s.innerHeight():s.height(),d=s.prop("scrollWidth"),p=s.prop("scrollHeight"),!l.suppressScrollX&&d>i+l.scrollXMarginOffset?(a=!0,f=W(parseInt(i*i/d,10)),h=parseInt(s.scrollLeft()*(i-f)/(d-i),10)):(a=!1,f=0,h=0,s.scrollLeft(0)),!l.suppressScrollY&&p>u+l.scrollYMarginOffset?(c=!0,v=W(parseInt(u*u/p,10)),b=parseInt(s.scrollTop()*(u-v)/(p-u),10)):(c=!1,v=0,b=0,s.scrollTop(0)),b>=u-v&&(b=u-v),h>=i-f&&(h=i-f),j()},O=function(){var t,o;w.bind("mousedown"+D,function(e){o=e.pageX,t=w.position().left,g.addClass("in-scrolling"),e.stopPropagation(),e.preventDefault()}),e(document).bind("mousemove"+D,function(e){g.hasClass("in-scrolling")&&(M(t,e.pageX-o),e.stopPropagation(),e.preventDefault())}),e(document).bind("mouseup"+D,function(){g.hasClass("in-scrolling")&&g.removeClass("in-scrolling")}),t=o=null},q=function(){var t,o;T.bind("mousedown"+D,function(e){o=e.pageY,t=T.position().top,m.addClass("in-scrolling"),e.stopPropagation(),e.preventDefault()}),e(document).bind("mousemove"+D,function(e){m.hasClass("in-scrolling")&&(k(t,e.pageY-o),e.stopPropagation(),e.preventDefault())}),e(document).bind("mouseup"+D,function(){m.hasClass("in-scrolling")&&m.removeClass("in-scrolling")}),t=o=null},A=function(e,t){var o=s.scrollTop();if(0===e){if(!c)return!1;if(0===o&&t>0||o>=p-u&&0>t)return!l.wheelPropagation}var r=s.scrollLeft();if(0===t){if(!a)return!1;if(0===r&&0>e||r>=d-i&&e>0)return!l.wheelPropagation}return!0},B=function(){l.wheelSpeed/=10;var e=!1;s.bind("mousewheel"+D,function(t,o,r,n){var i=t.deltaX*t.deltaFactor||r,u=t.deltaY*t.deltaFactor||n;e=!1,l.useBothWheelAxes?c&&!a?(u?s.scrollTop(s.scrollTop()-u*l.wheelSpeed):s.scrollTop(s.scrollTop()+i*l.wheelSpeed),e=!0):a&&!c&&(i?s.scrollLeft(s.scrollLeft()+i*l.wheelSpeed):s.scrollLeft(s.scrollLeft()-u*l.wheelSpeed),e=!0):(s.scrollTop(s.scrollTop()-u*l.wheelSpeed),s.scrollLeft(s.scrollLeft()+i*l.wheelSpeed)),E(),e=e||A(i,u),e&&(t.stopPropagation(),t.preventDefault())}),s.bind("MozMousePixelScroll"+D,function(t){e&&t.preventDefault()})},F=function(){var t=!1;s.bind("mouseenter"+D,function(){t=!0}),s.bind("mouseleave"+D,function(){t=!1});var o=!1;e(document).bind("keydown"+D,function(r){if(!(r.isDefaultPrevented&&r.isDefaultPrevented()||!t||e(document.activeElement).is(":input,[contenteditable]"))){var n=0,l=0;switch(r.which){case 37:n=-30;break;case 38:l=30;break;case 39:n=30;break;case 40:l=-30;break;case 33:l=90;break;case 32:case 34:l=-90;break;case 35:l=-u;break;case 36:l=u;break;default:return}s.scrollTop(s.scrollTop()-l),s.scrollLeft(s.scrollLeft()+n),o=A(n,l),o&&r.preventDefault()}})},H=function(){var e=function(e){e.stopPropagation()};T.bind("click"+D,e),m.bind("click"+D,function(e){var t=parseInt(v/2,10),o=e.pageY-m.offset().top-t,r=u-v,n=o/r;0>n?n=0:n>1&&(n=1),s.scrollTop((p-u)*n)}),w.bind("click"+D,e),g.bind("click"+D,function(e){var t=parseInt(f/2,10),o=e.pageX-g.offset().left-t,r=i-f,n=o/r;0>n?n=0:n>1&&(n=1),s.scrollLeft((d-i)*n)})},K=function(){var t=function(e,t){s.scrollTop(s.scrollTop()-t),s.scrollLeft(s.scrollLeft()-e),E()},o={},r=0,n={},l=null,a=!1;e(window).bind("touchstart"+D,function(){a=!0}),e(window).bind("touchend"+D,function(){a=!1}),s.bind("touchstart"+D,function(e){var t=e.originalEvent.targetTouches[0];o.pageX=t.pageX,o.pageY=t.pageY,r=(new Date).getTime(),null!==l&&clearInterval(l),e.stopPropagation()}),s.bind("touchmove"+D,function(e){if(!a&&1===e.originalEvent.targetTouches.length){var l=e.originalEvent.targetTouches[0],s={};s.pageX=l.pageX,s.pageY=l.pageY;var c=s.pageX-o.pageX,i=s.pageY-o.pageY;t(c,i),o=s;var u=(new Date).getTime(),d=u-r;d>0&&(n.x=c/d,n.y=i/d,r=u),e.preventDefault()}}),s.bind("touchend"+D,function(){clearInterval(l),l=setInterval(function(){return.01>Math.abs(n.x)&&.01>Math.abs(n.y)?(clearInterval(l),void 0):(t(30*n.x,30*n.y),n.x*=.8,n.y*=.8,void 0)},10)})},z=function(){s.bind("scroll"+D,function(){E()})},Q=function(){s.unbind(D),e(window).unbind(D),e(document).unbind(D),s.data("perfect-scrollbar",null),s.data("perfect-scrollbar-update",null),s.data("perfect-scrollbar-destroy",null),w.remove(),T.remove(),g.remove(),m.remove(),g=m=w=T=a=c=i=u=d=p=f=h=L=y=I=v=b=S=x=C=P=D=null},R=function(t){s.addClass("ie").addClass("ie"+t);var o=function(){var t=function(){e(this).addClass("hover")},o=function(){e(this).removeClass("hover")};s.bind("mouseenter"+D,t).bind("mouseleave"+D,o),g.bind("mouseenter"+D,t).bind("mouseleave"+D,o),m.bind("mouseenter"+D,t).bind("mouseleave"+D,o),w.bind("mouseenter"+D,t).bind("mouseleave"+D,o),T.bind("mouseenter"+D,t).bind("mouseleave"+D,o)},r=function(){j=function(){var e={left:h+s.scrollLeft(),width:f};y?e.bottom=L:e.top=I,w.css(e);var t={top:b+s.scrollTop(),height:v};x?t.right=S:t.left=C,T.css(t),w.hide().show(),T.hide().show()}};6===t&&(o(),r())},G="ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch,J=function(){var e=navigator.userAgent.toLowerCase().match(/(msie) ([\w.]+)/);e&&"msie"===e[1]&&R(parseInt(e[2],10)),E(),z(),O(),q(),H(),G&&K(),s.mousewheel&&B(),l.useKeyboard&&F(),s.data("perfect-scrollbar",s),s.data("perfect-scrollbar-update",E),s.data("perfect-scrollbar-destroy",Q)};return J(),s})}});
0 5 \ No newline at end of file
... ...
plugins/proposals_discussion/public/perfect-scrollbar.with-mousewheel.min.js 0 → 100644
... ... @@ -0,0 +1,4 @@
  1 +/*! perfect-scrollbar - v0.4.11
  2 +* http://noraesae.github.com/perfect-scrollbar/
  3 +* Copyright (c) 2014 Hyeonje Alex Jun; Licensed MIT */
  4 +(function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof exports?e(require("jquery")):e(jQuery)})(function(e){"use strict";var t={wheelSpeed:10,wheelPropagation:!1,minScrollbarLength:null,maxScrollbarLength:null,useBothWheelAxes:!1,useKeyboard:!0,suppressScrollX:!1,suppressScrollY:!1,scrollXMarginOffset:0,scrollYMarginOffset:0,includePadding:!1},o=function(){var e=0;return function(){var t=e;return e+=1,".perfect-scrollbar-"+t}}();e.fn.perfectScrollbar=function(n,r){return this.each(function(){var l=e.extend(!0,{},t),s=e(this);if("object"==typeof n?e.extend(!0,l,n):r=n,"update"===r)return s.data("perfect-scrollbar-update")&&s.data("perfect-scrollbar-update")(),s;if("destroy"===r)return s.data("perfect-scrollbar-destroy")&&s.data("perfect-scrollbar-destroy")(),s;if(s.data("perfect-scrollbar"))return s.data("perfect-scrollbar");s.addClass("ps-container");var a,i,c,u,d,p,f,h,v,b,g=e("<div class='ps-scrollbar-x-rail'></div>").appendTo(s),m=e("<div class='ps-scrollbar-y-rail'></div>").appendTo(s),w=e("<div class='ps-scrollbar-x'></div>").appendTo(g),L=e("<div class='ps-scrollbar-y'></div>").appendTo(m),T=parseInt(g.css("bottom"),10),y=T===T,x=y?null:parseInt(g.css("top"),10),S=parseInt(m.css("right"),10),I=S===S,P=I?null:parseInt(m.css("left"),10),D="rtl"===s.css("direction"),M=o(),C=parseInt(g.css("borderLeftWidth"),10)+parseInt(g.css("borderRightWidth"),10),X=parseInt(g.css("borderTopWidth"),10)+parseInt(g.css("borderBottomWidth"),10),Y=function(e,t){var o=e+t,n=u-v;b=0>o?0:o>n?n:o;var r=parseInt(b*(p-u)/(u-v),10);s.scrollTop(r),y?g.css({bottom:T-r}):g.css({top:x+r})},k=function(e,t){var o=e+t,n=c-f;h=0>o?0:o>n?n:o;var r=parseInt(h*(d-c)/(c-f),10);s.scrollLeft(r),I?m.css({right:S-r}):m.css({left:P+r})},W=function(e){return l.minScrollbarLength&&(e=Math.max(e,l.minScrollbarLength)),l.maxScrollbarLength&&(e=Math.min(e,l.maxScrollbarLength)),e},j=function(){var e={width:c,display:a?"inherit":"none"};e.left=D?s.scrollLeft()+c-d:s.scrollLeft(),y?e.bottom=T-s.scrollTop():e.top=x+s.scrollTop(),g.css(e);var t={top:s.scrollTop(),height:u,display:i?"inherit":"none"};I?t.right=D?d-s.scrollLeft()-S-L.outerWidth():S-s.scrollLeft():t.left=D?s.scrollLeft()+2*c-d-P-L.outerWidth():P+s.scrollLeft(),m.css(t),w.css({left:h,width:f-C}),L.css({top:b,height:v-X}),a?s.addClass("ps-active-x"):s.removeClass("ps-active-x"),i?s.addClass("ps-active-y"):s.removeClass("ps-active-y")},O=function(){c=l.includePadding?s.innerWidth():s.width(),u=l.includePadding?s.innerHeight():s.height(),d=s.prop("scrollWidth"),p=s.prop("scrollHeight"),!l.suppressScrollX&&d>c+l.scrollXMarginOffset?(a=!0,f=W(parseInt(c*c/d,10)),h=parseInt(s.scrollLeft()*(c-f)/(d-c),10)):(a=!1,f=0,h=0,s.scrollLeft(0)),!l.suppressScrollY&&p>u+l.scrollYMarginOffset?(i=!0,v=W(parseInt(u*u/p,10)),b=parseInt(s.scrollTop()*(u-v)/(p-u),10)):(i=!1,v=0,b=0,s.scrollTop(0)),b>=u-v&&(b=u-v),h>=c-f&&(h=c-f),j()},E=function(){var t,o;w.bind("mousedown"+M,function(e){o=e.pageX,t=w.position().left,g.addClass("in-scrolling"),e.stopPropagation(),e.preventDefault()}),e(document).bind("mousemove"+M,function(e){g.hasClass("in-scrolling")&&(k(t,e.pageX-o),e.stopPropagation(),e.preventDefault())}),e(document).bind("mouseup"+M,function(){g.hasClass("in-scrolling")&&g.removeClass("in-scrolling")}),t=o=null},H=function(){var t,o;L.bind("mousedown"+M,function(e){o=e.pageY,t=L.position().top,m.addClass("in-scrolling"),e.stopPropagation(),e.preventDefault()}),e(document).bind("mousemove"+M,function(e){m.hasClass("in-scrolling")&&(Y(t,e.pageY-o),e.stopPropagation(),e.preventDefault())}),e(document).bind("mouseup"+M,function(){m.hasClass("in-scrolling")&&m.removeClass("in-scrolling")}),t=o=null},A=function(e,t){var o=s.scrollTop();if(0===e){if(!i)return!1;if(0===o&&t>0||o>=p-u&&0>t)return!l.wheelPropagation}var n=s.scrollLeft();if(0===t){if(!a)return!1;if(0===n&&0>e||n>=d-c&&e>0)return!l.wheelPropagation}return!0},q=function(){l.wheelSpeed/=10;var e=!1;s.bind("mousewheel"+M,function(t,o,n,r){var c=t.deltaX*t.deltaFactor||n,u=t.deltaY*t.deltaFactor||r;e=!1,l.useBothWheelAxes?i&&!a?(u?s.scrollTop(s.scrollTop()-u*l.wheelSpeed):s.scrollTop(s.scrollTop()+c*l.wheelSpeed),e=!0):a&&!i&&(c?s.scrollLeft(s.scrollLeft()+c*l.wheelSpeed):s.scrollLeft(s.scrollLeft()-u*l.wheelSpeed),e=!0):(s.scrollTop(s.scrollTop()-u*l.wheelSpeed),s.scrollLeft(s.scrollLeft()+c*l.wheelSpeed)),O(),e=e||A(c,u),e&&(t.stopPropagation(),t.preventDefault())}),s.bind("MozMousePixelScroll"+M,function(t){e&&t.preventDefault()})},B=function(){var t=!1;s.bind("mouseenter"+M,function(){t=!0}),s.bind("mouseleave"+M,function(){t=!1});var o=!1;e(document).bind("keydown"+M,function(n){if(!(n.isDefaultPrevented&&n.isDefaultPrevented()||!t||e(document.activeElement).is(":input,[contenteditable]"))){var r=0,l=0;switch(n.which){case 37:r=-30;break;case 38:l=30;break;case 39:r=30;break;case 40:l=-30;break;case 33:l=90;break;case 32:case 34:l=-90;break;case 35:l=-u;break;case 36:l=u;break;default:return}s.scrollTop(s.scrollTop()-l),s.scrollLeft(s.scrollLeft()+r),o=A(r,l),o&&n.preventDefault()}})},F=function(){var e=function(e){e.stopPropagation()};L.bind("click"+M,e),m.bind("click"+M,function(e){var t=parseInt(v/2,10),o=e.pageY-m.offset().top-t,n=u-v,r=o/n;0>r?r=0:r>1&&(r=1),s.scrollTop((p-u)*r)}),w.bind("click"+M,e),g.bind("click"+M,function(e){var t=parseInt(f/2,10),o=e.pageX-g.offset().left-t,n=c-f,r=o/n;0>r?r=0:r>1&&(r=1),s.scrollLeft((d-c)*r)})},z=function(){var t=function(e,t){s.scrollTop(s.scrollTop()-t),s.scrollLeft(s.scrollLeft()-e),O()},o={},n=0,r={},l=null,a=!1;e(window).bind("touchstart"+M,function(){a=!0}),e(window).bind("touchend"+M,function(){a=!1}),s.bind("touchstart"+M,function(e){var t=e.originalEvent.targetTouches[0];o.pageX=t.pageX,o.pageY=t.pageY,n=(new Date).getTime(),null!==l&&clearInterval(l),e.stopPropagation()}),s.bind("touchmove"+M,function(e){if(!a&&1===e.originalEvent.targetTouches.length){var l=e.originalEvent.targetTouches[0],s={};s.pageX=l.pageX,s.pageY=l.pageY;var i=s.pageX-o.pageX,c=s.pageY-o.pageY;t(i,c),o=s;var u=(new Date).getTime(),d=u-n;d>0&&(r.x=i/d,r.y=c/d,n=u),e.preventDefault()}}),s.bind("touchend"+M,function(){clearInterval(l),l=setInterval(function(){return.01>Math.abs(r.x)&&.01>Math.abs(r.y)?(clearInterval(l),void 0):(t(30*r.x,30*r.y),r.x*=.8,r.y*=.8,void 0)},10)})},K=function(){s.bind("scroll"+M,function(){O()})},Q=function(){s.unbind(M),e(window).unbind(M),e(document).unbind(M),s.data("perfect-scrollbar",null),s.data("perfect-scrollbar-update",null),s.data("perfect-scrollbar-destroy",null),w.remove(),L.remove(),g.remove(),m.remove(),g=m=w=L=a=i=c=u=d=p=f=h=T=y=x=v=b=S=I=P=D=M=null},R=function(t){s.addClass("ie").addClass("ie"+t);var o=function(){var t=function(){e(this).addClass("hover")},o=function(){e(this).removeClass("hover")};s.bind("mouseenter"+M,t).bind("mouseleave"+M,o),g.bind("mouseenter"+M,t).bind("mouseleave"+M,o),m.bind("mouseenter"+M,t).bind("mouseleave"+M,o),w.bind("mouseenter"+M,t).bind("mouseleave"+M,o),L.bind("mouseenter"+M,t).bind("mouseleave"+M,o)},n=function(){j=function(){var e={left:h+s.scrollLeft(),width:f};y?e.bottom=T:e.top=x,w.css(e);var t={top:b+s.scrollTop(),height:v};I?t.right=S:t.left=P,L.css(t),w.hide().show(),L.hide().show()}};6===t&&(o(),n())},N="ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch,Z=function(){var e=navigator.userAgent.toLowerCase().match(/(msie) ([\w.]+)/);e&&"msie"===e[1]&&R(parseInt(e[2],10)),O(),K(),E(),H(),F(),N&&z(),s.mousewheel&&q(),l.useKeyboard&&B(),s.data("perfect-scrollbar",s),s.data("perfect-scrollbar-update",O),s.data("perfect-scrollbar-destroy",Q)};return Z(),s})}}),function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof exports?module.exports=e:e(jQuery)}(function(e){function t(t){var s=t||window.event,a=i.call(arguments,1),c=0,u=0,d=0,p=0;if(t=e.event.fix(s),t.type="mousewheel","detail"in s&&(d=-1*s.detail),"wheelDelta"in s&&(d=s.wheelDelta),"wheelDeltaY"in s&&(d=s.wheelDeltaY),"wheelDeltaX"in s&&(u=-1*s.wheelDeltaX),"axis"in s&&s.axis===s.HORIZONTAL_AXIS&&(u=-1*d,d=0),c=0===d?u:d,"deltaY"in s&&(d=-1*s.deltaY,c=d),"deltaX"in s&&(u=s.deltaX,0===d&&(c=-1*u)),0!==d||0!==u){if(1===s.deltaMode){var f=e.data(this,"mousewheel-line-height");c*=f,d*=f,u*=f}else if(2===s.deltaMode){var h=e.data(this,"mousewheel-page-height");c*=h,d*=h,u*=h}return p=Math.max(Math.abs(d),Math.abs(u)),(!l||l>p)&&(l=p,n(s,p)&&(l/=40)),n(s,p)&&(c/=40,u/=40,d/=40),c=Math[c>=1?"floor":"ceil"](c/l),u=Math[u>=1?"floor":"ceil"](u/l),d=Math[d>=1?"floor":"ceil"](d/l),t.deltaX=u,t.deltaY=d,t.deltaFactor=l,t.deltaMode=0,a.unshift(t,c,u,d),r&&clearTimeout(r),r=setTimeout(o,200),(e.event.dispatch||e.event.handle).apply(this,a)}}function o(){l=null}function n(e,t){return u.settings.adjustOldDeltas&&"mousewheel"===e.type&&0===t%120}var r,l,s=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],a="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],i=Array.prototype.slice;if(e.event.fixHooks)for(var c=s.length;c;)e.event.fixHooks[s[--c]]=e.event.mouseHooks;var u=e.event.special.mousewheel={version:"3.1.9",setup:function(){if(this.addEventListener)for(var o=a.length;o;)this.addEventListener(a[--o],t,!1);else this.onmousewheel=t;e.data(this,"mousewheel-line-height",u.getLineHeight(this)),e.data(this,"mousewheel-page-height",u.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var e=a.length;e;)this.removeEventListener(a[--e],t,!1);else this.onmousewheel=null},getLineHeight:function(t){return parseInt(e(t)["offsetParent"in e.fn?"offsetParent":"parent"]().css("fontSize"),10)},getPageHeight:function(t){return e(t).height()},settings:{adjustOldDeltas:!0}};e.fn.extend({mousewheel:function(e){return e?this.bind("mousewheel",e):this.trigger("mousewheel")},unmousewheel:function(e){return this.unbind("mousewheel",e)}})});
0 5 \ No newline at end of file
... ...
plugins/proposals_discussion/public/proposals_list.js
... ... @@ -13,19 +13,25 @@ jQuery(document).ready(function($) {
13 13 });
14 14  
15 15 function proposalsScroll() {
  16 + $('.topic-content').data('jscroll', null);
  17 + $('.topic-content').jscroll({
  18 + loadingHtml: '<img src="/images/loading.gif" alt="Loading" />Loading...',
  19 + nextSelector: 'div.more a'
  20 + });
16 21 $('.proposals').data('jscroll', null);
17 22 $('.proposals').jscroll({
18 23 loadingHtml: '<img src="/images/loading.gif" alt="Loading" />Loading...',
19 24 nextSelector: 'div.more a'
20 25 });
21   - $('.proposals').trigger('scroll.jscroll');
22 26 }
23   - proposalsScroll();
  27 + $('.filters .random').click();
24 28  
25 29 $('.proposals_list .filters a.order').on('ajax:success', function(event, data, status, xhr) {
26   - $('.proposals_list .filters a.order').removeClass('selected');
  30 + $(this).parents('div.proposals_list').find('.filters a.order').removeClass('selected');
27 31 $(this).addClass('selected');
28 32 $(this).parents('div.proposals_list').find('.proposals').html(data);
29 33 proposalsScroll();
30 34 });
  35 +
  36 + $('.topic-content').perfectScrollbar({suppressScrollX: true});
31 37 });
... ...
plugins/proposals_discussion/public/style.css
... ... @@ -6,13 +6,10 @@
6 6 }
7 7  
8 8 .proposal {
9   - background: rgb(236, 236, 236);
10 9 width: 100%;
11 10 min-width: 272px;
12 11 vertical-align: top;
13 12 margin: 12px 13px 12px 0;
14   - box-shadow: 5px 5px 5px -2px #ddd;
15   - height: 100px;
16 13 }
17 14  
18 15 .article-body-proposals-discussion-plugin_discussion .actions,
... ... @@ -21,8 +18,7 @@
21 18 }
22 19  
23 20 .proposal .content, .proposal .score, .proposal .topic {
24   - display: table-cell;
25   - border-right: 1px solid;
  21 + display: inline-block;
26 22 border-color: rgb(201, 201, 201);
27 23 padding: 5px;
28 24 vertical-align: middle;
... ... @@ -34,17 +30,17 @@
34 30 width: 24%;
35 31 }
36 32 .proposal .score {
37   - width: 8%;
  33 + width: 5%;
38 34 text-align: center;
39 35 }
40 36  
41 37 .proposal .content:hover, .proposal .topic:hover {
42   - background: rgba(0, 0, 0, 0.1);
  38 + background: rgb(230, 230, 230);
43 39 }
44 40  
45 41 .proposal .title {
46 42 font-weight: bold;
47   - font-size: 15px;
  43 + font-size: 12px;
48 44 }
49 45  
50 46 #article .proposal a:visited, #article .proposal a {
... ... @@ -54,19 +50,11 @@
54 50 display: inline-block;
55 51 }
56 52  
57   -#article .proposal .title a {
58   - padding: 4px 0px;
59   -}
60   -
61 53 .proposal .content {
62   - width: 68%;
  54 + width: 84%;
63 55 color: rgb(83, 83, 83);
64 56 vertical-align: top;
65   - height: 90px;
66   -}
67   -
68   -.proposal .abstract {
69   - padding-top: 4px;
  57 + position: relative;
70 58 }
71 59  
72 60 form .proposals-discussion-plugin textarea {
... ... @@ -82,9 +70,8 @@ form .proposals-discussion-plugin .body textarea {
82 70 }
83 71  
84 72 .topic-color {
85   - width: 9px;
86   - float: left;
87   - height: 100%;
  73 + width: 100%;
  74 + height: 5px;
88 75 }
89 76  
90 77 .topics .topic {
... ... @@ -100,18 +87,9 @@ form .proposals-discussion-plugin .body textarea {
100 87 height: 100%;
101 88 }
102 89  
103   -#article .topics .topic a {
104   - text-decoration: none;
105   - display: inline-block;
106   - width: 95%;
107   - height: 100%;
108   - padding-left: 5px;
109   - font-weight: bold;
110   - font-size: 14px;
111   -}
112   -
113 90 .proposals_list .filters {
114 91 float: right;
  92 + margin-top: 4px;
115 93 }
116 94 #article .proposals_list .filters a {
117 95 text-decoration: none;
... ... @@ -122,3 +100,44 @@ form .proposals-discussion-plugin .body textarea {
122 100 .proposals_list .filters a.selected {
123 101 font-weight: bold;
124 102 }
  103 +#content .proposals_list h5 {
  104 + float: left;
  105 + margin: 0;
  106 +}
  107 +.topics .topic-item {
  108 + width: 48%;
  109 + float: left;
  110 + margin: 6px;
  111 + height: 450px;
  112 + font-size: 10px;
  113 + box-shadow: 5px 5px 5px -2px #ddd;
  114 +}
  115 +
  116 +#content .topic-item h2, #article .article-body-proposals-discussion-plugin_topic h2 {
  117 + background-color: #C4C4C4;
  118 + margin: 0;
  119 +}
  120 +
  121 +#content .topic-item h2 a, #article .article-body-proposals-discussion-plugin_topic h2 a {
  122 + text-decoration: none;
  123 + padding: 10px;
  124 + display: inline-block;
  125 + width: 94%;
  126 + color: white;
  127 +}
  128 +.topic-item .topic-content, #article .article-body-proposals-discussion-plugin_topic .topic-content {
  129 + padding: 5px 7px 5px 2px;
  130 + position: relative;
  131 + height: 86%;
  132 + overflow: hidden;
  133 +}
  134 +.topic-content .description {
  135 + font-size: 11px;
  136 +}
  137 +#article-header > h1 {
  138 + display: none;
  139 +}
  140 +.proposal .content .social {
  141 + position: absolute;
  142 + top: -18px;
  143 +}
... ...
plugins/proposals_discussion/views/content_viewer/_proposal_card.html.erb
1 1 <div class="proposal">
2   - <div class="topic-color" style="background-color: <%= proposal_card.topic.color %>;"></div>
  2 + <div class="score">
  3 + <%= proposal_card.comments_count %>
  4 + </div>
3 5 <div class="content">
4 6 <div class="title">
5 7 <%= link_to proposal_card.name, proposal_card.view_url %>
... ... @@ -11,10 +13,4 @@
11 13 <%= link_to strip_tags(proposal_card.abstract), proposal_card.view_url %>
12 14 </div>
13 15 </div>
14   - <div class="score">
15   - <%= proposal_card.comments_count %>
16   - </div>
17   - <div class="topic">
18   - <%= link_to proposal_card.topic.title, proposal_card.topic.view_url %>
19   - </div>
20 16 </div>
... ...
plugins/proposals_discussion/views/content_viewer/_proposals_list.html.erb
1   -<script src="/javascripts/plugins/proposals_discussion/jquery.jscroll.min.js" type="text/javascript"></script>
2   -<%= javascript_include_tag 'plugins/proposals_discussion/proposals_list.js' %>
3   -
4 1 <% extend ProposalsDiscussionPlugin::ProposalsListHelper %>
5 2  
6   -<% private_proposals = user ? @page.proposals.private(user) : [] %>
  3 +<% private_proposals = user ? holder.proposals.private(user) : [] %>
7 4 <% unless private_proposals.empty? %>
8 5 <div class="private-proposals">
9 6 <h5><%= _('My private proposals') %></h5>
... ... @@ -13,7 +10,6 @@
13 10  
14 11 <% order ||= 'random' %>
15 12 <div class="proposals_list">
16   - <h5><%= _('Proposals') %></h5>
17 13 <div class="filters">
18 14 <% [[_('Random'), :random], [_('Aplhabetical'), :alphabetical]].each_with_index do |order, i| %>
19 15 <%= link_to order.first, url_for({:controller => 'proposals_discussion_plugin_public', :action => 'load_proposals', :holder_id => holder.id, :profile => profile.identifier, :order => order.second}), :remote => true, :class => "order #{order.second} #{i==0 ? 'selected':''}" %>
... ...
plugins/proposals_discussion/views/content_viewer/discussion.html.erb
  1 +<%= stylesheet_link_tag 'plugins/proposals_discussion/perfect-scrollbar.min.css' %>
  2 +<%= javascript_include_tag 'plugins/proposals_discussion/perfect-scrollbar.min.js' %>
  3 +<%= javascript_include_tag 'plugins/proposals_discussion/perfect-scrollbar.with-mousewheel.min.js' %>
  4 +<%= javascript_include_tag 'plugins/proposals_discussion/jquery.jscroll.min.js' %>
  5 +<%= javascript_include_tag 'plugins/proposals_discussion/proposals_list.js' %>
  6 +
1 7 <div class="description">
2 8 <%= @page.body %>
3 9 </div>
... ... @@ -10,20 +16,17 @@
10 16 </div>
11 17 <% end %>
12 18  
13   -<div class="topics">
14   - <h3><%= _('Discussion Topics') %></h3>
15   - <% @page.topics.includes(:profile).each do |topic| %>
16   - <div class="topic">
17   - <div class="topic-color" style="background-color: <%= topic.color %>;"></div>
18   - <%= link_to topic.title, topic.view_url %>
19   - </div>
  19 +<div class="actions">
  20 + <%= link_to url_for({:controller => 'proposals_discussion_plugin_myprofile', :action => 'select_topic', :parent_id => @page.id}), :class => 'button with-text icon-add' do %>
  21 + <strong><%= _("Send your proposal") %></strong>
20 22 <% end %>
21 23 </div>
22 24  
23   -<div class="actions">
24   - <%= link_to url_for({:controller => 'proposals_discussion_plugin_myprofile', :action => 'select_topic', :parent_id => @page.id}), :class => 'button with-text icon-add' do %>
25   - <strong><%= _("Send my proposal") %></strong>
  25 +<div class="topics">
  26 + <% @page.topics.includes(:profile).each do |topic| %>
  27 + <div class="topic-item" id="topic-<%= topic.id %>">
  28 + <%= render :file => 'content_viewer/topic', :locals => {:topic => topic, :list_view => true} %>
  29 + </div>
26 30 <% end %>
27 31 </div>
28 32  
29   -<%= render :partial => 'content_viewer/proposals_list', :locals => {:holder => @page} %>
... ...
plugins/proposals_discussion/views/content_viewer/topic.html.erb
  1 +<% list_view ||= false %>
  2 +
  3 +<% unless list_view %>
  4 + <%= javascript_include_tag 'plugins/proposals_discussion/jquery.jscroll.min.js' %>
  5 + <%= javascript_include_tag 'plugins/proposals_discussion/proposals_list.js' %>
  6 +<% end %>
  7 +
  8 +<div class="topic-color" style="background-color: <%= topic.color %>;"></div>
  9 +<h2><%= link_to topic.title, topic.view_url %></h2>
  10 +
  11 +<div class="topic-content">
  12 +
1 13 <div class="description">
2   - <%= @page.body %>
  14 + <%= topic.body %>
3 15 </div>
4   -<h4><%= @page.discussion.title %></h4>
5 16  
  17 +<% unless list_view %>
  18 +<h4><%= topic.discussion.title %></h4>
6 19 <div class="proposals-count">
7 20 <span class="label"><%= _('Number of Proposals: ') %></span>
8   - <span class="content"><%= @page.proposals.count %></span>
  21 + <span class="content"><%= topic.proposals.count %></span>
9 22 </div>
10 23 <div class="participants-count">
11 24 <span class="label"><%= _('Number of Participants: ') %></span>
12   - <span class="content"><%= @page.proposals_authors.count %></span>
  25 + <span class="content"><%= topic.proposals_authors.count %></span>
13 26 </div>
14 27 <div class="comments-count">
15 28 <span class="label"><%= _('Number of Comments: ') %></span>
16   - <span class="content"><%= @page.proposals_comments.count %></span>
  29 + <span class="content"><%= topic.proposals_comments.count %></span>
17 30 </div>
18 31 <div class="active-participants">
19 32 <span class="label"><%= _('Most active: ') %></span>
20 33 <span class="content">
21   - <% @page.most_active_participants.each do |author| %>
  34 + <% topic.most_active_participants.each do |author| %>
22 35 <%= link_to profile_image(author, :icon), author.url, :title => author.name %>
23 36 <% end %>
24 37 </span>
25 38 </div>
  39 +<% end %>
26 40  
  41 +<% unless list_view %>
27 42 <div class="actions">
28   - <%= link_to url_for({:controller => 'cms', :action => 'new', :type => "ProposalsDiscussionPlugin::Proposal", :parent_id => @page.id}), :class => 'button with-text icon-add' do %>
29   - <strong><%= _("Send my proposal") %></strong>
  43 + <%= link_to url_for({:controller => 'cms', :action => 'new', :type => "ProposalsDiscussionPlugin::Proposal", :parent_id => topic.id}), :class => 'button with-text icon-add' do %>
  44 + <strong><%= _("Send your proposal") %></strong>
30 45 <% end %>
31 46 </div>
  47 +<% end %>
  48 +
  49 +<%= render :partial => 'content_viewer/proposals_list', :locals => {:holder => topic} %>
32 50  
33   -<%= render :partial => 'content_viewer/proposals_list', :locals => {:holder => @page} %>
  51 +</div>
... ...