File tree 3 files changed +9
-21
lines changed
runtimes/eoapi/stac/eoapi/stac 3 files changed +9
-21
lines changed Original file line number Diff line number Diff line change 1
1
"""eoapi-devseed: Custom pgstac client."""
2
2
3
3
import csv
4
- import math
5
4
import re
6
5
from typing import (
7
6
Any ,
@@ -363,21 +362,11 @@ async def all_collections(
363
362
)
364
363
365
364
if output_type == MimeTypes .html :
366
- offset = int (request .query_params .get ("offset" ) or 0 )
367
- limit = int (request .query_params .get ("limit" ) or 10 )
368
-
369
- current_page = 1
370
- if limit > 0 :
371
- current_page = math .ceil ((offset + limit ) / limit )
372
-
373
365
return create_html_response (
374
366
request ,
375
367
collections ,
376
368
template_name = "collections" ,
377
369
title = "Collections list" ,
378
- current_page = current_page ,
379
- limit = limit ,
380
- offset = offset ,
381
370
)
382
371
383
372
return collections
@@ -529,7 +518,6 @@ async def item_collection(
529
518
item_collection ,
530
519
template_name = "items" ,
531
520
title = f"{ collection_id } items" ,
532
- limit = limit ,
533
521
)
534
522
535
523
elif output_type == MimeTypes .csv :
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ <h1>Collections</h1>
24
24
{% else %}
25
25
< div class ="d-flex flex-row align-items-center mb-4 flex-wrap ">
26
26
< div class ="mr-3 ">
27
- Showing {{ offset + 1 }} - {{ offset + response.numberReturned }} of {{ response.numberMatched }} collections
27
+ Showing {{ template.params.get(" offset", 0)|int + 1 }} - {{ template.params.get(" offset", 0)|int + response.numberReturned }} of {{ response.numberMatched }} collections
28
28
</ div >
29
29
30
30
< form id ="search-form " class ="d-flex flex-wrap flex-grow-1 " style ="gap: 8px ">
@@ -43,10 +43,10 @@ <h1>Collections</h1>
43
43
< div class ="d-flex ">
44
44
< label for ="limit " class ="mr-1 small "> Page size:</ label >
45
45
< select class ="form-control form-control-sm " id ="limit " aria-label ="Select page size " style ="width: 70px ">
46
- < option value ="10 " {% if limit == 10 %}selected{% endif %} > 10</ option >
47
- < option value ="25 " {% if limit == 25 %}selected{% endif %} > 25</ option >
48
- < option value ="50 " {% if limit == 50 %}selected{% endif %} > 50</ option >
49
- < option value ="100 " {% if limit == 100 %}selected{% endif %} > 100</ option >
46
+ < option value ="10 " {% if template.params.get( " limit", 10)|int == 10 %}selected{% endif %} > 10</ option >
47
+ < option value ="25 " {% if template.params.get( " limit", 10)|int == 25 %}selected{% endif %} > 25</ option >
48
+ < option value ="50 " {% if template.params.get( " limit", 10)|int == 50 %}selected{% endif %} > 50</ option >
49
+ < option value ="100 " {% if template.params.get( " limit", 10)|int == 100 %}selected{% endif %} > 100</ option >
50
50
</ select >
51
51
</ div >
52
52
Original file line number Diff line number Diff line change @@ -36,10 +36,10 @@ <h1 class="my-4">
36
36
< div class ="d-flex ">
37
37
< label for ="limit "> Page size: </ label >
38
38
< select class ="form-control form-control-sm ml-1 " id ="limit " aria-label ="Select page size "> <!-- TODO: dynamically populate the values based on oga_max_limit -->
39
- < option value ="10 " {% if limit == 10 %}selected{% endif %} > 10</ option >
40
- < option value ="25 " {% if limit == 25 %}selected{% endif %} > 25</ option >
41
- < option value ="50 " {% if limit == 50 %}selected{% endif %} > 50</ option >
42
- < option value ="100 " {% if limit == 100 %}selected{% endif %} > 100</ option >
39
+ < option value ="10 " {% if template.params.get( " limit", 10)|int == 10 %}selected{% endif %} > 10</ option >
40
+ < option value ="25 " {% if template.params.get( " limit", 10)|int == 25 %}selected{% endif %} > 25</ option >
41
+ < option value ="50 " {% if template.params.get( " limit", 10)|int == 50 %}selected{% endif %} > 50</ option >
42
+ < option value ="100 " {% if template.params.get( " limit", 10)|int == 100 %}selected{% endif %} > 100</ option >
43
43
</ select >
44
44
</ div >
45
45
{% if response.links|length > 0 %}
You can’t perform that action at this time.
0 commit comments