Compare commits

...

4 Commits

Author SHA1 Message Date
Darks 9de5b27d6e
Petites modifs sur le style du forum 2019-12-03 23:34:13 +01:00
Eragon dac218b3b9
Merge branch 'dev' of gitea.planet-casio.com:devs/PCv5 into dev 2019-12-03 23:16:07 +01:00
Eragon 134eaa4d58
Ajout du style et d'un peut d'affichage pour les topics
J'ai fait mon possible pour que ça rende bien et que le css ne soit pas
trop moche. Il faudra peut-être modifier légèrement l'afichage du
profil, ce dernier est pas assez bien en place à mon goût.
2019-12-03 23:13:22 +01:00
Darks 1434b3152b
Amélioration des slugs (utilisation de python-slugify) 2019-12-03 21:03:23 +01:00
5 changed files with 34 additions and 6 deletions

View File

@ -16,4 +16,5 @@ python-ldap
python-uwsgi
python-psycopg2
python-pyyaml
python-slugify
```

View File

@ -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;
}

View File

@ -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>

View File

@ -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>

View File

@ -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()