working sections version
This commit is contained in:
parent
16ea95bf09
commit
9424084a36
28 changed files with 367 additions and 251 deletions
|
|
@ -106,6 +106,9 @@ textarea,input,select {
|
|||
color: #e2e2e2 !important;
|
||||
background-color: #444444 !important;
|
||||
}
|
||||
select.sections {
|
||||
height: 120px !important;
|
||||
}
|
||||
input.menu {
|
||||
color: #e2e2e2 !important;
|
||||
background-color: #222222 !important;
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
<title>GoWiki | {{.Title}}</title>
|
||||
<link rel="shortcut icon" type="image/x-icon" href="/favicon.ico" integrity="sha256-bgotk/IPq4Yvt6s8AQGPTM5ZjPjQ6rrBRa2EyxpnFSc="></link>
|
||||
<link rel="stylesheet" type="text/css" href="/bootstrap.css" media="screen" integrity="sha256-NeLmQ7cX66J4MdtgGlG3O/TgvsSyP1b9WbaQtxYZUbQ="></link>
|
||||
<link rel="stylesheet" type="text/css" href="/custom.css" media="screen" integrity="sha256-o0xveJH8qNnWr/39Jnx97yDlYrvjuUnzE4q3p+94Yp4="></link>
|
||||
<link rel="stylesheet" type="text/css" href="/custom.css" media="screen" integrity="sha256-5/Vbh+c9BC042HeSbJXZZVIc1dD2b9cy6uH9LFAOSfo="></link>
|
||||
<meta name="theme-color" content="#375a7f">
|
||||
<meta name="description" content="{{.Title}}">
|
||||
</head>
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
<ul class="nav navbar-nav ml-auto">
|
||||
{{if .Login}}
|
||||
{{if .Admin}}
|
||||
<li class="nav-item"><a class="nav-link" href="/user">Users</a></li>
|
||||
<li class="nav-item"><a class="nav-link" href="/users">Users</a></li>
|
||||
{{else}}
|
||||
<li class="nav-item"><a class="nav-link" href="/user/edit/{{.User}}">Profile</a></li>
|
||||
{{end}}
|
||||
|
|
|
|||
|
|
@ -15,9 +15,6 @@
|
|||
<span class="badge badge-primary">Public</span>
|
||||
{{end}}
|
||||
{{if eq .Data.Perm 2}}
|
||||
<span class="badge badge-warning">Internal</span>
|
||||
{{end}}
|
||||
{{if eq .Data.Perm 3}}
|
||||
<span class="badge badge-danger">Private</span>
|
||||
{{end}}
|
||||
<br>
|
||||
|
|
|
|||
|
|
@ -21,11 +21,7 @@
|
|||
</div>
|
||||
<div class="custom-control custom-radio">
|
||||
<input type="radio" id="perm2" name="perm" value="2" class="custom-control-input" {{if eq .Data.Perm 2}}checked=""{{end}}>
|
||||
<label class="custom-control-label" for="perm2">Internal</label>
|
||||
</div>
|
||||
<div class="custom-control custom-radio">
|
||||
<input type="radio" id="perm3" name="perm" value="3" class="custom-control-input" {{if eq .Data.Perm 3}}checked=""{{end}}>
|
||||
<label class="custom-control-label" for="perm3">Private</label>
|
||||
<label class="custom-control-label" for="perm2">Private</label>
|
||||
</div>
|
||||
</div>
|
||||
<button class="btn btn-sm btn-primary" type="submit">Update</button>
|
||||
|
|
|
|||
|
|
@ -9,30 +9,31 @@
|
|||
<div class="form-group">
|
||||
<label class="col-form-label" for="section">Section</label>
|
||||
<select class="form-control input-sm" id="section" name="section" required>
|
||||
<option>wiki</option>
|
||||
<option>{{.User}}</option>
|
||||
{{range $section, $selected := .Data.Sections}}
|
||||
{{if $selected}}
|
||||
<option value="{{$section}}" selected>{{$section}}</option>
|
||||
{{else}}
|
||||
<option value="{{$section}}">{{$section}}</option>
|
||||
{{end}}
|
||||
{{end}}
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-form-label" for="title">Title</label>
|
||||
<input class="form-control input-sm" type="text" id="title" name="title" placeholder="Title" value="{{.Data.Title}}" spellcheck="false" autocomplete="off" autofocus required>
|
||||
<input class="form-control input-sm" type="text" id="title" name="title" placeholder="Title" value="{{.Data.Page.Title}}" spellcheck="false" autocomplete="off" autofocus required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-form-label" for="markdown">Markdown</label>
|
||||
<textarea class="form-control input-sm md-text" id="markdown" name="markdown" rows="30" spellcheck="false">{{.Data.Markdown}}</textarea>
|
||||
<textarea class="form-control input-sm md-text" id="markdown" name="markdown" rows="30" spellcheck="false">{{.Data.Page.Markdown}}</textarea>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="custom-control custom-radio">
|
||||
<input type="radio" id="perm1" name="perm" value="1" class="custom-control-input" {{if eq .Data.Perm 1}}checked=""{{end}}>
|
||||
<input type="radio" id="perm1" name="perm" value="1" class="custom-control-input" {{if eq .Data.Page.Perm 1}}checked=""{{end}}>
|
||||
<label class="custom-control-label" for="perm1">Public</label>
|
||||
</div>
|
||||
<div class="custom-control custom-radio">
|
||||
<input type="radio" id="perm2" name="perm" value="2" class="custom-control-input" {{if eq .Data.Perm 2}}checked=""{{end}}>
|
||||
<label class="custom-control-label" for="perm2">Internal</label>
|
||||
</div>
|
||||
<div class="custom-control custom-radio">
|
||||
<input type="radio" id="perm3" name="perm" value="3" class="custom-control-input" {{if eq .Data.Perm 3}}checked=""{{end}}>
|
||||
<label class="custom-control-label" for="perm3">Private</label>
|
||||
<input type="radio" id="perm2" name="perm" value="2" class="custom-control-input" {{if eq .Data.Page.Perm 2}}checked=""{{end}}>
|
||||
<label class="custom-control-label" for="perm2">Private</label>
|
||||
</div>
|
||||
</div>
|
||||
<button class="btn btn-sm btn-primary" type="submit">Create</button>
|
||||
|
|
|
|||
|
|
@ -15,9 +15,6 @@
|
|||
<span class="badge badge-primary">Public</span>
|
||||
{{end}}
|
||||
{{if eq .Data.Perm 2}}
|
||||
<span class="badge badge-warning">Internal</span>
|
||||
{{end}}
|
||||
{{if eq .Data.Perm 3}}
|
||||
<span class="badge badge-danger">Private</span>
|
||||
{{end}}
|
||||
<br>
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-form-label" for="members">Members</label>
|
||||
<select class="form-control input-sm" style="height:120px" id="members" name="members" multiple required>
|
||||
<select class="form-control input-sm sections" id="members" name="members" multiple required>
|
||||
{{range $user, $member := .Data.Members}}
|
||||
{{if $member}}
|
||||
<option value="{{$user}}" selected>{{$user}}</option>
|
||||
|
|
|
|||
|
|
@ -14,9 +14,13 @@
|
|||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-form-label" for="members">Members</label>
|
||||
<select class="form-control input-sm" style="height:120px" id="members" name="members" multiple required>
|
||||
{{range $nil, $user := .Data.Members}}
|
||||
<select class="form-control input-sm sections" id="members" name="members" multiple required>
|
||||
{{range $user, $member := .Data.Members}}
|
||||
{{if $member}}
|
||||
<option value="{{$user}}" selected>{{$user}}</option>
|
||||
{{else}}
|
||||
<option value="{{$user}}">{{$user}}</option>
|
||||
{{end}}
|
||||
{{end}}
|
||||
</select>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
<form class="form-horizontal" action="/user/del/{{.Data.Username}}" method="post">
|
||||
<input type="hidden" name="token" value="{{.Token}}">
|
||||
<button class="btn btn-sm btn-danger" type="submit">Delete</button>
|
||||
<a href="/user" class="btn btn-sm btn-primary">Back</a>
|
||||
<a href="/users" class="btn btn-sm btn-primary">Back</a>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@
|
|||
{{end}}
|
||||
<button class="btn btn-sm btn-primary" type="submit">Update</button>
|
||||
{{if .Admin}}
|
||||
<a href="/user" class="btn btn-sm btn-primary">Back</a>
|
||||
<a href="/users" class="btn btn-sm btn-primary">Back</a>
|
||||
{{else}}
|
||||
<a href="/" class="btn btn-sm btn-primary">Back</a>
|
||||
{{end}}
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
<input type="checkbox" id="admin" name="admin" value="0">
|
||||
</div>
|
||||
<button class="btn btn-sm btn-primary" type="submit">Create</button>
|
||||
<a href="/user" class="btn btn-sm btn-primary">Back</a>
|
||||
<a href="/users" class="btn btn-sm btn-primary">Back</a>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue