Browse Source

update links to /page and /pages and add HTML templates.

The templates added allow the viewer to view the 'pages' individually or
as a list (index page of 'pages' basically).
stable
Craig Oates 2 years ago
parent
commit
f4744f14b7
  1. 1
      templates/index.html
  2. 32
      templates/page.html
  3. 35
      templates/pages.html
  4. 2
      templates/user/dashboard.html
  5. 2
      templates/user/edit-page.html

1
templates/index.html

@ -6,4 +6,5 @@
<a href="/dashboard">Dashboard</a>
<a href="/login">Log In</a>
<a href="/sign-up">Sign Up</a>
<a href="/pages">Pages</a>
{% endblock %}

32
templates/page.html

@ -0,0 +1,32 @@
{% extends "layouts/default.html" %}
{% block title %}View page.{% endblock %}
{% block content %}
<div>
{% if roles.logged-in %}
<a href="/dashboard">Dashboard</a>
<a href="/user/edit">Edit Account</a>
<form action="/logout" method="post">
<input required type="hidden" name="AUTHENTICITY-TOKEN" value="{{token}}">
<input type="submit" value="logout">
</form>
<form action="/user/delete" method="post">
<input required type="hidden" name="AUTHENTICITY-TOKEN" value="{{token}}">
<input type="submit" value="Delete Account">
</form>
<a href="/create/page">Create Page</a>
<a href="/user/pages">View Pages</a>
{% if roles.administrator %}
<a href="/site-settings">Site Settings</a>
<a href="/users">Users</a>
{% endif %}
{% else %}
<a href="/">Home</a>
<a href="/login">Log-in</a>
{% endif %}
<main>
{{data | safe}}
</main>
</div>
{% endblock %}

35
templates/pages.html

@ -0,0 +1,35 @@
{% extends "layouts/default.html" %}
{% block title %}A list of the site's pages.{% endblock %}
{% block content %}
<h1>Pages</h1>
<div>
{% if roles.logged-in %}
<a href="/dashboard">Dashboard</a>
<a href="/user/edit">Edit Account</a>
<form action="/logout" method="post">
<input required type="hidden" name="AUTHENTICITY-TOKEN" value="{{token}}">
<input type="submit" value="logout">
</form>
<form action="/user/delete" method="post">
<input required type="hidden" name="AUTHENTICITY-TOKEN" value="{{token}}">
<input type="submit" value="Delete Account">
</form>
<a href="/create/page">Create Page</a>
<a href="/pages">View Pages</a>
{% if roles.administrator %}
<a href="/site-settings">Site Settings</a>
<a href="/users">Users</a>
{% endif %}
{% else %}
<a href="/">Home</a>
<a href="/login">Log-in</a>
{% endif %}
</div>
{% for page in pages %}
<div>
<a href="/view/page/{{page}}">{{page}}</a>
</div>
{% endfor %}
{% endblock %}

2
templates/user/dashboard.html

@ -15,7 +15,7 @@
<input type="submit" value="Delete Account">
</form>
<a href="/create/page">Create Page</a>
<a href="/pages">View Pages</a>
<a href="/user/pages">View Pages</a>
{% if roles.administrator %}
<a href="/site-settings">Site Settings</a>
<a href="/users">Users</a>

2
templates/user/edit-page.html

@ -15,7 +15,7 @@
<input type="submit" value="Delete Account">
</form>
<a href="/create/page">Create Page</a>
<a href="/pages">View Pages</a>
<a href="/user/pages">View Pages</a>
{% if roles.administrator %}
<a href="/site-settings">Site Settings</a>

Loading…
Cancel
Save