Add a site setting for when progress bar should only show post number. Default is 1000.

This commit is contained in:
Neil Lalonde
2013-12-05 17:03:31 -05:00
parent 79427732b2
commit 082f131b27
6 changed files with 18 additions and 9 deletions

View File

@@ -294,12 +294,16 @@ Discourse.TopicController = Discourse.ObjectController.extend(Discourse.Selected
}.property('postStream.loaded', 'currentPost', 'postStream.filteredPostsCount'),
hugeNumberOfPosts: function() {
return (this.get('postStream.filteredPostsCount') >= 1000);
}.property('postStream.filteredPostsCount'),
return (this.get('postStream.filteredPostsCount') >= Discourse.SiteSettings.short_progress_text_threshold);
}.property('highest_post_number'),
progressPositionTitle: function() {
return I18n.t("topic.progress.position", {current: this.get('progressPosition'), total: this.get('highest_post_number')});
}.property('progressPosition', 'highest_post_number'),
jumpToBottomTitle: function() {
if (this.get('hugeNumberOfPosts')) {
return I18n.t('topic.progress.jump_bottom_with_number', {post_number: this.get('highest_post_number')});
} else {
return I18n.t('topic.progress.jump_bottom');
}
}.property('hugeNumberOfPosts', 'highest_post_number'),
deselectPost: function(post) {
this.get('selectedPosts').removeObject(post);

View File

@@ -52,9 +52,9 @@
<nav id='topic-progress' title="{{i18n topic.progress.title}}" {{bindAttr class="hideProgress:hidden"}}>
<button id='jump-top' title="{{i18n topic.progress.jump_top}}" {{bindAttr disabled="jumpTopDisabled"}} {{action jumpTop}}><i class="icon-circle-arrow-up"></i></button>
<div class='nums' {{bindAttr title="progressPositionTitle"}}>
<h4>{{progressPosition}}</h4><span {{bindAttr class="hugeNumberOfPosts:hidden"}}> <span>{{i18n of_value}}</span> <h4>{{postStream.filteredPostsCount}}</h4></span>
<h4>{{progressPosition}}</h4><span {{bindAttr class="hugeNumberOfPosts:hidden"}}> <span>{{i18n of_value}}</span> <h4>{{highest_post_number}}</h4></span>
</div>
<button id='jump-bottom' title="{{i18n topic.progress.jump_bottom}}" {{bindAttr disabled="jumpBottomDisabled"}} {{action jumpBottom}}><i class="icon-circle-arrow-down"></i></button>
<button id='jump-bottom' {{bindAttr title="jumpToBottomTitle"}} {{bindAttr disabled="jumpBottomDisabled"}} {{action jumpBottom}}><i class="icon-circle-arrow-down"></i></button>
<div class='bg'>&nbsp;</div>
</nav>
</div>

View File

@@ -132,8 +132,8 @@ a:hover.reply-new {
border: 0;
background: none;
color: #666;
width: 50%;
text-align: left;
width: 30px;
height: 30px;
margin: 0;
i {