36 lines
986 B
HTML
36 lines
986 B
HTML
@use super::base_html;
|
|
@use crate::db::artworks::Artwork;
|
|
|
|
@(artworks: Vec<Artwork>)
|
|
|
|
@:base_html({
|
|
<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>
|
|
<form action="/admin/logout" method="post">
|
|
<button type="logout">log out</button>
|
|
</form>
|
|
})
|
|
|