FEATURE: category setting for mailinglist mirror

This commit is contained in:
Gerhard Schlager 2017-11-15 17:36:52 +01:00
parent ddd4ddc020
commit 8f6d35aa59
7 changed files with 21 additions and 0 deletions

View File

@ -90,6 +90,7 @@ const Category = RestModel.extend({
position: this.get('position'), position: this.get('position'),
email_in: this.get('email_in'), email_in: this.get('email_in'),
email_in_allow_strangers: this.get('email_in_allow_strangers'), email_in_allow_strangers: this.get('email_in_allow_strangers'),
mailinglist_mirror: this.get('mailinglist_mirror'),
parent_category_id: this.get('parent_category_id'), parent_category_id: this.get('parent_category_id'),
uploaded_logo_id: this.get('uploaded_logo.id'), uploaded_logo_id: this.get('uploaded_logo.id'),
uploaded_background_id: this.get('uploaded_background.id'), uploaded_background_id: this.get('uploaded_background.id'),

View File

@ -119,6 +119,13 @@
</label> </label>
</section> </section>
<section class='field'>
<label>
{{input type="checkbox" checked=category.mailinglist_mirror}}
{{i18n 'category.mailinglist_mirror'}}
</label>
</section>
{{plugin-outlet name="category-email-in" args=(hash category=category)}} {{plugin-outlet name="category-email-in" args=(hash category=category)}}
{{/if}} {{/if}}

View File

@ -233,6 +233,7 @@ class CategoriesController < ApplicationController
:position, :position,
:email_in, :email_in,
:email_in_allow_strangers, :email_in_allow_strangers,
:mailinglist_mirror,
:suppress_from_homepage, :suppress_from_homepage,
:all_topics_wiki, :all_topics_wiki,
:parent_category_id, :parent_category_id,

View File

@ -555,6 +555,7 @@ end
# default_view :string(50) # default_view :string(50)
# subcategory_list_style :string(50) default("rows_with_featured_topics") # subcategory_list_style :string(50) default("rows_with_featured_topics")
# default_top_period :string(20) default("all") # default_top_period :string(20) default("all")
# mailinglist_mirror :boolean default(FALSE), not null
# #
# Indexes # Indexes
# #

View File

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

View File

@ -2122,6 +2122,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.'
mailinglist_mirror: "Category mirrors a mailinglist"
suppress_from_homepage: "Suppress this category from the homepage." suppress_from_homepage: "Suppress this category from the homepage."
show_subcategory_list: "Show subcategory list above topics in this category." show_subcategory_list: "Show subcategory list above topics in this category."
num_featured_topics: "Number of topics shown on the categories page:" num_featured_topics: "Number of topics shown on the categories page:"

View File

@ -0,0 +1,9 @@
class AddMailinglistMirrorToCategories < ActiveRecord::Migration[5.1]
def up
add_column :categories, :mailinglist_mirror, :boolean, default: false, null: false
end
def down
remove_column :categories, :mailinglist_mirror
end
end