gitar

file.djhtml

1
{% extends "website/base.djhtml" %}
2
{% load i18n %}
3
{% load static %}
4
5
{% block title %}{{repository_name}}/{{file_name}} | Gitar{% endblock title %}
6
7
{% block stylesheets %}
8
    {{ block.super }}
9
    <link rel="stylesheet" type="text/css" href="/static/website/syntax.css" />
10
    <link rel="stylesheet" type="text/css" href="/static/gitar/css/file.css" />
11
    <style>
12
    table.highlight tr {
13
        line-height: 15px;
14
    }
15
16
    /* These vendor prefixes are still necessary, yeah...*/
17
    .line-number {
18
      -moz-user-select: none;
19
      -webkit-user-select: none;
20
      -ms-user-select: none;
21
      user-select: none;
22
    }
23
    </style>
24
{% endblock stylesheets %}
25
26
{% block description %}
27
Content of {{ file_name }} in {{ repository_name }}
28
{% endblock description %}
29
30
{% block header %}
31
<header>
32
    <a href="https://maartenv.be"><label for="nav-drawer-toggle"></label></a>
33
    <h1>{{ repository_name }}</h1>  
34
</header>
35
{% endblock header %}
36
37
{% comment %}
38
{% block stylesheets %}
39
<link href="/static/website/materialize/css/google-icons.css" rel="stylesheet" />
40
<link href="/static/website/materialize/css/materialize.css" rel="stylesheet" media="screen, projection" />
41
<!--<link rel="stylesheet href="https://cdn.rawgit.com/tonsky/FiraCode/1.204/distr/fira_code.css">-->
42
<!-- TODO: Download Fira Code stylesheet and serve via the static folder!
43
    This is necessary BEFORE activating the Fira Code ligature font, because
44
    using a CDN I do not controll brings in tonnes of JS code from Google,
45
    Amazon, and whatnot. -->
46
<!--<style>
47
td {
48
	padding: 0 0 0 0;
49
}
50
pre {
51
	margin-top: 10px;
52
	margin-bottom: 10px;
53
}
54
table {
55
	line-height: 0px;
56
	padding-top: 0px;
57
	padding-bottom: 0px;
58
	border-spacing: 0 0;
59
	margin-top: 0px;
60
	margin-bottom: 0px;
61
}
62
</style>-->
63
{# For the syntax coloring of Gitar. TODO for later. #}
64
<link rel="stylesheet" type="text/css" href="/static/website/syntax.css" />
65
<link rel="stylesheet" type="text/css" href="/static/gitar/css/file.css" />
66
{% endblock stylesheets %}
67
{% endcomment %}
68
69
<!-- NOTE: Currently I'm using an ordered list to get numbers, but now I can't
70
link to the different lines. So until I figure out a way to make tables behave
71
correctly, this ought to be the temporary solution-->
72
{% block main %}
73
<section style="font-family: 'Fira Code', monospace;">
74
    <h3>{{file_name}}</h3>
75
	<table class="highlight">
76
		{% for line in content %}
77
		<tr>
78
            <td id="{{ forloop.counter }}" class="line-number" style=":hover { background-color: #00E676;}">
79
                <a style=":hover { background-color: #00e676;}" href="#{{ forloop.counter }}">
80
                <pre>{{ forloop.counter }}</pre></a></td>
81
			<td><pre>{{ line|safe }}</pre></td>
82
		</tr>
83
		{% endfor %}
84
	</table>
85
</section>
86
{% endblock main %}
87