Merge pull request #5 from flifloo/flifloo

Merge branche flifloo
This commit is contained in:
Ethanell 2021-12-03 02:39:36 +01:00 committed by GitHub
commit 92184d5633
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 127 additions and 237 deletions

View file

@ -3,4 +3,4 @@ from django.shortcuts import render
def index(request): def index(request):
context = {} context = {}
return render(request, "login.html", context) return render(request, "index.html", context)

View file

@ -3,7 +3,8 @@ from django.urls import path
from . import views from . import views
urlpatterns = [ urlpatterns = [
path("<int:people_id>/", views.index, name='index'), path("", views.index, name='index'),
path("<int:people_id>/", views.details, name='details'),
path("submit/", views.submit, name="submit"), path("submit/", views.submit, name="submit"),
path("edit/<int:people_id>/", views.edit, name="edit") path("edit/<int:people_id>/", views.edit, name="edit")
] ]

View file

@ -14,12 +14,17 @@ def get_people(people_id: int) -> People:
raise Http404("People does not exist") raise Http404("People does not exist")
def index(request, people_id: int): def index(request):
return render(request, "people/personnes.html", {
"personnes": People.objects.all()
})
def details(request, people_id: int):
return render(request, "people/people.html", { return render(request, "people/people.html", {
"people": get_people(people_id) "people": get_people(people_id)
}) })
@login_required @login_required
def submit(request): def submit(request):
if request.method == "POST": if request.method == "POST":

View file

@ -3,7 +3,8 @@ from django.urls import path
from . import views from . import views
urlpatterns = [ urlpatterns = [
path('<int:rescue_id>', views.index, name='index'), path('', views.index, name='index'),
path('<int:rescue_id>/', views.details, name='details'),
path("submit/", views.submit, name="submit"), path("submit/", views.submit, name="submit"),
path("edit/<int:rescue_id>/", views.edit, name="edit") path("edit/<int:rescue_id>/", views.edit, name="edit")
] ]

View file

@ -14,7 +14,11 @@ def get_rescue(rescue_id: int) -> Rescue:
raise Http404("Rescue does not exist") raise Http404("Rescue does not exist")
def index(request, rescue_id: int): def index(request):
return render(request, "article/articles.html", {"rescues": Rescue.objects.all()})
def details(request, rescue_id: int):
return render(request, "article/article.html", {"rescue": get_rescue(rescue_id)}) return render(request, "article/article.html", {"rescue": get_rescue(rescue_id)})

View file

@ -0,0 +1,26 @@
{% extends 'base.html' %}
{% load static %}
{% block content %}
<section>
<h1>Articles</h1>
<div class="flex-card">
{% for rescue in rescues %}
<div class="card">
<div class="inner">
<div class="img-container">
<img src="{% static 'images/sauvetage.png' %}">
</div>
<div class="content">
<p class="date">{{ rescue.date }}</p>
<p class="titre">{{ rescue.name }}</p>
<a class="btn" href="/a/{{ rescue.pk }}/">Voir l'article</a>
</div>
</div>
</div>
{% endfor %}
</div>
<a class="btn btn--blue" href="">Charger plus d'articles</a>
</section>
{% include 'quicksearch.html' %}
{% endblock %}

View file

