diff --git a/js/dist/admin.js b/js/dist/admin.js index c4e1046..ecf0998 100644 --- a/js/dist/admin.js +++ b/js/dist/admin.js @@ -1,2 +1,2 @@ -module.exports=function(e){var t={};function n(a){if(t[a])return t[a].exports;var o=t[a]={i:a,l:!1,exports:{}};return e[a].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,a){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var a=Object.create(null);if(n.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(a,o,function(t){return e[t]}.bind(null,o));return a},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=34)}([function(e,t,n){"use strict";function a(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}n.d(t,"a",(function(){return a}))},function(e,t){e.exports=flarum.core.compat["components/Button"]},function(e,t){e.exports=flarum.core.compat["components/Switch"]},function(e,t){e.exports=flarum.core.compat.extend},,function(e,t){e.exports=flarum.core.compat["components/Alert"]},function(e,t){e.exports=flarum.core.compat["components/Page"]},function(e,t){e.exports=flarum.core.compat.Component},function(e,t){e.exports=flarum.core.compat["components/Modal"]},function(e,t){e.exports=flarum.core.compat["utils/ItemList"]},function(e,t){e.exports=flarum.core.compat["utils/saveSettings"]},,function(e,t){e.exports=flarum.core.compat["components/FieldSet"]},,,,,,,,,,,,,,,,function(e,t){e.exports=flarum.core.compat["components/AdminNav"]},function(e,t){e.exports=flarum.core.compat["components/AdminLinkButton"]},function(e,t){e.exports=flarum.core.compat["components/BasicsPage"]},function(e,t){e.exports=flarum.core.compat["components/PermissionGrid"]},,,function(e,t,n){"use strict";n.r(t);var a=n(0),o=n(6),s=n.n(o),i=n(10),r=n.n(i),l=n(5),c=n.n(l),d=n(7),g=function(e){function t(){return e.apply(this,arguments)||this}return Object(a.a)(t,e),t.prototype.view=function(){return m("div",null,m("div",{className:"FlarumBlog-header"},m("div",{className:"header-container"},m("h2",null,"Flarum Blog"),m("p",null,"Adds a blog to your forum"),m("div",{className:"clear"}))),m("div",{className:"container"},m("p",null,"Welcome to the Flarum Blog settings. If you have found a bug, have feedback or an idea, join the ",m("a",{href:"https://join.slack.com/t/v17dev/shared_invite/zt-g6ky1fd3-RreB9UB~636jL~QjDGfZHg"},"V17 Development Slack workspace"),". Also, for tips & tricks, check our ",m("a",{href:"https://community.v17.dev/knowledgebase/category/flarum-blog",target:"_blank"},"knowledge base"),". Do you want to contribute? Check the ",m("a",{href:"https://github.com/v17development/flarum-blog"},"GitHub repository")),m("h2",{style:{marginTop:"25px"}},"Blog settings")))},t}(n.n(d).a),p=n(1),u=n.n(p),h=n(12),b=n.n(h),f=n(2),v=n.n(f),y=n(8),_=function(e){function t(){return e.apply(this,arguments)||this}Object(a.a)(t,e);var n=t.prototype;return n.init=function(){e.prototype.init.call(this),this.blogCategoriesOriginal=app.data.settings.blog_tags?app.data.settings.blog_tags.split("|"):[],this.blogCategories=app.data.settings.blog_tags?app.data.settings.blog_tags.split("|"):[],this.isSaving=!1,this.hasChanges=!1},n.title=function(){return"Select blog categories"},n.className=function(){return"Modal modal-dialog FlarumBlog-TagsModal"},n.content=function(){var e=this;return m("div",null,m("div",{className:"Modal-body"},m("p",null,"Please select one or more tags that are considered blog tags. ",m("a",{href:app.forum.attribute("baseUrl")+"/blog",target:"_blank"},"Visit your blog.")),m("table",{className:"FlarumBlog-TagsTable"},m("thead",null,m("th",{width:"35"}),m("th",null,"Tag name"),m("th",{width:"50"})),m("tbody",null,0===app.store.all("tags").length&&m("tr",null,m("td",{colspan:"3"},"You currently have no tags.")),app.store.all("tags").map((function(t){if(!t.parent()){var n=function(){var n=e.blogCategories.indexOf(t.id());e.hasChanges=!0,n>=0?e.blogCategories.splice(n,1):e.blogCategories.push(t.id())};return m("tr",null,m("td",null,m("i",{className:t.icon()})),m("td",{onclick:n},t.name()),m("td",null,m(v.a,{state:e.blogCategories.indexOf(t.id())>=0,onchange:n})))}}))))),m("div",{style:"padding: 25px 30px; text-align: center;"},m(u.a,{type:"submit",className:"Button Button--primary",loading:this.loading},this.hasChanges?"Save changes":"Close")))},n.onsubmit=function(e){var t=this;e.preventDefault(),this.hasChanges?(this.isSaving=!0,r()({blog_tags:this.blogCategories.join("|")}).then((function(){app.alerts.show(new c.a({type:"success",children:app.translator.trans("core.admin.basics.saved_message")})),t.hide()})).catch((function(){app.alerts.show(new c.a({type:"error",children:app.translator.trans("core.lib.error.generic_message")}))})).then((function(){t.isSaving=!1}))):this.hide()},t}(n.n(y).a),w=function(e){function t(){return e.apply(this,arguments)||this}Object(a.a)(t,e);var n=t.prototype;return n.init=function(){this.hasChanges=!1,this.isSaving=!1,this.blogCategories=app.data.settings.blog_tags?app.data.settings.blog_tags.split("|"):[],this.redirectsEnabled=app.data.settings.blog_redirects_enabled?app.data.settings.blog_redirects_enabled:"both",this.hideTagsInList=!app.data.settings.blog_hide_tags||app.data.settings.blog_hide_tags,this.allowComments=!app.data.settings.blog_allow_comments||app.data.settings.blog_allow_comments,this.requiresReviewOnPost=!!app.data.settings.blog_requires_review&&app.data.settings.blog_requires_review,this.addCategoryHierarchy=!app.data.settings.blog_category_hierarchy||app.data.settings.blog_category_hierarchy},n.view=function(){var e=this;return m("div",{className:"BasicsPage FlarumBlog"},g.component(),m("div",{className:"container"},m("div",{className:"FlarumBlog-SelectCategories"},this.blogCategories.length>=1?"You have "+this.blogCategories.length+" categories selected":"No categories selected",m(u.a,{className:"Button",onclick:function(){app.modal.show(new _)}},"Select blog categories")),b.a.component({label:"Blog",children:[v.a.component({state:1==this.allowComments,onchange:function(t){e.allowComments=t,e.hasChanges=!0},children:[m("b",null,"Allow comments"),m("div",{className:"helpText"},"By default, allow comments on blog posts. When disabled, it can be enabled individually per blog post. ",m("b",null,"Note:")," Changing this setting will not affect pre-existing blog posts.")]}),v.a.component({state:1==this.requiresReviewOnPost,onchange:function(t){e.requiresReviewOnPost=t,e.hasChanges=!0},children:[m("b",null,"Blog posts requires review"),m("div",{className:"helpText"},"When posting an article, it will not be visible directly and needs to be reviewed by a moderator.")]})]}),b.a.component({label:"Categories",children:[v.a.component({state:1==this.hideTagsInList,onchange:function(t){e.hideTagsInList=t,e.hasChanges=!0},children:[m("b",null,"Hide tags in taglist"),m("div",{className:"helpText"},"When enabled, this extension will hide the blog tags from your homepage. After changing this setting, clear the cache of your forum.")]}),v.a.component({state:1==this.addCategoryHierarchy,onchange:function(t){e.addCategoryHierarchy=t,e.hasChanges=!0},children:[m("b",null,"Show tag hierarchy"),m("div",{className:"helpText"},"Add spacing to child-categories and give the category-list a hierarchy.")]})]}),b.a.component({label:"Redirects",children:[v.a.component({state:"both"===this.redirectsEnabled||"discussions_only"===this.redirectsEnabled,onchange:function(t){t?"tags_only"===e.redirectsEnabled?e.redirectsEnabled="both":"none"===e.redirectsEnabled&&(e.redirectsEnabled="discussions_only"):"discussions_only"===e.redirectsEnabled?e.redirectsEnabled="none":e.redirectsEnabled="tags_only",e.hasChanges=!0},children:[m("b",null,"Redirect blog articles"),m("div",{className:"helpText"},"When enabled, this extension will redirect original discussion URLs to their blog URL.")]}),v.a.component({state:"both"===this.redirectsEnabled||"tags_only"===this.redirectsEnabled,onchange:function(t){t?"discussions_only"===e.redirectsEnabled?e.redirectsEnabled="both":"none"===e.redirectsEnabled&&(e.redirectsEnabled="tags_only"):"tags_only"===e.redirectsEnabled?e.redirectsEnabled="none":e.redirectsEnabled="discussions_only",e.hasChanges=!0},children:[m("b",null,"Redirect blog tags"),m("div",{className:"helpText"},"When enabled, this extension redirects blog tag URLs to the blog category URL.")]})]}),m(u.a,{loading:this.isSaving,className:"Button Button--primary",onclick:function(){return e.save()},disabled:!this.hasChanges},app.translator.trans("core.admin.basics.submit_button"))))},n.save=function(){var e=this;this.isSaving=!0,r()({blog_redirects_enabled:this.redirectsEnabled,blog_hide_tags:this.hideTagsInList,blog_requires_review:this.requiresReviewOnPost,blog_allow_comments:this.allowComments,blog_category_hierarchy:this.addCategoryHierarchy}).then((function(){e.hasChanges=!1,app.alerts.show(e.successAlert=new c.a({type:"success",children:app.translator.trans("core.admin.basics.saved_message")}))})).catch((function(){})).then((function(){e.isSaving=!1,m.redraw()}))},t}(s.a),x=n(3),C=n(28),B=n.n(C),N=n(29),O=n.n(N),S=n(30),E=n.n(S),j=n(31),P=n.n(j),T=n(9),k=n.n(T);function A(){var e=new k.a;return e.add("writeArticles",{icon:"fas fa-pencil-alt",label:"Write and edit blog articles",permission:"blog.writeArticles"},100),e.add("autoApprovePosts",{icon:"far fa-star",label:"Auto approve articles",permission:"blog.autoApprovePosts"},90),e.add("approvePreview",{icon:"far fa-thumbs-up",label:"Can approve blog articles",permission:"blog.canApprovePosts"},90),e}app.initializers.add("v17development-flarum-blog",(function(){app.routes.blog={path:"/blog",component:w.component()},Object(x.extend)(E.a.prototype,"homePageItems",(function(e){e.add("v17development-flarum-blog",{path:"/blog",label:"Blog"})})),Object(x.extend)(B.a.prototype,"items",(function(e){e.add("blog",O.a.component({href:app.route("blog"),icon:"fas fa-blog",children:"Blog",description:"Configure your forum's blog."}))})),Object(x.extend)(P.a.prototype,"permissionItems",(function(e){e.add("v17-development-blog",{label:"Blog",children:A().toArray()},80)}))}))}]); +module.exports=function(e){var t={};function n(a){if(t[a])return t[a].exports;var o=t[a]={i:a,l:!1,exports:{}};return e[a].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,a){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var a=Object.create(null);if(n.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(a,o,function(t){return e[t]}.bind(null,o));return a},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=36)}([function(e,t,n){"use strict";function a(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}n.d(t,"a",(function(){return a}))},function(e,t){e.exports=flarum.core.compat["components/Button"]},function(e,t){e.exports=flarum.core.compat["components/Switch"]},function(e,t){e.exports=flarum.core.compat.Component},function(e,t){e.exports=flarum.core.compat["utils/ItemList"]},function(e,t){e.exports=flarum.core.compat.extend},,function(e,t){e.exports=flarum.core.compat["components/Alert"]},function(e,t){e.exports=flarum.core.compat["components/Page"]},function(e,t){e.exports=flarum.core.compat["components/Modal"]},,function(e,t){e.exports=flarum.core.compat["utils/saveSettings"]},,function(e,t){e.exports=flarum.core.compat["components/FieldSet"]},,,,,,,,,,,,,,,,,function(e,t){e.exports=flarum.core.compat["components/AdminNav"]},function(e,t){e.exports=flarum.core.compat["components/AdminLinkButton"]},function(e,t){e.exports=flarum.core.compat["components/BasicsPage"]},function(e,t){e.exports=flarum.core.compat["components/PermissionGrid"]},,,function(e,t,n){"use strict";n.r(t);var a=n(0),o=n(8),s=n.n(o),i=n(11),r=n.n(i),l=n(7),c=n.n(l),d=n(3),g=function(e){function t(){return e.apply(this,arguments)||this}return Object(a.a)(t,e),t.prototype.view=function(){return m("div",null,m("div",{className:"FlarumBlog-header"},m("div",{className:"header-container"},m("h2",null,"Flarum Blog"),m("p",null,"Adds a blog to your forum"),m("div",{className:"clear"}))),m("div",{className:"container"},m("p",null,"Welcome to the Flarum Blog settings. If you have found a bug, have feedback or an idea, join the ",m("a",{href:"https://join.slack.com/t/v17dev/shared_invite/zt-g6ky1fd3-RreB9UB~636jL~QjDGfZHg"},"V17 Development Slack workspace"),". Also, for tips & tricks, check our ",m("a",{href:"https://community.v17.dev/knowledgebase/category/flarum-blog",target:"_blank"},"knowledge base"),". Do you want to contribute? Check the ",m("a",{href:"https://github.com/v17development/flarum-blog"},"GitHub repository")),m("h2",{style:{marginTop:"25px"}},"Blog settings")))},t}(n.n(d).a),p=n(1),u=n.n(p),h=n(13),b=n.n(h),f=n(2),v=n.n(f),y=n(9),_=function(e){function t(){return e.apply(this,arguments)||this}Object(a.a)(t,e);var n=t.prototype;return n.init=function(){e.prototype.init.call(this),this.blogCategoriesOriginal=app.data.settings.blog_tags?app.data.settings.blog_tags.split("|"):[],this.blogCategories=app.data.settings.blog_tags?app.data.settings.blog_tags.split("|"):[],this.isSaving=!1,this.hasChanges=!1},n.title=function(){return"Select blog categories"},n.className=function(){return"Modal modal-dialog FlarumBlog-TagsModal"},n.content=function(){var e=this;return m("div",null,m("div",{className:"Modal-body"},m("p",null,"Please select one or more tags that are considered blog tags. ",m("a",{href:app.forum.attribute("baseUrl")+"/blog",target:"_blank"},"Visit your blog.")),m("table",{className:"FlarumBlog-TagsTable"},m("thead",null,m("th",{width:"35"}),m("th",null,"Tag name"),m("th",{width:"50"})),m("tbody",null,0===app.store.all("tags").length&&m("tr",null,m("td",{colspan:"3"},"You currently have no tags.")),app.store.all("tags").map((function(t){if(!t.parent()){var n=function(){var n=e.blogCategories.indexOf(t.id());e.hasChanges=!0,n>=0?e.blogCategories.splice(n,1):e.blogCategories.push(t.id())};return m("tr",null,m("td",null,m("i",{className:t.icon()})),m("td",{onclick:n},t.name()),m("td",null,m(v.a,{state:e.blogCategories.indexOf(t.id())>=0,onchange:n})))}}))))),m("div",{style:"padding: 25px 30px; text-align: center;"},m(u.a,{type:"submit",className:"Button Button--primary",loading:this.loading},this.hasChanges?"Save changes":"Close")))},n.onsubmit=function(e){var t=this;e.preventDefault(),this.hasChanges?(this.isSaving=!0,r()({blog_tags:this.blogCategories.join("|")}).then((function(){app.alerts.show(new c.a({type:"success",children:app.translator.trans("core.admin.basics.saved_message")})),t.hide()})).catch((function(){app.alerts.show(new c.a({type:"error",children:app.translator.trans("core.lib.error.generic_message")}))})).then((function(){t.isSaving=!1}))):this.hide()},t}(n.n(y).a),w=function(e){function t(){return e.apply(this,arguments)||this}Object(a.a)(t,e);var n=t.prototype;return n.init=function(){this.hasChanges=!1,this.isSaving=!1,this.blogCategories=app.data.settings.blog_tags?app.data.settings.blog_tags.split("|"):[],this.redirectsEnabled=app.data.settings.blog_redirects_enabled?app.data.settings.blog_redirects_enabled:"both",this.hideTagsInList=!app.data.settings.blog_hide_tags||app.data.settings.blog_hide_tags,this.allowComments=!app.data.settings.blog_allow_comments||app.data.settings.blog_allow_comments,this.requiresReviewOnPost=!!app.data.settings.blog_requires_review&&app.data.settings.blog_requires_review,this.addCategoryHierarchy=!app.data.settings.blog_category_hierarchy||app.data.settings.blog_category_hierarchy},n.view=function(){var e=this;return m("div",{className:"BasicsPage FlarumBlog"},g.component(),m("div",{className:"container"},m("div",{className:"FlarumBlog-SelectCategories"},this.blogCategories.length>=1?"You have "+this.blogCategories.length+" categories selected":"No categories selected",m(u.a,{className:"Button",onclick:function(){app.modal.show(new _)}},"Select blog categories")),b.a.component({label:"Blog",children:[v.a.component({state:1==this.allowComments,onchange:function(t){e.allowComments=t,e.hasChanges=!0},children:[m("b",null,"Allow comments"),m("div",{className:"helpText"},"By default, allow comments on blog posts. When disabled, it can be enabled individually per blog post. ",m("b",null,"Note:")," Changing this setting will not affect pre-existing blog posts.")]}),v.a.component({state:1==this.requiresReviewOnPost,onchange:function(t){e.requiresReviewOnPost=t,e.hasChanges=!0},children:[m("b",null,"Blog posts requires review"),m("div",{className:"helpText"},"When posting an article, it will not be visible directly and needs to be reviewed by a moderator.")]})]}),b.a.component({label:"Categories",children:[v.a.component({state:1==this.hideTagsInList,onchange:function(t){e.hideTagsInList=t,e.hasChanges=!0},children:[m("b",null,"Hide tags in taglist"),m("div",{className:"helpText"},"When enabled, this extension will hide the blog tags from your homepage. After changing this setting, clear the cache of your forum.")]}),v.a.component({state:1==this.addCategoryHierarchy,onchange:function(t){e.addCategoryHierarchy=t,e.hasChanges=!0},children:[m("b",null,"Show tag hierarchy"),m("div",{className:"helpText"},"Add spacing to child-categories and give the category-list a hierarchy.")]})]}),b.a.component({label:"Redirects",children:[v.a.component({state:"both"===this.redirectsEnabled||"discussions_only"===this.redirectsEnabled,onchange:function(t){t?"tags_only"===e.redirectsEnabled?e.redirectsEnabled="both":"none"===e.redirectsEnabled&&(e.redirectsEnabled="discussions_only"):"discussions_only"===e.redirectsEnabled?e.redirectsEnabled="none":e.redirectsEnabled="tags_only",e.hasChanges=!0},children:[m("b",null,"Redirect blog articles"),m("div",{className:"helpText"},"When enabled, this extension will redirect original discussion URLs to their blog URL.")]}),v.a.component({state:"both"===this.redirectsEnabled||"tags_only"===this.redirectsEnabled,onchange:function(t){t?"discussions_only"===e.redirectsEnabled?e.redirectsEnabled="both":"none"===e.redirectsEnabled&&(e.redirectsEnabled="tags_only"):"tags_only"===e.redirectsEnabled?e.redirectsEnabled="none":e.redirectsEnabled="discussions_only",e.hasChanges=!0},children:[m("b",null,"Redirect blog tags"),m("div",{className:"helpText"},"When enabled, this extension redirects blog tag URLs to the blog category URL.")]})]}),m(u.a,{loading:this.isSaving,className:"Button Button--primary",onclick:function(){return e.save()},disabled:!this.hasChanges},app.translator.trans("core.admin.basics.submit_button"))))},n.save=function(){var e=this;this.isSaving=!0,r()({blog_redirects_enabled:this.redirectsEnabled,blog_hide_tags:this.hideTagsInList,blog_requires_review:this.requiresReviewOnPost,blog_allow_comments:this.allowComments,blog_category_hierarchy:this.addCategoryHierarchy}).then((function(){e.hasChanges=!1,app.alerts.show(e.successAlert=new c.a({type:"success",children:app.translator.trans("core.admin.basics.saved_message")}))})).catch((function(){})).then((function(){e.isSaving=!1,m.redraw()}))},t}(s.a),x=n(5),C=n(30),B=n.n(C),N=n(31),O=n.n(N),S=n(32),E=n.n(S),j=n(33),P=n.n(j),T=n(4),k=n.n(T);function A(){var e=new k.a;return e.add("writeArticles",{icon:"fas fa-pencil-alt",label:"Write and edit blog articles",permission:"blog.writeArticles"},100),e.add("autoApprovePosts",{icon:"far fa-star",label:"Auto approve articles",permission:"blog.autoApprovePosts"},90),e.add("approvePreview",{icon:"far fa-thumbs-up",label:"Can approve blog articles",permission:"blog.canApprovePosts"},90),e}app.initializers.add("v17development-flarum-blog",(function(){app.routes.blog={path:"/blog",component:w.component()},Object(x.extend)(E.a.prototype,"homePageItems",(function(e){e.add("v17development-flarum-blog",{path:"/blog",label:"Blog"})})),Object(x.extend)(B.a.prototype,"items",(function(e){e.add("blog",O.a.component({href:app.route("blog"),icon:"fas fa-blog",children:"Blog",description:"Configure your forum's blog."}))})),Object(x.extend)(P.a.prototype,"permissionItems",(function(e){e.add("v17-development-blog",{label:"Blog",children:A().toArray()},80)}))}))}]); //# sourceMappingURL=admin.js.map \ No newline at end of file diff --git a/js/dist/admin.js.map b/js/dist/admin.js.map index e1df7fa..28416f2 100644 --- a/js/dist/admin.js.map +++ b/js/dist/admin.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack://@v17development/flarum-blog/webpack/bootstrap","webpack://@v17development/flarum-blog/./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@v17development/flarum-blog/external \"flarum.core.compat['components/Button']\"","webpack://@v17development/flarum-blog/external \"flarum.core.compat['components/Switch']\"","webpack://@v17development/flarum-blog/external \"flarum.core.compat['extend']\"","webpack://@v17development/flarum-blog/external \"flarum.core.compat['components/Alert']\"","webpack://@v17development/flarum-blog/external \"flarum.core.compat['components/Page']\"","webpack://@v17development/flarum-blog/external \"flarum.core.compat['Component']\"","webpack://@v17development/flarum-blog/external \"flarum.core.compat['components/Modal']\"","webpack://@v17development/flarum-blog/external \"flarum.core.compat['utils/ItemList']\"","webpack://@v17development/flarum-blog/external \"flarum.core.compat['utils/saveSettings']\"","webpack://@v17development/flarum-blog/external \"flarum.core.compat['components/FieldSet']\"","webpack://@v17development/flarum-blog/external \"flarum.core.compat['components/AdminNav']\"","webpack://@v17development/flarum-blog/external \"flarum.core.compat['components/AdminLinkButton']\"","webpack://@v17development/flarum-blog/external \"flarum.core.compat['components/BasicsPage']\"","webpack://@v17development/flarum-blog/external \"flarum.core.compat['components/PermissionGrid']\"","webpack://@v17development/flarum-blog/./src/admin/Components/Header/Header.js","webpack://@v17development/flarum-blog/./src/admin/components/Modals/SelectCategoriesModal.js","webpack://@v17development/flarum-blog/./src/admin/pages/BlogSettings.js","webpack://@v17development/flarum-blog/./src/admin/addPermissions.js","webpack://@v17development/flarum-blog/./src/admin/index.js","webpack://@v17development/flarum-blog/./src/admin/addRoutes.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","_inheritsLoose","subClass","superClass","constructor","__proto__","flarum","core","compat","Header","view","className","href","target","style","marginTop","Component","SelectCategoriesModal","init","this","blogCategoriesOriginal","app","data","settings","blog_tags","split","blogCategories","isSaving","hasChanges","title","content","forum","attribute","width","store","all","length","colspan","map","obj","parent","toggleTag","currentIndex","indexOf","id","splice","push","icon","onclick","state","onchange","type","loading","onsubmit","e","preventDefault","saveSettings","join","then","alerts","show","Alert","children","translator","trans","hide","Modal","BlogSettings","redirectsEnabled","blog_redirects_enabled","hideTagsInList","blog_hide_tags","allowComments","blog_allow_comments","requiresReviewOnPost","blog_requires_review","addCategoryHierarchy","blog_category_hierarchy","component","modal","FieldSet","label","Switch","val","save","disabled","successAlert","redraw","Page","blogPermissions","items","ItemList","add","permission","initializers","routes","blog","path","extend","Basic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8B,WCLjDvE,IAAI0E,OAAOC,KAAO,CAChBC,KAAM,QACNnB,UAAWX,EAAaW,aDO1BoB,iBAAOC,IAAWtG,UAAW,iBAAiB,SAAA6F,GAC5CA,EAAME,IAAI,6BAA8B,CACtCK,KAAM,QACNhB,MAAO,YAKXiB,iBAAOE,IAASvG,UAAW,SAAS,SAAA6F,GAClCA,EAAME,IACJ,OACAS,IAAgBvB,UAAU,CACxBlE,KAAMS,IAAIiF,MAAM,QAChBvD,KAAM,cACNe,SAAU,OACVyC,YAAa,qCAMnBL,iBAAOM,IAAe3G,UAAW,mBAAmB,SAAA6F,GAClDA,EAAME,IAAI,uBAAwB,CAChCX,MAAO,OACPnB,SAAU2B,IAAkBgB,WAC3B","file":"admin.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 34);\n","export default function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n subClass.__proto__ = superClass;\n}","module.exports = flarum.core.compat['components/Button'];","module.exports = flarum.core.compat['components/Switch'];","module.exports = flarum.core.compat['extend'];","module.exports = flarum.core.compat['components/Alert'];","module.exports = flarum.core.compat['components/Page'];","module.exports = flarum.core.compat['Component'];","module.exports = flarum.core.compat['components/Modal'];","module.exports = flarum.core.compat['utils/ItemList'];","module.exports = flarum.core.compat['utils/saveSettings'];","module.exports = flarum.core.compat['components/FieldSet'];","module.exports = flarum.core.compat['components/AdminNav'];","module.exports = flarum.core.compat['components/AdminLinkButton'];","module.exports = flarum.core.compat['components/BasicsPage'];","module.exports = flarum.core.compat['components/PermissionGrid'];","import Component from 'flarum/Component';\r\n\r\nexport default class Header extends Component {\r\n view() {\r\n return (\r\n
\r\n
\r\n
\r\n

