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

36 lines
1.9 KiB
Plaintext

<dialog class="card" id="update-card">
<h3 class="card-title">Ažuriraj praznik</h3>
<form method="post" action="/admin/holidays">
<input type="hidden" name="id" value="{{.Holiday.Id}}">
<section class="form-field">
<label for="country">Država:</label>
<select id="country" required name="country">
{{range $entry := .Countries}}
<option {{if eq $.Holiday.Country $entry.IsoName}}selected{{end}} value="{{$entry.IsoName}}">{{$entry.Name}}</option>
{{end}}
</select>
</section>
<section class="form-field">
<label for="name">Ime:</label>
<input required id="name" value="{{.Holiday.Name}}" name="name" type="text">
</section>
<section class="form-field">
<label for="description">Opis:</label>
<textarea id="description" name="description">{{.Holiday.Description}}</textarea>
</section>
<section class="form-field">
<label for="date">Datum:</label>
<input required id="date" value="{{.Holiday.Date.Format "2006-01-02"}}" name="date" type="date">
</section>
<section class="form-field">
<label class="checkbox"><span>Državni praznik</span><input id="state_holiday" value="true" {{if .Holiday.IsStateHoliday}}checked{{end}} name="state_holiday" type="checkbox"></label>
</section>
<section class="form-field">
<label class="checkbox"><span>Religiozni praznik</span><input id="religious_holiday" value="true" {{if .Holiday.IsReligiousHoliday}}checked{{end}} name="religious_holiday" type="checkbox"></label>
</section>
<section class="actions">
<button class="primary" type="submit">Ažuriraj</button>
<button class="secondary" type="button" onclick="closeDialog('#update-card')">Odustani</button>
</section>
</form>
</dialog>