show file expiry on download page
This commit is contained in:
parent
6bf83dcbe6
commit
3125e1f4e7
|
@ -20,6 +20,9 @@ use tokio::{fs::File, sync::RwLock};
|
||||||
|
|
||||||
const APP_NAME: &str = "transbeam";
|
const APP_NAME: &str = "transbeam";
|
||||||
|
|
||||||
|
const DATE_DISPLAY_FORMAT: &[time::format_description::FormatItem] =
|
||||||
|
time::macros::format_description!("[year]-[month]-[day]");
|
||||||
|
|
||||||
struct AppState {
|
struct AppState {
|
||||||
file_store: RwLock<FileStore>,
|
file_store: RwLock<FileStore>,
|
||||||
config: Config,
|
config: Config,
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
<div class="file_name">{{ info.file.name }}</div>
|
<div class="file_name">{{ info.file.name }}</div>
|
||||||
<div class="file_size">{{ bytesize::to_string(info.file.size.clone(), false).replace(" ", "") }}</div>
|
<div class="file_size">{{ bytesize::to_string(info.file.size.clone(), false).replace(" ", "") }}</div>
|
||||||
<div class="file_download"><a class="download_button" href="download?code={{ info.code }}&download=all"></a></div>
|
<div class="file_download"><a class="download_button" href="download?code={{ info.code }}&download=all"></a></div>
|
||||||
|
<div class="file_expiry">Expires {{ info.file.expiry.format(DATE_DISPLAY_FORMAT).unwrap() }}</div>
|
||||||
</div>
|
</div>
|
||||||
{% match info.file.contents %}
|
{% match info.file.contents %}
|
||||||
{% when Some with (files) %}
|
{% when Some with (files) %}
|
||||||
|
|
Loading…
Reference in a new issue