From b40d21e559cbca042c48bdbe7d36dd60c035f429 Mon Sep 17 00:00:00 2001 From: Nathan Moos Date: Sun, 3 Jan 2021 21:00:36 -0800 Subject: [PATCH] Add controversial sort order --- src/main.rs | 4 ++-- templates/subreddit.html | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main.rs b/src/main.rs index 45a06fe..0b6cfdb 100644 --- a/src/main.rs +++ b/src/main.rs @@ -69,10 +69,10 @@ async fn main() -> std::io::Result<()> { .route("/r/{sub}/wiki/{page}/", web::get().to(subreddit::wiki)) // SUBREDDIT SERVICES .route("/r/{sub}/", web::get().to(subreddit::page)) - .route("/r/{sub}/{sort:hot|new|top|rising}/", web::get().to(subreddit::page)) + .route("/r/{sub}/{sort:hot|new|top|rising|controversial}/", web::get().to(subreddit::page)) // POPULAR SERVICES .route("/", web::get().to(subreddit::page)) - .route("/{sort:best|hot|new|top|rising}/", web::get().to(subreddit::page)) + .route("/{sort:best|hot|new|top|rising|controversial}/", web::get().to(subreddit::page)) // POST SERVICES .route("/{id:.{5,6}}/", web::get().to(post::item)) .route("/r/{sub}/comments/{id}/{title}/", web::get().to(post::item)) diff --git a/templates/subreddit.html b/templates/subreddit.html index 44a9025..0faf115 100644 --- a/templates/subreddit.html +++ b/templates/subreddit.html @@ -17,9 +17,9 @@
{% if sub.name.is_empty() %} - {% call utils::sort("", ["hot", "new", "top", "rising"], sort.0) %} + {% call utils::sort("", ["hot", "new", "top", "rising", "controversial"], sort.0) %} {% else %} - {% call utils::sort(["/r/", sub.name.as_str()].concat(), ["hot", "new", "top", "rising"], sort.0) %} + {% call utils::sort(["/r/", sub.name.as_str()].concat(), ["hot", "new", "top", "rising", "controversial"], sort.0) %} {% endif %}
{% if sort.0 == "top" %}