add switch for last posts in category view (#289)

main
xidui 9 years ago committed by Julian Lam
parent 9b03f0dfc8
commit ab6c98f2d0

@ -87,11 +87,12 @@ library.defineWidgetAreas = function(areas, callback) {
};
library.getThemeConfig = function(config, callback) {
meta.settings.get('persona', function(err, settings) {
config.hideSubCategories = settings.hideSubCategories === 'on';
config.hideCategoryLastPost = settings.hideCategoryLastPost === 'on';
});
callback(false, config);
};

@ -8,6 +8,12 @@
<span class="mdl-switch__label"><strong>Hide subcategories on categories view</strong></span>
</label>
</div>
<div class="checkbox">
<label class="mdl-switch mdl-js-switch mdl-js-ripple-effect">
<input class="mdl-switch__input" type="checkbox" id="hideCategoryLastPost" name="hideCategoryLastPost">
<span class="mdl-switch__label"><strong>Hide last post on categories view</strong></span>
</label>
</div>
</form>
</div>
</div>

@ -33,8 +33,10 @@
<span class="{../unread-class} human-readable-number" title="{../totalPostCount}">{../totalPostCount}</span><br />
<small>[[global:posts]]</small>
</div>
<!-- IF !config.hideCategoryLastPost -->
<div class="col-md-3 col-sm-3 teaser hidden-xs" component="topic/teaser">
<!-- IMPORT partials/categories/lastpost.tpl -->
</div>
<!-- ENDIF !config.hideCategoryLastPost -->
<!-- ENDIF !../link -->
</li>
Loading…
Cancel
Save