diff --git a/app/assets/javascripts/discourse/components/topic_information_component.js b/app/assets/javascripts/discourse/components/topic_map_component.js similarity index 73% rename from app/assets/javascripts/discourse/components/topic_information_component.js rename to app/assets/javascripts/discourse/components/topic_map_component.js index f02511f0d..7d9d3c436 100644 --- a/app/assets/javascripts/discourse/components/topic_information_component.js +++ b/app/assets/javascripts/discourse/components/topic_map_component.js @@ -1,7 +1,7 @@ /** - The information that sits in the topic map. + The topic map underneath the first post of a topic. - @class DiscourseTopicInformationComponent + @class DiscourseTopicMapComponent @extends Ember.Component @namespace Discourse @module Discourse @@ -9,12 +9,19 @@ var LINKS_SHOWN = 5; -Discourse.DiscourseTopicInformationComponent = Ember.Component.extend({ +Discourse.DiscourseTopicMapComponent = Ember.Component.extend({ mapCollapsed: true, - templateName: 'components/discourse-topic-information', + templateName: 'components/discourse-topic-map', details: Em.computed.alias('topic.details'), allLinksShown: false, + init: function() { + this._super(); + + // If the topic has a summary, expand the map by default + this.set('mapCollapsed', !this.get('topic.has_summary')); + }, + toggleMapClass: function() { return this.get('mapCollapsed') ? 'icon-chevron-down' : 'icon-chevron-up'; }.property('mapCollapsed'), diff --git a/app/assets/javascripts/discourse/templates/components/discourse-topic-information.js.handlebars b/app/assets/javascripts/discourse/templates/components/discourse-topic-map.js.handlebars similarity index 100% rename from app/assets/javascripts/discourse/templates/components/discourse-topic-information.js.handlebars rename to app/assets/javascripts/discourse/templates/components/discourse-topic-map.js.handlebars diff --git a/app/assets/javascripts/discourse/templates/post.js.handlebars b/app/assets/javascripts/discourse/templates/post.js.handlebars index 6f8c65c10..d07ccb7e3 100644 --- a/app/assets/javascripts/discourse/templates/post.js.handlebars +++ b/app/assets/javascripts/discourse/templates/post.js.handlebars @@ -70,7 +70,7 @@ </div> {{view Discourse.RepliesView content=replies postView=view}} {{discourse-action-history post=this}} - {{view Discourse.TopicMapView post=this topic=controller.model}} + {{view Discourse.TopicMapContainerView post=this topic=controller.model}} </div> <div class='span5 gutter'> diff --git a/app/assets/javascripts/discourse/views/topic_map/topic_map_view.js b/app/assets/javascripts/discourse/views/topic_map_container_view.js similarity index 83% rename from app/assets/javascripts/discourse/views/topic_map/topic_map_view.js rename to app/assets/javascripts/discourse/views/topic_map_container_view.js index ac888545d..686959c60 100644 --- a/app/assets/javascripts/discourse/views/topic_map/topic_map_view.js +++ b/app/assets/javascripts/discourse/views/topic_map_container_view.js @@ -1,12 +1,13 @@ /** - This view handles rendering of the map of the topic under the first post + This view contains the topic map as well as other relevant information underneath the + first post. - @class TopicMapView + @class TopicMapContainerView @extends Discourse.View @namespace Discourse @module Discourse **/ -Discourse.TopicMapView = Discourse.ContainerView.extend({ +Discourse.TopicMapContainerView = Discourse.ContainerView.extend({ classNameBindings: ['hidden', ':topic-map'], shouldRerender: Discourse.View.renderIfChanged('topic.posts_count'), @@ -23,7 +24,7 @@ Discourse.TopicMapView = Discourse.ContainerView.extend({ this._super(); if (this.get('hidden')) return; - this.attachViewWithArgs({ topic: this.get('topic') }, Discourse.DiscourseTopicInformationComponent); + this.attachViewWithArgs({ topic: this.get('topic') }, Discourse.DiscourseTopicMapComponent); this.trigger('appendMapInformation', this); }, diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml index 7e548b383..b6984b982 100644 --- a/config/locales/client.en.yml +++ b/config/locales/client.en.yml @@ -383,8 +383,8 @@ en: summary: enabled_description: "You're viewing a summary of this topic. To see all posts again, click below." description: "There are <b>{{count}}</b> posts in this topic. That's a lot! Would you like to save time by showing only the most relevant posts?" - enable: 'Switch to Summary view' - disable: 'Cancel Summary view' + enable: 'Summarize This Topic' + disable: 'Cancel Summary' private_message_info: title: "Private Message"