mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Rename TopicSummary -> TopicMap
This commit is contained in:
@@ -70,7 +70,7 @@
|
||||
</div>
|
||||
{{view Discourse.RepliesView contentBinding="replies" postViewBinding="view"}}
|
||||
{{view Discourse.ActionsHistoryView postBinding="this"}}
|
||||
{{view Discourse.TopicSummaryView postBinding="this"}}
|
||||
{{view Discourse.TopicMapView postBinding="this"}}
|
||||
</div>
|
||||
|
||||
<div class='span5 gutter'>
|
||||
|
||||
@@ -82,10 +82,10 @@
|
||||
<ul class='topic-links'>
|
||||
{{#groupedEach view.parentView.infoLinks}}
|
||||
<li>
|
||||
<span class='badge badge-notification clicks' title='{{i18n topic_summary.clicks}}'>{{clicks}}</span>
|
||||
<span class='badge badge-notification clicks' title='{{i18n topic_map.clicks}}'>{{clicks}}</span>
|
||||
<a href="{{unbound url}}" target="_blank" class='topic-link track-link' data-user-id="{{unbound user_id}}" data-ignore-post-id="true" title="{{unbound url}}">
|
||||
{{#if title}}{{shorten title}}{{else}}{{shortenUrl url}}{{/if}}
|
||||
{{#if internal}}<i class='icon-arrow-right' title='{{i18n topic_summary.topic_link}}'></i>{{/if}}
|
||||
{{#if internal}}<i class='icon-arrow-right' title='{{i18n topic_map.topic_link}}'></i>{{/if}}
|
||||
</a>
|
||||
</li>
|
||||
{{/groupedEach}}
|
||||
@@ -93,7 +93,7 @@
|
||||
|
||||
{{#if view.parentView.showAllLinksControls}}
|
||||
<div class='link-summary'>
|
||||
<a href='#' {{action showAllLinks target="view.parentView"}}>{{i18n topic_summary.links_shown totalLinks="details.links.length"}}</a>
|
||||
<a href='#' {{action showAllLinks target="view.parentView"}}>{{i18n topic_map.links_shown totalLinks="details.links.length"}}</a>
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
@@ -125,7 +125,7 @@ Discourse.PostView = Discourse.GroupedView.extend(Ember.Evented, {
|
||||
if (link.closest('.badge-category').length === 0) {
|
||||
// nor in oneboxes (except when we force it)
|
||||
if (link.closest(".onebox-result").length === 0 || link.hasClass("track-link")) {
|
||||
link.append("<span class='badge badge-notification clicks' title='" + I18n.t("topic_summary.clicks") + "'>" + lc.clicks + "</span>");
|
||||
link.append("<span class='badge badge-notification clicks' title='" + I18n.t("topic_map.clicks") + "'>" + lc.clicks + "</span>");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
/**
|
||||
This view handles rendering of the summary of the topic under the first post
|
||||
|
||||
@class TopicSummaryView
|
||||
@class TopicMapView
|
||||
@extends Discourse.View
|
||||
@namespace Discourse
|
||||
@module Discourse
|
||||
**/
|
||||
Discourse.TopicSummaryView = Discourse.ContainerView.extend({
|
||||
Discourse.TopicMapView = Discourse.ContainerView.extend({
|
||||
classNameBindings: ['hidden', ':topic-summary'],
|
||||
allLinksShown: false,
|
||||
|
||||
@@ -14,7 +14,7 @@ Discourse.TopicSummaryView = Discourse.ContainerView.extend({
|
||||
|
||||
showAllLinksControls: function() {
|
||||
if (this.get('allLinksShown')) return false;
|
||||
if ((this.get('topic.details.links.length') || 0) <= Discourse.TopicSummaryView.LINKS_SHOWN) return false;
|
||||
if ((this.get('topic.details.links.length') || 0) <= Discourse.TopicMapView.LINKS_SHOWN) return false;
|
||||
return true;
|
||||
}.property('allLinksShown', 'topic.details.links'),
|
||||
|
||||
@@ -23,7 +23,7 @@ Discourse.TopicSummaryView = Discourse.ContainerView.extend({
|
||||
|
||||
var allLinks = this.get('topic.details.links');
|
||||
if (this.get('allLinksShown')) return allLinks;
|
||||
return allLinks.slice(0, Discourse.TopicSummaryView.LINKS_SHOWN);
|
||||
return allLinks.slice(0, Discourse.TopicMapView.LINKS_SHOWN);
|
||||
}.property('topic.details.links', 'allLinksShown'),
|
||||
|
||||
shouldRerender: Discourse.View.renderIfChanged('topic.posts_count'),
|
||||
@@ -40,7 +40,7 @@ Discourse.TopicSummaryView = Discourse.ContainerView.extend({
|
||||
if (this.get('hidden')) return;
|
||||
|
||||
this.attachViewWithArgs({
|
||||
templateName: 'topic_summary/info',
|
||||
templateName: 'topic_map/info',
|
||||
content: this.get('controller')
|
||||
}, Discourse.GroupedView);
|
||||
|
||||
@@ -56,7 +56,7 @@ Discourse.TopicSummaryView = Discourse.ContainerView.extend({
|
||||
// If we have a best of view
|
||||
if (this.get('controller.has_best_of')) {
|
||||
container.attachViewWithArgs({
|
||||
templateName: 'topic_summary/best_of_toggle',
|
||||
templateName: 'topic_map/best_of_toggle',
|
||||
tagName: 'section',
|
||||
classNames: ['information'],
|
||||
content: this.get('controller')
|
||||
@@ -66,7 +66,7 @@ Discourse.TopicSummaryView = Discourse.ContainerView.extend({
|
||||
// If we have a private message
|
||||
if (this.get('topic.isPrivateMessage')) {
|
||||
container.attachViewWithArgs({
|
||||
templateName: 'topic_summary/private_message',
|
||||
templateName: 'topic_map/private_message',
|
||||
tagName: 'section',
|
||||
classNames: ['information'],
|
||||
content: this.get('controller')
|
||||
@@ -75,6 +75,6 @@ Discourse.TopicSummaryView = Discourse.ContainerView.extend({
|
||||
}
|
||||
});
|
||||
|
||||
Discourse.TopicSummaryView.reopenClass({
|
||||
Discourse.TopicMapView.reopenClass({
|
||||
LINKS_SHOWN: 5
|
||||
});
|
||||
@@ -22,7 +22,7 @@ class TopicLink < ActiveRecord::Base
|
||||
errors.add(:base, "can't link to the same topic") if (topic_id == link_topic_id)
|
||||
end
|
||||
|
||||
def self.topic_summary(guardian, topic_id)
|
||||
def self.topic_map(guardian, topic_id)
|
||||
|
||||
# Sam: complicated reports are really hard in AR
|
||||
builder = SqlBuilder.new("SELECT ftl.url,
|
||||
|
||||
Reference in New Issue
Block a user