diff options
Diffstat (limited to 'fatcat_scholar')
-rw-r--r-- | fatcat_scholar/hacks.py | 2 | ||||
-rw-r--r-- | fatcat_scholar/templates/search.html | 4 | ||||
-rw-r--r-- | fatcat_scholar/templates/search_macros.html | 6 |
3 files changed, 6 insertions, 6 deletions
diff --git a/fatcat_scholar/hacks.py b/fatcat_scholar/hacks.py index e7d4566..29274c9 100644 --- a/fatcat_scholar/hacks.py +++ b/fatcat_scholar/hacks.py @@ -18,7 +18,7 @@ class Jinja2Templates: def get_env( self, directory: str, extensions: typing.List[str] = [] ) -> "jinja2.Environment": - @jinja2.contextfunction + @jinja2.pass_context def url_for(context: dict, name: str, **path_params: typing.Any) -> str: request = context["request"] return request.url_for(name, **path_params) diff --git a/fatcat_scholar/templates/search.html b/fatcat_scholar/templates/search.html index 3aa2929..3adaf2f 100644 --- a/fatcat_scholar/templates/search.html +++ b/fatcat_scholar/templates/search.html @@ -43,7 +43,7 @@ </details> {% if hits %} - <span class="hit-count" style="font-size: 1.5em;">{{ babel_numbers.format_number(hits.count_found, locale=locale) }}</span> + <span class="hit-count" style="font-size: 1.5em;">{{ babel_numbers.format_decimal(hits.count_found, locale=locale) }}</span> {% trans trimmed count=hits.count_found %} Hit {% pluralize %} @@ -72,7 +72,7 @@ {% set count_size = "2.0em" %} {% endif %} <span class="hit-count" style="display: block; font-size: {{ count_size }};"> - {{ babel_numbers.format_number(hits.count_found, locale=locale) }} + {{ babel_numbers.format_decimal(hits.count_found, locale=locale) }} </span> {% trans trimmed count=hits.count_found %} Hit diff --git a/fatcat_scholar/templates/search_macros.html b/fatcat_scholar/templates/search_macros.html index 45a421d..4965045 100644 --- a/fatcat_scholar/templates/search_macros.html +++ b/fatcat_scholar/templates/search_macros.html @@ -505,9 +505,9 @@ {% endif %} <i style="padding-left: 0.5em; padding-right: 0.5em;"> - {% trans trimmed start=babel_numbers.format_number(hits.offset + 1, locale=locale), - end=babel_numbers.format_number([hits.offset + hits.limit, hits.count_found]|min, locale=locale), - total=babel_numbers.format_number(hits.count_found, locale=locale) %} + {% trans trimmed start=babel_numbers.format_decimal(hits.offset + 1, locale=locale), + end=babel_numbers.format_decimal([hits.offset + hits.limit, hits.count_found]|min, locale=locale), + total=babel_numbers.format_decimal(hits.count_found, locale=locale) %} Showing results {{ start }} — {{ end }} out of {{ total }} results {% endtrans %} </i> |