2022-05-27 13:43:40 +00:00
|
|
|
{{define "interwiki map"}}Interwiki map{{end}}
|
|
|
|
{{define "title"}}{{template "interwiki map"}}{{end}}
|
|
|
|
|
2022-06-08 13:45:27 +00:00
|
|
|
{{define "static map"}}
|
2022-06-06 16:12:56 +00:00
|
|
|
{{if len .Entries}}
|
|
|
|
<ul>
|
|
|
|
{{range $i, $wiki := .Entries}}
|
2022-05-27 13:43:40 +00:00
|
|
|
<li>
|
|
|
|
<dl>
|
2022-06-08 13:45:27 +00:00
|
|
|
<dt>Name</dt>
|
|
|
|
<dd>{{.Name}}</dd>
|
|
|
|
|
|
|
|
<dt>Aliases</dt>
|
|
|
|
{{range .Aliases}}<dd>{{.}}</dd>{{end}}
|
2022-05-27 13:43:40 +00:00
|
|
|
|
|
|
|
<dt>Engine</dt>
|
2022-06-08 13:45:27 +00:00
|
|
|
<dd>{{.Engine}}</dd>
|
2022-05-27 13:43:40 +00:00
|
|
|
|
|
|
|
<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>
|
2022-05-27 13:43:40 +00:00
|
|
|
</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}}
|
2022-06-08 13:45:27 +00:00
|
|
|
{{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>
|
2022-06-08 13:45:27 +00:00
|
|
|
<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>
|
2022-06-08 13:45:27 +00:00
|
|
|
<p><a href="/help/en/interwiki">Documentation.</a></p>
|
2022-06-06 16:12:56 +00:00
|
|
|
{{if .CanEdit}}
|
|
|
|
{{template "authorized map" .}}
|
2022-05-27 13:43:40 +00:00
|
|
|
{{else}}
|
2022-06-06 16:12:56 +00:00
|
|
|
{{template "static map" .}}
|
2022-05-27 13:43:40 +00:00
|
|
|
{{end}}
|
|
|
|
</main>
|
|
|
|
{{end}}
|