Upload 6 files
Browse filesFiles changed (6)
- templates/base.htmlAdded+33
- templates/index.htmlAdded+17
- templates/moderate.htmlAdded+22
- templates/new_thread.htmlAdded+12
- templates/search.htmlAdded+29
- templates/thread.htmlAdded+63
123456789101112131415161718192021222324252627282930313233<!doctype html><html lang="fr"><head> <meta charset="UTF-8"> <title>{% block title %}Forum Anonyme{% endblock %}</title> <link rel="stylesheet" href="{{ url_for('static', filename='styles.css') }}"></head><body> <div class="container"> <header> <h1><a href="{{ url_for('index') }}">Forum Anonyme</a></h1> <nav> <a href="{{ url_for('new_thread') }}">Nouveau fil</a> | <a href="{{ url_for('moderate') }}">Modération</a> </nav> <form action="{{ url_for('search') }}" method="GET"> <input type="text" name="q" placeholder="Recherche..." required> <button type="submit">Chercher</button> </form> </header> {% with messages = get_flashed_messages(with_categories=true) %} {% if messages %} <ul class="flashes"> {% for category, message in messages %} <li class="flash {{ category }}">{{ message }}</li> {% endfor %} </ul> {% endif %} {% endwith %} {% block content %}{% endblock %} </div></body></html>1234567891011121314151617{% extends "base.html" %}{% block title %}Accueil - Forum Anonyme{% endblock %}{% block content %}<h2>Fils de discussion</h2>{% if threads %} <ul class="thread-list"> {% for thread in threads %} <li> <a href="{{ url_for('thread', thread_id=thread.id) }}">{{ thread.title }}</a> <small>Créé le {{ thread.timestamp.strftime('%d/%m/%Y %H:%M:%S') }}</small> </li> {% endfor %} </ul>{% else %} <p>Aucun fil de discussion pour le moment.</p>{% endif %}{% endblock %}12345678910111213141516171819202122{% extends "base.html" %}{% block title %}Modération{% endblock %}{% block content %}<h2>Modération</h2>{% if messages %} <ul class="message-list"> {% for msg in messages %} <li> <div class="message"> <p>{{ msg.content|safe }}</p> <small>Posté le {{ msg.timestamp.strftime('%d/%m/%Y %H:%M:%S') }} - Signalements: {{ msg.reports }}</small> <form action="{{ url_for('remove_message', message_id=msg.id) }}" method="POST"> <button type="submit">Retirer le message</button> </form> </div> </li> {% endfor %} </ul>{% else %} <p>Aucun message signalé.</p>{% endif %}{% endblock %}123456789101112{% extends "base.html" %}{% block title %}Nouveau Fil de Discussion{% endblock %}{% block content %}<h2>Créer un nouveau fil de discussion</h2><form method="POST" action="{{ url_for('new_thread') }}"> <label for="title">Titre :</label><br> <input type="text" name="title" id="title" required><br><br> <label for="content">Message initial :</label><br> <textarea name="content" id="content" rows="5" required></textarea><br> <button type="submit">Créer</button></form>{% endblock %}1234567891011121314151617181920212223242526272829{% extends "base.html" %}{% block title %}Résultats de recherche{% endblock %}{% block content %}<h2>Résultats de recherche pour "{{ query }}"</h2><h3>Fils de discussion</h3>{% if threads %} <ul class="thread-list"> {% for thread in threads %} <li><a href="{{ url_for('thread', thread_id=thread.id) }}">{{ thread.title }}</a></li> {% endfor %} </ul>{% else %} <p>Aucun fil de discussion trouvé.</p>{% endif %}<h3>Messages</h3>{% if messages %} <ul class="message-list"> {% for msg in messages %} <li> <a href="{{ url_for('thread', thread_id=msg.thread_id) }}#msg{{ msg.id }}"> {{ msg.content[:100]|safe }}... </a> </li> {% endfor %} </ul>{% else %} <p>Aucun message trouvé.</p>{% endif %}{% endblock %}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263{% extends "base.html" %}{% block title %}{{ thread.title }}{% endblock %}{% block content %}<h2>{{ thread.title }}</h2><p>Créé le {{ thread.timestamp.strftime('%d/%m/%Y %H:%M:%S') }}</p><hr><h3>Messages</h3>{% for msg in messages %} <div class="message {% if msg.removed %}removed{% endif %}"> {% if not msg.removed %} <p>{{ msg.content | safe }}</p> <small>Posté le {{ msg.timestamp.strftime('%d/%m/%Y %H:%M:%S') }} - Votes: {{ msg.vote_count }}</small> <div class="message-actions"> <form action="{{ url_for('vote', message_id=msg.id, action='up') }}" method="POST" style="display:inline;"> <button type="submit">Upvote</button> </form> <form action="{{ url_for('vote', message_id=msg.id, action='down') }}" method="POST" style="display:inline;"> <button type="submit">Downvote</button> </form> <form action="{{ url_for('report', message_id=msg.id) }}" method="POST" style="display:inline;"> <button type="submit">Signaler</button> </form> <button onclick="quoteMessage('{{ msg.id }}', '{{ msg.content|escapejs }}')">Citer</button> </div> {% else %} <p><em>Message supprimé par modération.</em></p> {% endif %} </div> <hr>{% else %} <p>Aucun message pour ce fil.</p>{% endfor %}<hr><h3>Répondre</h3><form method="POST" action="{{ url_for('thread', thread_id=thread.id) }}"> <textarea name="content" id="reply-content" rows="5" placeholder="Votre réponse ici..." required></textarea><br> <button type="button" onclick="previewMessage()">Prévisualiser</button> <button type="submit">Poster</button></form><div id="preview-area"></div><script>// Prévisualisation via l'API /previewfunction previewMessage() { const content = document.getElementById('reply-content').value; fetch('{{ url_for('preview') }}', { method: 'POST', headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, body: 'content=' + encodeURIComponent(content) }).then(response => response.json()) .then(data => { document.getElementById('preview-area').innerHTML = data.preview; });}// Fonction de citation : ajoute le contenu cité dans la zone de réponsefunction quoteMessage(messageId, content) { const replyArea = document.getElementById('reply-content'); replyArea.value = "> " + content + "\n\n" + replyArea.value; replyArea.focus();}</script>{% endblock %}templates/base.htmlAdded+33
templates/index.htmlAdded+17
templates/moderate.htmlAdded+22
templates/new_thread.htmlAdded+12
templates/search.htmlAdded+29
templates/thread.htmlAdded+63