Echo Writes Code

view_page.html

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
{% extends "_base.html" %}

{% if page.is_authenticated %}
{% set auth_url = "/api/deauthenticate" %}
{% set auth_text = "Log Out" %}
{% else %}
{% set auth_url = "/authentication" %}
{% set auth_text = "Log In" %}
{% endif %}

{% block title %}{{ page.title }}{% endblock %}

{% block content %}

<h1>{{ page.title }}</h1>
{{ page.content | safe }}

{% if page.tags | length > 0 %}
<ul class="tags">
{% for tag in page.tags %}
  <li><a href="/tags/in/{{ tag }}">{{ tag }}</a></li>
{% endfor %}
</ul>
{% endif %}

<aside>
  <nav id="sticky">
    <ul>
{% if page.is_administrator %}
      <li><a href="/administration">Administration</a></li>
{% endif %}
      <li><a href="/page/new">New Page</a></li>
      <li><a href="/page/edit/{{ page.slug }}">Edit Page</a></li>
      <li><a href="{{ auth_url }}">{{ auth_text }}</a></li>
    </ul>
  </nav>
</aside>

{% endblock %}