repo_new.html
·
55 строк
·
2.5 KB
| 1 | {{define "content"}} |
| 2 | <div class="container" style="max-width:32rem;"> |
| 3 | <div class="card"> |
| 4 | <div class="card-header"> |
| 5 | <h1 class="text-base font-semibold" style="margin:0;">{{t .Lang "repo.new.title"}}</h1> |
| 6 | </div> |
| 7 | |
| 8 | <form method="post" action="/new" class="card-body flex flex-col gap-3"> |
| 9 | <input type="hidden" name="_csrf" value="{{.CSRFToken}}"> |
| 10 | |
| 11 | <div> |
| 12 | <label class="label" for="name">{{t .Lang "repo.name"}}</label> |
| 13 | <div class="flex items-center gap-2"> |
| 14 | <span class="text-sm text-muted font-mono flex-shrink-0">{{.CurrentUser.Username}} /</span> |
| 15 | <input id="name" name="name" type="text" class="input font-mono flex-1 min-w-0" value="{{.FormName}}" placeholder="project" required autofocus pattern="^[a-zA-Z0-9][a-zA-Z0-9._-]{0,63}$"> |
| 16 | </div> |
| 17 | <div class="field-hint">{{t .Lang "repo.name_hint"}}</div> |
| 18 | </div> |
| 19 | |
| 20 | <div> |
| 21 | <label class="label" for="description">{{t .Lang "repo.description"}}</label> |
| 22 | <input id="description" name="description" type="text" class="input" value="{{.FormDescription}}" maxlength="500" placeholder="{{t .Lang "repo.description_ph"}}"> |
| 23 | </div> |
| 24 | |
| 25 | <div> |
| 26 | <span class="label">{{t .Lang "repo.visibility"}}</span> |
| 27 | <div class="flex flex-col gap-2"> |
| 28 | <label class="card p-3 flex items-start gap-2.5" style="cursor:pointer;"> |
| 29 | <input type="radio" name="visibility" value="public" checked style="margin-top:0.2rem;"> |
| 30 | <div> |
| 31 | <div class="font-medium text-sm flex items-center gap-1.5">{{icon "globe" "size-4"}} {{t .Lang "repo.public"}}</div> |
| 32 | <div class="text-xs text-muted mt-1">{{t .Lang "repo.public_desc"}}</div> |
| 33 | </div> |
| 34 | </label> |
| 35 | <label class="card p-3 flex items-start gap-2.5" style="cursor:pointer;"> |
| 36 | <input type="radio" name="visibility" value="private" style="margin-top:0.2rem;"> |
| 37 | <div> |
| 38 | <div class="font-medium text-sm flex items-center gap-1.5">{{icon "lock" "size-4"}} {{t .Lang "repo.private"}}</div> |
| 39 | <div class="text-xs text-muted mt-1">{{t .Lang "repo.private_desc"}}</div> |
| 40 | </div> |
| 41 | </label> |
| 42 | </div> |
| 43 | </div> |
| 44 | |
| 45 | <div class="flex items-center justify-end gap-2 pt-2"> |
| 46 | <a href="/repos" class="btn btn-outline">{{t .Lang "common.cancel"}}</a> |
| 47 | <button type="submit" class="btn btn-primary"> |
| 48 | {{icon "plus" "size-4"}} |
| 49 | <span>{{t .Lang "repo.create_btn"}}</span> |
| 50 | </button> |
| 51 | </div> |
| 52 | </form> |
| 53 | </div> |
| 54 | </div> |
| 55 | {{end}} |