# HG changeset patch # User neko259 # Date 2016-10-20 09:34:26 # Node ID 09f39956ba2e2e8156e756345c3f3bf2ed93111b # Parent bcd6c26972f00302b02db5709b3623d2ddc704c4 Added setting for posts per page in feeds diff --git a/boards/config/default_settings.ini b/boards/config/default_settings.ini --- a/boards/config/default_settings.ini +++ b/boards/config/default_settings.ini @@ -29,6 +29,7 @@ DefaultTheme = md DefaultImageViewer = simple LastRepliesCount = 3 ThreadsPerPage = 3 +PostsPerPage = 10 ImagesPerPageGallery = 20 MaxFavoriteThreads = 20 diff --git a/boards/views/feed.py b/boards/views/feed.py --- a/boards/views/feed.py +++ b/boards/views/feed.py @@ -1,13 +1,14 @@ from django.core.urlresolvers import reverse from django.shortcuts import render +from boards import settings from boards.abstracts.paginator import get_paginator from boards.abstracts.settingsmanager import get_settings_manager from boards.models import Post from boards.views.base import BaseBoardView from boards.views.posting_mixin import PostMixin -POSTS_PER_PAGE = 10 +POSTS_PER_PAGE = settings.get_int('View', 'PostsPerPage') PARAMETER_CURRENT_PAGE = 'current_page' PARAMETER_PAGINATOR = 'paginator'