Skip to content

Commit 4ce81e1

Browse files
committed
Rename "Best Of" to "Summary"
1 parent 34e451e commit 4ce81e1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+212
-227
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
/**
22
The controls for toggling the summarized view on/off
33
4-
@class DiscourseToggleBestOfComponent
4+
@class DiscourseToggleSummaryComponent
55
@extends Ember.Component
66
@namespace Discourse
77
@module Discourse
88
**/
9-
Discourse.DiscourseToggleBestOfComponent = Ember.Component.extend({
10-
templateName: 'components/discourse-toggle-best-of',
9+
Discourse.DiscourseToggleSummaryComponent = Ember.Component.extend({
10+
templateName: 'components/discourse-toggle-summary',
1111
tagName: 'section',
1212
classNames: ['information'],
1313
postStream: Em.computed.alias('topic.postStream'),
1414

1515
actions: {
16-
toggleBestOf: function() {
17-
this.get('postStream').toggleBestOf();
16+
toggleSummary: function() {
17+
this.get('postStream').toggleSummary();
1818
}
1919
}
2020
});

app/assets/javascripts/discourse/models/post_stream.js

+12-12
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ Discourse.PostStream = Em.Object.extend({
9797
**/
9898
streamFilters: function() {
9999
var result = {};
100-
if (this.get('bestOf')) { result.filter = "best_of"; }
100+
if (this.get('summary')) { result.filter = "summary"; }
101101

102102
var userFilters = this.get('userFilters');
103103
if (userFilters) {
@@ -106,7 +106,7 @@ Discourse.PostStream = Em.Object.extend({
106106
}
107107

108108
return result;
109-
}.property('userFilters.[]', 'bestOf'),
109+
}.property('userFilters.[]', 'summary'),
110110

111111
/**
112112
The text describing the current filters. For display in the pop up at the bottom of the
@@ -117,9 +117,9 @@ Discourse.PostStream = Em.Object.extend({
117117
filterDesc: function() {
118118
var streamFilters = this.get('streamFilters');
119119

120-
if (streamFilters.filter && streamFilters.filter === "best_of") {
121-
return I18n.t("topic.filters.best_of", {
122-
n_best_posts: I18n.t("topic.filters.n_best_posts", { count: this.get('filteredPostsCount') }),
120+
if (streamFilters.filter && streamFilters.filter === "summary") {
121+
return I18n.t("topic.filters.summary", {
122+
n_summarized_posts: I18n.t("topic.filters.n_summarized_posts", { count: this.get('filteredPostsCount') }),
123123
of_n_posts: I18n.t("topic.filters.of_n_posts", { count: this.get('topic.posts_count') })
124124
});
125125
} else if (streamFilters.username_filters) {
@@ -184,19 +184,19 @@ Discourse.PostStream = Em.Object.extend({
184184
@returns {Ember.Deferred} a promise that resolves when the filter has been cancelled.
185185
**/
186186
cancelFilter: function() {
187-
this.set('bestOf', false);
187+
this.set('summary', false);
188188
this.get('userFilters').clear();
189189
return this.refresh();
190190
},
191191

192192
/**
193-
Toggle best of mode on the stream.
193+
Toggle summary mode for the stream.
194194
195-
@method toggleBestOf
196-
@returns {Ember.Deferred} a promise that resolves when the best of stream has loaded.
195+
@method toggleSummary
196+
@returns {Ember.Deferred} a promise that resolves when the summary stream has loaded.
197197
**/
198-
toggleBestOf: function() {
199-
this.toggleProperty('bestOf');
198+
toggleSummary: function() {
199+
this.toggleProperty('summary');
200200
this.refresh();
201201
},
202202

@@ -691,7 +691,7 @@ Discourse.PostStream.reopenClass({
691691
stream: Em.A(),
692692
userFilters: Em.Set.create(),
693693
postIdentityMap: Em.Map.create(),
694-
bestOf: false,
694+
summary: false,
695695
loaded: false,
696696
loadingAbove: false,
697697
loadingBelow: false,

app/assets/javascripts/discourse/models/topic.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -340,9 +340,9 @@ Discourse.Topic.reopenClass({
340340
});
341341
}
342342

343-
// Add the best of filter if we have it
344-
if (opts.bestOf === true) {
345-
data.best_of = true;
343+
// Add the summary of filter if we have it
344+
if (opts.summary === true) {
345+
data.summary = true;
346346
}
347347

348348
// Check the preload store. If not, load it via JSON

app/assets/javascripts/discourse/routes/topic_from_params_route.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ Discourse.TopicFromParamsRoute = Discourse.Route.extend({
1818

1919
var queryParams = Discourse.URL.get('queryParams');
2020
if (queryParams) {
21-
// Set bestOf on the postStream if present
22-
postStream.set('bestOf', Em.get(queryParams, 'filter') === 'best_of');
21+
// Set summary on the postStream if present
22+
postStream.set('summary', Em.get(queryParams, 'filter') === 'summary');
2323

2424
// Set any username filters on the postStream
2525
var userFilters = Em.get(queryParams, 'username_filters') || Em.get(queryParams, 'username_filters[]');

app/assets/javascripts/discourse/templates/components/discourse-basic-topic-list.js.handlebars

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444

4545
<td class='num likes'>
4646
{{#if topic.like_count}}
47-
<a href='{{unbound topic.url}}{{#if topic.has_best_of}}?filter=best_of{{/if}}'>{{unbound topic.like_count}} <i class='icon-heart'></i></a>
47+
<a href='{{unbound topic.url}}{{#if topic.has_summary}}?filter=summary{{/if}}'>{{unbound topic.like_count}} <i class='icon-heart'></i></a>
4848
{{/if}}
4949
</td>
5050

app/assets/javascripts/discourse/templates/components/discourse-toggle-best-of.js.handlebars

-9
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{{#if postStream.summary}}
2+
<p>{{{i18n summary.enabled_description}}}</p>
3+
<button class='btn' {{action toggleSummary}}>{{i18n summary.disable}}</button>
4+
{{else}}
5+
<p>{{{i18n summary.description count="topic.posts_count"}}}</p>
6+
<button class='btn' {{action toggleSummary}}>{{i18n summary.enable}}</button>
7+
{{/if}}

app/assets/javascripts/discourse/templates/list/topic_list_item.js.handlebars

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757

5858
<td class='num likes'>
5959
{{#if like_count}}
60-
<a href='{{url}}{{#if has_best_of}}?filter=best_of{{/if}}' title='{{i18n topic.likes count="like_count"}}'>{{number like_count numberKey="likes_long"}} <i class='icon-heart'></i></a>
60+
<a href='{{url}}{{#if has_summary}}?filter=summary{{/if}}' title='{{i18n topic.likes count="like_count"}}'>{{number like_count numberKey="likes_long"}} <i class='icon-heart'></i></a>
6161
{{/if}}
6262
</td>
6363

app/assets/javascripts/discourse/templates/mobile/list/topic_list_item.js.handlebars

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
<div class='num posts'><a href="{{lastUnreadUrl}}">{{number posts_count numberKey="posts_long"}}</a></div>
4646

4747
{{#if like_count}}
48-
<div class='num likes'><a href='{{url}}{{#if has_best_of}}?filter=best_of{{/if}}' title='{{i18n topic.likes count="like_count"}}'><i class='icon-heart'></i> {{number like_count numberKey="likes_long"}}</a></div>
48+
<div class='num likes'><a href='{{url}}{{#if has_summary}}?filter=summary{{/if}}' title='{{i18n topic.likes count="like_count"}}'><i class='icon-heart'></i> {{number like_count numberKey="likes_long"}}</a></div>
4949
{{/if}}
5050

5151
<div class='last-poster'>

app/assets/javascripts/discourse/views/topic_map/topic_map_view.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ Discourse.TopicMapView = Discourse.ContainerView.extend({
3030
appendMapInformation: function(container) {
3131
var topic = this.get('topic');
3232

33-
// If we have a best of capability
34-
if (topic.get('has_best_of')) {
35-
container.attachViewWithArgs({ topic: topic }, Discourse.DiscourseToggleBestOfComponent);
33+
// If we have a summary capability
34+
if (topic.get('has_summary')) {
35+
container.attachViewWithArgs({ topic: topic }, Discourse.DiscourseToggleSummaryComponent);
3636
}
3737

3838
// If we have a private message

app/models/post.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,8 @@ def self.reverse_order
175175
order('sort_order desc, post_number desc')
176176
end
177177

178-
def self.best_of
179-
where(["(post_number = 1) or (percent_rank <= ?)", SiteSetting.best_of_percent_filter.to_f / 100.0])
178+
def self.summary
179+
where(["(post_number = 1) or (percent_rank <= ?)", SiteSetting.summary_percent_filter.to_f / 100.0])
180180
end
181181

182182
def update_flagged_posts_count

app/models/topic.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -692,7 +692,7 @@ def apply_per_day_rate_limit_for(key, method_name)
692692
# closed :boolean default(FALSE), not null
693693
# archived :boolean default(FALSE), not null
694694
# bumped_at :datetime not null
695-
# has_best_of :boolean default(FALSE), not null
695+
# has_summary :boolean default(FALSE), not null
696696
# meta_data :hstore
697697
# vote_count :integer default(0), not null
698698
# archetype :string(255) default("regular"), not null

app/serializers/topic_list_item_serializer.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ class TopicListItemSerializer < ListableTopicSerializer
33
attributes :views,
44
:like_count,
55
:starred,
6-
:has_best_of,
6+
:has_summary,
77
:archetype,
88
:rank_details,
99
:last_poster_username,

app/serializers/topic_view_serializer.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def self.topic_attributes
1616
:visible,
1717
:closed,
1818
:archived,
19-
:has_best_of,
19+
:has_summary,
2020
:archetype,
2121
:slug,
2222
:category_id,

config/locales/client.cs.yml

+3-4
Original file line numberDiff line numberDiff line change
@@ -355,8 +355,7 @@ cs:
355355
unmute: Zrušit ignorování
356356
last_post: Poslední příspěvek
357357

358-
best_of:
359-
title: "Nejlepší příspěvky"
358+
summary:
360359
enabled_description: Právě máte zobrazeny "nejlepší příspěvky" tohoto tématu.
361360
description: "V tomto tématu je <b>{{count}}</b> příspěvků. A to už je hodně! Nechcete ušetřit čas při čtení tím, že zobrazíte pouze příspěvky, které mají nejvíce interakcí a odpovědí?"
362361
enable: 'Přepnout na "nejlepší příspěvky"'
@@ -724,8 +723,8 @@ cs:
724723
few: "od {{count}} vybraného uživatele"
725724
other: "od {{count}} vybraných uživatelů"
726725

727-
best_of: "{{n_best_posts}} {{of_n_posts}}."
728-
n_best_posts:
726+
summary: "{{n_summarized_posts}} {{of_n_posts}}."
727+
n_summarized_posts:
729728
one: "Je zobrazen 1 nejlepší příspěvek"
730729
few: "Jsou zobrazeny {{count}} nejlepší příspěvky"
731730
other: "Je zobrazeno {{count}} nejlepších příspěvků"

config/locales/client.da.yml

+2-3
Original file line numberDiff line numberDiff line change
@@ -212,8 +212,7 @@ da:
212212
unmute: Unmute
213213
last_post: Sidste indlæg
214214

215-
best_of:
216-
title: "Topindlæg"
215+
summary:
217216
description: "Der er <b>{{count}}</b> indlæg i dette emne. Det er mange! Vil du gerne spare lidt tid, ved kun at se de indlæg der har flest interaktioner og svar?"
218217
button: 'Vis kun “Topindlæg”'
219218

@@ -502,7 +501,7 @@ da:
502501

503502
filters:
504503
user: "Du ser kun endlæg fra specifikke brugere."
505-
best_of: "Du ser kun “Topindlæg”."
504+
summary: "Du ser kun “Topindlæg”."
506505
cancel: "Se alle indlæg i emnet."
507506

508507
move_selected:

config/locales/client.de.yml

+3-4
Original file line numberDiff line numberDiff line change
@@ -363,8 +363,7 @@ de:
363363
unmute: Wieder beachten
364364
last_post: Letzter Beitrag
365365

366-
best_of:
367-
title: "Top-Beiträge"
366+
summary:
368367
enabled_description: Du siehst gerade die Top-Beiträge dieses Themas.
369368
description: "Es gibt <b>{{count}}</b> Beiträge zu diesem Thema. Das sind eine Menge! Möchtest Du Zeit sparen und nur die Beiträge mit den meisten Antworten und Nutzerreaktionen betrachten?"
370369
enable: 'Nur die Top-Beiträge anzeigen'
@@ -730,8 +729,8 @@ de:
730729
one: "von einem Benutzer"
731730
other: "von {{count}} Benutzern"
732731

733-
best_of: "Du betrachtest {{n_best_posts}} {{of_n_posts}}."
734-
n_best_posts:
732+
summary: "Du betrachtest {{n_summarized_posts}} {{of_n_posts}}."
733+
n_summarized_posts:
735734
one: "den besten Beitrag"
736735
other: "{{count}} besten Beiträge"
737736
of_n_posts:

config/locales/client.en.yml

+9-10
Original file line numberDiff line numberDiff line change
@@ -380,12 +380,11 @@ en:
380380
unmute: Unmute
381381
last_post: Last post
382382

383-
best_of:
384-
title: "Best Of"
385-
enabled_description: "You're viewing only the best posts in this topic. To see all posts again, click below."
386-
description: "There are <b>{{count}}</b> posts in this topic. That's a lot! Would you like to save time by showing only the best posts?"
387-
enable: 'Switch to "Best Of" view'
388-
disable: 'Cancel "Best Of"'
383+
summary:
384+
enabled_description: "You're viewing a summary of this topic. To see all posts again, click below."
385+
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?"
386+
enable: 'Switch to Summary view'
387+
disable: 'Cancel Summary view'
389388

390389
private_message_info:
391390
title: "Private Message"
@@ -758,10 +757,10 @@ en:
758757
one: "made by 1 specific user"
759758
other: "made by {{count}} specific users"
760759

761-
best_of: "You're viewing the {{n_best_posts}} {{of_n_posts}}."
762-
n_best_posts:
763-
one: "1 best post"
764-
other: "{{count}} best posts"
760+
summary: "You're viewing the {{n_summarized_posts}} {{of_n_posts}}."
761+
n_summarized_posts:
762+
one: "1 summarized post"
763+
other: "{{count}} summarized posts"
765764
of_n_posts:
766765
one: "of 1 in the topic"
767766
other: "of {{count}} in the topic"

config/locales/client.es.yml

+3-4
Original file line numberDiff line numberDiff line change
@@ -297,8 +297,7 @@ es:
297297
unmute: Quitar silencio
298298
last_post: Última publicación
299299

300-
best_of:
301-
title: "Lo Mejor De"
300+
summary:
302301
description: "Hay <b>{{count}}</b> publicaciones en este tema. ¡Son muchas! ¿Te gustaría ahorrar algo de tiempo viendo sólo las publicaciones con más interacciones y respuestas?"
303302
button: 'Cambiar a la vista "Lo Mejor De"'
304303

@@ -602,8 +601,8 @@ es:
602601
one: "hechos por 1 usuario específico"
603602
other: "hechos por {{count}} usuarios específicos"
604603

605-
best_of: "Estás viendo el {{n_best_posts}} {{of_n_posts}}."
606-
n_best_posts:
604+
summary: "Estás viendo el {{n_summarized_posts}} {{of_n_posts}}."
605+
n_summarized_posts:
607606
one: "1 mejor mensaje"
608607
other: "{{count}} mejores mensajes"
609608
of_n_posts:

config/locales/client.fr.yml

+3-4
Original file line numberDiff line numberDiff line change
@@ -378,8 +378,7 @@ fr:
378378
unmute: Activer
379379
last_post: Dernier message
380380

381-
best_of:
382-
title: "les meilleurs"
381+
summary:
383382
enabled_description: "Vous êtes actuellement en train de consulter seulement les messages les plus populaires de cette discussion. Pour voir tous les messages, cliquez ci-dessous."
384383
description: "Il y a <b>{{count}}</b> messages dans cette discussion. C'est beaucoup ! Voulez-vous gagner du temps en n'affichant que les meilleurs messages ?"
385384
enable: 'Basculer dans la vue : "les meilleurs"'
@@ -730,8 +729,8 @@ fr:
730729
by_n_users:
731730
one: "de l'utilisateur"
732731
other: "rédigés par {{count}} utilisateurs"
733-
best_of: "Vous voyez seulement {{n_best_posts}} {{of_n_posts}} de cette discussion."
734-
n_best_posts:
732+
summary: "Vous voyez seulement {{n_summarized_posts}} {{of_n_posts}} de cette discussion."
733+
n_summarized_posts:
735734
one: "le message"
736735
other: "les {{count}} messages"
737736
of_n_posts:

config/locales/client.id.yml

+4-5
Original file line numberDiff line numberDiff line change
@@ -206,10 +206,9 @@ id:
206206
unmute: Unmute
207207
last_post: Last post
208208

209-
best_of:
210-
title: "Best Of"
211-
description: "There are <b>{{count}}</b> posts in this topic. That's a lot! Would you like to save time by showing only the best posts?"
212-
button: 'Switch to "Best Of" view'
209+
summary:
210+
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?"
211+
button: 'Switch to "Summary" view'
213212

214213
private_message_info:
215214
title: "Private Message"
@@ -463,7 +462,7 @@ id:
463462

464463
filters:
465464
user: "You're viewing only posts by specific user(s)."
466-
best_of: "You're viewing only the 'Best Of' posts."
465+
summary: "You're viewing only the 'Summary' posts."
467466
cancel: "Show all posts in this topic again."
468467

469468
move_selected:

config/locales/client.it.yml

+6-7
Original file line numberDiff line numberDiff line change
@@ -361,12 +361,11 @@ it:
361361
unmute: Annulla ignora
362362
last_post: Ultimo post
363363

364-
best_of:
365-
title: "Best Of"
366-
enabled_description: Stai guardando il "Best Of" di questo topic.
364+
summary:
365+
enabled_description: Stai guardando il "Summary" di questo topic.
367366
description: "Ci sono <b>{{count}}</b> post in questo topic. Sono tanti! Vuoi risparmiare tempo leggendo solo i post con più interazioni e risposte?"
368-
enable: 'Passa a "Best Of"'
369-
disable: 'Annulla "Best Of"'
367+
enable: 'Passa a "Summary"'
368+
disable: 'Annulla "Summary"'
370369

371370
private_message_info:
372371
title: "Conversazione Privata"
@@ -705,8 +704,8 @@ it:
705704
one: "da 1 utente specifico"
706705
other: "da {{count}} utenti specifici"
707706

708-
best_of: "Stai vedendo i {{n_best_posts}} {{of_n_posts}}."
709-
n_best_posts:
707+
summary: "Stai vedendo i {{n_summarized_posts}} {{of_n_posts}}."
708+
n_summarized_posts:
710709
one: "1 best post"
711710
other: "{{count}} best post"
712711
of_n_posts:

0 commit comments

Comments
 (0)