@ -1,126 +0,0 @@
{% extends 'base.html' %}
{% load static %}
{% block content %}
<section>
<h1>Articles</h1>
<div class="flex-card">
<div class="card">
<div class="inner">
<div class="img-container">
<img src="{% static 'images/sauvetage.png' %}">
</div>
<div class="content">
<p class="date">16/02/2020</p>
<p class="titre">Sauvetage risqué en côte d'Ivoire</p>
<a class="btn" href="">Voir l'article</a>
</div>
</div>
</div>
<div class="card">
<div class="inner">
<div class="img-container">
<img src="{% static 'images/sauvetage.png' %}">
</div>
<div class="content">
<p class="date">16/02/2020</p>
<p class="titre">Sauvetage risqué en côte d'Ivoire</p>
<a class="btn" href="">Voir l'article</a>
</div>
</div>
</div>
<div class="card">
<div class="inner">
<div class="img-container">
<img src="{% static 'images/sauvetage.png' %}">
</div>
<div class="content">
<p class="date">16/02/2020</p>
<p class="titre">Sauvetage risqué en côte d'Ivoire</p>
<a class="btn" href="">Voir l'article</a>
</div>
</div>
</div>
<div class="card">
<div class="inner">
<div class="img-container">
<img src="{% static 'images/sauvetage.png' %}">
</div>
<div class="content">
<p class="date">16/02/2020</p>
<p class="titre">Sauvetage risqué en côte d'Ivoire</p>
<a class="btn" href="">Voir l'article</a>
</div>
</div>
</div>
<div class="card">
<div class="inner">
<div class="img-container">
<img src="{% static 'images/sauvetage.png' %}">
</div>
<div class="content">
<p class="date">16/02/2020</p>
<p class="titre">Sauvetage risqué en côte d'Ivoire</p>
<a class="btn" href="">Voir l'article</a>
</div>
</div>
</div>
<div class="card">
<div class="inner">
<div class="img-container">
<img src="{% static 'images/sauvetage.png' %}">
</div>
<div class="content">
<p class="date">16/02/2020</p>
<p class="titre">Sauvetage risqué en côte d'Ivoire</p>
<a class="btn" href="">Voir l'article</a>
</div>
</div>
</div>
<div class="card">
<div class="inner">
<div class="img-container">
<img src="{% static 'images/sauvetage.png' %}">
</div>
<div class="content">
<p class="date">16/02/2020</p>
<p class="titre">Sauvetage risqué en côte d'Ivoire</p>
<a class="btn" href="">Voir l'article</a>
</div>
</div>
</div>
<div class="card">
<div class="inner">
<div class="img-container">
<img src="{% static 'images/sauvetage.png' %}">
</div>
<div class="content">
<p class="date">16/02/2020</p>
<p class="titre">Sauvetage risqué en côte d'Ivoire</p>
<a class="btn" href="">Voir l'article</a>
</div>
</div>
</div>
<div class="card">
<div class="inner">
<div class="img-container">
<img src="{% static 'images/sauvetage.png' %}">
</div>
<div class="content">
<p class="date">16/02/2020</p>
<p class="titre">Sauvetage risqué en côte d'Ivoire</p>
<a class="btn" href="">Voir l'article</a>
</div>
</div>
</div>
<a class="btn btn--blue" href="">Charger plus d'articles</a>
</div>
</section>
{% include 'quicksearch.html' %}
{% endblock %}

View file

View file

