1
0
mirror of https://github.com/osmarks/mycorrhiza.git synced 2024-12-12 05:20:26 +00:00
mycorrhiza/interwiki/view_interwiki.html

95 lines
2.5 KiB
HTML
Raw Normal View History

{{define "interwiki map"}}Interwiki map{{end}}
{{define "title"}}{{template "interwiki map"}}{{end}}
{{define "static map"}}
2022-06-06 16:12:56 +00:00
{{if len .Entries}}
<ul>
{{range $i, $wiki := .Entries}}
<li>
<dl>
<dt>Name</dt>
<dd>{{.Name}}</dd>
<dt>Aliases</dt>
{{range .Aliases}}<dd>{{.}}</dd>{{end}}
<dt>Engine</dt>
<dd>{{.Engine}}</dd>
<dt>URL</dt>
<dd><a href="{{.URL}}">{{.URL}}</a></dd>
2022-06-06 16:12:56 +00:00
<dt>Link href format</dt>
<dd>{{.LinkHrefFormat}}</dd>
<dt>Img src format</dt>
<dd>{{.ImgSrcFormat}}</dd>
</dl>
</li>
2022-06-06 16:12:56 +00:00
{{end}}
</ul>
{{else}}
<p>No interwiki map set.</p>
{{end}}
{{end}}
{{define "authorized map"}}
{{if .Error}}
<p class="error">{{.Error}}</p>
{{end}}
{{if len .Entries}}
{{range $i, $wiki := .Entries}}
<!-- todo -->
{{end}}
{{end}}
2022-06-06 16:12:56 +00:00
<form method="post" action="/interwiki/add-entry">
<h2>Add interwiki entry</h2>
<p>
<label for="name" class="required-field">Name:</label>
<input type="text" id="name" name="name" required
placeholder="home_wiki">
</p>
<p>
<label for="aliases">Aliases (separated by commas):</label>
<input type="text" id="aliases" name="aliases"
placeholder="homewiki, hw">
2022-06-06 16:12:56 +00:00
</p>
<p>
<label for="url" class="required-field">URL:</label>
<input type="url" id="url" name="url" required
placeholder="https://wiki.example.org">
</p>
<p>
<label for="engine" class="required-field">Engine:</label>
<select name="engine" id="engine" required>
<option value="mycorrhiza">Mycorrhiza 🍄</option>
<option value="agora">Agora ἀ</option>
<option value="generic">Generic (any website)</option>
</select>
</p>
<p>Fill the next two fields if you have chosen <kbd>Generic</kbd> in the previous field.</p>
<p>
<label for="link-href-format">Link href attribute format string:</label>
<input type="url" id="link-href-format" name="link-href-format"
placeholder="https://wiki.example.org/view/{NAME}">
</p>
<p>
<label for="img-src-format">Image src attribute format string:</label>
<input type="url" id="img-src-format" name="img-src-format"
placeholder="https://wiki.example.org/media/{NAME}">
</p>
<input type="submit">
</form>
{{end}}
{{define "body"}}
<main class="main-width">
<h1>{{template "interwiki map"}}</h1>
<p><a href="/help/en/interwiki">Documentation.</a></p>
2022-06-06 16:12:56 +00:00
{{if .CanEdit}}
{{template "authorized map" .}}
{{else}}
2022-06-06 16:12:56 +00:00
{{template "static map" .}}
{{end}}
</main>
{{end}}