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>
|
<h1 class="display-1 text-center">Welcome to Micrach</h1>
|
||||||
|
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<form class="row row-cols-auto gy-4" action="/" method="POST" enctype="multipart/form-data">
|
{{ template "post-form" }}
|
||||||
<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>
|
|
||||||
|
|
||||||
<div class="row row-cols-auto gy-4">
|
<div class="row row-cols-auto gy-4">
|
||||||
{{range $Post := .}}
|
{{range $Post := .}}
|
||||||
|
@ -11,6 +11,10 @@
|
|||||||
crossorigin="anonymous">
|
crossorigin="anonymous">
|
||||||
</script>
|
</script>
|
||||||
<link rel="icon" href="/static/favicon.ico"/>
|
<link rel="icon" href="/static/favicon.ico"/>
|
||||||
|
<link
|
||||||
|
href="/static/post-form.css"
|
||||||
|
rel="stylesheet"
|
||||||
|
>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{ define "meta" }}
|
{{ define "meta" }}
|
||||||
@ -57,4 +61,14 @@
|
|||||||
<meta property="twitter:title" content="Micrach">
|
<meta property="twitter:title" content="Micrach">
|
||||||
<meta property="twitter:description" content="Single board imageboard.">
|
<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">
|
<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 }}
|
{{ end }}
|
@ -10,11 +10,7 @@
|
|||||||
<h1 class="display-1 text-center">Welcome to Micrach</h1>
|
<h1 class="display-1 text-center">Welcome to Micrach</h1>
|
||||||
|
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<form class="row row-cols-auto gy-4" action="/{{$FirstPost.ID}}" method="POST" enctype="multipart/form-data">
|
{{ template "post-form" $FirstPost.ID }}
|
||||||
<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>
|
|
||||||
|
|
||||||
<div class="row row-cols-auto gy-4">
|
<div class="row row-cols-auto gy-4">
|
||||||
{{range $Post := .}}
|
{{range $Post := .}}
|
||||||
|
Loading…
Reference in New Issue
Block a user