mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2025-05-13 06:34:25 -04:00
add new SNAPSHOTS_PER_PAGE pagination limit config
This commit is contained in:
parent
3e96871386
commit
9cd4ba38f0
3 changed files with 5 additions and 3 deletions
|
@ -77,6 +77,7 @@ CONFIG_SCHEMA: Dict[str, ConfigDefaultDict] = {
|
||||||
'PUBLIC_SNAPSHOTS': {'type': bool, 'default': True},
|
'PUBLIC_SNAPSHOTS': {'type': bool, 'default': True},
|
||||||
'PUBLIC_ADD_VIEW': {'type': bool, 'default': False},
|
'PUBLIC_ADD_VIEW': {'type': bool, 'default': False},
|
||||||
'FOOTER_INFO': {'type': str, 'default': 'Content is hosted for personal archiving purposes only. Contact server owner for any takedown requests.'},
|
'FOOTER_INFO': {'type': str, 'default': 'Content is hosted for personal archiving purposes only. Contact server owner for any takedown requests.'},
|
||||||
|
'SNAPSHOTS_PER_PAGE': {'type': int, 'default': 40},
|
||||||
},
|
},
|
||||||
|
|
||||||
'ARCHIVE_METHOD_TOGGLES': {
|
'ARCHIVE_METHOD_TOGGLES': {
|
||||||
|
|
|
@ -21,7 +21,7 @@ from core.mixins import SearchResultsAdminMixin
|
||||||
from index.html import snapshot_icons
|
from index.html import snapshot_icons
|
||||||
from logging_util import printable_filesize
|
from logging_util import printable_filesize
|
||||||
from main import add, remove
|
from main import add, remove
|
||||||
from config import OUTPUT_DIR
|
from config import OUTPUT_DIR, SNAPSHOTS_PER_PAGE
|
||||||
from extractors import archive_links
|
from extractors import archive_links
|
||||||
|
|
||||||
# Admin URLs
|
# Admin URLs
|
||||||
|
@ -106,7 +106,7 @@ class SnapshotAdmin(SearchResultsAdminMixin, admin.ModelAdmin):
|
||||||
actions = [delete_snapshots, overwrite_snapshots, update_snapshots, update_titles, verify_snapshots]
|
actions = [delete_snapshots, overwrite_snapshots, update_snapshots, update_titles, verify_snapshots]
|
||||||
actions_template = 'admin/actions_as_select.html'
|
actions_template = 'admin/actions_as_select.html'
|
||||||
form = SnapshotAdminForm
|
form = SnapshotAdminForm
|
||||||
list_per_page = 40
|
list_per_page = SNAPSHOTS_PER_PAGE
|
||||||
|
|
||||||
def get_urls(self):
|
def get_urls(self):
|
||||||
urls = super().get_urls()
|
urls = super().get_urls()
|
||||||
|
|
|
@ -22,6 +22,7 @@ from ..config import (
|
||||||
PUBLIC_ADD_VIEW,
|
PUBLIC_ADD_VIEW,
|
||||||
VERSION,
|
VERSION,
|
||||||
FOOTER_INFO,
|
FOOTER_INFO,
|
||||||
|
SNAPSHOTS_PER_PAGE,
|
||||||
)
|
)
|
||||||
from main import add
|
from main import add
|
||||||
from ..util import base_url, ansi_to_html
|
from ..util import base_url, ansi_to_html
|
||||||
|
@ -94,7 +95,7 @@ class SnapshotView(View):
|
||||||
class PublicIndexView(ListView):
|
class PublicIndexView(ListView):
|
||||||
template_name = 'public_index.html'
|
template_name = 'public_index.html'
|
||||||
model = Snapshot
|
model = Snapshot
|
||||||
paginate_by = 100
|
paginate_by = SNAPSHOTS_PER_PAGE
|
||||||
ordering = ['title']
|
ordering = ['title']
|
||||||
|
|
||||||
def get_context_data(self, **kwargs):
|
def get_context_data(self, **kwargs):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue