mirror of
https://github.com/osmarks/mycorrhiza.git
synced 2024-12-12 13:30:26 +00:00
60 lines
2.1 KiB
Plaintext
60 lines
2.1 KiB
Plaintext
{% import "net/http" %}
|
|
|
|
{% func DeleteAskHTML(rq *http.Request, hyphaName string, isOld bool) %}
|
|
{%= modalBegin(
|
|
"delete-confirm",
|
|
hyphaName,
|
|
"",
|
|
"Delete "+beautifulLink(hyphaName)+"?") %}
|
|
{%= modalReallyWant(hyphaName, "unattach") %}
|
|
<p>In this version of Mycorrhiza Wiki you cannot undelete a deleted hypha but the history can still be accessed.</p>
|
|
{%= modalEnd(hyphaName, true) %}
|
|
{% endfunc %}
|
|
|
|
{% func UnattachAskHTML(rq *http.Request, hyphaName string, isOld bool) %}
|
|
{%= modalBegin(
|
|
"unattach",
|
|
hyphaName,
|
|
"",
|
|
"Unattach "+beautifulLink(hyphaName)+"?") %}
|
|
{%= modalReallyWant(hyphaName, "unattach") %}
|
|
{%= modalEnd(hyphaName, true) %}
|
|
{% endfunc %}
|
|
|
|
{% func RenameAskHTML(rq *http.Request, hyphaName string, isOld bool) %}
|
|
{%= modalBegin(
|
|
"rename-confirm",
|
|
hyphaName,
|
|
` method="post" enctype="multipart/form-data"`,
|
|
"Rename "+beautifulLink(hyphaName)) %}
|
|
<label for="new-name">New name</label>
|
|
<input type="text" value="{%s hyphaName %}" required autofocus id="new-name" name="new-name"/>
|
|
|
|
<input type="checkbox" id="recursive" name="recursive" value="true" checked/>
|
|
<label for="recursive">Rename subhyphae too</label>
|
|
|
|
<p>If you rename this hypha, all incoming links and all relative outcoming links will break. You will also lose all history for the new name. Rename carefully.</p>
|
|
{%= modalEnd(hyphaName, false) %}
|
|
{% endfunc %}
|
|
|
|
{% func modalReallyWant(hyphaName, verb string) %}
|
|
<p class="modal__confirmation-msg">Do you really want to {%s verb %} hypha <em>{%s hyphaName %}</em>?</p>
|
|
{% endfunc %}
|
|
|
|
{% func modalBegin(path, hyphaName, formAttrs, legend string) %}
|
|
<div class="layout">
|
|
<main class="main-width">
|
|
<form class="modal" action="/{%s path %}/{%s hyphaName %}"{%s= formAttrs %}>
|
|
<fieldset class="modal__fieldset">
|
|
<legend class="modal__title">{%s= legend %}</legend>
|
|
{% endfunc %}
|
|
|
|
{% func modalEnd(hyphaName string, shouldFocusOnConfirm bool) %}
|
|
<input type="submit" value="Confirm" class="btn" {% if shouldFocusOnConfirm %}autofocus{% endif %}>
|
|
<a href="/hypha/{%s hyphaName %}" class="btn btn_weak">Cancel</a>
|
|
</fieldset>
|
|
</form>
|
|
</main>
|
|
</div>
|
|
{% endfunc %}
|