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) { library.getThemeConfig = function(config, callback) {
meta.settings.get('persona', function(err, settings) { meta.settings.get('persona', function(err, settings) {
config.hideSubCategories = settings.hideSubCategories === 'on'; config.hideSubCategories = settings.hideSubCategories === 'on';
config.hideCategoryLastPost = settings.hideCategoryLastPost === 'on';
}); });
callback(false, config); callback(false, config);
}; };

@ -8,6 +8,12 @@
<span class="mdl-switch__label"><strong>Hide subcategories on categories view</strong></span> <span class="mdl-switch__label"><strong>Hide subcategories on categories view</strong></span>
</label> </label>
</div> </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> </form>
</div> </div>
</div> </div>

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