mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
new Category.is_support attribute
This commit is contained in:
@@ -11,7 +11,7 @@ CategoryList.reopenClass({
|
|||||||
const users = Discourse.Model.extractByKey(result.featured_users, Discourse.User);
|
const users = Discourse.Model.extractByKey(result.featured_users, Discourse.User);
|
||||||
const list = Discourse.Category.list();
|
const list = Discourse.Category.list();
|
||||||
|
|
||||||
result.category_list.categories.forEach(function(c) {
|
result.category_list.categories.forEach(c => {
|
||||||
if (c.parent_category_id) {
|
if (c.parent_category_id) {
|
||||||
c.parentCategory = list.findBy('id', c.parent_category_id);
|
c.parentCategory = list.findBy('id', c.parent_category_id);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -86,6 +86,7 @@ const Category = RestModel.extend({
|
|||||||
custom_fields: this.get('custom_fields'),
|
custom_fields: this.get('custom_fields'),
|
||||||
topic_template: this.get('topic_template'),
|
topic_template: this.get('topic_template'),
|
||||||
suppress_from_homepage: this.get('suppress_from_homepage'),
|
suppress_from_homepage: this.get('suppress_from_homepage'),
|
||||||
|
is_support: this.get("is_support"),
|
||||||
},
|
},
|
||||||
type: this.get('id') ? 'PUT' : 'POST'
|
type: this.get('id') ? 'PUT' : 'POST'
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -20,6 +20,12 @@
|
|||||||
</section>
|
</section>
|
||||||
|
|
||||||
{{#if emailInEnabled}}
|
{{#if emailInEnabled}}
|
||||||
|
<section class='field'>
|
||||||
|
<label>
|
||||||
|
{{input type="checkbox" checked=category.is_support}}
|
||||||
|
{{i18n 'category.email_in_allow_strangers'}}
|
||||||
|
</label>
|
||||||
|
</section>
|
||||||
<section class='field'>
|
<section class='field'>
|
||||||
<label>
|
<label>
|
||||||
{{input type="checkbox" checked=category.email_in_allow_strangers}}
|
{{input type="checkbox" checked=category.email_in_allow_strangers}}
|
||||||
|
|||||||
@@ -178,6 +178,7 @@ class CategoriesController < ApplicationController
|
|||||||
:position,
|
:position,
|
||||||
:email_in,
|
:email_in,
|
||||||
:email_in_allow_strangers,
|
:email_in_allow_strangers,
|
||||||
|
:is_support,
|
||||||
:suppress_from_homepage,
|
:suppress_from_homepage,
|
||||||
:parent_category_id,
|
:parent_category_id,
|
||||||
:auto_close_hours,
|
:auto_close_hours,
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ class CategorySerializer < BasicCategorySerializer
|
|||||||
:position,
|
:position,
|
||||||
:email_in,
|
:email_in,
|
||||||
:email_in_allow_strangers,
|
:email_in_allow_strangers,
|
||||||
|
:is_support,
|
||||||
:suppress_from_homepage,
|
:suppress_from_homepage,
|
||||||
:can_delete,
|
:can_delete,
|
||||||
:cannot_delete_reason,
|
:cannot_delete_reason,
|
||||||
|
|||||||
@@ -1590,6 +1590,7 @@ en:
|
|||||||
email_in_allow_strangers: "Accept emails from anonymous users with no accounts"
|
email_in_allow_strangers: "Accept emails from anonymous users with no accounts"
|
||||||
email_in_disabled: "Posting new topics via email is disabled in the Site Settings. To enable posting new topics via email, "
|
email_in_disabled: "Posting new topics via email is disabled in the Site Settings. To enable posting new topics via email, "
|
||||||
email_in_disabled_click: 'enable the "email in" setting.'
|
email_in_disabled_click: 'enable the "email in" setting.'
|
||||||
|
is_support: "Transform this category into a private support portal."
|
||||||
suppress_from_homepage: "Suppress this category from the homepage."
|
suppress_from_homepage: "Suppress this category from the homepage."
|
||||||
allow_badges_label: "Allow badges to be awarded in this category"
|
allow_badges_label: "Allow badges to be awarded in this category"
|
||||||
edit_permissions: "Edit Permissions"
|
edit_permissions: "Edit Permissions"
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
class AddIsSupportToCategories < ActiveRecord::Migration
|
||||||
|
def change
|
||||||
|
add_column :categories, :is_support, :boolean, default: false, null: false
|
||||||
|
end
|
||||||
|
end
|
||||||
Reference in New Issue
Block a user