Rename TopicSummary -> TopicMap

This commit is contained in:
Robin Ward 2013-11-15 12:15:46 -05:00
parent dabdcf59c4
commit ad3e276b4b
27 changed files with 167 additions and 168 deletions

View file

@ -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'>

View file

@ -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}}

View file

@ -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>");
}
}
}

View file

@ -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
});

View file

@ -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,

View file

@ -979,7 +979,7 @@ cs:
more: "ještě {{n}}..."
left: "{{n}} zbývá"
topic_summary:
topic_map:
title: "Souhrn tématu"
links_shown: "zobrazit všech {{totalLinks}} odkazů..."
clicks: "počet kliknutí"

View file

@ -616,7 +616,7 @@ da:
more: "{{n}} to go..."
left: "{{n}} remaining"
topic_summary:
topic_map:
title: "Topic Summary"
links_shown: "show all {{totalLinks}} links..."

View file

@ -969,7 +969,7 @@ de:
more: "{{n}} weitere..."
left: "{{n}} übrig"
topic_summary:
topic_map:
title: "Zusammenfassung des Themas"
links_shown: "Zeige alle {{totalLinks}} Links..."
clicks: "Klicks"

View file

@ -1003,7 +1003,7 @@ en:
more: "{{n}} to go..."
left: "{{n}} remaining"
topic_summary:
topic_map:
title: "Topic Summary"
links_shown: "show all {{totalLinks}} links..."
clicks: "clicks"

View file

@ -726,7 +726,7 @@ es:
more: "{{n}} para ir..."
left: "{{n}} restantes"
topic_summary:
topic_map:
title: "Resumen de temas"
links_shown: "mostrar los {{totalLinks}} links..."

View file

@ -960,7 +960,7 @@ fr:
at_least: "saisissez au moins {{n}} caractères"
more: "{{n}} restants..."
left: "{{n}} restants"
topic_summary:
topic_map:
title: "Résumé de la discussion"
links_shown: "montrer les {{totalLinks}} liens..."
clicks: "clics"

View file

@ -572,7 +572,7 @@ id:
more: "{{n}} to go..."
left: "{{n}} remaining"
topic_summary:
topic_map:
title: "Topic Summary"
links_shown: "show all {{totalLinks}} links..."

View file

@ -927,7 +927,7 @@ it:
more: "ancora {{n}}..."
left: "{{n}} rimanenti"
topic_summary:
topic_map:
title: "Riepilogo del Topic"
links_shown: "mostra tutti i {{totalLinks}} link..."
clicks: "click"

View file

@ -993,7 +993,7 @@ ko:
more: "{{n}} 이동합니다..."
left: "{{n}} 나머지"
topic_summary:
topic_map:
title: "토픽 요약"
links_shown: "모든 {{totalLinks}} 링크 보기..."
clicks: "클릭"
@ -1410,4 +1410,3 @@ ko:
site_description: '사이트 설명'

View file

@ -840,7 +840,7 @@ nb_NO:
more: "{{n}} igjen..."
left: "{{n}} gjenstående"
topic_summary:
topic_map:
title: "Emneoppsummering"
links_shown: "vis alle {{totalLinks}} linker..."
clicks: "klikk"

View file

@ -998,7 +998,7 @@ nl:
more: "Nog {{n}} te gaan..."
left: "Nog {{n}} resterend"
topic_summary:
topic_map:
title: "Topic samenvatting"
links_shown: "laat alle {{totalLinks}} links zien..."
clicks: clicks

View file

@ -897,7 +897,7 @@ pseudo:
at_least: '[[ éɳťéř áť łéášť {{n}} čĥářáčťéřš ]]'
more: '[[ {{n}} ťó ǧó... ]]'
left: '[[ {{n}} řéɱáíɳíɳǧ ]]'
topic_summary:
topic_map:
title: '[[ Ťóƿíč Šůɱɱářý ]]'
links_shown: '[[ šĥóŵ áłł {{totalLinks}} łíɳǩš... ]]'
clicks: '[[ čłíčǩš ]]'

