Redmage/views/subredditsview/addview/addview.templ

44 lines
1.1 KiB
Plaintext

package addview
import "github.com/tigorlazuardi/redmage/views"
import "github.com/tigorlazuardi/redmage/views/components"
templ Addview(c *views.Context) {
@components.Doctype() {
@components.Head(c, components.HeadTitle("Redmage - Subreddits"))
@components.Body(c) {
@AddviewContent(c)
@components.NotificationContainer()
}
}
}
templ AddviewContent(c *views.Context) {
<main class="prose min-w-full">
@components.Container() {
<h1>Add Subreddit</h1>
<div class="divider"></div>
<form
action="/htmx/subreddits/add"
method="POST"
onkeydown="return event.key !== 'Enter'"
hx-post="/htmx/subreddits/add"
>
<div
class="grid grid-cols-1 sm:grid-cols-2 gap-4"
>
@SubredditInputForm(SubredditInputData{})
@SubredditTypeInput(SubredditTypeData{})
<div class="sm:col-span-2">
@scheduleInputContainer()
</div>
<div class="sm:col-span-2">
@CountbackInput(CountbackInputData{})
</div>
</div>
<button type="submit" class="block btn btn-primary mx-auto w-full max-w-xs mt-8 text-primary-content">Add</button>
</form>
}
</main>
}