| 1 |
{% extends "base.html" %} |
| 2 |
{% block title %}{% if editing %}Edit drop{% else %}New drop{% endif %}{% endblock %} |
| 3 |
{% block content %} |
| 4 |
<div class="head"><h1>{% if editing %}Edit drop{% else %}New drop{% endif %} <small>{% if editing %}saved as one signed change{% else %}a small repository of its own, never listed among your repositories{% endif %}</small></h1></div> |
| 5 |
{% if let Some(d) = delegation %}<div class="strip warn">{{ d }}</div>{% endif %} |
| 6 |
{% if let Some(e) = error %}<p class="error">{{ e }}</p>{% endif %} |
| 7 |
<form class="card wide editor drop-form" method="post" action="{{ action }}"> |
| 8 |
<input type="hidden" name="_csrf" value="{{ shell.csrf }}"> |
| 9 |
<label for="title">Title</label><input type="text" id="title" name="title" value="{{ title }}" maxlength="200" placeholder="optional: the first file's name otherwise"> |
| 10 |
<label for="description">Description</label><input type="text" id="description" name="description" value="{{ description }}" maxlength="2000"> |
| 11 |
<label>Visibility</label> |
| 12 |
<div class="choice"> |
| 13 |
<label><input type="radio" name="visibility" value="public"{% if !secret %} checked{% endif %}> public: listed on your Drops page</label> |
| 14 |
<label><input type="radio" name="visibility" value="secret"{% if secret %} checked{% endif %}> secret: listed nowhere, readable by anyone with its address</label> |
| 15 |
</div> |
| 16 |
<div data-drop-files> |
| 17 |
{% for (name, content) in files %} |
| 18 |
<fieldset class="drop-file" data-drop-file> |
| 19 |
<div class="row"><div><label>File name</label><input type="text" name="name" value="{{ name }}" placeholder="notes.md" maxlength="255"></div><div class="drop-file-actions"><button type="button" class="small" data-drop-remove hidden>REMOVE</button></div></div> |
| 20 |
<textarea class="code" name="content" rows="14" spellcheck="false">{{ content }}</textarea> |
| 21 |
</fieldset> |
| 22 |
{% endfor %} |
| 23 |
</div> |
| 24 |
<p><button type="button" class="small" data-drop-add hidden>+ ADD FILE</button> <span class="small mute">A file left without a name and content is ignored{% if editing %}; one whose name you clear is removed{% endif %}.</span></p> |
| 25 |
{% if !kept.is_empty() %}<p class="small mute">Kept as they are (not text, or pushed with oxy): {% for k in kept %}<code>{{ k }}</code>{% if !loop.last %}, {% endif %}{% endfor %}.</p>{% endif %} |
| 26 |
{% if editing %}<label for="message">Change message</label><input type="text" id="message" name="message" value="{{ message }}" placeholder="Edit {{ title }}">{% endif %} |
| 27 |
<p class="small mute">The change is authored by your linked key and signed by this hub's key as your delegate. Push protection refuses anything that looks like a credential.</p> |
| 28 |
<div class="actions"> |
| 29 |
<button type="submit"{% if delegation.is_some() %} disabled{% endif %}>{% if editing %}SAVE{% else %}CREATE DROP{% endif %}</button> |
| 30 |
<a class="go" href="{{ cancel }}">CANCEL</a> |
| 31 |
</div> |
| 32 |
</form> |
| 33 |
{% endblock %} |