From a538ace61b19cafa7dbdce7cd8b3478ca544820e Mon Sep 17 00:00:00 2001 From: obarlev Date: Mon, 15 Jul 2024 23:48:50 +0300 Subject: [PATCH] added further expiration periods (#5) --- src/endpoints/create.rs | 5 +++++ templates/index.html | 30 ++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) diff --git a/src/endpoints/create.rs b/src/endpoints/create.rs index d2b5ca66..0acba5ce 100644 --- a/src/endpoints/create.rs +++ b/src/endpoints/create.rs @@ -56,6 +56,11 @@ pub fn expiration_to_timestamp(expiration: &str, timenow: i64) -> i64 { "24hour" => timenow + 60 * 60 * 24, "3days" => timenow + 60 * 60 * 24 * 3, "1week" => timenow + 60 * 60 * 24 * 7, + "2weeks" => timenow + 60 * 60 * 24 * 7 * 2, + "30days" => timenow + 60 * 60 * 24 * 30, + "60days" => timenow + 60 * 60 * 24 * 60, + "90days" => timenow + 60 * 60 * 24 * 90, + "1year" => timenow + 60 * 60 * 24 * 365, "never" => { if ARGS.eternal_pasta { 0 diff --git a/templates/index.html b/templates/index.html index 1c16155d..e64cfa94 100644 --- a/templates/index.html +++ b/templates/index.html @@ -42,6 +42,36 @@ + {% if args.default_expiry == "2weeks" %} + + {% if args.default_expiry == "30days" %} + + {% if args.default_expiry == "60days" %} + + {% if args.default_expiry == "90days" %} + + {% if args.default_expiry == "1year" %} + {% if args.eternal_pasta %} {% if args.default_expiry == "never" %}