text: (window.webpackJsonp=window.webpackJsonp||[]).push([[31],{vH3e:function(t,e,s){"use strict";s.r(e);var a={data:function(){return{fields:[{name:"id",trans:"table.id",titleClass:"width-5-percent text-center",dataClass:"text-center"},{name:"user",trans:"table.username",titleClass:"text-center",dataClass:"text-center",callback:"username"},{name:"title",trans:"table.title"},{name:"__component",trans:"table.status",titleClass:"text-center",dataClass:"text-center"},{name:"created_at",trans:"table.created_at"},{name:"__actions",trans:"table.action",titleClass:"text-center",dataClass:"text-center"}],itemActions:[{name:"view-item",icon:"fas fa-eye",class:"btn btn-success"},{name:"edit-item",permission:"UPDATE_DISCUSSION",icon:"fas fa-pencil-alt",class:"btn btn-info"},{name:"delete-item",permission:"DESTROY_DISCUSSION",icon:"fas fa-trash-alt",class:"btn btn-danger"}]}},methods:{username:function(t){if(t)return t.data.name},tableActions:function(t,e){var s=this;"edit-item"==t?this.$router.push({name:"dashboard.discussion.edit",params:{id:e.id}}):"delete-item"==t?this.$http.delete("discussion/"+e.id).then((function(t){s.$message.success("You delete the discussion success!"),s.$emit("reload")})).catch((function(t){var e=t.response;s.$message.error(e.status+" : Resource "+e.statusText)})):"view-item"==t&&window.open("/discussion/"+e.id,"_blank")}}},n=s("KHd+"),i=Object(n.a)(a,(function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"row"},[s("vue-table",{attrs:{title:t.$t("page.discussions"),fields:t.fields,"api-url":"discussion","item-actions":t.itemActions,"show-paginate":""},on:{"table-action":t.tableActions}},[s("template",{slot:"buttons"},[t.checkPermission("CREATE_DISCUSSION")?s("router-link",{staticClass:"btn btn-sm btn-success",attrs:{to:{name:"dashboard.discussion.create"}}},[t._v(t._s(t.$t("page.create")))]):t._e()],1)],2)],1)}),[],!1,null,null,null);e.default=i.exports}}]);