Compare commits
4 Commits
b5e875e136
...
9de5b27d6e
Author | SHA1 | Date |
---|---|---|
Darks | 9de5b27d6e | |
Eragon | dac218b3b9 | |
Eragon | 134eaa4d58 | |
Darks | 1434b3152b |
|
@ -16,4 +16,5 @@ python-ldap
|
|||
python-uwsgi
|
||||
python-psycopg2
|
||||
python-pyyaml
|
||||
python-slugify
|
||||
```
|
||||
|
|
|
@ -61,3 +61,19 @@ table.topiclist th > td:last-child,
|
|||
table.topiclist tr > td:last-child {
|
||||
width: 20%; text-align: center;
|
||||
}
|
||||
|
||||
|
||||
/* Thread table */
|
||||
|
||||
table.thread {
|
||||
width: 100%;
|
||||
}
|
||||
table.thread td.member {
|
||||
width: 20%;
|
||||
}
|
||||
table.thread td {
|
||||
vertical-align: top;
|
||||
}
|
||||
table.thread td:nth-child(2) {
|
||||
padding-top: 10px;
|
||||
}
|
||||
|
|
|
@ -1,23 +1,33 @@
|
|||
{% extends "base/base.html" %}
|
||||
{% import "widgets/editor.html" as widget_editor %}
|
||||
{% import "widgets/member.html" as widget_member %}
|
||||
|
||||
{% block title %}
|
||||
<a href='/forum'>Forum de Planète Casio</a> » <h1>{{ t.forum.name }}</h1>
|
||||
<a href='/forum'>Forum de Planète Casio</a> » <a href="{{ url_for('forum_page', f=t.forum) }}">{{ t.forum.name }}</a> » <h1>{{ t.title }}</h1>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<section>
|
||||
<h1>{{ t.title }}</h1>
|
||||
<table class="thread"><tr>
|
||||
<td class="member">{{ widget_member.profile(t.author ) }}</td>
|
||||
<td>{{ t.thread.top_comment.text }}</td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
|
||||
<div>{{ t.thread.top_comment.text }}</div>
|
||||
|
||||
<table class="thread">
|
||||
{% for i, c in enumerate(t.thread.comments) %}
|
||||
<tr>
|
||||
{% if c != t.thread.top_comment %}
|
||||
<div>{{ c.text }}</div>
|
||||
<td class="member">{{ widget_member.profile(c.author ) }}</td>
|
||||
<td>{{ c.text }}
|
||||
{% elif i != 0 %}
|
||||
<div>Ce message est le top comment</div>
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
|
||||
<div class=form>
|
||||
<h3>Commenter le sujet</h3>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{% macro text_editor(field, label=True) %}
|
||||
<div class=editor>
|
||||
{{ field.label if label }}
|
||||
<div>Widgets. Lots of widgets :3</div>
|
||||
<div>Widgets. Lots of widgets :3 For lightscript</div>
|
||||
{{ field() }}
|
||||
{% for error in field.errors %}
|
||||
<span class=msgerror>{{ error }}</span>
|
||||
|
|
|
@ -19,6 +19,7 @@ For more information, see the Werkzeug documentation:
|
|||
from werkzeug.routing import BaseConverter, ValidationError
|
||||
from app.models.forum import Forum
|
||||
from app.models.topic import Topic
|
||||
from slugify import slugify
|
||||
import re
|
||||
import sys
|
||||
|
||||
|
@ -52,7 +53,7 @@ class TopicSlugConverter(BaseConverter):
|
|||
return Topic.query.get_or_404(int(m[1], 10))
|
||||
|
||||
def to_url(self, topic):
|
||||
return str(topic.id)
|
||||
return f'{topic.id}-{slugify(topic.title)}'
|
||||
|
||||
# Export only the converter classes
|
||||
__all__ = "ForumConverter TopicSlugConverter".split()
|
||||
|
|
Loading…
Reference in New Issue