Files
mediacms/static/js/manage-comments.js
T

1 line
14 KiB
JavaScript
Raw Normal View History

2025-06-11 14:48:30 +03:00
!function(){"use strict";var e,t={282:function(e,t,n){var i=n(2985),a=n(9471),o=n(8713),r=n.n(o),s=n(8790),l=n(285),c=n(2855),u=n(9835),m=n(9479);function d(e,t,n){return e+"?"+t+(""===t?"":"&")+"page="+n}class f extends m.Y{constructor(e){super(e,"manage-comments"),this.state={resultsCount:null,requestUrl:s.ApiUrlContext._currentValue.manage.comments,currentPage:1,sortingArgs:"",sortBy:"add_date",ordering:"desc",refresh:0},this.getCountFunc=this.getCountFunc.bind(this),this.onTablePageChange=this.onTablePageChange.bind(this),this.onColumnSortClick=this.onColumnSortClick.bind(this),this.onItemsRemoval=this.onItemsRemoval.bind(this),this.onItemsRemovalFail=this.onItemsRemovalFail.bind(this)}onTablePageChange(e,t){this.setState({currentPage:t,requestUrl:d(s.ApiUrlContext._currentValue.manage.comments,this.state.sortingArgs,t)})}getCountFunc(e){this.setState({resultsCount:e})}onColumnSortClick(e,t){const n="sort_by="+e+"&ordering="+t;this.setState({sortBy:e,ordering:t,sortingArgs:n,requestUrl:d(s.ApiUrlContext._currentValue.manage.comments,n,this.state.currentPage)})}onItemsRemoval(e){this.setState({resultsCount:null,refresh:this.state.refresh+1,requestUrl:s.ApiUrlContext._currentValue.manage.comments},(function(){e?l.PageActions.addNotification("The comments deleted successfully.","commentsRemovalSucceed"):l.PageActions.addNotification("The comment deleted successfully.","commentRemovalSucceed")}))}onItemsRemovalFail(e){e?l.PageActions.addNotification("The comments removal failed. Please try again.","commentsRemovalFailed"):l.PageActions.addNotification("The comment removal failed. Please try again.","commentRemovalFailed")}pageContent(){return a.createElement(c.MediaListWrapper,{title:this.props.title+(null===this.state.resultsCount?"":" ("+this.state.resultsCount+")"),className:"search-results-wrap items-list-hor"},a.createElement(u.D,{pageItems:50,manageType:"comments",key:this.state.requestUrl+"["+this.state.refresh+"]",itemsCountCallback:this.getCountFunc,requestUrl:this.state.requestUrl,onPageChange:this.onTablePageChange,sortBy:this.state.sortBy,ordering:this.state.ordering,onRowsDelete:this.onItemsRemoval,onRowsDeleteFail:this.onItemsRemovalFail,onClickColumnSort:this.onColumnSortClick}))}}f.propTypes={title:r().string.isRequired},f.defaultProps={title:"Manage comments"},(0,i.C)("page-manage-comments",f)},878:function(e,t,n){n.d(t,{c:function(){return c}});var i=n(9471),a=n(8713),o=n.n(a),r=n(6387),s=n(5321),l=n(2828);function c(e){const{thumbnail:t}=(0,r.useUser)(),n={"aria-label":"Account profile photo that opens list of options and settings pages links",className:"thumbnail"};switch(e.isButton?void 0!==e.onClick&&(n.onClick=e.onClick):n.type="span",e.size){case"small":case"large":n.className+=" "+e.size+"-thumb"}return i.createElement(s.i,n,t?i.createElement("img",{src:t,alt:""}):i.createElement(l.Z,{type:"person"}))}c.propTypes={isButton:o().bool,size:o().oneOf(["small","medium","large"]),onClick:o().func},c.defaultProps={isButton:!1,size:"medium"}},2828:function(e,t,n){n.d(t,{Z:function(){return a}});var i=n(9471);const a=e=>{let{type:t}=e;return t?i.createElement("i",{className:"material-icons","data-icon":t}):null}},2901:function(e,t,n){n.d(t,{AP:function(){return r},cp:function(){return o}});var i=n(9471);const a=i.forwardRef(((e,t)=>void 0!==e.children?i.createElement("div",{ref:t,className:"popup"+(void 0!==e.className?" "+e.className:""),style:e.style},e.children):null));function o(e){return void 0!==e.children?i.createElement("div",{className:"popup-top"+(void 0!==e.className?" "+e.className:""),style:e.style},e.children):null}function r(e){return void 0!==e.children?i.createElement("div",{className:"popup-main"+(void 0!==e.className?" "+e.className:""),style:e.style},e.children):null}t.Ay=a},3135:function(e,t,n){var i=n(9471),a=n(8713),o=n.n(a),r=n(2828);function s(e){const[t,n]=(0,i.useState)(e.active);return i.createElement("div",{className:"mi-filters-toggle"},i.createElement("button",{className:t?"active":"","aria-label":"Filter",onClick:function(){n(!t),void 0!==e.onClick&&e.onClick()}},i.createE