OXYGENHUB
# b951c58734e8 oxygenhub / templates / drop_form.html
2.9 KiB · HTML · last changed Drops: per-user gists, each a small hidden Oxygen repository (#279) 16 days ago source blame history raw
166f6e9b Andy McCall 1
{% extends "base.html" %}
2
{% block title %}{% if editing %}Edit drop{% else %}New drop{% endif %}{% endblock %}
3
{% block mainclass %} class="wide"{% endblock %}
4
{% block content %}
5
<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>
6
{% if let Some(d) = delegation %}<div class="strip warn">{{ d }}</div>{% endif %}
7
{% if let Some(e) = error %}<p class="error">{{ e }}</p>{% endif %}
8
<form class="card wide editor drop-form" method="post" action="{{ action }}">
9
  <input type="hidden" name="_csrf" value="{{ shell.csrf }}">
10
  <label for="title">Title</label><input type="text" id="title" name="title" value="{{ title }}" maxlength="200" placeholder="optional: the first file's name otherwise">
11
  <label for="description">Description</label><input type="text" id="description" name="description" value="{{ description }}" maxlength="2000">
12
  <label>Visibility</label>
13
  <div class="choice">
14
    <label><input type="radio" name="visibility" value="public"{% if !secret %} checked{% endif %}> public: listed on your Drops page</label>
15
    <label><input type="radio" name="visibility" value="secret"{% if secret %} checked{% endif %}> secret: listed nowhere, readable by anyone with its address</label>
16
  </div>
17
  <div data-drop-files>
18
  {% for (name, content) in files %}
19
    <fieldset class="drop-file" data-drop-file>
20
      <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>
21
      <textarea class="code" name="content" rows="14" spellcheck="false">{{ content }}</textarea>
22
    </fieldset>
23
  {% endfor %}
24
  </div>
25
  <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>
26
  {% 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 %}
27
  {% if editing %}<label for="message">Change message</label><input type="text" id="message" name="message" value="{{ message }}" placeholder="Edit {{ title }}">{% endif %}
28
  <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>
29
  <div class="choice">
30
    <button type="submit"{% if delegation.is_some() %} disabled{% endif %}>{% if editing %}SAVE{% else %}CREATE DROP{% endif %}</button>
31
    <a class="go" href="{{ cancel }}">CANCEL</a>
32
  </div>
33
</form>
34
{% endblock %}