(window.webpackJsonp=window.webpackJsonp||[]).push([[55],{585:function(t,e,a){},707:function(t,e,a){"use strict";var s=a(585);a.n(s).a},754:function(t,e,a){"use strict";a.r(e);var s=a(220),r=a(221),i=a(32),n=a(0),o=a(3).a.extend({components:{factorIcon:s.g,factorLink:s.u,dashboardGrid:r.b,dashboardGridControls:r.d,dashboardGridActions:r.c,dashboardGridFilter:r.e,dashboardPane:r.h,dashboardTableFooter:r.i,dashboardUserCard:r.j},props:{title:{type:String,default:""},list:{type:Array,default:()=>[]},meta:{type:Object,default:()=>{}},loading:{type:Boolean,default:!1}},data:()=>({selected:[],loadingAction:!1}),computed:{tabs(){return["all","published","draft","trash"].map(t=>{const e="all"==t?this.meta.total:Object(i.c)({meta:this.meta,key:t,nullKey:"draft"});return{name:Object(n.F)(t),value:"all"==t?"":t,count:e}})},statusDetails(){const{categories:{status:t={}}={}}=this.index||{};return t},postType(){return this.$route.params.postType||""},controlActions(){return[{value:"published",name:"Publish"},{value:"draft",name:"Change to Draft"},{value:"trash",name:"Move to Trash"},{value:"delete",name:"Permanently Delete"}].filter(t=>t.value!=this.$route.query.status).filter(t=>"delete"!==t.value||"delete"==t.value&&"trash"==this.$route.query.status)}},methods:{toLabel:n.F,standardDate:n.A,selectAll(t){this.selected=t?this.list.map(t=>t._id):[]},async runAction(t){this.loadingAction=!0,this.selected.length>0&&("delete"==t?confirm("Are you sure? This will permanently delete the selected posts.")&&await Object(i.d)({_ids:this.selected,postType:this.postType}):await Object(i.i)({_ids:this.selected,data:{status:t},postType:this.postType}),Object(n.h)("refresh-table")),this.loadingAction=!1},postlink:(t,e)=>Object(n.j)({postType:t,permalink:e}),setDefault:()=>!0,tableStructure:()=>[{_id:"select",width:"25px"},{_id:"title",width:"minmax(30vw, 550px)"},{_id:"author",width:"minmax(150px, 250px)"},{_id:"status",width:"minmax(100px, 200px)"},{_id:"publish-date",width:"minmax(100px, 200px)"},{_id:"updated",width:"minmax(100px, 200px)"}]}}),d=(a(707),a(531)),l=Object(d.a)(o,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("dashboard-pane",{attrs:{title:t.title}},[t._t("title",null,{slot:"title"}),t._v(" "),a("template",{slot:"nav"},[a("factor-link",{attrs:{path:"/dashboard/posts/"+t.postType+"/add-new",btn:"primary","data-test":"add-post"}},[t._v("\n      Add New\n      "),a("factor-icon",{attrs:{icon:"arrow-right"}})],1)],1),t._v(" "),a("dashboard-grid-controls",[a("dashboard-grid-actions",{attrs:{actions:t.controlActions,loading:t.loadingAction},on:{action:function(e){return t.runAction(e)}}}),t._v(" "),a("dashboard-grid-filter",{attrs:{"filter-id":"status","filter-tabs":t.tabs}})],1),t._v(" "),a("dashboard-grid",{attrs:{structure:t.tableStructure(),rows:t.list,"zero-state":7},on:{"select-all":function(e){return t.selectAll(e)}},scopedSlots:t._u([{key:"select",fn:function(e){var s=e.row;return[a("input",{directives:[{name:"model",rawName:"v-model",value:t.selected,expression:"selected"}],staticClass:"checkbox",attrs:{type:"checkbox",label:""},domProps:{value:s._id,checked:Array.isArray(t.selected)?t._i(t.selected,s._id)>-1:t.selected},on:{change:function(e){var a=t.selected,r=e.target,i=!!r.checked;if(Array.isArray(a)){var n=s._id,o=t._i(a,n);r.checked?o<0&&(t.selected=a.concat([n])):o>-1&&(t.selected=a.slice(0,o).concat(a.slice(o+1)))}else t.selected=i}}})]}},{key:"title",fn:function(e){var s=e.row;return[a("div",{staticClass:"post-title"},[a("factor-link",{attrs:{path:t.$route.path+"/edit",query:{_id:s._id}}},[t._v("\n          "+t._s(s.title)+"\n        ")]),t._v(" "),s.permalink?a("factor-link",{staticClass:"permalink",attrs:{path:t.postlink(s.postType,s.permalink,!1)}},[t._v(t._s(t.postlink(s.postType,s.permalink,!1)))]):t._e()],1)]}},{key:"author",fn:function(e){var s=e.row;return t._l(s.author,(function(t,e){return a("dashboard-user-card",{key:e,attrs:{"post-id":t}})}))}},{key:"status",fn:function(e){var a=e.row;return[t._v(t._s(t.toLabel(a.status)))]}},{key:"updated",fn:function(e){var a=e.row;return[t._v(t._s(t.standardDate(a.updatedAt)))]}},{key:"publish-date",fn:function(e){var a=e.row;return[t._v(t._s(t.standardDate(a.date)))]}}])}),t._v(" "),a("dashboard-table-footer",t._b({attrs:{meta:t.meta}},"dashboard-table-footer",t.$attrs,!1))],2)}),[],!1,null,null,null);e.default=l.exports}}]);