salvi/templates/view.jinja2

81 lines
2.4 KiB
Text
Raw Normal View History

2023-03-16 14:24:29 +01:00
{% extends "base.jinja2" %}
{% block title %}{{ p.title }} - {{ app_name }}{% endblock %}
2021-03-14 22:50:49 +01:00
{% block json_info %}<script>window.page_info={{ p.js_info()|tojson|safe }};</script>{% endblock %}
{% set html_and_toc = rev.html_and_toc(math = request.args.get('math') not in ['0', 'false', 'no', 'off']) %}
{% block content %}
<article>
<header class="article-header">
<h1 id="firstHeading">{{ p.title }}</h1>
2023-02-10 14:15:21 +01:00
{% if p.calendar %}
2023-04-06 23:02:07 +02:00
<p class="calendar-subtitle">
<span class="material-icons">calendar_today</span>
<a href="/calendar/{{ p.calendar.year }}/{{ p.calendar.month }}">
<time datetime="{{ p.calendar.isoformat() }}">{{ p.calendar.strftime('%B %-d, %Y') }}</time>
</a>
</p>
{% endif %}
<ul class="article-actions inline">
{% if current_user and current_user.is_authenticated %}
{% if p.is_editable() %}
<li><span class="material-icons">edit</span><a href="/edit/{{ p.id }}">{{ T('action-edit') }}</a></li>
{% else %}
<li><span class="material-icons">code</span><a href="/edit/{{ p.id }}">{{ T('action-view-source') }}</a></li>
{% endif %}
{% endif %}
<li><span class="material-icons">history</span><a href="/history/{{ p.id }}">{{ rev.human_pub_date() }}</a></li>
</ul>
</header>
{% block history_nav %}{% endblock %}
{% if p.is_cw %}
<div class="flash">
<strong>Content Warning</strong> -
this page may contain shocking or unexpected content, spoilers, or similar.
Proceed with caution.
</div>
{% endif %}
<div class="inner-content">
{{ html_and_toc[0]|safe }}
</div>
{% if p.tags %}
<div class="page-tags">
<p>{{ T('tags') }}:</p>
<ul>
{% for tag in p.tags %}
<li><a href="/tags/{{ tag.name }}/">#{{ tag.name }}</a> <span class="tag-count">({{ tag.popularity() }})</span></li>
{% endfor %}
</ul>
</div>
{% endif %}
</article>
{% endblock %}
{% block actions %}
<a href="/edit/{{ p.id }}/">{{ T('action-edit') }}</a> -
<a href="/history/{{ p.id }}/">{{ T('action-history') }}</a> -
<a href="/backlinks/{{ p.id }}/">Backlinks</a> -
{{ T('last-changed') }} <time datetime="{{ rev.pub_date.isoformat() }}">{{ rev.pub_date.strftime('%B %-d, %Y at %H:%M:%S') }}</time> -
{{ T('page-id') }}: {{ p.id }} -
{{ T('owner') }}: {{ p.owner.username }}
{% endblock %}
{% block toc %}
<nav class="toc">
{{ html_and_toc[1] }}
</nav>
{% endblock %}
{% block scripts %}
<script src="/static/content.js"></script>
{% endblock %}