diff --git a/nuitdelinfo_2021/views.py b/nuitdelinfo_2021/views.py index 6bb4419..b49be7a 100644 --- a/nuitdelinfo_2021/views.py +++ b/nuitdelinfo_2021/views.py @@ -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) diff --git a/people/urls.py b/people/urls.py index ae7518b..0a07d07 100644 --- a/people/urls.py +++ b/people/urls.py @@ -3,7 +3,8 @@ from django.urls import path from . import views urlpatterns = [ - path("/", views.index, name='index'), + path("", views.index, name='index'), + path("/", views.details, name='details'), path("submit/", views.submit, name="submit"), path("edit//", views.edit, name="edit") ] diff --git a/people/views.py b/people/views.py index 3f4dd5d..5687eab 100644 --- a/people/views.py +++ b/people/views.py @@ -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": diff --git a/rescue/urls.py b/rescue/urls.py index 491a8a0..42a7fe9 100644 --- a/rescue/urls.py +++ b/rescue/urls.py @@ -3,7 +3,8 @@ from django.urls import path from . import views urlpatterns = [ - path('', views.index, name='index'), + path('', views.index, name='index'), + path('/', views.details, name='details'), path("submit/", views.submit, name="submit"), path("edit//", views.edit, name="edit") ] diff --git a/rescue/views.py b/rescue/views.py index de31110..9e05b8f 100644 --- a/rescue/views.py +++ b/rescue/views.py @@ -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)}) diff --git a/templates/article/articles.html b/templates/article/articles.html new file mode 100644 index 0000000..e857705 --- /dev/null +++ b/templates/article/articles.html @@ -0,0 +1,26 @@ +{% extends 'base.html' %} +{% load static %} +{% block content %} +
+

Articles

+
+ {% for rescue in rescues %} +
+
+
+ +
+
+

{{ rescue.date }}

+

{{ rescue.name }}

+ Voir l'article +
+
+ +
+ {% endfor %} +
+ Charger plus d'articles +
+ {% include 'quicksearch.html' %} +{% endblock %} \ No newline at end of file diff --git a/templates/articles.html b/templates/articles.html deleted file mode 100644 index 6376ea7..0000000 --- a/templates/articles.html +++ /dev/null @@ -1,126 +0,0 @@ -{% extends 'base.html' %} -{% load static %} -{% block content %} -
-

Articles

-
-
-
-
- -
-
-

16/02/2020

-

Sauvetage risqué en côte d'Ivoire

- Voir l'article -
-
- -
-
-
-
- -
-
-

16/02/2020

-

Sauvetage risqué en côte d'Ivoire

- Voir l'article -
-
- -
-
-
-
- -
-
-

16/02/2020

-

Sauvetage risqué en côte d'Ivoire

- Voir l'article -
-
- -
-
-
-
- -
-
-

16/02/2020

-

Sauvetage risqué en côte d'Ivoire

- Voir l'article -
-
- -
-
-
-
- -
-
-

16/02/2020

-

Sauvetage risqué en côte d'Ivoire

- Voir l'article -
-
- -
-
-
-
- -
-
-

16/02/2020

-

Sauvetage risqué en côte d'Ivoire

- Voir l'article -
-
- -
-
-
-
- -
-
-

16/02/2020

-

Sauvetage risqué en côte d'Ivoire

- Voir l'article -
-
- -
-
-
-
- -
-
-

16/02/2020

-

Sauvetage risqué en côte d'Ivoire

- Voir l'article -
-
-
-
-
-
- -
-
-

16/02/2020

-

Sauvetage risqué en côte d'Ivoire

- Voir l'article -
-
-
- Charger plus d'articles -
-
- {% include 'quicksearch.html' %} -{% endblock %} \ No newline at end of file diff --git a/templates/crew.html b/templates/crew.html deleted file mode 100644 index e69de29..0000000 diff --git a/templates/people/people.html b/templates/people/people.html index 96de6fe..f41014c 100644 --- a/templates/people/people.html +++ b/templates/people/people.html @@ -1,23 +1,86 @@ -{% if not people.validated %} - {% if people.pending_edit_of %} -

This edit is not validated !

- {% else %} -

This new entry is not validated !

+{% extends 'base.html' %} +{% load static %} +{% block content %} + {% if not people.validated %} + {% if people.pending_edit_of %} +

This edit is not validated !

+ {% else %} +

This new entry is not validated !

+ {% endif %} {% endif %} -{% endif %} -{{ people.first_name }} {{ people.last_name }}
-{{ people.title }}
-
-{{ people.description.html | safe }}
-
-{{ people.birth }}
-{{ people.death }}
-
-{{ people.history.html | safe }}
-{{ people.genealogy.html | safe }}
-{{ people.awards.html | safe }}
-{{ people.pro_life.html | safe }}
-
-{{ people.testimonials.html | safe }}
-{{ people.sources.html | safe }} +
+

Personnes

+
+ +
+

{{ people }}

+ {% if title %} +

{{ people.title }}

+ {% endif %} +

Né le {{ people.birth }}

+ {% if people.death %} +

Décédé le {{ people.death }}

+ {% endif %} +
+
+

{{ people.description.html | safe }}

+ +
+
+
+
+ a + 20/20/2020 +
+
+ a + 20/20/2020 +
+
+ a + 20/20/2020 +
+
+ a + 20/20/2020 +
+
+ a + 20/20/2020 +
+
+ a + 20/20/2020 +
+
+ a + 20/20/2020 +
+
+ a + 20/20/2020 +
+
+ a + 20/20/2020 +
+
+
+

Sauvetage en côte d'Ivoire

+

Le 20/20/2020

+

Lorem ipsum dolor sit amet, consectetur adipiscing elit. + Curabitur ultrices, massa at tincidunt auctor, dolor

+
+
+ + {{ people.history.html | safe }}
+ {{ people.genealogy.html | safe }}
+ {{ people.awards.html | safe }}
+ {{ people.pro_life.html | safe }}
+
+ {{ people.testimonials.html | safe }}
+ {{ people.sources.html | safe }} +
+ {% include 'quicksearch.html' %} +{% endblock %} diff --git a/templates/personnes.html b/templates/personnes.html deleted file mode 100644 index 61eaeda..0000000 --- a/templates/personnes.html +++ /dev/null @@ -1,70 +0,0 @@ -{% extends 'base.html' %} -{% load static %} -{% block content %} -
-

Personnes

-
- -
-

Thomas Pesquet

-

43 ans

-
-
-

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.

- -
-
-
-
- a - 20/20/2020 -
-
- a - 20/20/2020 -
-
- a - 20/20/2020 -
-
- a - 20/20/2020 -
-
- a - 20/20/2020 -
-
- a - 20/20/2020 -
-
- a - 20/20/2020 -
-
- a - 20/20/2020 -
-
- a - 20/20/2020 -
-
-
-

Sauvetage en côte d'Ivoire

-

Le 20/20/2020

-

Lorem ipsum dolor sit amet, consectetur adipiscing elit. - Curabitur ultrices, massa at tincidunt auctor, dolor

-
-
- -
- {% include 'quicksearch.html' %} -{% endblock %} \ No newline at end of file