mirror of
https://github.com/yanislav-igonin/micrach
synced 2024-12-22 14:22:33 +03:00
feat: remove edges from form, add gutters between form elements, move form to templates
This commit is contained in:
parent
828deb52a4
commit
8860c4f26c
3
static/post-form.css
Normal file
3
static/post-form.css
Normal file
@ -0,0 +1,3 @@
|
||||
#postForm > * {
|
||||
margin-bottom: 1rem;
|
||||
}
|
@ -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 := .}}
|
||||
|
@ -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 }}
|
@ -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 := .}}
|
||||
|
Loading…
Reference in New Issue
Block a user