{{template "admin/layout_head" (dict "ctxData" . "pageClass" "admin edit badge")}}
	<div class="admin-setting-content">
		<h4 class="ui top attached header">
			{{ctx.Locale.Tr "admin.badges.edit_badge"}}
		</h4>
			<div class="ui attached segment">
				<form class="ui form form-fetch-action" action="./edit" method="post">
					<div class="field">
					<label>{{ctx.Locale.Tr "admin.badges.slug"}}</label>
					<input value="{{.Badge.Slug}}" readonly>
				</div>
				<div class="field {{if .Err_Description}}error{{end}}">
					<label>{{ctx.Locale.Tr "admin.badges.description"}}</label>
					<textarea name="description" rows="2">{{.Badge.Description}}</textarea>
				</div>
				<div class="field {{if .Err_ImageURL}}error{{end}}">
					<label>{{ctx.Locale.Tr "admin.badges.image_url"}}</label>
					<input type="url" name="image_url" value="{{.Badge.ImageURL}}">
				</div>

				<div class="divider"></div>

				<div class="field">
					<button class="ui primary button">{{ctx.Locale.Tr "admin.badges.update_badge"}}</button>
					<button class="ui red button show-modal" data-modal="#delete-badge-modal">{{ctx.Locale.Tr "admin.badges.delete_badge"}}</button>
				</div>
			</form>
		</div>
	</div>

<div class="ui g-modal-confirm modal" id="delete-badge-modal">
	<div class="header">
		{{svg "octicon-trash"}}
		{{ctx.Locale.Tr "admin.badges.delete_badge"}}
	</div>
	<form class="ui form" method="post" action="./delete">
		<div class="content">
			<p>{{ctx.Locale.Tr "admin.badges.delete_badge_desc"}}</p>
		</div>
		{{template "base/modal_actions_confirm" .}}
	</form>
</div>

{{template "admin/layout_footer" .}}
