Add Wiki Pages

This commit is contained in:
spikecodes 2021-01-01 22:21:43 -08:00
parent 2f2ed6169d
commit 0925a9b334
10 changed files with 161 additions and 66 deletions

View file

@ -12,7 +12,7 @@
<link rel="stylesheet" href="/style.css">
{% endblock %}
</head>
<body style="visibility: hidden;">
<body>
<nav>
<a id="logo" href="/"><span id="lib">lib</span>reddit. <span id="version">v{{ env!("CARGO_PKG_VERSION") }}</span></a>
{% block search %}{% endblock %}

View file

@ -66,15 +66,23 @@
{% if sub.name != "" %}
<aside>
<div id="subreddit">
<img id="subreddit_icon" src="{{ sub.icon }}">
<p id="subreddit_title">{{ sub.title }}</p>
<p id="subreddit_name">r/{{ sub.name }}</p>
<p id="subreddit_description">{{ sub.description }}</p>
<div id="subreddit_details">
<label>Members</label>
<label>Active</label>
<div>{{ sub.members }}</div>
<div>{{ sub.active }}</div>
{% if sub.wiki %}
<div id="top">
<div>Posts</div>
<a href="/r/{{ sub.name }}/wiki/index">Wiki</a>
</div>
{% endif %}
<div id="sub_meta">
<img id="sub_icon" src="{{ sub.icon }}">
<p id="sub_title">{{ sub.title }}</p>
<p id="sub_name">r/{{ sub.name }}</p>
<p id="sub_description">{{ sub.description }}</p>
<div id="sub_details">
<label>Members</label>
<label>Active</label>
<div>{{ sub.members }}</div>
<div>{{ sub.active }}</div>
</div>
</div>
</div>
<details id="sidebar">

25
templates/wiki.html Normal file
View file

@ -0,0 +1,25 @@
{% extends "base.html" %}
{% import "utils.html" as utils %}
{% block title %}
{% if sub != "" %}{{ sub }}
{% else %}Libreddit{% endif %}
{% endblock %}
{% block search %}
{% call utils::search(["/r/", sub.as_str()].concat(), "") %}
{% endblock %}
{% block body %}
<main>
<div id="column_one">
<div id="top">
<a href="/r/{{ sub }}">Posts</a>
<div>Wiki</div>
</div>
<div id="wiki">
{{ wiki }}
</div>
</div>
</main>
{% endblock %}