Flarum Blog

\r\n\r\n

Adds a blog to your forum

\r\n\r\n
\r\n
\r\n
\r\n
\r\n

Welcome to the Flarum Blog settings. If you have found a bug, have feedback or an idea, join the V17 Development Slack workspace. Also, for tips & tricks, check our knowledge base. Do you want to contribute? Check the GitHub repository

\r\n\r\n

Blog settings

\r\n
\r\n
\r\n )\r\n }\r\n}","import Modal from 'flarum/components/Modal';\r\nimport Button from 'flarum/components/Button';\r\nimport Alert from 'flarum/components/Alert';\r\nimport saveSettings from 'flarum/utils/saveSettings';\r\nimport Switch from 'flarum/components/Switch';\r\n\r\nexport default class SelectCategoriesModal extends Modal {\r\n init() {\r\n super.init();\r\n\r\n this.blogCategoriesOriginal = app.data.settings.blog_tags ? app.data.settings.blog_tags.split(\"|\") : [];\r\n this.blogCategories = app.data.settings.blog_tags ? app.data.settings.blog_tags.split(\"|\") : [];\r\n\r\n this.isSaving = false;\r\n this.hasChanges = false;\r\n }\r\n\r\n title() {\r\n return 'Select blog categories';\r\n }\r\n\r\n className() {\r\n return 'Modal modal-dialog FlarumBlog-TagsModal';\r\n }\r\n\r\n content() {\r\n return (\r\n
\r\n
\r\n

Please select one or more tags that are considered blog tags. Visit your blog.

\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {app.store.all('tags').length === 0 && (\r\n \r\n \r\n \r\n )}\r\n\r\n {app.store.all('tags').map(obj => {\r\n // Skip all tags who aren't main categories\r\n if(obj.parent()) {\r\n return;\r\n }\r\n\r\n // Toggle tag\r\n const toggleTag = () => {\r\n const currentIndex = this.blogCategories.indexOf(obj.id());\r\n this.hasChanges = true;\r\n\r\n // Remove tag\r\n if(currentIndex >= 0) {\r\n this.blogCategories.splice(currentIndex, 1);\r\n }else {\r\n // Add tag\r\n this.blogCategories.push(obj.id());\r\n }\r\n }\r\n\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n )\r\n })}\r\n \r\n
Tag name
You currently have no tags.
{obj.name()}\r\n = 0}\r\n onchange={toggleTag}\r\n />\r\n
\r\n
\r\n
\r\n \r\n {this.hasChanges ? 'Save changes' : 'Close'}\r\n \r\n
\r\n
\r\n );\r\n }\r\n\r\n // Close or save setting\r\n onsubmit(e) {\r\n e.preventDefault();\r\n\r\n if(!this.hasChanges) {\r\n this.hide();\r\n return;\r\n }\r\n\r\n this.isSaving = true;\r\n\r\n saveSettings({\r\n blog_tags: this.blogCategories.join('|')\r\n })\r\n .then(() => {\r\n app.alerts.show(new Alert({\r\n type: 'success', \r\n children: app.translator.trans('core.admin.basics.saved_message')\r\n }));\r\n\r\n this.hide();\r\n })\r\n .catch(() => {\r\n app.alerts.show(new Alert({\r\n type: 'error', \r\n children: app.translator.trans('core.lib.error.generic_message')\r\n }));\r\n })\r\n .then(() => {\r\n this.isSaving = false;\r\n });\r\n }\r\n}","import Page from 'flarum/components/Page';\r\nimport saveSettings from 'flarum/utils/saveSettings';\r\nimport Alert from 'flarum/components/Alert';\r\nimport Header from '../Components/Header/Header';\r\nimport Button from 'flarum/components/Button';\r\nimport FieldSet from 'flarum/components/FieldSet';\r\nimport Switch from 'flarum/components/Switch';\r\nimport SelectCategoriesModal from '../components/Modals/SelectCategoriesModal';\r\n\r\nexport default class BlogSettings extends Page {\r\n init() {\r\n // Form\r\n this.hasChanges = false;\r\n this.isSaving = false;\r\n\r\n // Settings\r\n this.blogCategories = app.data.settings.blog_tags ? app.data.settings.blog_tags.split(\"|\") : [];\r\n this.redirectsEnabled = app.data.settings.blog_redirects_enabled ? app.data.settings.blog_redirects_enabled : 'both';\r\n this.hideTagsInList = app.data.settings.blog_hide_tags ? app.data.settings.blog_hide_tags : true;\r\n this.allowComments = app.data.settings.blog_allow_comments ? app.data.settings.blog_allow_comments : true;\r\n this.requiresReviewOnPost = app.data.settings.blog_requires_review ? app.data.settings.blog_requires_review : false;\r\n this.addCategoryHierarchy = app.data.settings.blog_category_hierarchy ? app.data.settings.blog_category_hierarchy : true;\r\n }\r\n\r\n view() {\r\n return (\r\n
\r\n {Header.component()}\r\n\r\n
\r\n
\r\n {this.blogCategories.length >= 1 ? `You have ${this.blogCategories.length} categories selected` : 'No categories selected'}\r\n\r\n \r\n
\r\n\r\n {FieldSet.component({\r\n label: \"Blog\",\r\n children: [\r\n Switch.component({\r\n state: this.allowComments == true,\r\n onchange: (val) => {\r\n this.allowComments = val;\r\n this.hasChanges = true;\r\n },\r\n children: [\r\n Allow comments, \r\n
By default, allow comments on blog posts. When disabled, it can be enabled individually per blog post. Note: Changing this setting will not affect pre-existing blog posts.
,\r\n ]\r\n }),\r\n Switch.component({\r\n state: this.requiresReviewOnPost == true,\r\n onchange: (val) => {\r\n this.requiresReviewOnPost = val;\r\n this.hasChanges = true;\r\n },\r\n children: [\r\n Blog posts requires review, \r\n
When posting an article, it will not be visible directly and needs to be reviewed by a moderator.
,\r\n ]\r\n })\r\n ]\r\n })}\r\n \r\n {FieldSet.component({\r\n label: \"Categories\",\r\n children: [\r\n Switch.component({\r\n state: this.hideTagsInList == true,\r\n onchange: (val) => {\r\n this.hideTagsInList = val;\r\n this.hasChanges = true;\r\n },\r\n children: [\r\n Hide tags in taglist, \r\n
When enabled, this extension will hide the blog tags from your homepage. After changing this setting, clear the cache of your forum.
,\r\n ]\r\n }),\r\n Switch.component({\r\n state: this.addCategoryHierarchy == true,\r\n onchange: (val) => {\r\n this.addCategoryHierarchy = val;\r\n this.hasChanges = true;\r\n },\r\n children: [\r\n Show tag hierarchy, \r\n
Add spacing to child-categories and give the category-list a hierarchy.
,\r\n ]\r\n }),\r\n ]\r\n })}\r\n\r\n {FieldSet.component({\r\n label: \"Redirects\",\r\n children: [\r\n Switch.component({\r\n state: this.redirectsEnabled === 'both' || this.redirectsEnabled === 'discussions_only',\r\n onchange: (val) => {\r\n if(val) {\r\n // Add\r\n if(this.redirectsEnabled === 'tags_only') {\r\n this.redirectsEnabled = 'both';\r\n }else if(this.redirectsEnabled === 'none') {\r\n this.redirectsEnabled = 'discussions_only';\r\n }\r\n }else{\r\n if(this.redirectsEnabled === 'discussions_only') {\r\n this.redirectsEnabled = 'none';\r\n }else {\r\n this.redirectsEnabled = 'tags_only';\r\n }\r\n }\r\n\r\n this.hasChanges = true;\r\n },\r\n children: [\r\n Redirect blog articles, \r\n
When enabled, this extension will redirect original discussion URLs to their blog URL.
\r\n ],\r\n }),\r\n Switch.component({\r\n state: this.redirectsEnabled === 'both' || this.redirectsEnabled === 'tags_only',\r\n onchange: (val) => {\r\n if(val) {\r\n // Add\r\n if(this.redirectsEnabled === 'discussions_only') {\r\n this.redirectsEnabled = 'both';\r\n }else if(this.redirectsEnabled === 'none') {\r\n this.redirectsEnabled = 'tags_only';\r\n }\r\n }else{\r\n if(this.redirectsEnabled === 'tags_only') {\r\n this.redirectsEnabled = 'none';\r\n }else {\r\n this.redirectsEnabled = 'discussions_only';\r\n }\r\n }\r\n\r\n this.hasChanges = true;\r\n },\r\n children: [\r\n Redirect blog tags, \r\n
When enabled, this extension redirects blog tag URLs to the blog category URL.
\r\n ],\r\n })\r\n ]\r\n })}\r\n\r\n \r\n
\r\n
\r\n );\r\n }\r\n\r\n /**\r\n * Save data\r\n */\r\n save() {\r\n this.isSaving = true;\r\n \r\n saveSettings({\r\n blog_redirects_enabled: this.redirectsEnabled,\r\n blog_hide_tags: this.hideTagsInList,\r\n blog_requires_review: this.requiresReviewOnPost,\r\n blog_allow_comments: this.allowComments,\r\n blog_category_hierarchy: this.addCategoryHierarchy\r\n })\r\n .then(() => {\r\n this.hasChanges = false;\r\n\r\n // Show saved message\r\n app.alerts.show(this.successAlert = new Alert({type: 'success', children: app.translator.trans('core.admin.basics.saved_message')}));\r\n })\r\n .catch(() => {})\r\n .then(() => {\r\n this.isSaving = false;\r\n m.redraw();\r\n });\r\n }\r\n}","import ItemList from 'flarum/utils/ItemList';\r\n\r\nexport default function blogPermissions() {\r\n const items = new ItemList();\r\n\r\n items.add('writeArticles', {\r\n icon: 'fas fa-pencil-alt',\r\n label: \"Write and edit blog articles\",\r\n permission: 'blog.writeArticles',\r\n }, 100);\r\n\r\n items.add('autoApprovePosts', {\r\n icon: 'far fa-star',\r\n label: \"Auto approve articles\",\r\n permission: 'blog.autoApprovePosts'\r\n }, 90);\r\n\r\n items.add('approvePreview', {\r\n icon: 'far fa-thumbs-up',\r\n label: \"Can approve blog articles\",\r\n permission: 'blog.canApprovePosts'\r\n }, 90);\r\n \r\n return items;\r\n}\r\n","import addRoutes from './addRoutes';\r\nimport { extend } from 'flarum/extend';\r\nimport AdminNav from 'flarum/components/AdminNav';\r\nimport AdminLinkButton from 'flarum/components/AdminLinkButton';\r\nimport BasicsPage from 'flarum/components/BasicsPage';\r\nimport PermissionGrid from 'flarum/components/PermissionGrid';\r\nimport blogPermissions from './addPermissions';\r\n// import { knowledgeBasePermissions, supportTicketPermissions } from './addPermissions';\r\n\r\napp.initializers.add('v17development-flarum-blog', () => {\r\n addRoutes();\r\n\r\n // Add home page option\r\n extend(BasicsPage.prototype, 'homePageItems', items => {\r\n items.add('v17development-flarum-blog', {\r\n path: '/blog',\r\n label: 'Blog',\r\n });\r\n });\r\n\r\n // Add Admin navigation\r\n extend(AdminNav.prototype, 'items', items => {\r\n items.add(\r\n 'blog',\r\n AdminLinkButton.component({\r\n href: app.route('blog'),\r\n icon: 'fas fa-blog',\r\n children: 'Blog',\r\n description: 'Configure your forum\\'s blog.',\r\n })\r\n );\r\n });\r\n\r\n // Add addPermissions\r\n extend(PermissionGrid.prototype, 'permissionItems', items => {\r\n items.add('v17-development-blog', {\r\n label: \"Blog\",\r\n children: blogPermissions().toArray()\r\n }, 80);\r\n });\r\n});","import BlogSettings from './pages/BlogSettings';\r\n\r\nexport default function() {\r\n // Main page\r\n app.routes.blog = {\r\n path: '/blog',\r\n component: BlogSettings.component()\r\n };\r\n};"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack://@v17development/flarum-blog/webpack/bootstrap","webpack://@v17development/flarum-blog/./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@v17development/flarum-blog/external \"flarum.core.compat['components/Button']\"","webpack://@v17development/flarum-blog/external \"flarum.core.compat['components/Switch']\"","webpack://@v17development/flarum-blog/external \"flarum.core.compat['Component']\"","webpack://@v17development/flarum-blog/external \"flarum.core.compat['utils/ItemList']\"","webpack://@v17development/flarum-blog/external \"flarum.core.compat['extend']\"","webpack://@v17development/flarum-blog/external \"flarum.core.compat['components/Alert']\"","webpack://@v17development/flarum-blog/external \"flarum.core.compat['components/Page']\"","webpack://@v17development/flarum-blog/external \"flarum.core.compat['components/Modal']\"","webpack://@v17development/flarum-blog/external \"flarum.core.compat['utils/saveSettings']\"","webpack://@v17development/flarum-blog/external \"flarum.core.compat['components/FieldSet']\"","webpack://@v17development/flarum-blog/external \"flarum.core.compat['components/AdminNav']\"","webpack://@v17development/flarum-blog/external \"flarum.core.compat['components/AdminLinkButton']\"","webpack://@v17development/flarum-blog/external \"flarum.core.compat['components/BasicsPage']\"","webpack://@v17development/flarum-blog/external \"flarum.core.compat['components/PermissionGrid']\"","webpack://@v17development/flarum-blog/./src/admin/Components/Header/Header.js","webpack://@v17development/flarum-blog/./src/admin/components/Modals/SelectCategoriesModal.js","webpack://@v17development/flarum-blog/./src/admin/pages/BlogSettings.js","webpack://@v17development/flarum-blog/./src/admin/addPermissions.js","webpack://@v17development/flarum-blog/./src/admin/index.js","webpack://@v17development/flarum-blog/./src/admin/addRoutes.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","_inheritsLoose","subClass","superClass","constructor","__proto__","flarum","core","compat","Header","view","className","href","target","style","marginTop","Component","SelectCategoriesModal","init","this","blogCategoriesOriginal","app","data","settings","blog_tags","split","blogCategories","isSaving","hasChanges","title","content","forum","attribute","width","store","all","length","colspan","map","obj","parent","toggleTag","currentIndex","indexOf","id","splice","push","icon","onclick","state","onchange","type","loading","onsubmit","e","preventDefault","saveSettings","join","then","alerts","show","Alert","children","translator","trans","hide","Modal","BlogSettings","redirectsEnabled","blog_redirects_enabled","hideTagsInList","blog_hide_tags","allowComments","blog_allow_comments","requiresReviewOnPost","blog_requires_review","addCategoryHierarchy","blog_category_hierarchy","component","modal","FieldSet","label","Switch","val","save","disabled","successAlert","redraw","Page","blogPermissions","items","ItemList","add","permission","initializers","routes","blog","path","extend","BasicsPage","AdminNav","AdminLinkButton","route","description","PermissionGrid","toArray"],"mappings":"2BACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QA0Df,OArDAF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxBC,EAAoBU,EAAI,SAASR,EAASS,EAAMC,GAC3CZ,EAAoBa,EAAEX,EAASS,IAClCG,OAAOC,eAAeb,EAASS,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEZ,EAAoBkB,EAAI,SAAShB,GACX,oBAAXiB,QAA0BA,OAAOC,aAC1CN,OAAOC,eAAeb,EAASiB,OAAOC,YAAa,CAAEC,MAAO,WAE7DP,OAAOC,eAAeb,EAAS,aAAc,CAAEmB,OAAO,KAQvDrB,EAAoBsB,EAAI,SAASD,EAAOE,GAEvC,GADU,EAAPA,IAAUF,EAAQrB,EAAoBqB,IAC/B,EAAPE,EAAU,OAAOF,EACpB,GAAW,EAAPE,GAA8B,iBAAVF,GA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M,yCAXnG,OAaS,eACNN,MAAK,WACJ,EAAK/B,UAAW,EAChBtD,EAAEkH,a,GApLgCC,K,2FCP3B,SAASC,IACtB,IAAMC,EAAQ,IAAIC,IAoBlB,OAlBAD,EAAME,IAAI,gBAAiB,CACzB7C,KAAM,oBACNkC,MAAO,+BACPY,WAAY,sBACX,KAEHH,EAAME,IAAI,mBAAoB,CAC5B7C,KAAM,cACNkC,MAAO,wBACPY,WAAY,yBACX,IAEHH,EAAME,IAAI,iBAAkB,CAC1B7C,KAAM,mBACNkC,MAAO,4BACPY,WAAY,wBACX,IAEIH,ECdTrE,IAAIyE,aAAaF,IAAI,8BAA8B,WCLjDvE,IAAI0E,OAAOC,KAAO,CAChBC,KAAM,QACNnB,UAAWX,EAAaW,aDO1BoB,iBAAOC,IAAWtG,UAAW,iBAAiB,SAAA6F,GAC5CA,EAAME,IAAI,6BAA8B,CACtCK,KAAM,QACNhB,MAAO,YAKXiB,iBAAOE,IAASvG,UAAW,SAAS,SAAA6F,GAClCA,EAAME,IACJ,OACAS,IAAgBvB,UAAU,CACxBlE,KAAMS,IAAIiF,MAAM,QAChBvD,KAAM,cACNe,SAAU,OACVyC,YAAa,qCAMnBL,iBAAOM,IAAe3G,UAAW,mBAAmB,SAAA6F,GAClDA,EAAME,IAAI,uBAAwB,CAChCX,MAAO,OACPnB,SAAU2B,IAAkBgB,WAC3B","file":"admin.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 36);\n","export default function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n subClass.__proto__ = superClass;\n}","module.exports = flarum.core.compat['components/Button'];","module.exports = flarum.core.compat['components/Switch'];","module.exports = flarum.core.compat['Component'];","module.exports = flarum.core.compat['utils/ItemList'];","module.exports = flarum.core.compat['extend'];","module.exports = flarum.core.compat['components/Alert'];","module.exports = flarum.core.compat['components/Page'];","module.exports = flarum.core.compat['components/Modal'];","module.exports = flarum.core.compat['utils/saveSettings'];","module.exports = flarum.core.compat['components/FieldSet'];","module.exports = flarum.core.compat['components/AdminNav'];","module.exports = flarum.core.compat['components/AdminLinkButton'];","module.exports = flarum.core.compat['components/BasicsPage'];","module.exports = flarum.core.compat['components/PermissionGrid'];","import Component from 'flarum/Component';\r\n\r\nexport default class Header extends Component {\r\n view() {\r\n return (\r\n
\r\n
\r\n
\r\n

Flarum Blog

\r\n\r\n

Adds a blog to your forum

\r\n\r\n
\r\n
\r\n
\r\n
\r\n

Welcome to the Flarum Blog settings. If you have found a bug, have feedback or an idea, join the V17 Development Slack workspace. Also, for tips & tricks, check our knowledge base. Do you want to contribute? Check the GitHub repository

\r\n\r\n

Blog settings

\r\n
\r\n
\r\n )\r\n }\r\n}","import Modal from 'flarum/components/Modal';\r\nimport Button from 'flarum/components/Button';\r\nimport Alert from 'flarum/components/Alert';\r\nimport saveSettings from 'flarum/utils/saveSettings';\r\nimport Switch from 'flarum/components/Switch';\r\n\r\nexport default class SelectCategoriesModal extends Modal {\r\n init() {\r\n super.init();\r\n\r\n this.blogCategoriesOriginal = app.data.settings.blog_tags ? app.data.settings.blog_tags.split(\"|\") : [];\r\n this.blogCategories = app.data.settings.blog_tags ? app.data.settings.blog_tags.split(\"|\") : [];\r\n\r\n this.isSaving = false;\r\n this.hasChanges = false;\r\n }\r\n\r\n title() {\r\n return 'Select blog categories';\r\n }\r\n\r\n className() {\r\n return 'Modal modal-dialog FlarumBlog-TagsModal';\r\n }\r\n\r\n content() {\r\n return (\r\n
\r\n
\r\n

Please select one or more tags that are considered blog tags. Visit your blog.

\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {app.store.all('tags').length === 0 && (\r\n \r\n \r\n \r\n )}\r\n\r\n {app.store.all('tags').map(obj => {\r\n // Skip all tags who aren't main categories\r\n if(obj.parent()) {\r\n return;\r\n }\r\n\r\n // Toggle tag\r\n const toggleTag = () => {\r\n const currentIndex = this.blogCategories.indexOf(obj.id());\r\n this.hasChanges = true;\r\n\r\n // Remove tag\r\n if(currentIndex >= 0) {\r\n this.blogCategories.splice(currentIndex, 1);\r\n }else {\r\n // Add tag\r\n this.blogCategories.push(obj.id());\r\n }\r\n }\r\n\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n )\r\n })}\r\n \r\n
Tag name
You currently have no tags.
{obj.name()}\r\n = 0}\r\n onchange={toggleTag}\r\n />\r\n
\r\n
\r\n
\r\n \r\n {this.hasChanges ? 'Save changes' : 'Close'}\r\n \r\n
\r\n
\r\n );\r\n }\r\n\r\n // Close or save setting\r\n onsubmit(e) {\r\n e.preventDefault();\r\n\r\n if(!this.hasChanges) {\r\n this.hide();\r\n return;\r\n }\r\n\r\n this.isSaving = true;\r\n\r\n saveSettings({\r\n blog_tags: this.blogCategories.join('|')\r\n })\r\n .then(() => {\r\n app.alerts.show(new Alert({\r\n type: 'success', \r\n children: app.translator.trans('core.admin.basics.saved_message')\r\n }));\r\n\r\n this.hide();\r\n })\r\n .catch(() => {\r\n app.alerts.show(new Alert({\r\n type: 'error', \r\n children: app.translator.trans('core.lib.error.generic_message')\r\n }));\r\n })\r\n .then(() => {\r\n this.isSaving = false;\r\n });\r\n }\r\n}","import Page from 'flarum/components/Page';\r\nimport saveSettings from 'flarum/utils/saveSettings';\r\nimport Alert from 'flarum/components/Alert';\r\nimport Header from '../Components/Header/Header';\r\nimport Button from 'flarum/components/Button';\r\nimport FieldSet from 'flarum/components/FieldSet';\r\nimport Switch from 'flarum/components/Switch';\r\nimport SelectCategoriesModal from '../components/Modals/SelectCategoriesModal';\r\n\r\nexport default class BlogSettings extends Page {\r\n init() {\r\n // Form\r\n this.hasChanges = false;\r\n this.isSaving = false;\r\n\r\n // Settings\r\n this.blogCategories = app.data.settings.blog_tags ? app.data.settings.blog_tags.split(\"|\") : [];\r\n this.redirectsEnabled = app.data.settings.blog_redirects_enabled ? app.data.settings.blog_redirects_enabled : 'both';\r\n this.hideTagsInList = app.data.settings.blog_hide_tags ? app.data.settings.blog_hide_tags : true;\r\n this.allowComments = app.data.settings.blog_allow_comments ? app.data.settings.blog_allow_comments : true;\r\n this.requiresReviewOnPost = app.data.settings.blog_requires_review ? app.data.settings.blog_requires_review : false;\r\n this.addCategoryHierarchy = app.data.settings.blog_category_hierarchy ? app.data.settings.blog_category_hierarchy : true;\r\n }\r\n\r\n view() {\r\n return (\r\n
\r\n {Header.component()}\r\n\r\n
\r\n
\r\n {this.blogCategories.length >= 1 ? `You have ${this.blogCategories.length} categories selected` : 'No categories selected'}\r\n\r\n \r\n
\r\n\r\n {FieldSet.component({\r\n label: \"Blog\",\r\n children: [\r\n Switch.component({\r\n state: this.allowComments == true,\r\n onchange: (val) => {\r\n this.allowComments = val;\r\n this.hasChanges = true;\r\n },\r\n children: [\r\n Allow comments, \r\n
By default, allow comments on blog posts. When disabled, it can be enabled individually per blog post. Note: Changing this setting will not affect pre-existing blog posts.
,\r\n ]\r\n }),\r\n Switch.component({\r\n state: this.requiresReviewOnPost == true,\r\n onchange: (val) => {\r\n this.requiresReviewOnPost = val;\r\n this.hasChanges = true;\r\n },\r\n children: [\r\n Blog posts requires review, \r\n
When posting an article, it will not be visible directly and needs to be reviewed by a moderator.
,\r\n ]\r\n })\r\n ]\r\n })}\r\n \r\n {FieldSet.component({\r\n label: \"Categories\",\r\n children: [\r\n Switch.component({\r\n state: this.hideTagsInList == true,\r\n onchange: (val) => {\r\n this.hideTagsInList = val;\r\n this.hasChanges = true;\r\n },\r\n children: [\r\n Hide tags in taglist, \r\n
When enabled, this extension will hide the blog tags from your homepage. After changing this setting, clear the cache of your forum.
,\r\n ]\r\n }),\r\n Switch.component({\r\n state: this.addCategoryHierarchy == true,\r\n onchange: (val) => {\r\n this.addCategoryHierarchy = val;\r\n this.hasChanges = true;\r\n },\r\n children: [\r\n Show tag hierarchy, \r\n
Add spacing to child-categories and give the category-list a hierarchy.
,\r\n ]\r\n }),\r\n ]\r\n })}\r\n\r\n {FieldSet.component({\r\n label: \"Redirects\",\r\n children: [\r\n Switch.component({\r\n state: this.redirectsEnabled === 'both' || this.redirectsEnabled === 'discussions_only',\r\n onchange: (val) => {\r\n if(val) {\r\n // Add\r\n if(this.redirectsEnabled === 'tags_only') {\r\n this.redirectsEnabled = 'both';\r\n }else if(this.redirectsEnabled === 'none') {\r\n this.redirectsEnabled = 'discussions_only';\r\n }\r\n }else{\r\n if(this.redirectsEnabled === 'discussions_only') {\r\n this.redirectsEnabled = 'none';\r\n }else {\r\n this.redirectsEnabled = 'tags_only';\r\n }\r\n }\r\n\r\n this.hasChanges = true;\r\n },\r\n children: [\r\n Redirect blog articles, \r\n
When enabled, this extension will redirect original discussion URLs to their blog URL.
\r\n ],\r\n }),\r\n Switch.component({\r\n state: this.redirectsEnabled === 'both' || this.redirectsEnabled === 'tags_only',\r\n onchange: (val) => {\r\n if(val) {\r\n // Add\r\n if(this.redirectsEnabled === 'discussions_only') {\r\n this.redirectsEnabled = 'both';\r\n }else if(this.redirectsEnabled === 'none') {\r\n this.redirectsEnabled = 'tags_only';\r\n }\r\n }else{\r\n if(this.redirectsEnabled === 'tags_only') {\r\n this.redirectsEnabled = 'none';\r\n }else {\r\n this.redirectsEnabled = 'discussions_only';\r\n }\r\n }\r\n\r\n this.hasChanges = true;\r\n },\r\n children: [\r\n Redirect blog tags, \r\n
When enabled, this extension redirects blog tag URLs to the blog category URL.
\r\n ],\r\n })\r\n ]\r\n })}\r\n\r\n \r\n
\r\n
\r\n );\r\n }\r\n\r\n /**\r\n * Save data\r\n */\r\n save() {\r\n this.isSaving = true;\r\n \r\n saveSettings({\r\n blog_redirects_enabled: this.redirectsEnabled,\r\n blog_hide_tags: this.hideTagsInList,\r\n blog_requires_review: this.requiresReviewOnPost,\r\n blog_allow_comments: this.allowComments,\r\n blog_category_hierarchy: this.addCategoryHierarchy\r\n })\r\n .then(() => {\r\n this.hasChanges = false;\r\n\r\n // Show saved message\r\n app.alerts.show(this.successAlert = new Alert({type: 'success', children: app.translator.trans('core.admin.basics.saved_message')}));\r\n })\r\n .catch(() => {})\r\n .then(() => {\r\n this.isSaving = false;\r\n m.redraw();\r\n });\r\n }\r\n}","import ItemList from 'flarum/utils/ItemList';\r\n\r\nexport default function blogPermissions() {\r\n const items = new ItemList();\r\n\r\n items.add('writeArticles', {\r\n icon: 'fas fa-pencil-alt',\r\n label: \"Write and edit blog articles\",\r\n permission: 'blog.writeArticles',\r\n }, 100);\r\n\r\n items.add('autoApprovePosts', {\r\n icon: 'far fa-star',\r\n label: \"Auto approve articles\",\r\n permission: 'blog.autoApprovePosts'\r\n }, 90);\r\n\r\n items.add('approvePreview', {\r\n icon: 'far fa-thumbs-up',\r\n label: \"Can approve blog articles\",\r\n permission: 'blog.canApprovePosts'\r\n }, 90);\r\n \r\n return items;\r\n}\r\n","import addRoutes from './addRoutes';\r\nimport { extend } from 'flarum/extend';\r\nimport AdminNav from 'flarum/components/AdminNav';\r\nimport AdminLinkButton from 'flarum/components/AdminLinkButton';\r\nimport BasicsPage from 'flarum/components/BasicsPage';\r\nimport PermissionGrid from 'flarum/components/PermissionGrid';\r\nimport blogPermissions from './addPermissions';\r\n// import { knowledgeBasePermissions, supportTicketPermissions } from './addPermissions';\r\n\r\napp.initializers.add('v17development-flarum-blog', () => {\r\n addRoutes();\r\n\r\n // Add home page option\r\n extend(BasicsPage.prototype, 'homePageItems', items => {\r\n items.add('v17development-flarum-blog', {\r\n path: '/blog',\r\n label: 'Blog',\r\n });\r\n });\r\n\r\n // Add Admin navigation\r\n extend(AdminNav.prototype, 'items', items => {\r\n items.add(\r\n 'blog',\r\n AdminLinkButton.component({\r\n href: app.route('blog'),\r\n icon: 'fas fa-blog',\r\n children: 'Blog',\r\n description: 'Configure your forum\\'s blog.',\r\n })\r\n );\r\n });\r\n\r\n // Add addPermissions\r\n extend(PermissionGrid.prototype, 'permissionItems', items => {\r\n items.add('v17-development-blog', {\r\n label: \"Blog\",\r\n children: blogPermissions().toArray()\r\n }, 80);\r\n });\r\n});","import BlogSettings from './pages/BlogSettings';\r\n\r\nexport default function() {\r\n // Main page\r\n app.routes.blog = {\r\n path: '/blog',\r\n component: BlogSettings.component()\r\n };\r\n};"],"sourceRoot":""} \ No newline at end of file diff --git a/js/dist/forum.js b/js/dist/forum.js index cb932c5..4c19d71 100644 --- a/js/dist/forum.js +++ b/js/dist/forum.js @@ -1,2 +1,2 @@ -module.exports=function(t){var e={};function a(o){if(e[o])return e[o].exports;var i=e[o]={i:o,l:!1,exports:{}};return t[o].call(i.exports,i,i.exports,a),i.l=!0,i.exports}return a.m=t,a.c=e,a.d=function(t,e,o){a.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},a.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},a.t=function(t,e){if(1&e&&(t=a(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(a.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)a.d(o,i,function(e){return t[e]}.bind(null,i));return o},a.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return a.d(e,"a",e),e},a.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},a.p="",a(a.s=33)}([function(t,e,a){"use strict";function o(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}a.d(e,"a",(function(){return o}))},function(t,e){t.exports=flarum.core.compat["components/Button"]},function(t,e){t.exports=flarum.core.compat["components/Switch"]},function(t,e){t.exports=flarum.core.compat.extend},function(t,e){t.exports=flarum.core.compat.Model},function(t,e){t.exports=flarum.core.compat["components/Alert"]},function(t,e){t.exports=flarum.core.compat["components/Page"]},function(t,e){t.exports=flarum.core.compat.Component},function(t,e){t.exports=flarum.core.compat["components/Modal"]},function(t,e){t.exports=flarum.core.compat["utils/ItemList"]},,function(t,e){t.exports=flarum.core.compat["utils/DiscussionControls"]},,function(t,e){t.exports=flarum.core.compat["helpers/humanTime"]},function(t,e){t.exports=flarum.core.compat["helpers/avatar"]},function(t,e){t.exports=flarum.core.compat["components/PostStream"]},function(t,e){t.exports=flarum.core.compat["tags/components/TagDiscussionModal"]},function(t,e){t.exports=flarum.core.compat["components/Dropdown"]},function(t,e){t.exports=flarum.core.compat["components/EditPostComposer"]},function(t,e){t.exports=flarum.core.compat["utils/extractText"]},function(t,e){t.exports=flarum.core.compat["utils/string"]},function(t,e){t.exports=flarum.core.compat["models/Discussion"]},function(t,e){t.exports=flarum.core.compat["components/DiscussionComposer"]},function(t,e){t.exports=flarum.core.compat["components/IndexPage"]},function(t,e){t.exports=flarum.core.compat["components/DiscussionPage"]},function(t,e){t.exports=flarum.core.compat["components/LoadingIndicator"]},function(t,e){t.exports=flarum.core.compat["utils/mixin"]},function(t,e){t.exports=flarum.core.compat["tags/components/TagsPage"]},,,,,function(t,e){t.exports=flarum.core.compat["components/ReplyComposer"]},function(t,e,a){"use strict";a.r(e);var o=a(0),i=a(6),s=a.n(i),r=a(14),l=a.n(r),n=a(1),u=a.n(n),c=(a(32),a(15)),p=a.n(c),d=a(7),g=a.n(d),f=function(t){function e(){return t.apply(this,arguments)||this}Object(o.a)(e,t);var a=e.prototype;return a.init=function(){this.blogCategories=app.forum.attribute("blogTags")},a.view=function(){var t=this;return m("div",{className:"BlogCategories"},m("h3",null,app.translator.trans("v17development-flarum-blog.forum.categories")),this.blogCategories&&this.blogCategories.map((function(e){var a=app.store.getById("tags",e);if(!a)return null;var o=[];return o.push(t.categoryItem(a)),app.store.all("tags").forEach((function(e){e.isChild()&&e.parent().id()===a.id()&&o.push(t.categoryItem(e))})),o})))},a.categoryItem=function(t){return m("a",{href:app.route("blogCategory",{slug:t.slug()}),className:"BlogCategories-item BlogCategories-item-"+t.id()+" "+(t.isChild()&&1==app.forum.attribute("blogCategoryHierarchy")?"BlogCategories-item-child":""),config:m.route},m("span",{className:""===t.icon()?"BlogCategories-item-colored":"",style:{backgroundColor:""===t.icon()?t.color():null}},m("i",{className:t.icon()})),t.name())},e}(g.a),h=a(16),v=a.n(h),b=a(11),y=a.n(b),N=a(5),B=a.n(N),w=a(17),A=a.n(w),F=a(8),x=a.n(F),P=a(9),M=a.n(P),_=a(2),C=a.n(_),I=function(t){function e(){return t.apply(this,arguments)||this}Object(o.a)(e,t);var a=e.prototype;return a.init=function(){t.prototype.init.call(this),this.isNew=!this.props.article.blogMeta(),this.meta=this.props.article.blogMeta()?this.props.article.blogMeta():app.store.createRecord("blogMeta"),this.summary=m.prop(this.meta.summary()||""),this.featuredImage=m.prop(this.meta.featuredImage()||""),this.isFeatured=m.prop(this.meta.isFeatured()||!1),this.isSized=m.prop(this.meta.isSized()||!1),this.isPendingReview=m.prop(this.meta.isPendingReview()||!1)},a.className=function(){return"Modal--small Support-Modal"},a.title=function(){return"Blog post settings"},a.content=function(){return m("div",{className:"Modal-body"},m("div",{className:"Form"},this.fields().toArray()))},a.fields=function(){var t=this,e=new M.a;return e.add("summary",m("div",{className:"Form-group"},m("label",null,"Article summary:"),m("textarea",{className:"FormControl",style:{maxWidth:"100%",minWidth:"100%",width:"100%",minHeight:"120px"},value:this.summary(),placeholder:"Please enter a summary",oninput:m.withAttr("value",this.summary)}),m("small",null,"This summary will be visible on the blog overview page and will be used for SEO purposes.")),30),e.add("image",m("div",{className:"Form-group"},m("label",null,"Article image URL:"),m("input",{type:"text",className:"FormControl",value:this.featuredImage(),placeholder:"https://",oninput:m.withAttr("value",this.featuredImage)}),m("small",null,"Best image resolution for social media: 1200x630"),""!=this.featuredImage()&&m("img",{src:this.featuredImage(),alt:this.props.article.title(),title:"Blog post image",width:"100%",style:{marginTop:"15px"}})),30),e.add("sized",m("div",{className:"Form-group"},C.a.component({state:1==this.isSized(),onchange:function(e){t.isSized(e)},children:[m("b",null,"Highlighted post"),m("div",{className:"helpText",style:{fontWeight:500}},"Give this post a big image on the blog overview page.")]})),-10),e.add("submit",m("div",{className:"Form-group"},u.a.component({type:"submit",className:"Button Button--primary SupportModal-save",loading:this.loading,children:"Update"})),-10),e},a.submitData=function(){return{summary:this.summary(),featuredImage:this.featuredImage(),isFeatured:this.isFeatured(),isSized:this.isSized(),isPendingReview:this.isPendingReview(),relationships:this.isNew&&{discussion:this.props.article}}},a.onsubmit=function(t){var e=this;t.preventDefault(),this.loading=!0,this.meta.save(this.submitData()).then((function(){e.isNew&&e.props.article.pushData({relationships:{blogMeta:e.meta}}),e.hide(),m.redraw()}),(function(t){e.loading=!1,e.handleErrors(t)}))},e}(x.a),k=a(18),O=a.n(k),R=a(19),L=a.n(R),S=a(20),T=function(t){function e(){return t.apply(this,arguments)||this}Object(o.a)(e,t);var a=e.prototype;return a.init=function(){t.prototype.init.call(this),this.article=this.props.article,this.name=m.prop(this.article.title()||""),this.slug=m.prop(this.article.slug()||""),this.redirect=this.props.redirect},a.className=function(){return"Modal--small Support-Modal"},a.title=function(){return app.translator.trans("v17development-flarum-blog.forum.tools.rename_article")},a.content=function(){return m("div",{className:"Modal-body"},m("div",{className:"Form"},this.fields().toArray()))},a.fields=function(){var t=this,e=new M.a;return e.add("name",m("div",{className:"Form-group"},m("label",null,app.translator.trans("v17development-flarum-blog.forum.article.title"),":"),m("input",{className:"FormControl",placeholder:app.translator.trans("v17development-flarum-blog.forum.article.title"),value:this.name(),oninput:function(e){t.name(e.target.value),t.slug(Object(S.slug)(e.target.value))}})),50),e.add("slug",m("div",{className:"Form-group"},m("label",null,app.translator.trans("v17development-flarum-blog.forum.article.slug"),":"),m("input",{className:"FormControl",placeholder:app.translator.trans("v17development-flarum-blog.forum.article.slug"),value:this.slug(),oninput:m.withAttr("value",this.slug)})),40),e.add("submit",m("div",{className:"Form-group"},u.a.component({type:"submit",className:"Button Button--primary SupportModal-save",loading:this.loading,children:"Update"})),-10),e},a.submitData=function(){return{title:this.name(),slug:this.slug()}},a.onsubmit=function(t){var e=this;t.preventDefault(),this.loading=!0,this.article.save({title:this.name(),slug:this.slug()}).then((function(){if(e.hide(),e.redirect){var t="/knowledgebase/"+e.article.id()+"-"+e.slug();m.route(t,!0),window.history.replaceState(null,document.title,t)}}),(function(t){e.loading=!1,e.handleErrors(t)}))},e}(x.a),D=function(t){function e(){return t.apply(this,arguments)||this}Object(o.a)(e,t);var a=e.prototype;return a.init=function(){this.loadedPost=!1},a.view=function(){var t=this,e=this.props.article,a=[];e.canRename()&&a.push(u.a.component({className:"Button",onclick:function(){return app.modal.show(new T({article:e}))},icon:"fas fa-pencil-alt",children:app.translator.trans("v17development-flarum-blog.forum.tools.rename_article")}));var o=e.firstPost()?e.firstPost():app.store.getById("posts",e.firstPostId());return a.push(u.a.component({className:"Button",disabled:!o||!o.canEdit(),onclick:function(){app.composer.load(new O.a({post:o})),app.composer.show()},icon:"fas fa-edit",children:app.translator.trans("v17development-flarum-blog.forum.tools.edit_article")})),a.push(u.a.component({className:"Button",onclick:function(){return app.modal.show(new I({article:e}))},icon:"fas fa-cogs",children:app.translator.trans("v17development-flarum-blog.forum.tools.article_settings")})),e.canTag()&&a.push(u.a.component({className:"Button",onclick:function(){return app.modal.show(new v.a({discussion:e}))},icon:"fas fa-tag",children:app.translator.trans("v17development-flarum-blog.forum.tools.update_category")})),e.blogMeta()&&e.blogMeta().isPendingReview()&&(a.push(m("li",{className:"Dropdown-separator"})),a.push(u.a.component({className:"Button",disabled:!app.forum.attribute("canApproveBlogPosts"),onclick:function(){e.blogMeta().save({isPendingReview:!1}).then((function(){app.alerts.show(new B.a({type:"success",children:app.translator.trans("v17development-flarum-blog.forum.review_article.approve_article_approved")}))}),(function(e){t.loading=!1,t.handleErrors(e)}))},icon:"fas fa-thumbs-up",children:app.translator.trans("v17development-flarum-blog.forum.review_article.approve_article")}))),a.push(m("li",{className:"Dropdown-separator"})),e.canLock()&&a.push(u.a.component({className:"Button",onclick:y.a.lockAction.bind(e),icon:"fas "+(e.isLocked()?"fa-comments":"fa-comment-slash"),children:e.isLocked()?app.translator.trans("v17development-flarum-blog.forum.tools.enable_comments"):app.translator.trans("v17development-flarum-blog.forum.tools.disable_comments")})),e.canHide()&&(e.isHidden()?(a.push(u.a.component({className:"Button",onclick:y.a.restoreAction.bind(e),icon:"fas fa-eye",children:app.translator.trans("v17development-flarum-blog.forum.tools.recover_article")})),e.canDelete()&&a.push(u.a.component({className:"Button",onclick:function(){if(confirm(L()(app.translator.trans("core.forum.discussion_controls.delete_confirmation"))))return"blogArticle"===app.history.getCurrent().name&&(app.previous?app.history.back():m.route(app.route("blog"))),e.delete().then((function(){m.redraw()}))},icon:"far fa-trash-alt",children:app.translator.trans("v17development-flarum-blog.forum.tools.delete_forever")}))):a.push(u.a.component({className:"Button",onclick:y.a.hideAction.bind(e),icon:"fas fa-eye-slash",children:app.translator.trans("v17development-flarum-blog.forum.tools.hide_article")}))),m("div",{className:"FlarumBlog-Article-Content-Edit-Button"},m("div",{className:"FlarumBlog-Article-Content-Edit-Dropdown"},A.a.component({icon:"fas fa-cog",label:"Manage",buttonClassName:"Button",menuClassName:"Dropdown-menu--right",children:a,onshow:function(){!o||o.canEdit()||t.loadedPost||(t.loadedPost=!0,app.store.find("posts",e.firstPost()?e.firstPost().id():e.firstPostId()).then((function(){})).catch((function(){})).then((function(){return m.redraw()})))}})))},e}(g.a),j=function(t){function e(){return t.apply(this,arguments)||this}Object(o.a)(e,t);var a=e.prototype;return a.init=function(){t.prototype.init.call(this),app.setTitle(app.translator.trans("v17development-flarum-blog.forum.blog")),app.history.push("blogArticle"),this.bodyClass="BlogItemPage",this.loading=!0,this.found=!1,this.article=null,this.loadBlogItem()},a.loadBlogItem=function(){var t=app.preloadedApiDocument();t?setTimeout(this.show.bind(this,t),0):app.store.find("discussions",m.route.param("id").split("-")[0]).then(this.show.bind(this)).catch((function(){m.redraw()})),m.lazyRedraw()},a.show=function(t){this.article=t,app.setTitle(t.title()+" - "+app.translator.trans("v17development-flarum-blog.forum.blog")),this.loading=!1;var e=[];if(t.payload&&t.payload.included){var a=t.id();e=t.payload.included.filter((function(t){return"posts"===t.type&&t.relationships&&t.relationships.discussion&&t.relationships.discussion.data.id===a})).map((function(t){return app.store.getById("posts",t.id)})).sort((function(t,e){return t.id()-e.id()})).slice(0,20)}this.stream=new p.a({discussion:t,includedPosts:e}),this.stream.on("positionChanged",this.positionChanged.bind(this)),m.lazyRedraw()},a.view=function(){var t=this.article&&this.article.blogMeta()&&this.article.blogMeta().featuredImage()?"url("+this.article.blogMeta().featuredImage()+")":null,e=null;return!this.loading&&this.article&&(e=this.article.firstPost()?this.article.firstPost():app.store.getById("posts",this.article.firstPostId())),m("div",{className:"FlarumBlogItem"},m("div",{className:"container"},m("div",{className:"FlarumBlog-Article"},m("div",{className:"FlarumBlog-Article-Container"},m("div",{className:"FlarumBlog-Article-Content"},m("div",{className:"FlarumBlog-Article-Image FlarumBlog-default-image "+(this.loading?"FlarumBlog-Article-GhostImage":""),style:{backgroundImage:t,opacity:this.article&&this.article.isHidden()?.4:null}}),this.article&&app.session.user&&(app.session.user.canEdit()||this.article.canRename()||this.article.posts()&&this.article.posts()[0].canEdit())&&m(D,{article:this.article}),m("div",{className:"FlarumBlog-Article-Categories"},!this.loading&&this.article&&this.article.tags()&&this.article.tags().map((function(t){return m("a",{href:app.route("blogCategory",{slug:t.slug()}),config:m.route},t.name())})),this.loading&&[0,1].map((function(){return m("span",{className:"FlarumBlog-Article-GhostCategory"},"Category")}))),m("div",{className:"FlarumBlog-Article-Post"},m("h3",{className:this.loading?"FlarumBlog-Article-GhostTitle":null},this.article?this.article.title():"Ghost title",this.article&&this.article.isHidden()&&"("+app.translator.trans("v17development-flarum-blog.forum.hidden")+")"),this.loading&&[0,1,2].map((function(){return m("div",null,m("p",{className:"FlarumBlog-Article-GhostParagraph"}," "),m("p",{className:"FlarumBlog-Article-GhostParagraph"}," "),m("p",{className:"FlarumBlog-Article-GhostParagraph"}," "),m("p",null," "))})),m("div",{className:"Post-body"},!this.loading&&this.article.blogMeta()&&1==this.article.blogMeta().isPendingReview()&&m("blockquote",{class:"uncited",style:{fontSize:"16px"}},m("div",null,m("span",{className:"far fa-clock",style:{marginRight:"5px"}})," ",app.translator.trans("v17development-flarum-blog.forum.review_article.pending_review"))),!this.loading&&e&&m.trust(e.contentHtml())))),m("div",{className:"FlarumBlog-Article-Comments"},m("h4",null,app.translator.trans("v17development-flarum-blog.forum.comment_section.comments")," (",this.article?this.article.commentCount()-1:0,")"),!this.loading&&this.article.isLocked&&this.article.isLocked()&&m("div",{className:"Post-body"},m("blockquote",{class:"uncited"},m("div",null,m("span",{className:"far fa-lock",style:{marginRight:"5px"}})," ",app.translator.trans("v17development-flarum-blog.forum.comment_section.locked")))),!this.loading&&this.stream&&this.stream.render())),m("div",{className:"FlarumBlog-Article-Author"},m("div",{className:"FlarumBlog-Article-Author-Info"},m("div",{className:"FlarumBlog-Article-Author-background "+(this.loading?"FlarumBlog-Author-Ghost":""),style:{backgroundColor:this.article&&this.article.user()?this.article&&this.article.user().color():null}}),m("div",{className:"FlarumBlog-Article-Author-Avatar"},this.article&&this.article.user()?l()(this.article.user()):m("span",{className:"Avatar FlarumBlog-Author-Ghost"})),this.article&&this.article.user()&&m("div",{style:{padding:"0 20px 20px"}},m("span",{className:"FlarumBlog-Article-Author-Name"},this.article.user().displayName()),m("p",{className:"FlarumBlog-Article-Author-Bio"},this.article.user().bio())),this.loading&&m("div",null,m("span",{className:"FlarumBlog-Article-Author-Name FlarumBlog-Author-Ghost"}," "),m("p",{className:"FlarumBlog-Article-Author-Bio FlarumBlog-Author-Ghost"}," "),m("p",{className:"FlarumBlog-Article-Author-Bio FlarumBlog-Author-Ghost"}," "),m("p",{className:"FlarumBlog-Article-Author-Bio FlarumBlog-Author-Ghost"}," "))),m(f,null)))))},a.positionChanged=function(t,e){var a=this.article;app.session.user&&e>(a.lastReadPostNumber()||0)&&(a.save({lastReadPostNumber:e}),m.redraw())},e}(s.a),z=a(4),E=a.n(z),G=a(21),H=a.n(G),W=a(13),q=a.n(W),U=a(22),J=function(t){function e(){return t.apply(this,arguments)||this}return Object(o.a)(e,t),e.prototype.onsubmit=function(){this.loading=!0;var t=this.data();app.store.createRecord("discussions").save(t).then((function(t){app.composer.hide(),m.route(app.route("blogArticle",{id:t.id()+"-"+t.slug()}))}),this.loaded.bind(this))},e}(a.n(U).a);function K(t){$(t).tooltip()}var Q=function(t){function e(){return t.apply(this,arguments)||this}Object(o.a)(e,t);var a=e.prototype;return a.init=function(){t.prototype.init.call(this),app.setTitle(app.translator.trans("v17development-flarum-blog.forum.blog")),this.bodyClass="BlogOverviewPage",this.isLoading=!0,this.featuredPosts=[],this.posts=[],this.hasMore=null,app.history.push("blog"),this.loadBlogOverview()},a.loadBlogOverview=function(){var t=app.preloadedApiDocument();t?setTimeout(this.show.bind(this,t),0):app.store.find("discussions",{filter:{q:"is:blog"+(m.route.param("slug")?" tag:"+m.route.param("slug"):"")}}).then(this.show.bind(this)).catch((function(){m.redraw()})),m.lazyRedraw()},a.show=function(t){if(0===t.length)return this.isLoading=!1,void m.lazyRedraw();this.featuredPosts=t.slice(0,3),this.posts=t.length>=4?t.slice(3,t.length):[],this.isLoading=!1,m.lazyRedraw()},a.title=function(){if(!m.route.param("slug"))return m("h2",null,app.translator.trans("v17development-flarum-blog.forum.recent_posts"));var t=app.store.all("tags").filter((function(t){return t.slug()===m.route.param("slug")}));return m("h2",null,t&&t[0]&&t[0].name(),m("small",null," - ",m("a",{href:app.route("blog"),config:m.route},app.translator.trans("v17development-flarum-blog.forum.return_to_overview"))))},a.view=function(){var t=this;return m("div",{className:"FlarumBlogOverview"},m("div",{className:"container"},m("div",{className:"BlogFeatured"},app.forum.attribute("canWriteBlogPosts")&&m(u.a,{className:"Button FlarumBlogWrite",onclick:function(){return t.newArticle()},icon:"fas fa-pencil"},app.translator.trans("v17development-flarum-blog.forum.compose.write_article")),this.title(),m("div",{style:{clear:"both"}}),m("div",{className:"BlogFeatured-list"},this.isLoading&&[0,1,2].map((function(){return m("div",{className:"BlogFeatured-list-item BlogFeatured-list-item-ghost"},m("div",{className:"BlogFeatured-list-item-details"},m("h4",null," "),m("div",{className:"data"},m("span",null,m("i",{className:"far fa-wave"})))))})),!this.isLoading&&this.featuredPosts.length>=0&&this.featuredPosts.map((function(e){var a=e.blogMeta()&&e.blogMeta().featuredImage()?"url("+e.blogMeta().featuredImage()+")":null,o=e.tags()?e.tags().filter((function(t){return t.isChild()})):[];return m("a",{href:app.route("blogArticle",{id:e.id()+"-"+e.slug()}),className:"BlogFeatured-list-item FlarumBlog-default-image",style:{backgroundImage:a},config:m.route},m("div",{className:"BlogFeatured-list-item-top"},o[0]&&m("span",null,o[0].name()),e.isSticky()&&m("span",null,m("i",{className:"fas fa-thumbtack"})),(e.blogMeta()&&1==e.blogMeta().isPendingReview()||e.isHidden())&&m("span",null,m("i",{className:"fas fa-eye-slash"})),e.blogMeta()&&1==e.blogMeta().isPendingReview()&&m("span",{title:app.translator.trans("v17development-flarum-blog.forum.review_article.pending_review"),config:K.bind(t),"data-placement":"bottom"},m("i",{className:"far fa-clock"})," ",app.translator.trans("v17development-flarum-blog.forum.review_article.pending_review_title"))),m("div",{className:"BlogFeatured-list-item-details"},m("h4",null,e.title()),m("div",{className:"data"},m("span",null,m("i",{className:"far fa-clock"})," ",q()(e.createdAt())),m("span",null,m("i",{className:"far fa-user"})," ",e.user()?e.user().displayName():"[Deleted]"),m("span",null,m("i",{className:"far fa-comment"})," ",e.commentCount()))))})))),m("div",{className:"BlogScrubber"},m("div",{className:"BlogList"},this.isLoading&&[!1,!1,!0,!1].map((function(t){return m("div",{className:"BlogList-item BlogList-item-"+(!0===t?"sized":"default")+" BlogList-item-ghost"},m("div",{className:"BlogList-item-photo FlarumBlog-default-image"}),m("div",{className:"BlogList-item-content"},m("h4",null," "),m("p",null," "),m("div",{className:"data"},m("span",null,m("i",{className:"far fa-wave"})))))})),!this.isLoading&&this.posts.length>=1&&this.posts.map((function(e){var a=e.blogMeta()&&e.blogMeta().featuredImage()?"url("+e.blogMeta().featuredImage()+")":null,o=e.blogMeta()&&e.blogMeta().isSized(),i=e.blogMeta()&&e.blogMeta().summary()?e.blogMeta().summary():"";return m("a",{href:app.route("blogArticle",{id:e.id()+"-"+e.slug()}),className:"BlogList-item BlogList-item-"+(o?"sized":"default"),config:m.route},m("div",{className:"BlogList-item-photo FlarumBlog-default-image",style:{backgroundImage:a}}),m("div",{className:"BlogList-item-content"},m("h4",null,e.title(),(e.blogMeta()&&1==e.blogMeta().isPendingReview()||e.isHidden())&&m("i",{className:"fas fa-eye-slash"}),e.blogMeta()&&1==e.blogMeta().isPendingReview()&&m("i",{className:"far fa-clock",title:app.translator.trans("v17development-flarum-blog.forum.review_article.pending_review"),config:K.bind(t)})),m("p",null,i),m("div",{className:"data"},m("span",null,m("i",{className:"far fa-clock"})," ",q()(e.createdAt())),m("span",null,m("i",{className:"far fa-user"})," ",e.user()?e.user().displayName():"[Deleted]"),m("span",null,m("i",{className:"far fa-comment"})," ",e.commentCount()))))})),!this.isLoading&&this.featuredPosts.length>0&&0===this.posts.length&&m("p",{className:"FlarumBlog-reached-end"},app.translator.trans("v17development-flarum-blog.forum.no_more_posts")),!this.isLoading&&0===this.featuredPosts.length&&0===this.posts.length&&m("p",{className:"FlarumBlog-reached-end"},app.translator.trans("v17development-flarum-blog.forum.category_empty"))),m("div",{className:"Sidebar"},m(f,null)))))},a.newArticle=function(){var t=new J({user:app.session.user}),e=[];app.forum.attribute("blogTags").forEach((function(t){var a=app.store.getById("tags",t);0!==e.length||a.isChild()||e.push(a)})),t.tags=e,app.composer.load(t),app.composer.show()},e}(s.a),V=a(23),X=a.n(V),Y=a(24),Z=a.n(Y),tt=a(25),et=a.n(tt),at=a(3),ot=function(){Object(at.extend)(X.a.prototype,"config",(function(){var t=this.currentTag(),e="both"===app.forum.attribute("blogRedirectsEnabled")||"tags_only"===app.forum.attribute("blogRedirectsEnabled");if(t&&e){var a=app.forum.attribute("blogTags");(a.indexOf(t.id())>=0||t.parent()&&a.indexOf(t.parent().id())>=0)&&m.route(app.route("blog"))}})),Object(at.override)(Z.a.prototype,"view",(function(t){if(("both"===app.forum.attribute("blogRedirectsEnabled")||"discussions_only"===app.forum.attribute("blogRedirectsEnabled"))&&this.discussion&&this.discussion&&this.discussion.tags().length>0){var e=app.forum.attribute("blogTags");if(this.discussion.tags().filter((function(t){return e.indexOf(t.id())>=0||t.parent()&&e.indexOf(t.parent().id())>=0})).length>0){var a=app.route("blogArticle",{id:this.discussion.id()+"-"+this.discussion.slug()});return document.location.href=a,m("div",{style:{textAlign:"center",padding:"40px 20px"}},m(et.a,{size:"large"}),m("h2",{style:{marginTop:"40px"}},app.translator.trans("v17development-flarum-blog.forum.utils.redirect.title")),app.translator.trans("v17development-flarum-blog.forum.utils.redirect.link",{a:m("a",{href:a})}))}}return t()}))},it=a(26),st=function(t){function e(){return t.apply(this,arguments)||this}return Object(o.a)(e,t),e}(a.n(it)()(E.a,{discussion:E.a.hasOne("discussion"),featuredImage:E.a.attribute("featuredImage"),summary:E.a.attribute("summary"),isFeatured:E.a.attribute("isFeatured"),isSized:E.a.attribute("isSized"),isPendingReview:E.a.attribute("isPendingReview")})),rt=a(27),lt=a.n(rt);function nt(){Object(at.extend)(lt.a.prototype,"view",(function(t){var e=this;if(0==app.forum.attribute("blogHideTags"))return t;var a=app.forum.attribute("blogTags")||[],o=t.children[1].children[1].children[0].children;return t.children[1].children[1].children[0].children=o.map((function(t,o){return a.indexOf(e.tags[o].id())>=0?null:t})),t}))}app.initializers.add("v17development-flarum-blog",(function(t){t.routes.blog={path:"/blog",component:Q.component()},t.routes.blogCategory={path:"/blog/category/:slug",component:Q.component()},t.routes.blogArticle={path:"/blog/:id",component:j.component()},t.store.models.blogMeta=st,H.a.prototype.blogMeta=E.a.hasOne("blogMeta"),ot(),nt()}))}]); +module.exports=function(t){var e={};function a(o){if(e[o])return e[o].exports;var r=e[o]={i:o,l:!1,exports:{}};return t[o].call(r.exports,r,r.exports,a),r.l=!0,r.exports}return a.m=t,a.c=e,a.d=function(t,e,o){a.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},a.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},a.t=function(t,e){if(1&e&&(t=a(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(a.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)a.d(o,r,function(e){return t[e]}.bind(null,r));return o},a.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return a.d(e,"a",e),e},a.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},a.p="",a(a.s=35)}([function(t,e,a){"use strict";function o(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}a.d(e,"a",(function(){return o}))},function(t,e){t.exports=flarum.core.compat["components/Button"]},function(t,e){t.exports=flarum.core.compat["components/Switch"]},function(t,e){t.exports=flarum.core.compat.Component},function(t,e){t.exports=flarum.core.compat["utils/ItemList"]},function(t,e){t.exports=flarum.core.compat.extend},function(t,e){t.exports=flarum.core.compat.Model},function(t,e){t.exports=flarum.core.compat["components/Alert"]},function(t,e){t.exports=flarum.core.compat["components/Page"]},function(t,e){t.exports=flarum.core.compat["components/Modal"]},function(t,e){t.exports=flarum.core.compat["helpers/listItems"]},,function(t,e){t.exports=flarum.core.compat["utils/DiscussionControls"]},,function(t,e){t.exports=flarum.core.compat["helpers/humanTime"]},function(t,e){t.exports=flarum.core.compat["components/CommentPost"]},function(t,e){t.exports=flarum.core.compat["components/PostStream"]},function(t,e){t.exports=flarum.core.compat["tags/components/TagDiscussionModal"]},function(t,e){t.exports=flarum.core.compat["components/Dropdown"]},function(t,e){t.exports=flarum.core.compat["components/EditPostComposer"]},function(t,e){t.exports=flarum.core.compat["utils/extractText"]},function(t,e){t.exports=flarum.core.compat["utils/string"]},function(t,e){t.exports=flarum.core.compat["helpers/avatar"]},function(t,e){t.exports=flarum.core.compat["models/Discussion"]},function(t,e){t.exports=flarum.core.compat["components/DiscussionComposer"]},function(t,e){t.exports=flarum.core.compat["components/IndexPage"]},function(t,e){t.exports=flarum.core.compat["components/DiscussionPage"]},function(t,e){t.exports=flarum.core.compat["utils/mixin"]},function(t,e){t.exports=flarum.core.compat["tags/components/TagsPage"]},function(t,e){t.exports=flarum.core},,,,,function(t,e){t.exports=flarum.core.compat["components/ReplyComposer"]},function(t,e,a){"use strict";a.r(e);var o=a(0),r=a(8),i=a.n(r),s=a(1),n=a.n(s),l=a(15),u=a.n(l),c=(a(34),a(16)),p=a.n(c),d=a(3),g=a.n(d),f=a(17),h=a.n(f),v=a(12),b=a.n(v),y=a(7),N=a.n(y),B=a(18),w=a.n(B),A=a(9),F=a.n(A),x=a(4),P=a.n(x),M=a(2),_=a.n(M),C=function(t){function e(){return t.apply(this,arguments)||this}Object(o.a)(e,t);var a=e.prototype;return a.init=function(){t.prototype.init.call(this),this.isNew=!this.props.article.blogMeta(),this.meta=this.props.article.blogMeta()?this.props.article.blogMeta():app.store.createRecord("blogMeta"),this.summary=m.prop(this.meta.summary()||""),this.featuredImage=m.prop(this.meta.featuredImage()||""),this.isFeatured=m.prop(this.meta.isFeatured()||!1),this.isSized=m.prop(this.meta.isSized()||!1),this.isPendingReview=m.prop(this.meta.isPendingReview()||!1)},a.className=function(){return"Modal--small Support-Modal"},a.title=function(){return"Blog post settings"},a.content=function(){return m("div",{className:"Modal-body"},m("div",{className:"Form"},this.fields().toArray()))},a.fields=function(){var t=this,e=new P.a;return e.add("summary",m("div",{className:"Form-group"},m("label",null,"Article summary:"),m("textarea",{className:"FormControl",style:{maxWidth:"100%",minWidth:"100%",width:"100%",minHeight:"120px"},value:this.summary(),placeholder:"Please enter a summary",oninput:m.withAttr("value",this.summary)}),m("small",null,"This summary will be visible on the blog overview page and will be used for SEO purposes.")),30),e.add("image",m("div",{className:"Form-group"},m("label",null,"Article image URL:"),m("input",{type:"text",className:"FormControl",value:this.featuredImage(),placeholder:"https://",oninput:m.withAttr("value",this.featuredImage)}),m("small",null,"Best image resolution for social media: 1200x630"),""!=this.featuredImage()&&m("img",{src:this.featuredImage(),alt:this.props.article.title(),title:"Blog post image",width:"100%",style:{marginTop:"15px"}})),30),e.add("sized",m("div",{className:"Form-group"},_.a.component({state:1==this.isSized(),onchange:function(e){t.isSized(e)},children:[m("b",null,"Highlighted post"),m("div",{className:"helpText",style:{fontWeight:500}},"Give this post a big image on the blog overview page.")]})),-10),e.add("submit",m("div",{className:"Form-group"},n.a.component({type:"submit",className:"Button Button--primary SupportModal-save",loading:this.loading,children:"Update"})),-10),e},a.submitData=function(){return{summary:this.summary(),featuredImage:this.featuredImage(),isFeatured:this.isFeatured(),isSized:this.isSized(),isPendingReview:this.isPendingReview(),relationships:this.isNew&&{discussion:this.props.article}}},a.onsubmit=function(t){var e=this;t.preventDefault(),this.loading=!0,this.meta.save(this.submitData()).then((function(){e.isNew&&e.props.article.pushData({relationships:{blogMeta:e.meta}}),e.hide(),m.redraw()}),(function(t){e.loading=!1,e.handleErrors(t)}))},e}(F.a),I=a(19),O=a.n(I),k=a(20),R=a.n(k),S=a(21),L=function(t){function e(){return t.apply(this,arguments)||this}Object(o.a)(e,t);var a=e.prototype;return a.init=function(){t.prototype.init.call(this),this.article=this.props.article,this.name=m.prop(this.article.title()||""),this.slug=m.prop(this.article.slug()||""),this.redirect=this.props.redirect},a.className=function(){return"Modal--small Support-Modal"},a.title=function(){return app.translator.trans("v17development-flarum-blog.forum.tools.rename_article")},a.content=function(){return m("div",{className:"Modal-body"},m("div",{className:"Form"},this.fields().toArray()))},a.fields=function(){var t=this,e=new P.a;return e.add("name",m("div",{className:"Form-group"},m("label",null,app.translator.trans("v17development-flarum-blog.forum.article.title"),":"),m("input",{className:"FormControl",placeholder:app.translator.trans("v17development-flarum-blog.forum.article.title"),value:this.name(),oninput:function(e){t.name(e.target.value),t.slug(Object(S.slug)(e.target.value))}})),50),e.add("slug",m("div",{className:"Form-group"},m("label",null,app.translator.trans("v17development-flarum-blog.forum.article.slug"),":"),m("input",{className:"FormControl",placeholder:app.translator.trans("v17development-flarum-blog.forum.article.slug"),value:this.slug(),oninput:m.withAttr("value",this.slug)})),40),e.add("submit",m("div",{className:"Form-group"},n.a.component({type:"submit",className:"Button Button--primary SupportModal-save",loading:this.loading,children:"Update"})),-10),e},a.submitData=function(){return{title:this.name(),slug:this.slug()}},a.onsubmit=function(t){var e=this;t.preventDefault(),this.loading=!0,this.article.save({title:this.name(),slug:this.slug()}).then((function(){if(e.hide(),e.redirect){var t="/knowledgebase/"+e.article.id()+"-"+e.slug();m.route(t,!0),window.history.replaceState(null,document.title,t)}}),(function(t){e.loading=!1,e.handleErrors(t)}))},e}(F.a),T=function(t){function e(){return t.apply(this,arguments)||this}Object(o.a)(e,t);var a=e.prototype;return a.init=function(){this.loadedPost=!1},a.view=function(){var t=this,e=this.props.article,a=[];e.canRename()&&a.push(n.a.component({className:"Button",onclick:function(){return app.modal.show(new L({article:e}))},icon:"fas fa-pencil-alt",children:app.translator.trans("v17development-flarum-blog.forum.tools.rename_article")}));var o=e.firstPost()?e.firstPost():app.store.getById("posts",e.firstPostId());return a.push(n.a.component({className:"Button",disabled:!o||!o.canEdit(),onclick:function(){app.composer.load(new O.a({post:o})),app.composer.show()},icon:"fas fa-edit",children:app.translator.trans("v17development-flarum-blog.forum.tools.edit_article")})),a.push(n.a.component({className:"Button",onclick:function(){return app.modal.show(new C({article:e}))},icon:"fas fa-cogs",children:app.translator.trans("v17development-flarum-blog.forum.tools.article_settings")})),e.canTag()&&a.push(n.a.component({className:"Button",onclick:function(){return app.modal.show(new h.a({discussion:e}))},icon:"fas fa-tag",children:app.translator.trans("v17development-flarum-blog.forum.tools.update_category")})),e.blogMeta()&&e.blogMeta().isPendingReview()&&(a.push(m("li",{className:"Dropdown-separator"})),a.push(n.a.component({className:"Button",disabled:!app.forum.attribute("canApproveBlogPosts"),onclick:function(){e.blogMeta().save({isPendingReview:!1}).then((function(){app.alerts.show(new N.a({type:"success",children:app.translator.trans("v17development-flarum-blog.forum.review_article.approve_article_approved")}))}),(function(e){t.loading=!1,t.handleErrors(e)}))},icon:"fas fa-thumbs-up",children:app.translator.trans("v17development-flarum-blog.forum.review_article.approve_article")}))),a.push(m("li",{className:"Dropdown-separator"})),e.canLock()&&a.push(n.a.component({className:"Button",onclick:b.a.lockAction.bind(e),icon:"fas "+(e.isLocked()?"fa-comments":"fa-comment-slash"),children:e.isLocked()?app.translator.trans("v17development-flarum-blog.forum.tools.enable_comments"):app.translator.trans("v17development-flarum-blog.forum.tools.disable_comments")})),e.canHide()&&(e.isHidden()?(a.push(n.a.component({className:"Button",onclick:b.a.restoreAction.bind(e),icon:"fas fa-eye",children:app.translator.trans("v17development-flarum-blog.forum.tools.recover_article")})),e.canDelete()&&a.push(n.a.component({className:"Button",onclick:function(){if(confirm(R()(app.translator.trans("core.forum.discussion_controls.delete_confirmation"))))return"blogArticle"===app.history.getCurrent().name&&(app.previous?app.history.back():m.route(app.route("blog"))),e.delete().then((function(){m.redraw()}))},icon:"far fa-trash-alt",children:app.translator.trans("v17development-flarum-blog.forum.tools.delete_forever")}))):a.push(n.a.component({className:"Button",onclick:b.a.hideAction.bind(e),icon:"fas fa-eye-slash",children:app.translator.trans("v17development-flarum-blog.forum.tools.hide_article")}))),m("div",{className:"FlarumBlog-Article-Content-Edit-Button"},m("div",{className:"FlarumBlog-Article-Content-Edit-Dropdown"},w.a.component({icon:"fas fa-cog",label:"Manage",buttonClassName:"Button",menuClassName:"Dropdown-menu--right",children:a,onshow:function(){!o||o.canEdit()||t.loadedPost||(t.loadedPost=!0,app.store.find("posts",e.firstPost()?e.firstPost().id():e.firstPostId()).then((function(){})).catch((function(){})).then((function(){return m.redraw()})))}})))},e}(g.a),j=a(10),D=a.n(j),E=a(22),z=a.n(E),G=function(t){function e(){return t.apply(this,arguments)||this}Object(o.a)(e,t);var a=e.prototype;return a.view=function(){return m("div",{className:"FlarumBlog-Article-Author"},m("div",{className:"FlarumBlog-Article-Author-background "+(this.props.loading?"FlarumBlog-Author-Ghost":""),style:{backgroundColor:this.props.article&&this.props.article.user()?this.props.article&&this.props.article.user().color():null}}),m("div",{className:"FlarumBlog-Article-Author-Avatar"},this.props.article&&this.props.article.user()?z()(this.props.article.user()):m("span",{className:"Avatar FlarumBlog-Author-Ghost"})),this.props.article&&this.props.article.user()&&m("div",{className:"FlarumBlog-Article-Author-Info"},m("span",{className:"FlarumBlog-Article-Author-Name"},this.props.article.user().displayName()),m("p",{className:"FlarumBlog-Article-Author-Bio"},this.props.article.user().bio&&this.props.article.user().bio()),m("ul",{className:"FlarumBlog-Article-Author-Extended"},D()(this.items().toArray()))),this.props.loading&&m("div",null,m("span",{className:"FlarumBlog-Article-Author-Name FlarumBlog-Author-Ghost"}," "),m("p",{className:"FlarumBlog-Article-Author-Bio FlarumBlog-Author-Ghost"}," "),m("p",{className:"FlarumBlog-Article-Author-Bio FlarumBlog-Author-Ghost"}," "),m("p",{className:"FlarumBlog-Article-Author-Bio FlarumBlog-Author-Ghost"}," ")))},a.items=function(){return new P.a},e}(g.a),H=function(t){function e(){return t.apply(this,arguments)||this}Object(o.a)(e,t);var a=e.prototype;return a.init=function(){this.blogCategories=app.forum.attribute("blogTags")},a.view=function(){var t=this;return m("div",{className:"BlogCategories"},m("h3",null,app.translator.trans("v17development-flarum-blog.forum.categories")),this.blogCategories&&this.blogCategories.map((function(e){var a=app.store.getById("tags",e);if(!a)return null;var o=[];return o.push(t.categoryItem(a)),app.store.all("tags").forEach((function(e){e.isChild()&&e.parent().id()===a.id()&&o.push(t.categoryItem(e))})),o})))},a.categoryItem=function(t){return m("a",{href:app.route("blogCategory",{slug:t.slug()}),className:"BlogCategories-item BlogCategories-item-"+t.id()+" "+(t.isChild()&&1==app.forum.attribute("blogCategoryHierarchy")?"BlogCategories-item-child":""),config:m.route},m("span",{className:""===t.icon()?"BlogCategories-item-colored":"",style:{backgroundColor:""===t.icon()?t.color():null}},m("i",{className:t.icon()})),t.name())},e}(g.a),W=function(t){function e(){return t.apply(this,arguments)||this}Object(o.a)(e,t);var a=e.prototype;return a.view=function(){return m("div",{className:"FlarumBlog-Article-Sidebar"},m("ul",null,D()(this.items().toArray())))},a.items=function(){var t=new P.a;return t.add("author",G.component(this.props),0),t.add("categories",H.component(this.props),0),t},e}(g.a),q=function(t){function e(){return t.apply(this,arguments)||this}Object(o.a)(e,t);var a=e.prototype;return a.init=function(){t.prototype.init.call(this),app.setTitle(app.translator.trans("v17development-flarum-blog.forum.blog")),app.history.push("blogArticle"),this.bodyClass="BlogItemPage",this.loading=!0,this.found=!1,this.article=null,this.loadBlogItem()},a.loadBlogItem=function(){var t=app.preloadedApiDocument();t?setTimeout(this.show.bind(this,t),0):app.store.find("discussions",m.route.param("id").split("-")[0]).then(this.show.bind(this)).catch((function(){m.redraw()})),m.lazyRedraw()},a.show=function(t){this.article=t,app.setTitle(t.title()+" - "+app.translator.trans("v17development-flarum-blog.forum.blog")),this.loading=!1;var e=[];if(t.payload&&t.payload.included){var a=t.id();e=t.payload.included.filter((function(t){return"posts"===t.type&&t.relationships&&t.relationships.discussion&&t.relationships.discussion.data.id===a})).map((function(t){return app.store.getById("posts",t.id)})).sort((function(t,e){return t.id()-e.id()})).slice(0,20)}this.stream=new p.a({discussion:t,includedPosts:e}),this.stream.on("positionChanged",this.positionChanged.bind(this)),m.lazyRedraw()},a.view=function(){var t=this.article&&this.article.blogMeta()&&this.article.blogMeta().featuredImage()?"url("+this.article.blogMeta().featuredImage()+")":null,e=null;return!this.loading&&this.article&&(e=this.article.firstPost()?this.article.firstPost():app.store.getById("posts",this.article.firstPostId())),m("div",{className:"FlarumBlogItem"},m("div",{className:"container"},m("div",{className:"FlarumBlog-ToolButtons"},m(n.a,{className:"Button",onclick:function(){app.previous&&"blog"===app.previous.props.routeName?app.history.back():m.route(app.route("blog"))},icon:"fas fa-angle-left"},app.translator.trans("v17development-flarum-blog.forum.return_to_overview"))),m("div",{className:"FlarumBlog-Article"},m("div",{className:"FlarumBlog-Article-Container"},m("div",{className:"FlarumBlog-Article-Content"},m("div",{className:"FlarumBlog-Article-Image FlarumBlog-default-image "+(this.loading?"FlarumBlog-Article-GhostImage":""),style:{backgroundImage:t,opacity:this.article&&this.article.isHidden()?.4:null}}),this.article&&app.session.user&&(app.session.user.canEdit()||this.article.canRename()||this.article.posts()&&this.article.posts()[0].canEdit())&&m(T,{article:this.article}),m("div",{className:"FlarumBlog-Article-Categories"},!this.loading&&this.article&&this.article.tags()&&this.article.tags().map((function(t){return m("a",{href:app.route("blogCategory",{slug:t.slug()}),config:m.route},t.name())})),this.loading&&[0,1].map((function(){return m("span",{className:"FlarumBlog-Article-GhostCategory"},"Category")}))),m("div",{className:"FlarumBlog-Article-Post"},m("h3",{className:this.loading?"FlarumBlog-Article-GhostTitle":null},this.article?this.article.title():"Ghost title",this.article&&this.article.isHidden()&&"("+app.translator.trans("v17development-flarum-blog.forum.hidden")+")"),this.loading&&[0,1,2].map((function(){return m("div",null,m("p",{className:"FlarumBlog-Article-GhostParagraph"}," "),m("p",{className:"FlarumBlog-Article-GhostParagraph"}," "),m("p",{className:"FlarumBlog-Article-GhostParagraph"}," "),m("p",null," "))})),!this.loading&&this.article.blogMeta()&&1==this.article.blogMeta().isPendingReview()&&m("div",{className:"Post"},m("blockquote",{class:"uncited",style:{fontSize:"16px"}},m("div",null,m("span",{className:"far fa-clock",style:{marginRight:"5px"}})," ",app.translator.trans("v17development-flarum-blog.forum.review_article.pending_review")))),!this.loading&&e&&m(u.a,{post:e}))),m("div",{className:"FlarumBlog-Article-Comments"},m("h4",null,app.translator.trans("v17development-flarum-blog.forum.comment_section.comments")," (",this.article?this.article.commentCount()-1:0,")"),!this.loading&&this.article.isLocked&&this.article.isLocked()&&m("div",{className:"Post-body"},m("blockquote",{class:"uncited"},m("div",null,m("span",{className:"far fa-lock",style:{marginRight:"5px"}})," ",app.translator.trans("v17development-flarum-blog.forum.comment_section.locked")))),!this.loading&&this.stream&&this.stream.render())),m(W,{article:this.article,loading:this.loading}))))},a.positionChanged=function(t,e){var a=this.article;app.session.user&&e>(a.lastReadPostNumber()||0)&&(a.save({lastReadPostNumber:e}),m.redraw())},e}(i.a),U=a(6),J=a.n(U),K=a(23),Q=a.n(K),V=a(14),X=a.n(V),Y=a(24),Z=function(t){function e(){return t.apply(this,arguments)||this}return Object(o.a)(e,t),e.prototype.onsubmit=function(){this.loading=!0;var t=this.data();app.store.createRecord("discussions").save(t).then((function(t){app.composer.hide(),m.route(app.route("blogArticle",{id:t.id()+"-"+t.slug()}))}),this.loaded.bind(this))},e}(a.n(Y).a);function tt(t){$(t).tooltip()}var et=function(t){function e(){return t.apply(this,arguments)||this}Object(o.a)(e,t);var a=e.prototype;return a.init=function(){t.prototype.init.call(this),app.setTitle(app.translator.trans("v17development-flarum-blog.forum.blog")),this.bodyClass="BlogOverviewPage",this.isLoading=!0,this.featuredPosts=[],this.posts=[],this.hasMore=null,app.history.push("blog"),this.loadBlogOverview()},a.loadBlogOverview=function(){var t=app.preloadedApiDocument();t?setTimeout(this.show.bind(this,t),0):app.store.find("discussions",{filter:{q:"is:blog"+(m.route.param("slug")?" tag:"+m.route.param("slug"):"")},sort:"-createdAt"}).then(this.show.bind(this)).catch((function(){m.redraw()})),m.lazyRedraw()},a.show=function(t){if(0===t.length)return this.isLoading=!1,void m.lazyRedraw();this.featuredPosts=t.slice(0,3),this.posts=t.length>=4?t.slice(3,t.length):[],this.isLoading=!1,m.lazyRedraw()},a.title=function(){if(!m.route.param("slug"))return m("h2",null,app.translator.trans("v17development-flarum-blog.forum.recent_posts"));var t=app.store.all("tags").filter((function(t){return t.slug()===m.route.param("slug")}));return m("h2",null,t&&t[0]&&t[0].name(),m("small",null," - ",m("a",{href:app.route("blog"),config:m.route},app.translator.trans("v17development-flarum-blog.forum.return_to_overview"))))},a.view=function(){var t=this;return m("div",{className:"FlarumBlogOverview"},m("div",{className:"container"},m("div",{className:"BlogFeatured"},app.forum.attribute("canWriteBlogPosts")&&m(n.a,{className:"Button FlarumBlogWrite",onclick:function(){return t.newArticle()},icon:"fas fa-pencil"},app.translator.trans("v17development-flarum-blog.forum.compose.write_article")),this.title(),m("div",{style:{clear:"both"}}),m("div",{className:"BlogFeatured-list"},this.isLoading&&[0,1,2].map((function(){return m("div",{className:"BlogFeatured-list-item BlogFeatured-list-item-ghost"},m("div",{className:"BlogFeatured-list-item-details"},m("h4",null," "),m("div",{className:"data"},m("span",null,m("i",{className:"far fa-wave"})))))})),!this.isLoading&&this.featuredPosts.length>=0&&this.featuredPosts.map((function(e){var a=e.blogMeta()&&e.blogMeta().featuredImage()?"url("+e.blogMeta().featuredImage()+")":null,o=e.tags()?e.tags().filter((function(t){return t.isChild()})):[];return m("a",{href:app.route("blogArticle",{id:e.id()+"-"+e.slug()}),className:"BlogFeatured-list-item FlarumBlog-default-image",style:{backgroundImage:a},config:m.route},m("div",{className:"BlogFeatured-list-item-top"},o[0]&&m("span",null,o[0].name()),e.isSticky()&&m("span",null,m("i",{className:"fas fa-thumbtack"})),(e.blogMeta()&&1==e.blogMeta().isPendingReview()||e.isHidden())&&m("span",null,m("i",{className:"fas fa-eye-slash"})),e.blogMeta()&&1==e.blogMeta().isPendingReview()&&m("span",{title:app.translator.trans("v17development-flarum-blog.forum.review_article.pending_review"),config:tt.bind(t),"data-placement":"bottom"},m("i",{className:"far fa-clock"})," ",app.translator.trans("v17development-flarum-blog.forum.review_article.pending_review_title"))),m("div",{className:"BlogFeatured-list-item-details"},m("h4",null,e.title()),m("div",{className:"data"},m("span",null,m("i",{className:"far fa-clock"})," ",X()(e.createdAt())),m("span",null,m("i",{className:"far fa-user"})," ",e.user()?e.user().displayName():"[Deleted]"),m("span",null,m("i",{className:"far fa-comment"})," ",e.commentCount()))))})))),m("div",{className:"BlogScrubber"},m("div",{className:"BlogList"},this.isLoading&&[!1,!1,!0,!1].map((function(t){return m("div",{className:"BlogList-item BlogList-item-"+(!0===t?"sized":"default")+" BlogList-item-ghost"},m("div",{className:"BlogList-item-photo FlarumBlog-default-image"}),m("div",{className:"BlogList-item-content"},m("h4",null," "),m("p",null," "),m("div",{className:"data"},m("span",null,m("i",{className:"far fa-wave"})))))})),!this.isLoading&&this.posts.length>=1&&this.posts.map((function(e){var a=e.blogMeta()&&e.blogMeta().featuredImage()?"url("+e.blogMeta().featuredImage()+")":null,o=e.blogMeta()&&e.blogMeta().isSized(),r=e.blogMeta()&&e.blogMeta().summary()?e.blogMeta().summary():"";return m("a",{href:app.route("blogArticle",{id:e.id()+"-"+e.slug()}),className:"BlogList-item BlogList-item-"+(o?"sized":"default"),config:m.route},m("div",{className:"BlogList-item-photo FlarumBlog-default-image",style:{backgroundImage:a}}),m("div",{className:"BlogList-item-content"},m("h4",null,e.title(),(e.blogMeta()&&1==e.blogMeta().isPendingReview()||e.isHidden())&&m("i",{className:"fas fa-eye-slash"}),e.blogMeta()&&1==e.blogMeta().isPendingReview()&&m("i",{className:"far fa-clock",title:app.translator.trans("v17development-flarum-blog.forum.review_article.pending_review"),config:tt.bind(t)})),m("p",null,r),m("div",{className:"data"},m("span",null,m("i",{className:"far fa-clock"})," ",X()(e.createdAt())),m("span",null,m("i",{className:"far fa-user"})," ",e.user()?e.user().displayName():"[Deleted]"),m("span",null,m("i",{className:"far fa-comment"})," ",e.commentCount()))))})),!this.isLoading&&this.featuredPosts.length>0&&0===this.posts.length&&m("p",{className:"FlarumBlog-reached-end"},app.translator.trans("v17development-flarum-blog.forum.no_more_posts")),!this.isLoading&&0===this.featuredPosts.length&&0===this.posts.length&&m("p",{className:"FlarumBlog-reached-end"},app.translator.trans("v17development-flarum-blog.forum.category_empty"))),m("div",{className:"Sidebar"},m(H,null)))))},a.newArticle=function(){var t=new Z({user:app.session.user}),e=[];app.forum.attribute("blogTags").forEach((function(t){var a=app.store.getById("tags",t);a&&0===e.length&&!a.isChild()&&e.push(a)})),t.tags=e,app.composer.load(t),app.composer.show()},e}(i.a),at=a(25),ot=a.n(at),rt=a(26),it=a.n(rt),st=a(5),nt=function(){Object(st.extend)(ot.a.prototype,"config",(function(){var t=this.currentTag(),e="both"===app.forum.attribute("blogRedirectsEnabled")||"tags_only"===app.forum.attribute("blogRedirectsEnabled");if(t&&e){var a=app.forum.attribute("blogTags");(a.indexOf(t.id())>=0||t.parent()&&a.indexOf(t.parent().id())>=0)&&m.route(app.route("blog"))}})),Object(st.override)(it.a.prototype,"show",(function(t,e){if(!(("both"===app.forum.attribute("blogRedirectsEnabled")||"discussions_only"===app.forum.attribute("blogRedirectsEnabled"))&&e&&e&&e.tags().length>0))return t();var a=app.forum.attribute("blogTags");if(e.tags().filter((function(t){return a.indexOf(t.id())>=0||t.parent()&&a.indexOf(t.parent().id())>=0})).length>0){var o=app.route("blogArticle",{id:e.id()+"-"+e.slug()});m.route(o,null,!0)}}))},lt=a(27),mt=function(t){function e(){return t.apply(this,arguments)||this}return Object(o.a)(e,t),e}(a.n(lt)()(J.a,{discussion:J.a.hasOne("discussion"),featuredImage:J.a.attribute("featuredImage"),summary:J.a.attribute("summary"),isFeatured:J.a.attribute("isFeatured"),isSized:J.a.attribute("isSized"),isPendingReview:J.a.attribute("isPendingReview")})),ut=a(28),ct=a.n(ut);function pt(){Object(st.extend)(ct.a.prototype,"view",(function(t){var e=this;if(0==app.forum.attribute("blogHideTags"))return t;var a=app.forum.attribute("blogTags")||[],o=t.children[1].children[1].children[0].children;return t.children[1].children[1].children[0].children=o.map((function(t,o){return a.indexOf(e.tags[o].id())>=0?null:t})),t}))}var dt=function(){var t=app.route.discussion;app.route.discussion=function(e,a){var o=!1;if(("both"===app.forum.attribute("blogRedirectsEnabled")||"discussions_only"===app.forum.attribute("blogRedirectsEnabled"))&&e.tags().length>0){var r=app.forum.attribute("blogTags");e.tags().filter((function(t){return r.indexOf(t.id())>=0||t.parent()&&r.indexOf(t.parent().id())>=0})).length>0&&(o=!0)}if(o){var i=e.slug();return app.route("blogArticle",{id:e.id()+(i.trim()?"-"+i:"")})}return t(e,a)}};function gt(){return(gt=Object.assign||function(t){for(var e=1;e\r\n

{app.translator.trans('v17development-flarum-blog.forum.categories')}

\r\n\r\n {this.blogCategories && this.blogCategories.map(tagId => {\r\n const tag = app.store.getById('tags', tagId);\r\n\r\n if(!tag) return null; \r\n\r\n const tags = [];\r\n\r\n // Add tag\r\n tags.push(\r\n this.categoryItem(tag)\r\n );\r\n\r\n // Add tags\r\n app.store.all('tags').forEach(_tag => {\r\n if(_tag.isChild() && _tag.parent().id() === tag.id()) {\r\n tags.push(this.categoryItem(_tag));\r\n }\r\n });\r\n \r\n return tags;\r\n })}\r\n
\r\n )\r\n }\r\n\r\n // Category item\r\n categoryItem(tag) {\r\n return (\r\n \r\n \r\n \r\n \r\n {tag.name()}\r\n \r\n )\r\n }\r\n}","import Modal from 'flarum/components/Modal';\r\nimport Button from 'flarum/components/Button';\r\nimport ItemList from 'flarum/utils/ItemList';\r\nimport Switch from 'flarum/components/Switch';\r\n\r\nexport default class BlogPostSettingsModal extends Modal {\r\n init() {\r\n super.init();\r\n\r\n this.isNew = this.props.article.blogMeta() ? false : true;\r\n this.meta = this.props.article.blogMeta() ? this.props.article.blogMeta() : app.store.createRecord('blogMeta');\r\n \r\n this.summary = m.prop(this.meta.summary() || '');\r\n\r\n this.featuredImage = m.prop(this.meta.featuredImage() || '');\r\n\r\n this.isFeatured = m.prop(this.meta.isFeatured() || false);\r\n this.isSized = m.prop(this.meta.isSized() || false);\r\n this.isPendingReview = m.prop(this.meta.isPendingReview() || false);\r\n }\r\n\r\n className() {\r\n return 'Modal--small Support-Modal';\r\n }\r\n\r\n title() {\r\n return 'Blog post settings';\r\n }\r\n\r\n content() {\r\n return (\r\n
\r\n
\r\n {this.fields().toArray()}\r\n
\r\n
\r\n );\r\n }\r\n\r\n fields() {\r\n const items = new ItemList();\r\n\r\n items.add('summary', (\r\n
\r\n \r\n