{{define "content" -}}
<h2>Create database</h2>
{{if .Error}}
<div class="alert alert-danger">{{.Error}}</div>
{{end}}
<form method="POST" action="/create">
<div class="form-group">
<label for="name">Name</label>
<input type="text" class="form-control" name="name" id="name"
value="{{.Form.Name}}" required
pattern="[a-zA-Z0-9](?:[a-zA-Z0-9_-]*[a-zA-Z0-9])?" maxlength="64"
autofocus>
<small class="form-text text-muted">
Letters, digits, hyphen and underscore; must start and end with a letter or
digit. This doubles as the SQL database name.
</small>
</div>
<div class="form-group">
<label for="description">Description</label>
<input type="text" class="form-control" name="description" id="description"
value="{{.Form.Description}}" maxlength="1024">
</div>
<div class="form-group">
<label for="visibility">Visibility</label>
<select class="form-control" name="visibility" id="visibility">
<option value="PUBLIC" {{if eq .Form.Visibility "PUBLIC"}}selected{{end}}>Public — anyone can browse and clone</option>
<option value="UNLISTED" {{if eq .Form.Visibility "UNLISTED"}}selected{{end}}>Unlisted — anyone with the link can browse and clone</option>
<option value="PRIVATE" {{if eq .Form.Visibility "PRIVATE"}}selected{{end}}>Private — only you and collaborators</option>
</select>
</div>
<button type="submit" class="btn btn-primary">Create</button>
</form>
{{- end}}