FEATURE: flags for suppressing pinned expansion

To suppress pinned excerpt expansion
on mobile set "show_pinned_excerpt_mobile" to false

To suppress pinned excerpt expansion
on desktop set "show_pinned_excerpt_desktop" to false
This commit is contained in:
Sam Saffron 2016-07-12 13:51:44 +10:00
parent c145e747b6
commit dbc25a9d64
5 changed files with 25 additions and 2 deletions

View file

@ -55,6 +55,16 @@ export default Ember.Component.extend(StringBuffer, {
return false;
}
if (this.site.mobileView) {
if (!this.siteSettings.show_pinned_excerpt_mobile) {
return false;
}
} else {
if (!this.siteSettings.show_pinned_excerpt_desktop) {
return false;
}
}
if (this.get('expandGloballyPinned') && this.get('topic.pinned_globally')) {
return true;
}

View file

@ -17,7 +17,10 @@
showPosters=true
currentUser=currentUser
hideCategory=model.hideCategory
topics=model.topics}}
topics=model.topics
expandGloballyPinned=expandGloballyPinned
expandAllPinned=expandAllPinned
}}
{{/if}}
{{/discovery-topics-list}}

View file

@ -1,5 +1,5 @@
<td>
{{~#unless topic.hasExcerpt}}
{{~#unless expandPinned}}
<div class='pull-left'>
<a href="{{topic.lastPostUrl}}">{{avatar topic.lastPoster imageSize="large"}}</a>
</div>
@ -13,7 +13,9 @@
{{#if topic.unseen}}
<span class="badge-notification new-topic"></span>
{{/if}}
{{~#if expandPinned}}
{{raw "list/topic-excerpt" topic=topic}}
{{/if~}}
</div>
<div class='pull-right'>

View file

@ -852,6 +852,8 @@ en:
exclude_rel_nofollow_domains: "A list of domains where nofollow should not be added to links. tld.com will automatically allow sub.tld.com as well. As a minimum, you should add the top-level domain of this site to help web crawlers find all content. If other parts of your website are at other domains, add those too."
post_excerpt_maxlength: "Maximum length of a post excerpt / summary."
show_pinned_excerpt_mobile: "Show excerpt on pinned topics in mobile view."
show_pinned_excerpt_desktop: "Show excerpt on pinned topics in desktop view."
post_onebox_maxlength: "Maximum length of a oneboxed Discourse post in characters."
onebox_domains_whitelist: "A list of domains to allow oneboxing for; these domains should support OpenGraph or oEmbed. Test them at http://iframely.com/debug"

View file

@ -474,6 +474,12 @@ posting:
client: true
default: 0
post_excerpt_maxlength: 300
show_pinned_excerpt_mobile:
client: true
default: true
show_pinned_excerpt_desktop:
client: true
default: true
display_name_on_posts:
client: true
default: false