166f6e9b Andy McCall 16 days ago
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 %}
8bf30107 Andy McCall 16 days ago ↶
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 %}
c419455a Andy McCall 16 days ago ↶
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 > {% if !signed_in & & stars > 0 %} · {{ stars }} star{% if stars != 1 %}s{% endif %}{% endif %}{% if let Some(f) = forked_from %} · forked from < a href = " {{ f }}" > {{ f }}</ a > {% endif %}</ p >
8bf30107 Andy McCall 16 days ago ↶
12
</ div >
c419455a Andy McCall 16 days ago ↶
13
{% if signed_in || can_edit || can_delete || can_fork %}< div class = " drop-actions " > {% if signed_in %}< form class = " inline " method = " post" action = " {{ repo.url }}/star" > < input type = " hidden" name = " _csrf" value = " {{ shell.csrf }}" > < button type = " submit" title = " {% if starred %}Take your star back{% else %}Star this drop{% endif %}" aria-pressed = " {% if starred %}true{% else %}false{% endif %}" > {% if starred %}★ STARRED{% else %}☆ STAR{% endif %} {{ stars }}</ button > </ form > {% endif %}{% if can_fork %}< form class = " inline " method = " post" action = " {{ repo.url }}/fork" > < input type = " hidden" name = " _csrf" value = " {{ shell.csrf }}" > < button type = " submit" title = " A copy of this drop, history and all, as a drop of yours" > FORK</ button > </ form > {% endif %}{% 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 %}
166f6e9b Andy McCall 16 days ago
14
</ div >
15
{% if secret %}< div class = " strip " > Secret: this drop is listed nowhere, but anyone with its address can read it.</ div > {% endif %}
8bf30107 Andy McCall 16 days ago ↶
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 >
166f6e9b Andy McCall 16 days ago
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 %}
ca0c443c Andy McCall 16 days ago ↶
37
< section class = " card-box drop-comments " id = " comments " >
38
< div class = " card-head " > < h2 > Comments</ h2 > < span class = " count-chip " > {{ comments.len() }}</ span > </ div >
39
{% if comments.is_empty() %}< p class = " empty small " > No comments yet.</ p > {% else %}
40
< ul class = " rows drop-comment-rows " > {% for c in comments %}
41
< li id = " comment-{{ c.id }} " >
42
< div class = " drop-comment " >
43
< div class = " small mute " > < a href = " /{{ c.author }}" > {{ c.author }}</ a > · < time title = " {{ c.created_ms|when_i }}" > {{ c.created_ms|ago_i }}</ time > </ div >
44
< div class = " doc " > {{ c.html|safe }}</ div >
45
</ div >
46
{% if c.may_delete %}< form class = " inline " method = " post" action = " {{ repo.url }}/comment/{{ c.id }}/delete" data-confirm = " Delete this comment?" > < input type = " hidden" name = " _csrf" value = " {{ shell.csrf }}" > < button class = " small danger " > Delete</ button > </ form > {% endif %}
47
</ li > {% endfor %}
48
</ ul > {% endif %}
49
{% if signed_in %}< form class = " pad drop-comment-form " method = " post" action = " {{ repo.url }}/comment" >
50
< input type = " hidden" name = " _csrf" value = " {{ shell.csrf }}" >
51
< label for = " comment-body" class = " small mute " > Comment (Markdown)</ label >
52
< textarea id = " comment-body " name = " body" rows = " 4" required maxlength = " 65536" > </ textarea >
53
< div class = " actions " > < button type = " submit" > COMMENT</ button > </ div >
54
</ form > {% else %}< p class = " small mute pad " > Sign in to comment.</ p > {% endif %}
55
</ section >
166f6e9b Andy McCall 16 days ago
56
{% endblock %}