1
0
mirror of https://github.com/osmarks/mycorrhiza.git synced 2024-12-12 05:20:26 +00:00
mycorrhiza/templates/rename.qtpl
2021-01-20 18:53:30 +05:00

38 lines
1.2 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") %}
<main>
{%- 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>
{% 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 %}