Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
48 lines (39 sloc) 1.44 KB
{{ block "content" . }}
<h1 class='text-center'>{{ .Title }}</h1>
<form action='/todo/' method='POST'>
<div class='row'>
<div class='offset-lg-1 col-lg-8 offset-md-1 col-md-7' style='margin-bottom: 5pt;'>
<input type='text' class='form-control' name='todo' placeholder='Something to do.'>
</div>
<div class='col-lg-3 col-md-4'>
<button class='btn btn-primary'>Add</button>
</div>
</div>
</form>
{{ range $t := .TODOs }}
<form action='/todo/' method='POST'>
<div class='row'>
<div class='offset-lg-1 col-lg-8 offset-md-1 col-md-7 todo' style='margin-top: 5pt; margin-bottom: 5pt;'>
<label class='col-form-label'>{{ $t.Item }}</label>
<inupt name='index' name='index' value='{{ $t.Index }}' hidden>
</div>
<div class='col-lg-3 col-md-4'>
<button type='submit' name='_method' value='update' class='btn btn-secondary' onclick="updateTODO(event);">Update</button>
<button type='submit' name='_method' value='delete' class='btn btn-info' onclick="deleteTODO(event);">Delete</button>
</div>
</div>
</form>
{{ end }}
{{ if .Message }}
<div class='row'>
<div class='offset-lg-2 col-lg-8 offset-md-1 col-md-10 col-sm-12'>
<div class="alert alert-warning" role="alert">
{{ .Message }}
</div>
</div>
</div>
{{ end }}
{{ end }}
{{ block "script" . }}
<script src='/js/app.js'></script>
{{ end }}
You can’t perform that action at this time.