Create Page is done
This commit is contained in:
@@ -79,4 +79,5 @@ func Run(w io.Writer, name string, viewModel interface{}) error {
|
||||
func init() {
|
||||
Register("index", "base/default")
|
||||
Register("login", "base/default")
|
||||
Register("create", "base/default")
|
||||
}
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
{{ define "content" }}
|
||||
<article>
|
||||
<h1>Create</h1>
|
||||
<form action="/page/create", method="POST">
|
||||
<p class="red">{{$.Error}}</p>
|
||||
<input class="big" placeholder="Page Name" name="name" type="text" value="{{$.Page.Name}}" autofocus />
|
||||
<textarea class="tall" placeholder="Content" name="source">{{$.Page.Source}}</textarea>
|
||||
<input placeholder="IC Date" name="fictionalDate" type="text" value="{{if $.Page.FictionalDate.IsZero}}{{else}}{{$.Page.FictionalDate}}{{end}}" autofocus />
|
||||
<div class="group">
|
||||
{{ range $.Categories }}
|
||||
<div class="radio-wrapper">
|
||||
<input name="category" type="radio" name="category" value="{{.Key}}" {{if eq $.Page.Category .Key}}checked{{end}}><b> {{.Key}}</b>: {{.Info}}</input>
|
||||
</div>
|
||||
{{ end }}
|
||||
</div>
|
||||
<textarea name="tags" placeholder="Tags, e.g. 'Location: Miner's Respite'. One per line, topmost is primary tag"></textarea>
|
||||
<div class="group">
|
||||
<div class="radio-wrapper">
|
||||
<input type="checkbox" name="dated" value="true" {{if $.Page.Dated}}checked{{end}}><b> Dated</b>: The IC date is shown on the page list. It will still be used for sorting if this option is disabled.</input>
|
||||
</div>
|
||||
<div class="radio-wrapper">
|
||||
<input type="checkbox" name="unlisted" value="true" {{if $.Page.Unlisted}}checked{{end}}><b> Unlisted</b>: This page will not show up on page lists, but anyone with a link can view it.</input>
|
||||
</div>
|
||||
<div class="radio-wrapper">
|
||||
<input type="checkbox" name="specific" value="true" {{if $.Page.Specific}}checked{{end}}><b> Specific</b>: This page will only show up on page lists when one of its tags is searched for.</input>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Future option -->
|
||||
<input type="hidden" name="type" value="Markdown" />
|
||||
<input type="hidden" name="published" value="True" />
|
||||
|
||||
<button type="submit">Submit</button>
|
||||
|
||||
</form>
|
||||
</article>
|
||||
{{ end }}
|
||||
|
||||
{{ define "menu" }}
|
||||
<a href="/"><h1>Aite RP</h1></a>
|
||||
|
||||
<ul>
|
||||
<li><a href="/"><div class="mg-icon"><</div><div class="mg-label">Back</div></a></li>
|
||||
</ul>
|
||||
{{ end }}
|
||||
|
||||
{{ define "head" }}
|
||||
<link rel="stylesheet" href="/ui/css/form.css" />
|
||||
<script type="text/javascript" src="/ui/js/form-page.js"></script>
|
||||
{{ end }}
|
||||
@@ -3,8 +3,8 @@
|
||||
<h1>Login</h1>
|
||||
<form action="/user/login", method="POST">
|
||||
<p class="red">{{$.Error}}</p>
|
||||
<input placeholder="Username" name="username" type="text" />
|
||||
<input placeholder="Password" name="password" type="password" />
|
||||
<input placeholder="Username" name="username" type="text" value="{{$.UserName}}" {{if ne $.UserName ""}}autofocus{{end}} />
|
||||
<input placeholder="Password" name="password" type="password" {{if $.UserName}}autofocus{{end}} />
|
||||
<button type="submit">Submit</button>
|
||||
</form>
|
||||
</article>
|
||||
@@ -12,10 +12,12 @@
|
||||
|
||||
{{ define "menu" }}
|
||||
<a href="/"><h1>Aite RP</h1></a>
|
||||
|
||||
<li><a href="/"><div class="mg-icon"><</div><div class="mg-label">Back</div></a></li>
|
||||
|
||||
<ul>
|
||||
<li><a href="/"><div class="mg-icon"><</div><div class="mg-label">Back</div></a></li>
|
||||
</ul>
|
||||
{{ end }}
|
||||
|
||||
{{ define "head" }}
|
||||
|
||||
<link rel="stylesheet" href="/ui/css/form.css" />
|
||||
{{ end }}
|
||||
Reference in New Issue
Block a user