diff --git a/app/assets/javascripts/discourse/components/topic-list-item.js.es6 b/app/assets/javascripts/discourse/components/topic-list-item.js.es6 index 943a7b662..2f5026e10 100644 --- a/app/assets/javascripts/discourse/components/topic-list-item.js.es6 +++ b/app/assets/javascripts/discourse/components/topic-list-item.js.es6 @@ -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; } diff --git a/app/assets/javascripts/discourse/templates/mobile/discovery/topics.hbs b/app/assets/javascripts/discourse/templates/mobile/discovery/topics.hbs index df2e91044..6d61e9c4e 100644 --- a/app/assets/javascripts/discourse/templates/mobile/discovery/topics.hbs +++ b/app/assets/javascripts/discourse/templates/mobile/discovery/topics.hbs @@ -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}} diff --git a/app/assets/javascripts/discourse/templates/mobile/list/topic_list_item.raw.hbs b/app/assets/javascripts/discourse/templates/mobile/list/topic_list_item.raw.hbs index 1047de967..e630889d4 100644 --- a/app/assets/javascripts/discourse/templates/mobile/list/topic_list_item.raw.hbs +++ b/app/assets/javascripts/discourse/templates/mobile/list/topic_list_item.raw.hbs @@ -1,5 +1,5 @@ - {{~#unless topic.hasExcerpt}} + {{~#unless expandPinned}}
{{avatar topic.lastPoster imageSize="large"}}
@@ -13,7 +13,9 @@ {{#if topic.unseen}} {{/if}} + {{~#if expandPinned}} {{raw "list/topic-excerpt" topic=topic}} + {{/if~}}
diff --git a/config/locales/server.en.yml b/config/locales/server.en.yml index 75f8a4404..80aea6e72 100644 --- a/config/locales/server.en.yml +++ b/config/locales/server.en.yml @@ -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" diff --git a/config/site_settings.yml b/config/site_settings.yml index 5e726a2fd..9fe29a028 100644 --- a/config/site_settings.yml +++ b/config/site_settings.yml @@ -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