OXYGENHUB
◆ v0.6.1 oxygenhub / templates / drop.html
2.5 KiB · HTML · last changed Drops: per-user gists, each a small hidden Oxygen repository (#279) 15 days ago source blame history raw
166f6e9b Andy McCall 1
{% extends "base.html" %}
2
{% import "repo_tabs.html" as m %}
3
{% block title %}{{ title }} · {{ repo.owner }}'s drop{% endblock %}
4
{% block bodyattrs %} data-repo="{{ repo.url }}"{% endblock %}
5
{% block tabs %}{% call m::tabs(repo, "code") %}{% endblock %}
6
{% block mainclass %} class="wide"{% endblock %}
7
{% block content %}
8
<div class="head"><h1>{{ title }}{% if !at_default %} <small>at {{ target }}</small>{% endif %}</h1>
9
{% if can_edit || can_delete %}<div class="choice">{% if can_edit %}<a class="go" href="{{ repo.url }}/edit">EDIT</a>{% endif %}
10
<form class="inline" method="post" action="{{ repo.url }}/delete" data-confirm="Delete this drop and its history? Its address stops working."><input type="hidden" name="_csrf" value="{{ shell.csrf }}"><button type="submit" class="danger-btn">DELETE</button></form></div>{% endif %}
11
</div>
12
{% if !description.is_empty() %}<p>{{ description }}</p>{% endif %}
13
<p class="small mute">A drop by <a href="/{{ repo.owner }}">{{ repo.owner }}</a> · {{ files.len() }} file{% if files.len() != 1 %}s{% endif %} · created <time title="{{ created_ms|when_i }}">{{ created_ms|ago_i }}</time> · updated <time title="{{ updated_ms|when_i }}">{{ updated_ms|ago_i }}</time> · <a href="{{ repo.url }}/changes/{{ repo.default_bookmark }}">history</a></p>
14
{% if secret %}<div class="strip">Secret: this drop is listed nowhere, but anyone with its address can read it.</div>{% endif %}
15
<p class="small"><label for="clone">Clone</label> <input type="text" id="clone" class="code" readonly value="oxy clone {{ clone_url }}" data-select size="60"></p>
16
{% if files.is_empty() %}<p class="empty">No files.</p>{% endif %}
17
{% for f in files %}
18
<section class="filebox drop-filebox" id="{{ f.anchor }}">
19
  <header>
20
    <strong>{{ f.path }}</strong> <span class="small mute">{{ f.size|bytes }}{% if let Some(l) = f.language %} · {{ l }}{% endif %}</span>
21
    <span class="modes"><a href="{{ repo.url }}/raw/{{ target }}/{{ f.path }}">raw</a><a href="{{ repo.url }}/changes/{{ target }}?path={{ f.path }}">history</a></span>
22
  </header>
23
  {% if let Some(html) = f.markdown %}
24
  <article class="doc">{{ html|safe }}</article>
25
  {% else if let Some(note) = f.note %}
26
  <p class="empty">{{ note }} <a href="{{ repo.url }}/raw/{{ target }}/{{ f.path }}">Download it</a>.</p>
27
  {% else %}
28
  <table class="code">
29
  {% for line in f.lines %}
30
    <tr id="{{ f.anchor }}-L{{ loop.index }}"><td class="n">{{ loop.index }}</td><td class="t"><pre>{{ line|safe }}</pre></td></tr>
31
  {% endfor %}
32
  </table>
33
  {% endif %}
34
</section>
35
{% endfor %}
36
{% endblock %}