holiday-api/templates/dialogs/edit-webhook.gohtml

36 lines
1.8 KiB
Plaintext

<dialog class="card" id="update-card">
<h3 class="card-title">Edit webhook</h3>
<form method="post" action="/admin/webhooks">
<input type="hidden" id="id" name="id" value="{{.Webhook.Id}}">
<section>
<label for="url">Url:</label>
<input required id="url" name="url" type="url" value="{{.Webhook.Url}}">
</section>
<section>
<label for="country">Country:</label>
<select id="country" required name="country">
{{range $entry := .Countries}}
<option {{if eq $.Webhook.Country $entry.IsoName}}selected{{end}} value="{{$entry.IsoName}}">{{$entry.Name}}</option>
{{end}}
</select>
</section>
<section>
<label for="retry_count">Retry count:</label>
<input required id="retry_count" name="retry_count" type="number" min="0" max="10" value="{{.Webhook.RetryCount}}">
</section>
<section>
<label class="checkbox"><span>On created</span><input id="on_created" value="true" name="on_created" type="checkbox" {{if .Webhook.OnCreated}}checked{{end}}></label>
</section>
<section>
<label class="checkbox"><span>On edited</span><input id="on_edited" value="true" name="on_edited" type="checkbox" {{if .Webhook.OnEdited}}checked{{end}}></label>
</section>
<section>
<label class="checkbox"><span>On deleted</span><input id="on_deleted" value="true" name="on_deleted" type="checkbox" {{if .Webhook.OnDeleted}}checked{{end}}></label>
</section>
<section class="actions">
<button type="submit">Update</button>
<button type="button" onclick="closeDialog('#update-card')">Cancel</button>
</section>
</form>
</dialog>