1
0
mirror of https://github.com/osmarks/mycorrhiza.git synced 2024-10-30 11:46:16 +00:00
mycorrhiza/templates/rename.qtpl
2021-01-26 10:41:57 +05:00

40 lines
1.3 KiB
Plaintext

{% import "net/http" %}
This dialog is to be shown to a user when they try to rename a hypha.
{% func RenameAskHTML(rq *http.Request, hyphaName string, isOld bool) %}
{%= navHTML(rq, hyphaName, "rename-ask") %}
<div class="layout">
<main class="main-width">
{%- if isOld -%}
<section>
<h1>Rename {%s hyphaName %}</h1>
<form action="/rename-confirm/{%s hyphaName %}" method="post" enctype="multipart/form-data">
<fieldset>
<legend>New name</legend>
<input type="text" value="{%s hyphaName %}" required autofocus id="new-name" name="new-name"/>
</fieldset>
<fieldset>
<legend>Settings</legend>
<input type="checkbox" id="recursive" name="recursive" value="true" checked/>
<label for="recursive">Keep subhyphae</label>
</fieldset>
<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>
<input type="submit"/>
</form>
</section>
{%- else -%}
{%= cannotRenameDueToNonExistence(hyphaName) %}
{%- endif -%}
</main>
</div>
{% endfunc %}
{% func cannotRenameDueToNonExistence(hyphaName string) %}
<section>
<h1>Cannot rename {%s hyphaName %}</h1>
<p>This hypha does not exist.</p>
<p><a href="/page/{%s hyphaName %}">Go back</a></p>
</section>
{% endfunc %}