53 lines
2.6 KiB
HTML
53 lines
2.6 KiB
HTML
{{define "title"}}New Ticket{{end}}
|
|
|
|
{{define "content"}}
|
|
<div class="mx-auto max-w-2xl">
|
|
<h1 class="text-2xl font-bold text-gray-900 mb-6">Submit a Ticket</h1>
|
|
|
|
{{with .Data}}
|
|
{{if .Error}}
|
|
<div class="mb-4 rounded-md bg-red-50 p-4">
|
|
<p class="text-sm text-red-800">{{.Error}}</p>
|
|
</div>
|
|
{{end}}
|
|
{{end}}
|
|
|
|
<form method="POST" action="/tickets" class="space-y-6 bg-white p-6 rounded-lg shadow ring-1 ring-gray-200">
|
|
<input type="hidden" name="gorilla.csrf.Token" value="{{.CSRFToken}}">
|
|
|
|
<div>
|
|
<label for="repo_id" class="block text-sm font-medium text-gray-700">Product</label>
|
|
<select name="repo_id" id="repo_id" required
|
|
class="mt-1 block w-full rounded-md border border-gray-300 px-3 py-2 shadow-sm focus:border-blue-500 focus:outline-none focus:ring-1 focus:ring-blue-500">
|
|
<option value="">Select a product...</option>
|
|
{{with .Data}}
|
|
{{range .Repos}}
|
|
<option value="{{.ID}}" {{if eq (print .ID) (index $.Data "RepoID")}}selected{{end}}>{{.Name}}</option>
|
|
{{end}}
|
|
{{end}}
|
|
</select>
|
|
</div>
|
|
|
|
<div>
|
|
<label for="title" class="block text-sm font-medium text-gray-700">Title</label>
|
|
<input type="text" name="title" id="title" required
|
|
value="{{with .Data}}{{.Title}}{{end}}"
|
|
placeholder="Brief summary of the issue"
|
|
class="mt-1 block w-full rounded-md border border-gray-300 px-3 py-2 shadow-sm focus:border-blue-500 focus:outline-none focus:ring-1 focus:ring-blue-500">
|
|
</div>
|
|
|
|
<div>
|
|
<label for="description" class="block text-sm font-medium text-gray-700">Description</label>
|
|
<textarea name="description" id="description" rows="6" required
|
|
placeholder="Describe the issue in detail. Include steps to reproduce, expected behavior, and actual behavior."
|
|
class="mt-1 block w-full rounded-md border border-gray-300 px-3 py-2 shadow-sm focus:border-blue-500 focus:outline-none focus:ring-1 focus:ring-blue-500">{{with .Data}}{{.Description}}{{end}}</textarea>
|
|
</div>
|
|
|
|
<div class="flex justify-end gap-3">
|
|
<a href="/tickets" class="rounded-md bg-white px-4 py-2 text-sm font-semibold text-gray-900 shadow ring-1 ring-inset ring-gray-300 hover:bg-gray-50">Cancel</a>
|
|
<button type="submit" class="rounded-md bg-blue-600 px-4 py-2 text-sm font-semibold text-white shadow hover:bg-blue-500">Submit Ticket</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
{{end}}
|