@ -1,23 +1,86 @@
{% if not people.validated %} {% extends 'base.html' %}
{% load static %}
{% block content %}
{% if not people.validated %}
{% if people.pending_edit_of %} {% if people.pending_edit_of %}
<h1>This edit is not validated !</h1> <h1>This edit is not validated !</h1>
{% else %} {% else %}
<h1>This new entry is not validated !</h1> <h1>This new entry is not validated !</h1>
{% endif %} {% endif %}
{% endif %} {% endif %}
{{ people.first_name }} {{ people.last_name }} <br /> <section>
{{ people.title }} <br /> <h1>Personnes</h1>
<br /> <div class="personnal-info">
{{ people.description.html | safe }} <br /> <img src="{% static "images/pesquet.jpg" %}">
<br /> <div class="infos">
{{ people.birth }} <br /> <p>{{ people }}</p>
{{ people.death }} <br /> {% if title %}
<br /> <p>{{ people.title }}</p>
{{ people.history.html | safe }} <br /> {% endif %}
{{ people.genealogy.html | safe }} <br /> <p>Né le {{ people.birth }}</p>
{{ people.awards.html | safe }} <br /> {% if people.death %}
{{ people.pro_life.html | safe }} <br /> <p>Décédé le {{ people.death }}</p>
<br /> {% endif %}
{{ people.testimonials.html | safe }} <br /> </div>
{{ people.sources.html | safe }} </div>
<p class="biographie">{{ people.description.html | safe }}</p>
<div class="timeline-container">
<div class="timeline">
<div class="stroke"></div>
<div class="point">
<a class="active" href="#">a</a>
<span>20/20/2020</span>
</div>
<div class="point">
<a href="#">a</a>
<span>20/20/2020</span>
</div>
<div class="point">
<a href="#">a</a>
<span>20/20/2020</span>
</div>
<div class="point">
<a href="#">a</a>
<span>20/20/2020</span>
</div>
<div class="point">
<a href="#">a</a>
<span>20/20/2020</span>
</div>
<div class="point">
<a href="#">a</a>
<span>20/20/2020</span>
</div>
<div class="point">
<a href="#">a</a>
<span>20/20/2020</span>
</div>
<div class="point">
<a href="#">a</a>
<span>20/20/2020</span>
</div>
<div class="point">
<a href="#">a</a>
<span>20/20/2020</span>
</div>
</div>
<div class="point-content">
<p class="titre">Sauvetage en côte d'Ivoire</p>
<p class="date">Le 20/20/2020</p>
<p class="desc">Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Curabitur ultrices, massa at tincidunt auctor, dolor</p>
</div>
</div>
{{ people.history.html | safe }} <br />
{{ people.genealogy.html | safe }} <br />
{{ people.awards.html | safe }} <br />
{{ people.pro_life.html | safe }} <br />
<br />
{{ people.testimonials.html | safe }} <br />
{{ people.sources.html | safe }}
</section>
{% include 'quicksearch.html' %}
{% endblock %}

View file

@ -1,84 +0,0 @@
{% extends 'base.html' %}
{% load static %}
{% block content %}
<section>
<h1>Personnes</h1>
<div class="personnal-info">
<img id="pp" src="{% static "images/pesquet.jpg" %}">
<div class="infos">
<p>Thomas Pesquet</p>
<p>43 ans</p>
</div>
</div>
<p class="biographie">Insérer une biographie, Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Curabitur ultrices, massa at tincidunt auctor, dolor lorem accumsan augue, a blandit
urna diam in leo. Vestibulum in commodo lectus. Fusce congue lacinia pharetra.
Suspendisse imperdiet vehicula odio, eu varius ante accumsan ullamcorper.
Donec sodales urna felis, eu iaculis lectus facilisis vel. Sed facilisis, neque eget
varius interdum, velit est pellentesque tellus, id auctor urna ex id sapien.</p>
<div class="timeline-container">
<div class="timeline">
<div class="stroke"></div>
<div class="point">
<a class="active" href="#">a</a>
<span>20/20/2020</span>
</div>
<div class="point">
<a href="#">a</a>
<span>20/20/2020</span>
</div>
<div class="point">
<a href="#">a</a>
<span>20/20/2020</span>
</div>
<div class="point">
<a href="#">a</a>
<span>20/20/2020</span>
</div>
<div class="point">
<a href="#">a</a>
<span>20/20/2020</span>
</div>
<div class="point">
<a href="#">a</a>
<span>20/20/2020</span>
</div>
<div class="point">
<a href="#">a</a>
<span>20/20/2020</span>
</div>
<div class="point">
<a href="#">a</a>
<span>20/20/2020</span>
</div>
<div class="point">
<a href="#">a</a>
<span>20/20/2020</span>
</div>
</div>
<div class="point-content">
<p class="titre">Sauvetage en côte d'Ivoire</p>
<p class="date">Le 20/20/2020</p>
<p class="desc">Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Curabitur ultrices, massa at tincidunt auctor, dolor</p>
</div>
</div>
</section>
<script>
let count = 0;
let pp = document.querySelector('#pp');
pp.addEventListener('click', function(){
count++;
rickroll(count);
});
function rickroll(count){
if(count > 10){
window.open("https://www.youtube.com/watch?v=dQw4w9WgXcQ")
}
}
</script>
{% include 'quicksearch.html' %}
{% endblock %}