Add DASHBOARD_PAGE_SIZE to settings
Add DASHBOARD_PAGE_SIZE to TEMPLATE.env and app.json Parse dashboard page size value
This commit is contained in:
parent
b44642e023
commit
d66f683104
@ -92,3 +92,7 @@ AGGRESSIVE_HASH_SALTING=True
|
||||
# - https://www.google.com/maps/search/?api=1&query=$LATITUDE,$LONGITUDE
|
||||
# - https://www.mapquest.com/near-$LATITUDE,$LONGITUDE
|
||||
LOCATION_URL=https://www.openstreetmap.org/?mlat=$LATITUDE&mlon=$LONGITUDE
|
||||
|
||||
# How many services should be displayed on dashboard page?
|
||||
# Set to big number if you don't want pagination at all.
|
||||
DASHBOARD_PAGE_SIZE=5
|
||||
|
5
app.json
5
app.json
@ -127,6 +127,11 @@
|
||||
"description": "Custom location url to link to in frontend.",
|
||||
"value": "https://www.openstreetmap.org/?mlat=$LATITUDE&mlon=$LONGITUDE",
|
||||
"required": false
|
||||
},
|
||||
"DASHBOARD_PAGE_SIZE": {
|
||||
"description": "How many services should be displayed on dashboard page?",
|
||||
"value": "5",
|
||||
"required": false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -25,7 +25,7 @@ from .mixins import DateRangeMixin
|
||||
class DashboardView(LoginRequiredMixin, DateRangeMixin, ListView):
|
||||
model = Service
|
||||
template_name = "dashboard/pages/dashboard.html"
|
||||
paginate_by = 5
|
||||
paginate_by = settings.DASHBOARD_PAGE_SIZE
|
||||
|
||||
def get_queryset(self):
|
||||
return Service.objects.filter(
|
||||
|
@ -347,3 +347,6 @@ AGGRESSIVE_HASH_SALTING = os.getenv("AGGRESSIVE_HASH_SALTING", "False") == "True
|
||||
|
||||
# What location url should be linked to in the frontend?
|
||||
LOCATION_URL = os.getenv("LOCATION_URL", "https://www.openstreetmap.org/?mlat=$LATITUDE&mlon=$LONGITUDE")
|
||||
|
||||
# How many services should be displayed on dashboard page?
|
||||
DASHBOARD_PAGE_SIZE = int(os.getenv("DASHBOARD_PAGE_SIZE", "5"))
|
||||
|
Loading…
Reference in New Issue
Block a user