100 lines
2.5 KiB
HTML
100 lines
2.5 KiB
HTML
@use crate::PictrsPage;
|
|
@use crate::templates::statics::index_css;
|
|
|
|
@(page: &PictrsPage)
|
|
|
|
<!doctype html>
|
|
<html lang="en">
|
|
|
|
<head>
|
|
<title>pict-rs admin</title>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
<meta charset="utf-8" />
|
|
<link rel="stylesheet" type="text/css" href="/static/@index_css.name" />
|
|
</head>
|
|
|
|
<body>
|
|
<nav>
|
|
@if let Some(prev) = page.prev_link() {
|
|
<a href="@prev">Previous Page</a>
|
|
}
|
|
@if let Some(next) = page.next_link() {
|
|
<a href="@next">Next Page</a>
|
|
}
|
|
<form method="GET" action="/">
|
|
<input type="text" name="timestamp" placeholder="rfc3339 timestamp" />
|
|
<input type="submit" />
|
|
</form>
|
|
</nav>
|
|
|
|
<section>
|
|
@if page.hashes.is_empty() {
|
|
<article>
|
|
<div class="border">
|
|
<div class="metadata">
|
|
<p>Looks like there are no images to display</p>
|
|
</div>
|
|
</div>
|
|
</article>
|
|
}
|
|
@for hash in &page.hashes {
|
|
<article>
|
|
<div class="border">
|
|
@if let Some(src) = hash.media_link() {
|
|
<div class="image-box">
|
|
@if let Some(video_type) = hash.video_type() {
|
|
<video controls loop src="@src" type="@video_type"></video>
|
|
} else {
|
|
<img src="@src" />
|
|
}
|
|
</div>
|
|
}
|
|
<div class="metadata">
|
|
<div class="field">
|
|
<h4>hex:</h4>
|
|
<p class="hex">@hash.hex</p>
|
|
</div>
|
|
<div class="field">
|
|
<h4>aliases:</h4>
|
|
<ul>
|
|
@for alias in &hash.aliases {
|
|
<li>@alias</li>
|
|
}
|
|
</ul>
|
|
</div>
|
|
@if let Some(details) = &hash.details {
|
|
<div class="field">
|
|
<h4>width:</h4>
|
|
<p>@details.width</p>
|
|
</div>
|
|
<div class="field">
|
|
<h4>height:</h4>
|
|
<p>@details.height</p>
|
|
</div>
|
|
@if let Some(frames) = details.frames {
|
|
<div class="field">
|
|
<h4>frames:</h4>
|
|
<p>@frames</p>
|
|
</div>
|
|
}
|
|
<div class="field">
|
|
<h4>content_type:</h4>
|
|
<p>@details.content_type</p>
|
|
</div>
|
|
<div class="field">
|
|
<h4>created_at:</h4>
|
|
<p>@details.created_at</p>
|
|
</div>
|
|
}
|
|
@if let Some(link) = page.purge_link(hash) {
|
|
<a href="@link">Purge Image</a>
|
|
}
|
|
</div>
|
|
</div>
|
|
</article>
|
|
}
|
|
</section>
|
|
</body>
|
|
|
|
</html>
|