OXYGENHUB
# 8bf3010760d7 oxygenhub / templates / drop.html
2.7 KiB · HTML · last changed A drop's page is centred and its header clearer (closes #283) 15 days ago source blame history raw
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 content %}
7
<div class="drop-head">
8
  <div class="drop-id">
9
    <h1>{{ title }}{% if !at_default %} <small>at {{ target }}</small>{% endif %}</h1>
10
    {% if !description.is_empty() %}<p class="drop-desc">{{ description }}</p>{% endif %}
11
    <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>
12
  </div>
13
  {% if can_edit || can_delete %}<div class="drop-actions">{% if can_edit %}<a class="go" href="{{ repo.url }}/edit">EDIT</a>{% endif %}{% if can_delete %}<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>{% endif %}</div>{% endif %}
14
</div>
15
{% if secret %}<div class="strip">Secret: this drop is listed nowhere, but anyone with its address can read it.</div>{% endif %}
16
<div class="drop-clone"><label for="clone">Clone</label><input type="text" id="clone" class="code" readonly value="oxy clone {{ clone_url }}" data-select><button type="button" class="small" data-copy="oxy clone {{ clone_url }}">copy</button></div>
17
{% if files.is_empty() %}<p class="empty">No files.</p>{% endif %}
18
{% for f in files %}
19
<section class="filebox drop-filebox" id="{{ f.anchor }}">
20
  <header>
21
    <strong>{{ f.path }}</strong> <span class="small mute">{{ f.size|bytes }}{% if let Some(l) = f.language %} · {{ l }}{% endif %}</span>
22
    <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>
23
  </header>
24
  {% if let Some(html) = f.markdown %}
25
  <article class="doc">{{ html|safe }}</article>
26
  {% else if let Some(note) = f.note %}
27
  <p class="empty">{{ note }} <a href="{{ repo.url }}/raw/{{ target }}/{{ f.path }}">Download it</a>.</p>
28
  {% else %}
29
  <table class="code">
30
  {% for line in f.lines %}
31
    <tr id="{{ f.anchor }}-L{{ loop.index }}"><td class="n">{{ loop.index }}</td><td class="t"><pre>{{ line|safe }}</pre></td></tr>
32
  {% endfor %}
33
  </table>
34
  {% endif %}
35
</section>
36
{% endfor %}
37
{% endblock %}