- {# TODO: add trophies icons #}
- {{ input(checked=id in trophies_owned) }}
- {{ input.label }}
+
diff --git a/app/templates/admin/index.html b/app/templates/admin/index.html
index 26694eb..6cc7a28 100644
--- a/app/templates/admin/index.html
+++ b/app/templates/admin/index.html
@@ -12,8 +12,10 @@
{% endblock %}
diff --git a/app/templates/admin/login_as.html b/app/templates/admin/login_as.html
new file mode 100644
index 0000000..0576763
--- /dev/null
+++ b/app/templates/admin/login_as.html
@@ -0,0 +1,21 @@
+{% extends "base/base.html" %}
+
+{% block title %}
+
+{% endblock %}
diff --git a/app/templates/base/base.html b/app/templates/base/base.html
index 92d8b1b..3ff2a65 100644
--- a/app/templates/base/base.html
+++ b/app/templates/base/base.html
@@ -3,6 +3,7 @@
{% include "base/head.html" %}
+
@@ -10,8 +11,10 @@
{% block title %}
Planète Casio
{% endblock %}
{% include "base/header.html" %}
+
{% include "base/flash.html" %}
+
{% block content %}
{% endblock %}
diff --git a/app/templates/base/footer.html b/app/templates/base/footer.html
index 15079a1..2df21e7 100644
--- a/app/templates/base/footer.html
+++ b/app/templates/base/footer.html
@@ -1,8 +1,8 @@
diff --git a/app/templates/base/navbar/forum.html b/app/templates/base/navbar/forum.html
index 785dffb..29688c6 100644
--- a/app/templates/base/navbar/forum.html
+++ b/app/templates/base/navbar/forum.html
@@ -10,7 +10,10 @@
{% for f in main_forum.sub_forums %}
-
{{ f.name }}
+ {% if f.is_default_accessible() or
+ (current_user.is_authenticated and current_user.can_access_forum(f)) %}
+
{{ f.name }}
+ {% endif %}
{% endfor %}
diff --git a/app/templates/forum/edit_comment.html b/app/templates/forum/edit_comment.html
index de4d7af..d57ec1b 100644
--- a/app/templates/forum/edit_comment.html
+++ b/app/templates/forum/edit_comment.html
@@ -11,10 +11,10 @@
Édition de commentaire
Commentaire actuel
-
+
@@ -24,15 +24,35 @@
{{ form.hidden_tag() }}
{% if form.pseudo %}
- {{ form.pseudo.label }}
- {{ form.pseudo }}
- {% for error in form.pseudo.errors %}
- {{ error }}
- {% endfor %}
+
+ {{ form.pseudo.label }}
+ {{ form.pseudo }}
+ {% for error in form.pseudo.errors %}
+ {{ error }}
+ {% endfor %}
+
{% endif %}
{{ widget_editor.text_editor(form.message, label=False, autofocus=True) }}
+ {% if form.attachment_list %}
+ Supprimer des pièces jointes
+ {% for id, a in form.attachment_list.items() %}
+ {{ form[id]() }} {{ a.name }}
({{ a.size }} octets)
+ {% endfor %}
+
+ {% endif %}
+
+
+ {{ form.attachments.label }}
+
+ {{ form.attachments }}
+ {% for error in form.attachments.errors %}
+ {{ error }}
+ {% endfor %}
+
+
+
{{ form.submit(class_='bg-ok') }}
diff --git a/app/templates/forum/edit_topic.html b/app/templates/forum/edit_topic.html
index 91701cd..6c1b1d0 100644
--- a/app/templates/forum/edit_topic.html
+++ b/app/templates/forum/edit_topic.html
@@ -1,19 +1,82 @@
{% extends "base/base.html" %}
+{% import "widgets/attachments.html" as widget_attachments %}
+{% import "widgets/thread.html" as widget_thread with context %}
{% import "widgets/editor.html" as widget_editor %}
-{% import "widgets/member.html" as widget_member %}
+{% import "widgets/user.html" as widget_user %}
{% block title %}
-Forum de Planète Casio » {{ t.forum.name }} » {{ t.title }}
+Forum de Planète Casio » {{ t.forum.name }} » Édition de sujet
{% endblock %}
{% block content %}
- Édition du topic {{ t.title }}
+ Édition du sujet: {{ t.title }}
-
@@ -48,10 +48,8 @@
{% endif %}
- {% if (current_user.is_authenticated and current_user.priv('write-anywhere'))
- or ("/actus" in f.url and current_user.is_authenticated and current_user.priv('write-news'))
- or ("/actus" not in f.url and not f.sub_forums)
- and (current_user.is_authenticated or V5Config.ENABLE_GUEST_POST) %}
+ {% if (V5Config.ENABLE_GUEST_POST and f.is_default_postable())
+ or (current_user.is_authenticated and current_user.can_post_in_forum(f)) %}
Créer un nouveau sujet
+ {{ form.ab }}
{% endif %}
@@ -76,10 +75,15 @@
{{ widget_editor.text_editor(form.message) }}
- {{ form.attachments }}
- {% for error in form.attachments.errors %}
-
{{ error }}
- {% endfor %}
+
+ {{ form.attachments.label }}
+
+ {{ form.attachments }}
+ {% for error in form.attachments.errors %}
+ {{ error }}
+ {% endfor %}
+
+
{{ form.submit(class_='bg-ok') }}
diff --git a/app/templates/forum/index.html b/app/templates/forum/index.html
index 769a660..55f7130 100644
--- a/app/templates/forum/index.html
+++ b/app/templates/forum/index.html
@@ -9,9 +9,9 @@
Bienvenue sur le forum de Planète Casio ! Vous pouvez créer des
nouveaux sujets ou poster des réponses avec un compte
- {% if not current_user.is_authenticated %}
+ {%- if not current_user.is_authenticated %}
ou en postant en tant qu'invité
- {% endif %}
+ {%- endif -%}
.
@@ -20,22 +20,28 @@
{% else %}
{% for l1 in main_forum.sub_forums %}
-
- {{ l1.name }} | Nombre de sujets |
+ {% if l1.is_default_accessible() or
+ (current_user.is_authenticated and current_user.can_access_forum(l1)) %}
+
+ {{ l1.name }} | Nombre de sujets |
- {% if l1.sub_forums == [] %}
- {{ l1.name }} |
- {{ l1.topics.count() }} |
- {{ l1.descr }} | |
- {% endif %}
+ {% if l1.sub_forums == [] %}
+ {{ l1.name }} |
+ {{ l1.topics.count() }} |
+ {{ l1.descr }} | |
+ {% endif %}
- {% for l2 in l1.sub_forums %}
- {{ l2.name }} |
- {{ l2.topics.count() }} |
- {{ l2.descr }} | |
- {% endfor %}
+ {% for l2 in l1.sub_forums %}
+ {% if l2.is_default_accessible() or
+ (current_user.is_authenticated and current_user.can_access_forum(l2)) %}
+ {{ l2.name }} |
+ {{ l2.topics.count() }} |
+ {{ l2.descr }} | |
+ {% endif %}
+ {% endfor %}
-
+
+ {% endif %}
{% endfor %}
{% endif %}
diff --git a/app/templates/forum/topic.html b/app/templates/forum/topic.html
index a71391c..f4bcbd7 100644
--- a/app/templates/forum/topic.html
+++ b/app/templates/forum/topic.html
@@ -1,8 +1,9 @@
{% extends "base/base.html" %}
{% import "widgets/editor.html" as widget_editor %}
-{% import "widgets/thread.html" as widget_thread %}
+{% import "widgets/thread.html" as widget_thread with context %}
{% import "widgets/user.html" as widget_user %}
{% import "widgets/pagination.html" as widget_pagination with context %}
+{% import "widgets/attachments.html" as widget_attachments %}
{% block title %}
Forum de Planète Casio »
{{ t.forum.name }} »
{{ t.title }}
@@ -11,7 +12,17 @@
{% block content %}
{{ t.title }}
- {{ widget_thread.thread([t.thread.top_comment], None) }}
+
+ {% if t.thread.top_comment %}
+ {% call widget_thread.thread_leader(t.thread.top_comment) %}
+
+
Posté le {{ t.date_created | dyndate }}
+ {{ widget_thread.post_actions(t) }}
+
+ {{ t.thread.top_comment.text | md }}
+ {{ widget_attachments.attachments(t.thread.top_comment) }}
+ {% endcall %}
+ {% endif %}
{{ widget_pagination.paginate(comments, 'forum_topic', t, {'f': t.forum}) }}
@@ -25,30 +36,39 @@
{% endif %}
- {% if current_user.is_authenticated or V5Config.ENABLE_GUEST_POST %}
+ {% if V5Config.ENABLE_GUEST_POST
+ or (current_user.is_authenticated and current_user.can_post_in_forum(t.forum)) %}
+ {% endif %}
{% endblock %}
diff --git a/app/templates/post/move_post.html b/app/templates/post/move_post.html
new file mode 100644
index 0000000..9b4a212
--- /dev/null
+++ b/app/templates/post/move_post.html
@@ -0,0 +1,52 @@
+{% extends "base/base.html" %}
+{% import "widgets/editor.html" as widget_editor %}
+{% import "widgets/user.html" as widget_user %}
+
+{% block title %}
+
Forum de Planète Casio » Édition de commentaire
+{% endblock %}
+
+{% block content %}
+
+ Déplacer un commentaire
+
+
+
+
+
+{% endblock %}
diff --git a/app/templates/programs/program.html b/app/templates/programs/program.html
new file mode 100644
index 0000000..a6ca9fe
--- /dev/null
+++ b/app/templates/programs/program.html
@@ -0,0 +1,81 @@
+{% extends "base/base.html" %}
+{% import "widgets/editor.html" as widget_editor %}
+{% import "widgets/thread.html" as widget_thread with context %}
+{% import "widgets/user.html" as widget_user %}
+{% import "widgets/pagination.html" as widget_pagination with context %}
+{% import "widgets/attachments.html" as widget_attachments %}
+
+
+{% block title %}
+
Programme {{ program.name }}
+{% endblock %}
+
+{% block content %}
+
+
+
+ {{ widget_user.profile(program.author) }}
+
+
+
+ {{ program.title }}
+
+
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam vitae
+ feugiat ante. Pellentesque luctus lorem tincidunt vestibulum condimentum.
+ Nullam sed tempus sem. Phasellus quis diam vitae sapien luctus consequat
+ ac eget lacus. Sed rutrum condimentum sagittis. Nullam erat nibh, euismod
+ ac metus at, consequat tincidunt ipsum. Fusce sagittis iaculis orci sedporta.
+ Etiam bibendum purus et ipsum pellentesque, quis sodales libero congue. Nunc
+ lectus quam, cursus non dictum nec, volutpat eget felis. Praesent sollicitudin
+ massa erat, nec venenatis lorem lacinia et. Etiam ullamcorper neque quis
+ nisi sodales vulputate. Integer scelerisque luctus arcu, ut elementum justo
+ auctor a. Praesent sit amet libero risus.
+
+
+
+
+
+
+
+
+
+
+
+
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam vitae
+ feugiat ante. Pellentesque luctus lorem tincidunt vestibulum condimentum.
+ Nullam sed tempus sem. Phasellus quis diam vitae sapien luctus consequat
+ ac eget lacus. Sed rutrum condimentum sagittis. Nullam erat nibh, euismod
+ ac metus at, consequat tincidunt ipsum. Fusce sagittis iaculis orci sedporta.
+ Etiam bibendum purus et ipsum pellentesque, quis sodales libero congue. Nunc
+ lectus quam, cursus non dictum nec, volutpat eget felis. Praesent sollicitudin
+ massa erat, nec venenatis lorem lacinia et. Etiam ullamcorper neque quis
+ nisi sodales vulputate. Integer scelerisque luctus arcu, ut elementum justo
+ auctor a. Praesent sit amet libero risus.
+
+
+
+
+
+
+
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam vitae
+ feugiat ante. Pellentesque luctus lorem tincidunt vestibulum condimentum.
+ Nullam sed tempus sem. Phasellus quis diam vitae sapien luctus consequat
+ ac eget lacus. Sed rutrum condimentum sagittis. Nullam erat nibh, euismod
+ ac metus at, consequat tincidunt ipsum. Fusce sagittis iaculis orci sedporta.
+ Etiam bibendum purus et ipsum pellentesque, quis sodales libero congue. Nunc
+ lectus quam, cursus non dictum nec, volutpat eget felis. Praesent sollicitudin
+ massa erat, nec venenatis lorem lacinia et. Etiam ullamcorper neque quis
+ nisi sodales vulputate. Integer scelerisque luctus arcu, ut elementum justo
+ auctor a. Praesent sit amet libero risus.
+
+
+{% endblock %}
diff --git a/app/templates/widgets/attachments.html b/app/templates/widgets/attachments.html
index 7c11844..529698d 100644
--- a/app/templates/widgets/attachments.html
+++ b/app/templates/widgets/attachments.html
@@ -8,7 +8,7 @@
{% for a in comment.attachments %}
{{ a.name }} |
- {{ a.size }} |
+ {{ a.size | humanize(unit='o') }} |
{% endfor %}
diff --git a/app/templates/widgets/download_button.html b/app/templates/widgets/download_button.html
new file mode 100644
index 0000000..4f004dc
--- /dev/null
+++ b/app/templates/widgets/download_button.html
@@ -0,0 +1,8 @@
+{% macro download_button(file) %}
+
+ {{ file.name }}
+ {{ file.size | humanize(unit='o') }}
+
+{% endmacro %}
+
+{{ download_button(file) if file }}
diff --git a/app/templates/widgets/thread.html b/app/templates/widgets/thread.html
index d929333..c315060 100644
--- a/app/templates/widgets/thread.html
+++ b/app/templates/widgets/thread.html
@@ -1,25 +1,73 @@
{% import "widgets/user.html" as widget_user %}
{% import "widgets/attachments.html" as widget_attachments %}
-{% macro thread(comments, top_comment) %}
-