View file

@ -537,7 +537,7 @@ pt:
more: "{{n}} em falta..."
left: "{{n}} restantes"
topic_summary:
topic_map:
title: "Sumário do Tópico"
links_shown: "mostrar todos os {{totalLinks}} links..."

View file

@ -989,7 +989,7 @@ pt_BR:
more: "{{n}} em falta..."
left: "{{n}} restantes"
topic_summary:
topic_map:
title: "Sumário do Tópico"
links_shown: "mostrar todos os {{totalLinks}} links..."
clicks: "clicks"

View file

@ -1010,7 +1010,7 @@ ru:
at_least: 'введите как минимум {{n}} символов'
more: 'ещё {{n}} символов...'
left: 'осталось {{n}} символов'
topic_summary:
topic_map:
title: 'Сводка по теме'
links_shown: 'показать все {{totalLinks}} ссылок...'
clicks: переходов

View file

@ -716,7 +716,7 @@ sv:
more: "{{n}} fler..."
left: "{{n}} kvar"
topic_summary:
topic_map:
title: "Trådsammanfattning"
links_shown: "Visa alla {{totalLinks}} länkar..."

View file

@ -999,7 +999,7 @@ zh_CN:
more: "还差 {{n}} 个……"
left: "还剩下 {{n}}"
topic_summary:
topic_map:
title: "主题概要"
links_shown: "显示所有 {{totalLinks}} 个链接……"
clicks: "点击"

View file

@ -890,7 +890,7 @@ zh_TW:
more: "還差 {{n}} 個……"
left: "還剩下 {{n}}"
topic_summary:
topic_map:
title: "主題概要"
links_shown: "顯示所有 {{totalLinks}} 個鏈接……"
clicks: "點擊"

View file

@ -162,7 +162,7 @@ class TopicView
end
def links
@links ||= TopicLink.topic_summary(guardian, @topic.id)
@links ||= TopicLink.topic_map(guardian, @topic.id)
end
def link_counts

View file

@ -253,7 +253,7 @@ describe TopicLink do
end
end
describe 'counts_for and topic_summary' do
describe 'counts_for and topic_map' do
it 'returns blank without posts' do
TopicLink.counts_for(Guardian.new, nil, nil).should be_blank
end
@ -279,7 +279,7 @@ describe TopicLink do
counts_for[post.id].find {|l| l[:url] == 'http://google.com'}[:clicks].should == 0
counts_for[post.id].first[:clicks].should == 1
array = TopicLink.topic_summary(Guardian.new, post.topic_id)
array = TopicLink.topic_map(Guardian.new, post.topic_id)
array.length.should == 4
array[0]["clicks"].should == "1"
end
@ -292,7 +292,7 @@ describe TopicLink do
post = Fabricate(:post, raw: "hello test topic #{url}")
TopicLink.extract_from(post)
TopicLink.topic_summary(Guardian.new, post.topic_id).count.should == 1
TopicLink.topic_map(Guardian.new, post.topic_id).count.should == 1
TopicLink.counts_for(Guardian.new, post.topic, [post]).length.should == 1
category.set_permissions(:staff => :full)
@ -300,8 +300,8 @@ describe TopicLink do
admin = Fabricate(:admin)
TopicLink.topic_summary(Guardian.new, post.topic_id).count.should == 0
TopicLink.topic_summary(Guardian.new(admin), post.topic_id).count.should == 1
TopicLink.topic_map(Guardian.new, post.topic_id).count.should == 0
TopicLink.topic_map(Guardian.new(admin), post.topic_id).count.should == 1
TopicLink.counts_for(Guardian.new, post.topic, [post]).length.should == 0
TopicLink.counts_for(Guardian.new(admin), post.topic, [post]).length.should == 1