mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Add a site setting for when progress bar should only show post number. Default is 1000.
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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'> </div>
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user