Blob: base.html

Blob id: a4b99b2e0e3dfcd3fa17dfe292a553719be1f433

Size: 1.4 KB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Lipasto</title>
    <link rel="stylesheet" href="{{ url_for('static', filename='styles.css') }}">
</head>
<body>
    <nav>
        <a href="/">Home</a>
        {% set repo_name = request.view_args.get('repo_name') %}
        {% if repo_name %}
            | <a href="{{ url_for('repo_commits', repo_name=repo_name) }}?ref={{ current_ref }}">Commits</a>
            | <a href="{{ url_for('repo_refs', repo_name=repo_name) }}">Refs</a>
            | <a href="{{ url_for('repo_tree_path', repo_name=repo_name) }}?ref={{ current_ref }}">Tree</a>
            | <a href="{{ url_for('repo_diff', repo_name=repo_name) }}?ref={{ current_ref }}">Diff</a>
        {% endif %}
        {% if refs %}
            | Ref:
            <select onchange="changeRef(this.value)">
                {% for ref in refs %}
                <option value="{{ ref.shorthand }}" {% if ref.shorthand == current_ref %}selected{% endif %}>{{ ref.name }}</option>
                {% endfor %}
            </select>
        {% endif %}
    </nav>
    <hr />
    <main>
    {% block content %}{% endblock %}
    </main>
    <script>
    function changeRef(newRef) {
        const url = new URL(window.location);
        url.searchParams.set('ref', newRef);
        window.location = url;
    }
    </script>
</body>
</html>