57 lines
1.3 KiB
Plaintext
57 lines
1.3 KiB
Plaintext
|
package main
|
||
|
|
||
|
|
||
|
templ newFileUpload() {
|
||
|
<div id="file-submission" class="my-2">
|
||
|
<div class="mb-4 flex flex-row justify-start space-x-4">
|
||
|
<span
|
||
|
class="border-b-4 border-black cursor-pointer"
|
||
|
>
|
||
|
<b>upload</b>
|
||
|
</span>
|
||
|
<a
|
||
|
hx-get="/partial/new/text"
|
||
|
hx-target="#file-submission"
|
||
|
hx-swap="outerHTML"
|
||
|
class="cursor-pointer border-b-4 border-amber-300"
|
||
|
>
|
||
|
text
|
||
|
</a>
|
||
|
</div>
|
||
|
@fileUpload("browse ...", "file", "file")
|
||
|
</div>
|
||
|
}
|
||
|
|
||
|
templ newTextSubmit() {
|
||
|
<div id="file-submission" class="my-2">
|
||
|
<div class="mb-4 flex flex-row justify-start space-x-4">
|
||
|
<a
|
||
|
hx-get="/partial/new/upload"
|
||
|
hx-target="#file-submission"
|
||
|
hx-swap="outerHTML"
|
||
|
class="cursor-pointer border-b-4 border-amber-300"
|
||
|
>
|
||
|
upload
|
||
|
</a>
|
||
|
<span
|
||
|
class="border-b-4 border-black cursor-pointer"
|
||
|
>
|
||
|
<b>text</b>
|
||
|
</span>
|
||
|
</div>
|
||
|
<label for="text">paste/type your text here:</label> <br/>
|
||
|
<textarea
|
||
|
class="m-1 resize-none hover:resize-y
|
||
|
font-mono
|
||
|
outline-2 bg-amber-50
|
||
|
hover:outline-slate-400 hover:outline-dotted
|
||
|
focus:outline-slate-600 focus:outline-dashed
|
||
|
active:outline-green-600"
|
||
|
id="text"
|
||
|
name="text"
|
||
|
rows="10"
|
||
|
cols="80"
|
||
|
placeholder={ placeholderCode }
|
||
|
/>
|
||
|
</div>
|
||
|
}
|