~bigbes/sr-ht-dolt

ref: b4d6a3e641dc1e4417b69149ee707d8bd183465e sr-ht-dolt/web/templates/create.html -rw-r--r-- 1.4 KiB
b4d6a3e6 — Eugene Blikh docs: add design spec a month ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
{{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}}