1
0
mirror of https://github.com/osmarks/mycorrhiza.git synced 2024-10-30 19:56:16 +00:00
mycorrhiza/views/modal.qtpl

60 lines
2.1 KiB
Plaintext
Raw Normal View History

{% import "net/http" %}
{% func DeleteAskHTML(rq *http.Request, hyphaName string, isOld bool) %}
{%= modalBegin(
"delete-confirm",
hyphaName,
"",
"Delete "+beautifulLink(hyphaName)+"?") %}
{%= modalReallyWant(hyphaName, "unattach") %}
2021-06-12 15:01:24 +00:00
<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(
2021-02-24 17:34:42 +00:00
"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) %}
2021-05-25 07:34:04 +00:00
<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 %}