Page is done
This commit is contained in:
@@ -1,6 +1,28 @@
|
||||
{{ define "content" }}
|
||||
<article>
|
||||
|
||||
<table class="page-list">
|
||||
{{ range .Headers }}
|
||||
<tbody>
|
||||
<tr class="">
|
||||
<td class="pl-icon">{{.CategoryInfo.Icon}}</td>
|
||||
<td class="pl-content">
|
||||
<div class="plc-title"><a href="/page/{{.ID}}">{{.Name}}</a></div>
|
||||
<div class="plc-meta">
|
||||
{{ if .Dated }}
|
||||
<div class="plcm-date">{{.FictionalDate | formatDate}}</div>
|
||||
{{ else }}
|
||||
<div class="plcm-date">{{.PublishDate | formatDate}}</div>
|
||||
{{ end }}
|
||||
{{ if .PrimaryTag }}
|
||||
<div class="plcm-tag {{.PrimaryTag.CSSCLass}}">{{.PrimaryTag.Name}}</div>
|
||||
{{ end }}
|
||||
<div class="plcm-author">{{.Author | formatUserID}}</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="spacer"><td></td></tr>
|
||||
{{ end }}
|
||||
</table>
|
||||
</article>
|
||||
{{ end }}
|
||||
|
||||
@@ -9,10 +31,16 @@
|
||||
|
||||
<ul>
|
||||
{{ range .Categories }}
|
||||
<li class="{{ if eq .Key $.ActiveCategory.Key }}selected{{end}}"><a href="/{{.URLRoot}}/{{$.ActiveTag.Hook}}"><div class="mg-icon">Π</div><div class="mg-label">{{.Plural}}</div></a></li>
|
||||
<li class="{{ if eq .Key $.ActiveCategory.Key }}selected{{end}}"><a href="/{{.URLRoot}}/"><div class="mg-icon">{{.Icon}}</div><div class="mg-label">{{.Plural}}</div></a></li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
|
||||
{{ if $.ActiveTag.ID }}
|
||||
<ul>
|
||||
<li class="selected"><a href="/{{$.ActiveTag.Hook}}"><div class="mg-icon">{{$.ActiveTag.Icon}}</div><div class="mg-label">{{$.ActiveTag.Name}}</div></a></li>
|
||||
</ul>
|
||||
{{ end }}
|
||||
|
||||
{{ if $.User.LoggedIn }}
|
||||
<ul>
|
||||
<li><a href="/page/create"><div class="mg-icon">+</div><div class="mg-label">Create</div></a></li>
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
{{ define "content" }}
|
||||
<article>
|
||||
<h1>Create</h1>
|
||||
<h1>{{$.Operation}}</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 />
|
||||
<p class="danger">{{$.Error}}</p>
|
||||
<input class="big" placeholder="Page Name" name="name" type="text" value="{{$.Page.Name}}" />
|
||||
<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 />
|
||||
<input placeholder="IC Date" name="fictionalDate" type="text" value="{{if $.Page.FictionalDate.IsZero}}{{else}}{{$.Page.FictionalDate}}{{end}}" />
|
||||
<div class="group">
|
||||
{{ range $.Categories }}
|
||||
<div class="radio-wrapper">
|
||||
@@ -13,7 +13,7 @@
|
||||
</div>
|
||||
{{ end }}
|
||||
</div>
|
||||
<textarea name="tags" placeholder="Tags, e.g. 'Location: Miner's Respite'. One per line, topmost is primary tag"></textarea>
|
||||
<textarea name="tags" placeholder="Tags, e.g. 'Location: Miner's Respite'. One per line, topmost is primary tag">{{$.TagInput}}</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>
|
||||
@@ -30,7 +30,7 @@
|
||||
<input type="hidden" name="type" value="Markdown" />
|
||||
<input type="hidden" name="published" value="True" />
|
||||
|
||||
<button type="submit">Submit</button>
|
||||
<button type="submit">{{$.Operation}}</button>
|
||||
|
||||
</form>
|
||||
</article>
|
||||
@@ -0,0 +1,37 @@
|
||||
{{ define "content" }}
|
||||
<article class="narrow">
|
||||
<h1 class="danger">Delete Page</h1>
|
||||
<form action="/page/delete/{{$.Page.ID}}", method="POST">
|
||||
<p class="danger">
|
||||
This is an irreversible action, so make sure that this is the correct page!
|
||||
</p>
|
||||
<ul>
|
||||
<li><b>ID:</b> {{$.Page.ID}}</li>
|
||||
<li><b>Name:</b> {{$.Page.Name}}</li>
|
||||
<li><b>Category:</b> {{$.Page.Category}}</li>
|
||||
<li><b>Published:</b> {{$.Page.PublishDate | formatDateLong}}</li>
|
||||
</ul>
|
||||
<input type="hidden" name="aft" value="{{$.User.SessionID}}" />
|
||||
|
||||
<button type="submit">Delete Page</button>
|
||||
</article>
|
||||
{{ end }}
|
||||
|
||||
{{ define "menu" }}
|
||||
<a href="/"><h1>Page</h1></a>
|
||||
|
||||
{{ if eq $.User.ID $.Page.Author}}
|
||||
<ul>
|
||||
<li><a href="/page/edit/{{$.Page.ID}}"><div class="mg-icon">E</div><div class="mg-label">Edit</div></a></li>
|
||||
<li class="selected"><a href="/page/delete/{{$.Page.ID}}"><div class="mg-icon">X</div><div class="mg-label">Delete</div></a></li>
|
||||
</ul>
|
||||
{{ end }}
|
||||
|
||||
<ul>
|
||||
<li><a href="/page/{{$.Page.ID}}"><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 }}
|
||||
@@ -0,0 +1,50 @@
|
||||
{{ define "content" }}
|
||||
<article>
|
||||
<h1>{{$.Operation}}</h1>
|
||||
<form action="/page/edit/{{$.Page.ID}}", method="POST">
|
||||
<p class="danger">{{$.Error}}</p>
|
||||
<input class="big" placeholder="Page Name" name="name" type="text" value="{{$.Page.Name}}" />
|
||||
<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}}" />
|
||||
<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">{{$.TagInput}}</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">{{$.Operation}}</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 }}
|
||||
@@ -0,0 +1,44 @@
|
||||
{{ define "content" }}
|
||||
<article class="narrow">
|
||||
{{$.Page.Content}}
|
||||
</article>
|
||||
{{ end }}
|
||||
|
||||
{{ define "menu" }}
|
||||
<a href="/page/{{$.Page.ID}}"><h1>Page</h1></a>
|
||||
{{ if $.Page.Dated}}
|
||||
<div class="page-property">{{$.Page.FictionalDate | formatDate}}</div>
|
||||
{{ else }}
|
||||
<div class="page-property">{{$.Page.PublishDate | formatDate}}</div>
|
||||
{{ end }}
|
||||
|
||||
<ul>
|
||||
{{ range $.Page.Tags }}
|
||||
<li><a href="/{{.Hook}}"><div class="mg-icon">{{.Icon}}</div><div class="mg-label {{.CSSCLass}}">{{.Name}}</div></a></li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
|
||||
{{ if eq $.User.ID $.Page.Author}}
|
||||
<ul>
|
||||
<li><a href="/page/edit/{{$.Page.ID}}"><div class="mg-icon">E</div><div class="mg-label">Edit</div></a></li>
|
||||
<li><a href="/page/delete/{{$.Page.ID}}"><div class="mg-icon">X</div><div class="mg-label">Delete</div></a></li>
|
||||
</ul>
|
||||
{{ end }}
|
||||
|
||||
<ul>
|
||||
<li><a href="/"><div class="mg-icon"><</div><div class="mg-label">Back</div></a></li>
|
||||
</ul>
|
||||
|
||||
{{ if $.User.LoggedIn }}
|
||||
<ul>
|
||||
<li><a href="/user/logout"><div class="mg-icon">A</div><div class="mg-label">Logout</div></a></li>
|
||||
</ul>
|
||||
{{ else }}
|
||||
<ul>
|
||||
<li><a href="/user/login"><div class="mg-icon">A</div><div class="mg-label">Login</div></a></li>
|
||||
</ul>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ define "head" }}
|
||||
{{ end }}
|
||||
@@ -2,7 +2,8 @@
|
||||
<article>
|
||||
<h1>Login</h1>
|
||||
<form action="/user/login", method="POST">
|
||||
<p class="red">{{$.Error}}</p>
|
||||
<p>Use your wiki.aiterp.net account.</p>
|
||||
<p class="danger">{{$.Error}}</p>
|
||||
<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>
|
||||
Reference in New Issue
Block a user