ikurotime / gitgud

public
main / internal/interface/web/templates/issue_new.templ
973 B · Templ Raw
 1package templates
 2
 3import "gitgud/internal/domain"
 4
 5templ IssueNew(user *domain.User, repo *domain.Repository, title, body, errMsg string) {
 6	@Layout("New issue · "+repo.Name, user) {
 7		@repoHeader(repo, "issues")
 8		<div class="mx-auto max-w-2xl">
 9			<h2 class="mb-4 text-lg font-semibold tracking-tight">Open a new issue</h2>
10			if errMsg != "" {
11				<div class="mb-4 rounded-md border border-closed/30 bg-closed/10 px-3 py-2 text-sm text-closed">{ errMsg }</div>
12			}
13			<form method="post" action={ templ.SafeURL(repoPath(repo, "/issues")) } class="flex flex-col gap-3">
14				@csrfField()
15				<input class="input" type="text" name="title" placeholder="Title" value={ title } autofocus/>
16				<textarea class="textarea font-sans" name="body" rows="8" placeholder="Describe the issue… (markdown supported)">{ body }</textarea>
17				<div class="flex justify-end">
18					<button class="btn btn-primary" type="submit">Create issue</button>
19				</div>
20			</form>
21		</div>
22	}
23}