arche / internal/archesrv/templates/srv_repo_wiki_page.html

commit 154431fd
 1{{ define "title" }}{{.Repo}} — wiki — {{.Title}}{{ end }}
 2{{ define "navextra" }}<a href="/{{.Repo}}">{{.Repo}}</a> <a href="/{{.Repo}}/log">log</a> <a href="/{{.Repo}}/tree">tree</a> <a href="/{{.Repo}}/issues">issues</a> <a href="/{{.Repo}}/stacks">stacks</a> <a href="/{{.Repo}}/wiki">wiki</a>{{ end }}
 3{{ define "srv_repo_wiki_page.html" }}{{ template "head" . }}
 4<div class="container">
 5    <div style="display: flex;
 6                align-items: baseline;
 7                gap: 12px;
 8                margin-bottom: 16px">
 9        <h1 class="repo-name" style="margin-bottom: 0">{{.Repo}} / wiki / {{.Title}}</h1>
10        {{ if .User }}
11        <a href="?edit=1" style="font-size: 12px">edit</a>
12        {{ end }}
13    </div>
14    {{ if .Editing }}
15    <form method="post" action="/{{.Repo}}/wiki/{{.Title}}">
16        <div class="field">
17            <textarea name="content" rows="20" style="width: 100%; max-width: 800px; padding: 8px; border: 1px solid #ccc; border-radius: 3px; font-family: monospace; font-size: 13px;">
18{{.RawContent}}</textarea>
19        </div>
20        <button type="submit" style="margin-right: 8px">Save</button>
21        <a href="/{{.Repo}}/wiki/{{.Title}}" style="font-size: 13px">cancel</a>
22    </form>
23    {{ else if .RenderedContent }}
24    <div style="max-width: 800px; line-height: 1.6; font-size: 14px">{{.RenderedContent}}</div>
25{{ else }}
26    <p style="color: #888; font-style: italic">
27        This page has no content yet. {{ if .User }}<a href="?edit=1">Create it.</a>{{ end }}
28    </p>
29    {{ end }}
30</div>
31{{ template "foot" . }}
32{{ end }}