start the new topics route and view
This commit is contained in:
21
app/templates/base.html
Normal file
21
app/templates/base.html
Normal file
@@ -0,0 +1,21 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="icon" type="image/png" href="/static/favicon.png">
|
||||
<link rel="stylesheet" href="{{ "/static/css/style.css" | cachebust }}">
|
||||
{% if self.title() -%}
|
||||
<title>{{ config.SITE_NAME }} - {% block title -%}{%- endblock -%}</title>
|
||||
{%- else -%}
|
||||
<title>{{ config.SITE_NAME }}</title>
|
||||
{%- endif -%}
|
||||
</head>
|
||||
<body>
|
||||
<div id="wrapper">
|
||||
{%- include 'common/topnav.html' -%}
|
||||
{%- block content -%}{%- endblock -%}
|
||||
{%- include 'common/footer.html' -%}
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
9
app/templates/common/footer.html
Normal file
9
app/templates/common/footer.html
Normal file
@@ -0,0 +1,9 @@
|
||||
<footer class="plank secondary-bg bottom">
|
||||
<span>Pyrom commit <a href="{{ "https://git.poto.cafe/yagich/pyrom/commit/" + __commit }}">{{ __commit[:8] }}</a></span>
|
||||
<ul class="horizontal">
|
||||
{#-
|
||||
<li><a href="#">Contact</a></li>
|
||||
<li><a href="#">Guides</a></li>
|
||||
-#}
|
||||
</ul>
|
||||
</footer>
|
||||
3
app/templates/common/macros.html
Normal file
3
app/templates/common/macros.html
Normal file
@@ -0,0 +1,3 @@
|
||||
{% macro timestamp(unix_ts) -%}
|
||||
<span class="timestamp" data-utc="{{ unix_ts }}">{{ unix_ts | ts_datetime('%Y-%m-%d %H:%M')}} <abbr title="Server Time">ST</abbr></span>
|
||||
{%- endmacro %}
|
||||
15
app/templates/common/topnav.html
Normal file
15
app/templates/common/topnav.html
Normal file
@@ -0,0 +1,15 @@
|
||||
<nav id="header" class="plank top">
|
||||
<a class="site-title" href=#>Porom</a>
|
||||
<span>anti-social media</span>
|
||||
{%- if is_logged_in() -%}
|
||||
no
|
||||
{%- else -%}
|
||||
<form class="horizontal wrap">
|
||||
<input type="hidden" name="return_to" value="{{request.path}}">
|
||||
<input type="text" placeholder="Username">
|
||||
<input type="password" placeholder="Password">
|
||||
<input type="submit" value="Log in">
|
||||
<a href="#" class="linkbutton">Register</a>
|
||||
</form>
|
||||
{%- endif -%}
|
||||
</nav>
|
||||
23
app/templates/topics/topics.html
Normal file
23
app/templates/topics/topics.html
Normal file
@@ -0,0 +1,23 @@
|
||||
{% from 'common/macros.html' import timestamp %}
|
||||
{%- extends 'base.html' -%}
|
||||
{%- block content -%}
|
||||
{%- for topic in topics -%}
|
||||
<div class="topic-info plank">
|
||||
<div class="title-container">
|
||||
<a class="info" href="{{url_for('topics.topic', slug=topic.slug)}}">{{topic.name}}</a>
|
||||
</div>
|
||||
<div>{{topic.description}}</div>
|
||||
<ul class="horizontal">
|
||||
<li>{{topic.threads_count}} {{"thread" | pluralize(topic.threads_count)}}</li>
|
||||
<li>{{topic.posts_count}} {{"post" | pluralize(topic.posts_count)}}</li>
|
||||
</ul>
|
||||
<div>
|
||||
{%- if topic.latest_post_timestamp -%}
|
||||
Latest post at: {{timestamp(topic.latest_post_timestamp)}}
|
||||
{%- else -%}
|
||||
No posts yet
|
||||
{%- endif -%}
|
||||
</div>
|
||||
</div>
|
||||
{%- endfor -%}
|
||||
{%- endblock -%}
|
||||
Reference in New Issue
Block a user