new Category.is_support attribute

This commit is contained in:
Régis Hanol 2015-11-24 18:45:50 +01:00
parent 0d54c18c8b
commit 9ef8397164
7 changed files with 16 additions and 1 deletions

View file

@ -11,7 +11,7 @@ CategoryList.reopenClass({
const users = Discourse.Model.extractByKey(result.featured_users, Discourse.User);
const list = Discourse.Category.list();
result.category_list.categories.forEach(function(c) {
result.category_list.categories.forEach(c => {
if (c.parent_category_id) {
c.parentCategory = list.findBy('id', c.parent_category_id);
}

View file

@ -86,6 +86,7 @@ const Category = RestModel.extend({
custom_fields: this.get('custom_fields'),
topic_template: this.get('topic_template'),
suppress_from_homepage: this.get('suppress_from_homepage'),
is_support: this.get("is_support"),
},
type: this.get('id') ? 'PUT' : 'POST'
});

View file

@ -20,6 +20,12 @@
</section>
{{#if emailInEnabled}}
<section class='field'>
<label>
{{input type="checkbox" checked=category.is_support}}
{{i18n 'category.email_in_allow_strangers'}}
</label>
</section>
<section class='field'>
<label>
{{input type="checkbox" checked=category.email_in_allow_strangers}}

View file

@ -178,6 +178,7 @@ class CategoriesController < ApplicationController
:position,
:email_in,
:email_in_allow_strangers,
:is_support,
:suppress_from_homepage,
:parent_category_id,
:auto_close_hours,

View file

@ -8,6 +8,7 @@ class CategorySerializer < BasicCategorySerializer
:position,
:email_in,
:email_in_allow_strangers,
:is_support,
:suppress_from_homepage,
:can_delete,
:cannot_delete_reason,

View file

@ -1590,6 +1590,7 @@ en:
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_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."
allow_badges_label: "Allow badges to be awarded in this category"
edit_permissions: "Edit Permissions"

View file

@ -0,0 +1,5 @@
class AddIsSupportToCategories < ActiveRecord::Migration
def change
add_column :categories, :is_support, :boolean, default: false, null: false
end
end