2024-11-14 17:59:21 +00:00
|
|
|
@use super::base_html;
|
2024-11-14 21:43:54 +00:00
|
|
|
@use crate::db::artworks::Artwork;
|
2024-11-14 17:59:21 +00:00
|
|
|
|
2024-11-14 21:43:54 +00:00
|
|
|
@(artworks: Vec<Artwork>)
|
2024-11-14 17:59:21 +00:00
|
|
|
|
|
|
|
@:base_html({
|
2024-11-14 21:43:54 +00:00
|
|
|
<form action="/artworks" method="post" enctype="multipart/form-data">
|
|
|
|
<label for="title">title:</label><br>
|
|
|
|
<input type="text" id="title" name="title"><br>
|
|
|
|
<label for="artist">artist handle:</label><br>
|
|
|
|
<input type="text" id="artist" name="artist" required><br>
|
|
|
|
<label for="url">url source:</label><br>
|
|
|
|
<input type="text" id="url" name="url"><br>
|
|
|
|
<label for="description">description:</label><br>
|
|
|
|
<textarea id="description" name="description"></textarea><br>
|
|
|
|
<input type="file" name="file" multiple>
|
|
|
|
<button type="post">post artwork</button>
|
|
|
|
</form>
|
|
|
|
<ul>
|
|
|
|
@for artwork in artworks {
|
|
|
|
<li>
|
|
|
|
@if let Some(title) = artwork.title {
|
|
|
|
<h2>@title</h2>
|
|
|
|
}
|
|
|
|
@for file in artwork.files {
|
|
|
|
<img src="/uploads/@file.file_id().@file.extension()">
|
|
|
|
}
|
|
|
|
</li>
|
|
|
|
}
|
|
|
|
</ul>
|
2024-11-14 17:59:21 +00:00
|
|
|
<form action="/admin/logout" method="post">
|
|
|
|
<button type="logout">log out</button>
|
|
|
|
</form>
|
|
|
|
})
|
|
|
|
|