text: /*! Copyright Novix S.A. 2019. All rights reserved. */
  (window.webpackJsonp=window.webpackJsonp||[]).push([[203],{1020:function(n,e,a){"use strict";(function(t){var s,o=a(693);void 0===(s=function(){return t.Model.extend({getComments:function(n,e,a){(0,o.send)("DashboardComment/List/",{dashboardId:n},null,e,a)},createComment:function(n,e,a){(0,o.send)("DashboardComment/Create/",n,{type:"POST"},e,a)}})}.apply(e,[]))||(n.exports=s)}).call(this,a(218))},1021:function(n,e,a){var t=a(690);function s(n){return n&&(n.__esModule?n.default:n)}n.exports=(t.default||t).template({1:function(n,e,t,o,i){var l=null!=e?e:n.nullContext||{},r=n.escapeExpression;return'        <div class="message-text">\n            <textarea name="comment_text" placeholder="Write here..." rows="3"\n                class="input-block-level form-control"></textarea>\n            <button class="btn btn-small btn-satblue btnAddComment"><i class="fa fa-check"></i>\n                '+r(s(a(688)).call(l,"add_comment",{name:"L",hash:{},data:i}))+"</button>\n            <span> "+r(s(a(688)).call(l,"_or",{name:"L",hash:{},data:i}))+' </span>\n            <span class="btn btn-small btn-satblue btnDragComment"><i class="fa fa-arrows"></i>\n                '+r(s(a(688)).call(l,"drag_to_indicator",{name:"L",hash:{},data:i}))+"</span>\n        </div>\n"},compiler:[7,">= 4.0.0"],main:function(n,e,t,o,i){var l,r=null!=e?e:n.nullContext||{};return'<div class="dashboard-comments">\n\n\n\n    <div class="box">\n        <div class="box-title">\n            <h3>\n                <i class="fa fa-comments"></i>\n                '+n.escapeExpression(s(a(688)).call(r,"comments",{name:"L",hash:{},data:i}))+'\n            </h3>\n            <div class="actions">\n                <button class="btn btn-mini content-refresh btnRefresh"><i class="fa fa-refresh"></i></button>\n                \x3c!--<button class="btn btn-mini content-slideUp"><i class="fa fa-angle-left"></i></button>--\x3e\n            </div>\n        </div>\n        <div class="box-content nopadding  message-list  ">\n\n            <ul class="messages">\n\n            </ul>\n        </div>\n\n'+(null!=(l=s(a(698)).call(r,"add_dashboardcomment",{name:"haveAccess",hash:{},fn:n.program(1,i,0),inverse:n.noop,data:i}))?l:"")+"\n    </div>\n\n\n\n</div>"},useData:!0})},1022:function(n,e,a){var t=a(690);function s(n){return n&&(n.__esModule?n.default:n)}n.exports=(t.default||t).template({1:function(n,e,t,o,i){var l,r=null!=e?e:n.nullContext||{},d=n.lambda,m=n.escapeExpression;return'\n<li class="'+(null!=(l=t.if.call(r,null!=e?e.iAm:e,{name:"if",hash:{},fn:n.program(2,i,0),inverse:n.program(4,i,0),data:i}))?l:"")+'" data-itemId="'+m(d(null!=(l=null!=e?e.extraData:e)?l.itemId:l,e))+'">\n    <div class="image">\n        \x3c!--img src="'+m(s(a(719)).call(r,{name:"baseURL",hash:{},data:i}))+"thumbs/view.ashx?img=users-"+m(d(null!=(l=null!=e?e.user:e)?l.imageUrl:l,e))+'&w=32&h=40&t=crop" width="32" height="40" /--\x3e\n    </div>\n    <span class="time">'+m(s(a(799)).call(r,null!=e?e.createdDate:e,{name:"timeAgo",hash:{},data:i}))+'</span>\n    <div class="message">\n        <span class="caret"></span>\n        <span class="name">'+m(d(null!=(l=null!=e?e.user:e)?l.fullName:l,e))+"</span>\n        <p>"+m(d(null!=e?e.comment:e,e))+"</p>\n    </div>\n</li>\n\n"},2:function(n,e,a,t,s){return"right"},4:function(n,e,a,t,s){return"left"},compiler:[7,">= 4.0.0"],main:function(n,e,a,t,s){var o;return null!=(o=a.each.call(null!=e?e:n.nullContext||{},e,{name:"each",hash:{},fn:n.program(1,s,0),inverse:n.noop,data:s}))?o:""},useData:!0})},1113:function(n,e,a){"use strict";(function(t,s){var o,i,l=a(18);o=[a(1020),a(1021),a(1022)],void 0===(i=function(n,e,a){return t.View.extend({el:s("#main"),options:void 0,render:function(n){if(this.options=n,0==this.$el.find(".dashboard-comments").length){var a=e();this.$el.append(a),this.addHandlers(this.$el.find(".dashboard-comments")),this.getComments()}else this.$el.find(".dashboard-comments").trigger("removeCommentView")},getComments:function(){var e=this;(new n).getComments(this.options.dashboardId,function(n){if(n){s.each(n,function(n,e){e.iAm=e.user.userId==__currentSession.userId,e.extraData&&""!=e.extraData&&(e.extraData=s.parseJSON(e.extraData))});var t=a(n);e.$el.find(".dashboard-comments ul").empty(),e.$el.find(".dashboard-comments ul").append(t),e.$el.find(".message-list").animate({scrollTop:e.$el.find(".dashboard-comments ul").height()},1e3),e.addItemsHandlers(e.$el.find(".dashboard-comments"))}})},removeView:function(){this.$el.find(".dashboard-comments").empty(),this.$el.find(".dashboard-comments").remove(),this.$el.find(".btnDragComment").draggable("destroy")},addComment:function(e){var a=this.$el.find(".dashboard-comments"),t=a.find("textarea[name='comment_text']").val();if(t&&""!=t){var s=this,o=new n,i={dashboardId:this.options.dashboardId,comment:t,extraData:JSON.stringify({itemId:e})};o.createComment(i,function(n){a.find("textarea[name='comment_text']").val(""),s.getComments(),(0,l.triggerNodeJsEvent)("AfterCreateDashboardComment",s.options.dashboardId)})}else a.find("textarea[name='comment_text']").focus()},addHandlers:function(n){var e=this;n.on("removeCommentView",function(){e.removeView()}),n.on("addReferencedComment",function(n,a){e.addComment(a)}),n.find(".btnAddComment").on("click",function(){e.addComment()}),n.find(".btnDragComment").draggable({scroll:!1,appendTo:e.options.parent,helper:function(n){return s('<span class="btn btn-small btn-satblue btnDragComment ui-draggable" style="z-index:1000" ><i class="fa fa-arrows-alt"></i> Drop on indicator</span>"')}}),n.find(".btnRefresh").on("click",function(){e.getComments()}),n.on("refreshExternalComments",function(n,a){a==e.options.dashboardId&&e.getComments()})},addItemsHandlers:function(n){n.find("ul.messages li").off(),n.find("ul.messages li").hover(function(){var n=s(this).attr("data-itemId");if(n&&""!=n){var e=s(this).closest(".mainTask");e.find(".pane[data-itemId='"+n+"']").addClass("commented"),e.find(".pane[data-itemId!='"+n+"']").addClass("uncommented")}},function(){s(this).closest(".mainTask").find(".pane").removeClass("commented").removeClass("uncommented")})},timeSince:function(n){var e=Math.floor((new Date-n)/1e3),a=Math.floor(e/31536e3);return a>1?a+" "+(0,l.translate)("years_ago"):(a=Math.floor(e/2592e3))>1?a+" "+(0,l.translate)("months_ago"):(a=Math.floor(e/86400))>1?a+0+(0,l.translate)("days_ago"):(a=Math.floor(e/3600))>1?a+" "+(0,l.translate)("hours_ago"):(a=Math.floor(e/60))>1?a+" "+(0,l.translate)("minutes_ago"):(0,l.translate)("right_now")}})}.apply(e,o))||(n.exports=i)}).call(this,a(218),a(1))},799:function(n,e,a){"use strict";var t=a(18);n.exports=function(n){return(0,t.timeAgo)(n)}}}]);