Integration of kybo branch
This commit is contained in:
parent
833dac43c0
commit
93ad1230ae
10 changed files with 127 additions and 223 deletions
|
@ -3,4 +3,4 @@ from django.shortcuts import render
|
|||
|
||||
def index(request):
|
||||
context = {}
|
||||
return render(request, "personnes.html", context)
|
||||
return render(request, "index.html", context)
|
||||
|
|
|
@ -3,7 +3,8 @@ from django.urls import path
|
|||
from . import views
|
||||
|
||||
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("edit/<int:people_id>/", views.edit, name="edit")
|
||||
]
|
||||
|
|
|
@ -14,12 +14,17 @@ def get_people(people_id: int) -> People:
|
|||
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", {
|
||||
"people": get_people(people_id)
|
||||
})
|
||||
|
||||
|
||||
@login_required
|
||||
def submit(request):
|
||||
if request.method == "POST":
|
||||
|
|
|
@ -3,7 +3,8 @@ from django.urls import path
|
|||
from . import views
|
||||
|
||||
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("edit/<int:rescue_id>/", views.edit, name="edit")
|
||||
]
|
||||
|
|
|
@ -14,7 +14,11 @@ def get_rescue(rescue_id: int) -> Rescue:
|
|||
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)})
|
||||
|
||||
|
||||
|
|
26
templates/article/articles.html
Normal file
26
templates/article/articles.html
Normal 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 %}
|
|
@ -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 %}
|
|
@ -1,3 +1,6 @@
|
|||
{% extends 'base.html' %}
|
||||
{% load static %}
|
||||
{% block content %}
|
||||
{% if not people.validated %}
|
||||
{% if people.pending_edit_of %}
|
||||
<h1>This edit is not validated !</h1>
|
||||
|
@ -6,14 +9,71 @@
|
|||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
{{ people.first_name }} {{ people.last_name }} <br />
|
||||
{{ people.title }} <br />
|
||||
<br />
|
||||
{{ people.description.html | safe }} <br />
|
||||
<br />
|
||||
{{ people.birth }} <br />
|
||||
{{ people.death }} <br />
|
||||
<br />
|
||||
<section>
|
||||
<h1>Personnes</h1>
|
||||
<div class="personnal-info">
|
||||
<img src="{% static "images/pesquet.jpg" %}">
|
||||
<div class="infos">
|
||||
<p>{{ people }}</p>
|
||||
{% if title %}
|
||||
<p>{{ people.title }}</p>
|
||||
{% endif %}
|
||||
<p>Né le {{ people.birth }}</p>
|
||||
{% if people.death %}
|
||||
<p>Décédé le {{ people.death }}</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
</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 />
|
||||
|
@ -21,3 +81,6 @@
|
|||
<br />
|
||||
{{ people.testimonials.html | safe }} <br />
|
||||
{{ people.sources.html | safe }}
|
||||
</section>
|
||||
{% include 'quicksearch.html' %}
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,70 +0,0 @@
|
|||
{% extends 'base.html' %}
|
||||
{% load static %}
|
||||
{% block content %}
|
||||
<section>
|
||||
<h1>Personnes</h1>
|
||||
<div class="personnal-info">
|
||||
<img 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>
|
||||
{% include 'quicksearch.html' %}
|
||||
{% endblock %}
|
Loading…
Reference in a new issue