Basics to view threads
This commit is contained in:
13
templates/base.html
Normal file
13
templates/base.html
Normal file
@@ -0,0 +1,13 @@
|
||||
<!doctype html>
|
||||
<head>
|
||||
<title>{{ title }}</title>
|
||||
</head>
|
||||
<body>
|
||||
<nav>
|
||||
<a href="{{ url_for('index') }}">Home</a>
|
||||
</nav>
|
||||
<h1>{{ title }}</h1>
|
||||
<main>
|
||||
{% block content %}{% endblock %}
|
||||
</main>
|
||||
</body>
|
||||
9
templates/index.html
Normal file
9
templates/index.html
Normal file
@@ -0,0 +1,9 @@
|
||||
{% extends 'base.html' %}
|
||||
|
||||
{% block content %}
|
||||
<ul>
|
||||
{% for id, name, description in subforums %}
|
||||
<li><a href="{{ url_for('subforum', forum_id = id) }}">{{ name }} - {{ description }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endblock %}
|
||||
10
templates/subforum.html
Normal file
10
templates/subforum.html
Normal file
@@ -0,0 +1,10 @@
|
||||
{% extends 'base.html' %}
|
||||
|
||||
{% block content %}
|
||||
<p>{{ description }}</p>
|
||||
<ul>
|
||||
{% for id, title in threads %}
|
||||
<li><a href="{{ url_for('thread', thread_id = id) }}">{{ title }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endblock %}
|
||||
19
templates/thread.html
Normal file
19
templates/thread.html
Normal file
@@ -0,0 +1,19 @@
|
||||
{% extends 'base.html' %}
|
||||
|
||||
{% macro render_comment(comment) %}
|
||||
<div style="margin-left:20px">
|
||||
<p><i>{{ comment.author }}</i></p>
|
||||
<p>{{ comment.text }}</p>
|
||||
{% for c in comment.children %}
|
||||
{{ render_comment(c) }}
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endmacro %}
|
||||
|
||||
{% block content %}
|
||||
<p>{{ author }} - rjgoire</p>
|
||||
<p>{{ text }}</p>
|
||||
{% for c in comments %}
|
||||
{{ render_comment(c) }}
|
||||
{% endfor %}
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user