feat: remove edges from form, add gutters between form elements, move form to templates

This commit is contained in:
Yanislav Igonin 2021-09-08 22:34:10 +03:00
parent 828deb52a4
commit 8860c4f26c
4 changed files with 19 additions and 10 deletions

3
static/post-form.css Normal file
View File

@ -0,0 +1,3 @@
#postForm > * {
margin-bottom: 1rem;
}

View File

@ -13,11 +13,7 @@
<h1 class="display-1 text-center">Welcome to Micrach</h1>
<div class="container">
<form class="row row-cols-auto gy-4" action="/" method="POST" enctype="multipart/form-data">
<input class="form-control" id="postTitle" placeholder="Title" name="title">
<textarea class="form-control" id="postText" rows="3" placeholder="Text" name="text"></textarea>
<input class="form-control" type="file" id="formFileMultiple" multiple name="files">
</form>
{{ template "post-form" }}
<div class="row row-cols-auto gy-4">
{{range $Post := .}}

View File

@ -11,6 +11,10 @@
crossorigin="anonymous">
</script>
<link rel="icon" href="/static/favicon.ico"/>
<link
href="/static/post-form.css"
rel="stylesheet"
>
{{ end }}
{{ define "meta" }}
@ -58,3 +62,13 @@
<meta property="twitter:description" content="Single board imageboard.">
<meta property="twitter:image" content="https://memepedia.ru/wp-content/uploads/2018/03/ebanyy-rot-etogo-kazino.png">
{{ end }}
{{ define "post-form" }}
<div class="col col-12">
<form id="postForm" action="/{{ . }}" method="POST" enctype="multipart/form-data">
<input class="form-control" id="postTitle" placeholder="Title" name="title">
<textarea class="form-control" id="postText" rows="5" placeholder="Text" name="text"></textarea>
<input class="form-control" type="file" id="postFiles" multiple name="files">
</form>
</div>
{{ end }}

View File

@ -10,11 +10,7 @@
<h1 class="display-1 text-center">Welcome to Micrach</h1>
<div class="container">
<form class="row row-cols-auto gy-4" action="/{{$FirstPost.ID}}" method="POST" enctype="multipart/form-data">
<input class="form-control" id="postTitle" placeholder="Title" name="title">
<textarea class="form-control" id="postText" rows="3" placeholder="Text" name="text"></textarea>
<input class="form-control" type="file" id="formFileMultiple" multiple name="files">
</form>
{{ template "post-form" $FirstPost.ID }}
<div class="row row-cols-auto gy-4">
{{range $Post := .}}