First Commit

This commit is contained in:
mrtoine 2025-09-12 11:11:44 +02:00
commit ce0758fbbb
496 changed files with 52062 additions and 0 deletions

View file

@ -0,0 +1,17 @@
{% extends 'layout.html' %}
{% block content %}
<div class="container">
<h2>Créer un Post</h2>
<form action="" method="post" enctype="multipart/form-data">
{% csrf_token %}
{{ post_form.as_p }}
{% if type == 'news' %}
<label for="image">Image</label>
<input type="file" name="image" id="image">
{% endif %}
<br>
<button type="submit" class="btn btn-primary">Créer</button>
</form>
</div>
{% endblock %}

View file

@ -0,0 +1,17 @@
{% extends "layout.html" %}
{% block content %}
<div class="container">
<h2>Modifier le post : {{ post.title }}</h2>
<form method="post">
{% csrf_token %}
{{ form.as_p }}
<div class="form-inline">
<button type="submit" class="btn btn-primary">Enregistrer</button>
<a href="{% url 'contributions' %}" class="btn btn-danger">Annuler</a>
</div>
</form>
</div>
{% endblock %}

11
templates/posts/news.html Executable file
View file

@ -0,0 +1,11 @@
{% extends 'layout.html' %}
{% block content %}
<div class="container">
<h2>{{ news.title }}</h2>
<hr> <div style="float:left;margin:5px"><img src="/media/{{ news.image }}" style="max-width: 200px;" alt="{{ news.title }}"></div>
<p>{{ news.content|linebreaksbr }}</p>
<p style="text-align: center;"><a href="/{{ news.forum_link }}" class="btn btn-default">Participer au sujet sur le forum</a></p>
</div>
{% endblock %}

37
templates/posts/post.html Executable file
View file

@ -0,0 +1,37 @@
{% extends 'layout.html' %}
{% load bbcode_tags %}
{% block content %}
<div class="container">
<h2>{{ post.title }}</h2>
{% if post.parent %}
{% if subposts %}
<div class="postmenu">
<div class="header">Menu</div>
<div class="body">
<ul>
{% for subpost in subposts %}
<li><a href="{% url 'view_post' subpost.slug %}">{{ subpost.title }}</a></li>
{% endfor %}
</ul>
</div>
</div>
{% endif %}
{% else %}
{% if post.post_parent %}
<ul class="breadcrumbs">
<li><a href="{% url 'view_post' post.post_parent.slug %}">{{ post.post_parent.title }}</a> »</li>
<li>{{ post.title }}</li>
</ul>
{% endif %}
{% endif %}
{% if post.type == 'news' %}
<div style="float:left;margin:5px"><img src="/media/{{ post.image }}" style="max-width: 200px;" alt="{{ post.title }}"></div>
{% endif %}
<p>{{ post.content|bbcode|safe|linebreaksbr }}</p>
{% if post.type == 'news' %}
<p style="text-align: center;"><a href="/{{ post.forum_link }}" class="btn btn-default">Participer au sujet sur le forum</a></p>
{% endif %}
<small>Article créer le {{ post.created }} par <a href="{% url 'profile' post.author.id %}" class="{{ request.user.username_decoration }}">{{ post.author.username }}</a></small>
</div>
{% endblock %}