2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-09-06 10:50:21 +08:00

List the "Watching First Post" tags on preferences

This commit is contained in:
Robin Ward 2016-07-22 16:16:45 -04:00
parent 944b2aabfe
commit b2289d733f
5 changed files with 46 additions and 32 deletions

View file

@ -158,10 +158,10 @@ const User = RestModel.extend({
'card_background', 'card_background',
'muted_tags', 'muted_tags',
'tracked_tags', 'tracked_tags',
'watched_tags' 'watched_tags',
); 'watching_first_post_tags');
[ 'email_always', ['email_always',
'mailing_list_mode', 'mailing_list_mode',
'mailing_list_mode_frequency', 'mailing_list_mode_frequency',
'external_links_in_new_tab', 'external_links_in_new_tab',

View file

@ -288,6 +288,11 @@
{{tag-chooser tags=model.tracked_tags blacklist=selectedTags allowCreate=false placeholder="" everyTag="true" unlimitedTagCount="true"}} {{tag-chooser tags=model.tracked_tags blacklist=selectedTags allowCreate=false placeholder="" everyTag="true" unlimitedTagCount="true"}}
</div> </div>
<div class="instructions">{{i18n 'user.tracked_tags_instructions'}}</div> <div class="instructions">{{i18n 'user.tracked_tags_instructions'}}</div>
<div class="controls tag-controls">
<label><span class="icon fa fa-dot-circle-o watching-first-post"></span> {{i18n 'user.watched_first_post_tags'}}</label>
{{tag-chooser tags=model.watching_first_post_tags blacklist=selectedTags allowCreate=false placeholder="" everyTag="true" unlimitedTagCount="true"}}
</div>
<div class="instructions">{{i18n 'user.watched_first_post_tags_instructions'}}</div>
<div class="controls tag-controls"> <div class="controls tag-controls">
<label><span class="icon fa fa-times-circle muted"></span> {{i18n 'user.muted_tags'}}</label> <label><span class="icon fa fa-times-circle muted"></span> {{i18n 'user.muted_tags'}}</label>
{{tag-chooser tags=model.muted_tags blacklist=selectedTags allowCreate=false placeholder="" everyTag="true" unlimitedTagCount="true"}} {{tag-chooser tags=model.muted_tags blacklist=selectedTags allowCreate=false placeholder="" everyTag="true" unlimitedTagCount="true"}}

View file

@ -84,6 +84,7 @@ class UserSerializer < BasicUserSerializer
private_attributes :locale, private_attributes :locale,
:muted_category_ids, :muted_category_ids,
:watched_tags, :watched_tags,
:watching_first_post_tags,
:tracked_tags, :tracked_tags,
:muted_tags, :muted_tags,
:tracked_category_ids, :tracked_category_ids,
@ -258,6 +259,10 @@ class UserSerializer < BasicUserSerializer
TagUser.lookup(object, :tracking).joins(:tag).pluck('tags.name') TagUser.lookup(object, :tracking).joins(:tag).pluck('tags.name')
end end
def watching_first_post_tags
TagUser.lookup(object, :watching_first_post).joins(:tag).pluck('tags.name')
end
def watched_tags def watched_tags
TagUser.lookup(object, :watching).joins(:tag).pluck('tags.name') TagUser.lookup(object, :watching).joins(:tag).pluck('tags.name')
end end

View file

@ -8,6 +8,7 @@ class UserUpdater
} }
TAG_NAMES = { TAG_NAMES = {
watching_first_post_tags: :watching_first_post,
watched_tags: :watching, watched_tags: :watching,
tracked_tags: :tracking, tracked_tags: :tracking,
muted_tags: :muted muted_tags: :muted

View file

@ -553,6 +553,9 @@ en:
tracked_categories_instructions: "You will automatically track all topics in these categories. A count of new posts will appear next to the topic." tracked_categories_instructions: "You will automatically track all topics in these categories. A count of new posts will appear next to the topic."
watched_first_post_categories: "Watching First Post" watched_first_post_categories: "Watching First Post"
watched_first_post_categories_instructions: "You will be notified of the first post in each new topic in these categories." watched_first_post_categories_instructions: "You will be notified of the first post in each new topic in these categories."
watched_first_post_tags: "Watching First Post"
watched_first_post_tags_instructions: "You will be notified of the first post in each new topic with these tags."
muted_categories: "Muted" muted_categories: "Muted"
muted_categories_instructions: "You will not be notified of anything about new topics in these categories, and they will not appear in latest." muted_categories_instructions: "You will not be notified of anything about new topics in these categories, and they will not appear in latest."
delete_account: "Delete My Account" delete_account: "Delete My Account"