diff --git a/app/assets/javascripts/discourse/templates/list/topic_list_item.raw.hbs b/app/assets/javascripts/discourse/templates/list/topic_list_item.raw.hbs index 4ac4f7c0d..b45f2d55a 100644 --- a/app/assets/javascripts/discourse/templates/list/topic_list_item.raw.hbs +++ b/app/assets/javascripts/discourse/templates/list/topic_list_item.raw.hbs @@ -12,7 +12,6 @@ {{#if expandPinned}} {{raw "list/topic-excerpt" topic=topic}} {{/if}} - {{raw "list/action-list" topic=topic postNumbers=topic.bookmarked_post_numbers className="bookmarks" icon="bookmark"}} {{raw "list/action-list" topic=topic postNumbers=topic.liked_post_numbers className="likes" icon="heart"}} diff --git a/app/assets/javascripts/discourse/templates/topic-status.raw.hbs b/app/assets/javascripts/discourse/templates/topic-status.raw.hbs index ce30e2da8..891ff71d1 100644 --- a/app/assets/javascripts/discourse/templates/topic-status.raw.hbs +++ b/app/assets/javascripts/discourse/templates/topic-status.raw.hbs @@ -2,7 +2,11 @@
diff --git a/app/assets/javascripts/discourse/views/topic-status.js.es6 b/app/assets/javascripts/discourse/views/topic-status.js.es6 index 7c4e4c37c..5a755d32c 100644 --- a/app/assets/javascripts/discourse/views/topic-status.js.es6 +++ b/app/assets/javascripts/discourse/views/topic-status.js.es6 @@ -13,6 +13,15 @@ export default Ember.Object.extend({ results.push({icon: 'envelope', key: 'warning'}); } + if(topic.get('bookmarked')){ + var url = topic.get('url'); + var postNumbers = topic.get('bookmarked_post_numbers'); + if(postNumbers && postNumbers[0] > 1) { + url += '/' + postNumbers[0]; + } + results.push({icon: 'bookmark', key: 'bookmarked', href: url}); + } + if(topic.get('closed')){ results.push({icon: 'lock', key: 'locked'}); } diff --git a/app/assets/stylesheets/desktop/topic-list.scss b/app/assets/stylesheets/desktop/topic-list.scss index 449d9ddde..b52181b05 100644 --- a/app/assets/stylesheets/desktop/topic-list.scss +++ b/app/assets/stylesheets/desktop/topic-list.scss @@ -45,7 +45,7 @@ .fa-thumb-tack {color: $primary;} .fa-thumb-tack.unpinned {color: $primary;} a.title {color: $primary;} - a.title:visited:not(.badge-notification) {color: scale-color($primary, $lightness: 35%);} + a.title:visited:not(.badge-notification), .fa-bookmark {color: scale-color($primary, $lightness: 35%);} th, td { padding: 12px 5px; diff --git a/app/models/topic_list.rb b/app/models/topic_list.rb index 5fb0206a4..1e6a8bd57 100644 --- a/app/models/topic_list.rb +++ b/app/models/topic_list.rb @@ -44,10 +44,10 @@ class TopicList @topics = @topics_input.to_a # Attach some data for serialization to each topic - @topic_lookup = TopicUser.lookup_for(@current_user, @topics) if @current_user.present? + @topic_lookup = TopicUser.lookup_for(@current_user, @topics) if @current_user post_action_type = - if @current_user.present? + if @current_user if @opts[:filter].present? if @opts[:filter] == "bookmarked" PostActionType.types[:bookmark] @@ -57,6 +57,11 @@ class TopicList end end + # Include bookmarks if you have bookmarked topics + if @current_user && !post_action_type + post_action_type = PostActionType.types[:bookmark] if @topic_lookup.any?{|_,tu| tu && tu.bookmarked} + end + # Data for bookmarks or likes post_action_lookup = PostAction.lookup_for(@current_user, @topics, post_action_type) if post_action_type diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml index 3a931ef15..a224ce22a 100644 --- a/config/locales/client.en.yml +++ b/config/locales/client.en.yml @@ -1367,6 +1367,8 @@ en: topic_statuses: warning: help: "This is an official warning." + bookmarked: + help: "You bookmarked this topic" locked: help: "This topic is closed; it no longer accepts new replies" archived: