Skip to content

Commit

Permalink
added further expiration periods (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
obarlev authored Jul 15, 2024
1 parent a8727ba commit a538ace
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/endpoints/create.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
30 changes: 30 additions & 0 deletions templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,36 @@
<option value="1week">
{%- endif %} 1 week
</option>
{% if args.default_expiry == "2weeks" %}
<option selected value="2weeks">
{%- else %}
<option value="2weeks">
{%- endif %} 2 weeks
</option>
{% if args.default_expiry == "30days" %}
<option selected value="30days">
{%- else %}
<option value="30days">
{%- endif %} 30 days
</option>
{% if args.default_expiry == "60days" %}
<option selected value="60days">
{%- else %}
<option value="60days">
{%- endif %} 60 days
</option>
{% if args.default_expiry == "90days" %}
<option selected value="90days">
{%- else %}
<option value="90days">
{%- endif %} 90 days
</option>
{% if args.default_expiry == "1year" %}
<option selected value="1year">
{%- else %}
<option value="1year">
{%- endif %} 1 year
</option>
</optgroup>
{% if args.eternal_pasta %} {% if args.default_expiry ==
"never" %}
Expand Down

0 comments on commit a538ace

Please sign in to comment.