Rewrite + Searching

This commit is contained in:
spikecodes 2020-12-31 15:54:13 -08:00
parent c7282520cd
commit a6dc7ee043
17 changed files with 342 additions and 262 deletions

View file

@ -1,5 +1,13 @@
{% extends "base.html" %}
{% import "utils.html" as utils %}
{% block title %}{{ post.title }} - r/{{ post.community }}{% endblock %}
{% block search %}
{% call utils::search(["/r/", post.community.as_str()].concat(), "") %}
{% endblock %}
{% block root %}/r/{{ post.community }}{% endblock %}{% block location %}r/{{ post.community }}{% endblock %}
{% block head %}
{% call super() %}
<meta name="author" content="u/{{ post.author }}">
@ -56,13 +64,9 @@
<div class="post_body">{{ post.body }}</div>
</div>
</div>
<form>
<select id="sort" name="sort">
<option value="confidence" {% if sort == "confidence" %}selected{% endif %}>Best</option>
<option value="top" {% if sort == "top" %}selected{% endif %}>Top</option>
<option value="new" {% if sort == "new" %}selected{% endif %}>New</option>
<option value="controversial" {% if sort == "controversial" %}selected{% endif %}>Controversial</option>
<option value="old" {% if sort == "old" %}selected{% endif %}>Old</option>
<form id="sort">
<select name="sort">
{% call utils::options(sort, ["confidence", "top", "new", "controversial", "old"], "") %}
</select><input id="sort_submit" type="submit" value="&rarr;">
</form>