mirror of
https://github.com/YGGverse/btracker.git
synced 2026-03-31 17:15:31 +00:00
hide pagination totals on empty response
This commit is contained in:
parent
3f536fd316
commit
6a9a312b00
2 changed files with 9 additions and 7 deletions
14
src/main.rs
14
src/main.rs
|
|
@ -94,12 +94,14 @@ fn index(
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.collect::<Vec<R>>(),
|
.collect::<Vec<R>>(),
|
||||||
pagination_totals: format!(
|
pagination_totals: if total > 0 {
|
||||||
"Page {} / {} ({total} {} total)",
|
Some(format!(
|
||||||
page.unwrap_or(1),
|
"Page {} / {} ({total} {} total)",
|
||||||
(total as f64 / public.default_limit as f64).ceil(),
|
page.unwrap_or(1),
|
||||||
total.plurify(&["torrent", "torrents", "torrents"])
|
(total as f64 / public.default_limit as f64).ceil(),
|
||||||
),
|
total.plurify(&["torrent", "torrents", "torrents"])
|
||||||
|
))
|
||||||
|
} else { None },
|
||||||
search
|
search
|
||||||
},
|
},
|
||||||
))
|
))
|
||||||
|
|
|
||||||
|
|
@ -29,5 +29,5 @@
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if next %}<a href="{{ next }}">Next</a>{% endif %}
|
{% if next %}<a href="{{ next }}">Next</a>{% endif %}
|
||||||
{% if back %}<a href="{{ back }}">Back</a>{% endif %}
|
{% if back %}<a href="{{ back }}">Back</a>{% endif %}
|
||||||
<span>{{ pagination_totals }}</span>
|
{% if pagination_totals %}<span>{{ pagination_totals }}</span>{% endif %}
|
||||||
{% endblock content %}
|
{% endblock content %}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue