mirror of https://git.sr.ht/~sircmpwn/man.sr.ht
104 lines
2.8 KiB
HTML
104 lines
2.8 KiB
HTML
{% 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="container-fluid">
|
|
<div class="row">
|
|
<div class="col-md-12 header-tabbed">
|
|
<h2>
|
|
{% if wiki %}
|
|
{{wiki.owner.canonical_name}}/{{wiki.name}}/{{title}}
|
|
{% else %}
|
|
{{title}}
|
|
{% endif %}
|
|
</h2>
|
|
<ul class="nav nav-tabs">
|
|
<li class="nav-item">
|
|
<a class="nav-link active" href="/">article</a>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
<div class="container">
|
|
<div class="toc">
|
|
{% if len(toc) != 0 %}
|
|
<h3>Table of Contents</h3>
|
|
<ul style="list-style: none; padding-left: 0;">
|
|
{% 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 %}
|
|
</ul>
|
|
{% endif %}
|
|
{# TODO
|
|
<div class="pull-right" style="margin-bottom: 1rem">
|
|
<a href="#">Edit page</a>
|
|
</div>
|
|
#}
|
|
<h4>This commit</h4>
|
|
<div class="clearfix"></div>
|
|
<div class="card" style="padding: 0.25rem; border: none; border-radius: 0; margin-bottom: 0.5rem">
|
|
<pre class="card-text">commit <a
|
|
href="{{web_url}}/commit/{{repo.commit_sha}}"
|
|
>{{ repo.commit_sha }}</a>
|
|
Author: {{ repo.commit_author }} <{{ repo.commit_email }}>
|
|
Date: {{ repo.commit_time }}
|
|
|
|
{{ repo.commit_message.rstrip("\n") }}</pre>
|
|
</div>
|
|
<dl>
|
|
<dt>Clone this wiki</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>
|
|
{% else %}
|
|
<code>{{url}}</code>
|
|
<span class="text-muted pull-right">(read/write)</span>
|
|
{% endif %}
|
|
{% endfor %}
|
|
</dd>
|
|
</dl>
|
|
{% if current_user %}
|
|
<hr />
|
|
{% 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"
|
|
>Manage your wiki</a>
|
|
{% endif %}
|
|
{% if is_root %}
|
|
<a
|
|
href="{{ url_for("create.create_GET") }}"
|
|
class="btn btn-primary btn-block"
|
|
>Create a wiki {{icon("caret-right")}}</a>
|
|
{% endif %}
|
|
{% endif %}
|
|
</div>
|
|
<div class="content">
|
|
{{ content }}
|
|
</div>
|
|
</div>
|
|
{% endblock %}
|