Add a setting for the number of maps per search
Useful for https://github.com/umap-project/umap-dsfr
This commit is contained in:
parent
a62d88140e
commit
a87309cee6
3 changed files with 7 additions and 0 deletions
|
@ -234,6 +234,7 @@ SITE_NAME = 'uMap'
|
|||
UMAP_DEMO_SITE = env('UMAP_DEMO_SITE', default=False)
|
||||
UMAP_EXCLUDE_DEFAULT_MAPS = False
|
||||
UMAP_MAPS_PER_PAGE = 5
|
||||
UMAP_MAPS_PER_SEARCH = 25
|
||||
UMAP_MAPS_PER_PAGE_OWNER = 10
|
||||
UMAP_SEARCH_CONFIGURATION = "simple"
|
||||
UMAP_FEEDBACK_LINK = "https://wiki.openstreetmap.org/wiki/UMap#Feedback_and_help" # noqa
|
||||
|
|
|
@ -78,6 +78,8 @@ UMAP_EXCLUDE_DEFAULT_MAPS = False
|
|||
|
||||
# How many maps should be showcased on the main page resp. on the user page
|
||||
UMAP_MAPS_PER_PAGE = 5
|
||||
# How many maps should be looked for when performing a (sub)search
|
||||
UMAP_MAPS_PER_SEARCH = 15
|
||||
# How many maps should be showcased on the user page, if owner
|
||||
UMAP_MAPS_PER_PAGE_OWNER = 10
|
||||
|
||||
|
|
|
@ -235,6 +235,10 @@ class Search(TemplateView, PaginatorMixin):
|
|||
else:
|
||||
return super(Search, self).get_template_names()
|
||||
|
||||
@property
|
||||
def per_page(self):
|
||||
return settings.UMAP_MAPS_PER_SEARCH
|
||||
|
||||
|
||||
search = Search.as_view()
|
||||
|
||||
|
|
Loading…
Reference in a new issue