diff --git a/queries/records/get_records.sql b/queries/records/get_records.sql new file mode 100644 index 0000000..1a62878 --- /dev/null +++ b/queries/records/get_records.sql @@ -0,0 +1,6 @@ +SELECT + cache_name, + uploaded, + downloads, + max_downloads +FROM records; diff --git a/queries/records/get_records_page.sql b/queries/records/get_records_page.sql new file mode 100644 index 0000000..25e59b5 --- /dev/null +++ b/queries/records/get_records_page.sql @@ -0,0 +1,7 @@ +SELECT + cache_name, + uploaded, + downloads, + max_downloads +FROM records +LIMIT ? OFFSET ?; diff --git a/src/views/templates.rs b/src/views/templates.rs index 5487d18..4ee7f5e 100644 --- a/src/views/templates.rs +++ b/src/views/templates.rs @@ -39,6 +39,12 @@ pub struct DownloadLinkFragment { pub record: UploadRecord, } +#[derive(Template)] +#[template(path = "link.html", block = "downloads_remaining")] +pub struct DownloadsRemainingFragment { + pub record: UploadRecord, +} + #[derive(Template)] #[template(path = "linklist.html")] pub struct LinkListTemplate {