~sircmpwn/man.sr.ht

ref: 0edfb1b70e1c2988fd1545151dfd2f2c36289aef man.sr.ht/mansrht/templates/content.html -rw-r--r-- 3.6 KiB
0edfb1b7Thorben Günther Display "wiki settings" on "new-wiki" site. 7 months ago
                                                                                
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
{% extends "man.html" %}
{% block title %}
{% if title %}
<title>{{ title }} - man.sr.ht</title>
{% else %}
<title>man.sr.ht</title>
{% endif %}
{% endblock %}
{% block content %}
{% if not is_root or len(path) != 0 %}
<div class="header-tabbed">
  <div class="container">
    <ul class="nav nav-tabs">
      <h2>
        {% if wiki and not is_root %}
          {{wiki.owner.canonical_name}}/<wbr>{{wiki.name}}/<wbr>{{title}}
        {% else %}
          {{title}}
        {% endif %}
      </h2>
      <li class="nav-item">
        <a class="nav-link active" href="/">article</a>
      </li>
      <li class="nav-item">
        <a
          class="nav-link"
          href="{{web_url}}/tree/{{repo.ref}}/{{'/'.join(path)}}"
        >source</a>
      </li>
      <li class="nav-item">
        <a
          class="nav-link"
          href="{{web_url}}/log"
        >history</a>
      </li>
    </ul>
  </div>
</div>
{% endif %}
<div class="container">
  <div class="content">
    {{ firstpara }}
  </div>
</div>
{% if frontmatter.get("toc", True) and len(toc) != 0 %}
<div class="container">
  <div class="event-list row">
    <div class="event toc col-md-12">
      <h3>Table of Contents</h3>
      <ol>
        {% macro toc_entry(entry, depth) %}
        <li>
          <a href="#{{ entry.id }}">{{ entry.name }}</a>
          {% if len(entry.children) > 0 %}
          <ul style="list-style: none; padding-left: {{ depth + 1 }}rem">
            {% for child in entry.children %}
              {{ toc_entry(child, depth + 1) }}
            {% endfor %}
          </ul>
          {% endif %}
        </li>
        {% endmacro %}
        {% for entry in toc %}
          {{ toc_entry(entry, 0) }}
        {% endfor %}
      </ol>
      {# TODO
      <div class="pull-right" style="margin-bottom: 1rem">
        <a href="#">Edit page</a>
      </div>
      #}
    </div>
  </div>
</div>
{% endif %}
<div class="container" style="flex-grow: 1">
  <div class="content">
    {{ content }}
  </div>
</div>
<div class="container">
  <h3>About this wiki</h3>
  <div class="row">
    <div class="col-md-8">
      <pre>commit <a
href="{{web_url}}/commit/{{repo.commit_sha}}"
>{{ repo.commit_sha }}</a>
Author: {{ repo.commit_author }} &lt;{{ repo.commit_email }}&gt;
Date:   {{ repo.commit_time }}

{{ repo.commit_message.rstrip("\n") }}</pre>
      <dl>
        <dt><strong>Clone this wiki</strong></dt>
        <dd>
        {% for url in clone_urls|map(attribute="url") %}
          {% if "://" in url %}
          <a href={{ url }}>{{ url }}</a>
          <span class="text-muted pull-right">(read-only)</span><br />
          {% else %}
          {{url}}
          <span class="text-muted pull-right">(read/write)</span><br />
          {% endif %}
        {% endfor %}
        </dd>
      </dl>
    </div>
    <div class="col-md-4">
      {% if current_user %}
        {% if is_root %}
        <a
          href="{{ url_for("create.create_GET") }}"
          class="btn btn-primary btn-block"
        >Create a wiki {{icon("caret-right")}}</a>
        {% endif %}
        {% if wiki and wiki.owner.username == current_user.username %}
        <a
          href="{{ url_for("manage.info",
            owner_name=wiki.owner.canonical_name, wiki_name=wiki.name) }}"
          class="btn btn-default btn-block"
        >Settings for this wiki {{icon('caret-right')}}</a>
        {% endif %}
        <a
          href="{{ url_for("public.user_index",
            username=current_user.username) }}"
          class="btn btn-default btn-block"
        >Browse your wikis {{icon('caret-right')}}</a>
      {% endif %}
    </div>
  </div>
</div>
{% endblock %}