diff --git a/LITReview/LITReview/urls.py b/LITReview/LITReview/urls.py index 69bbb68..600a4d6 100644 --- a/LITReview/LITReview/urls.py +++ b/LITReview/LITReview/urls.py @@ -25,7 +25,6 @@ import reviews.views urlpatterns = [ path('admin/', admin.site.urls), - path('home/', reviews.views.home, name='home'), path('', LoginView.as_view( template_name='authentication/login.html', redirect_authenticated_user=True), name='login'), diff --git a/LITReview/authentication/templates/authentication/logout.html b/LITReview/authentication/templates/authentication/logout.html deleted file mode 100644 index e69de29..0000000 diff --git a/LITReview/media/uploads/spongeBob.jpg b/LITReview/media/uploads/spongeBob.jpg new file mode 100644 index 0000000..de2c47f Binary files /dev/null and b/LITReview/media/uploads/spongeBob.jpg differ diff --git a/LITReview/reviews/templates/reviews/flux.html b/LITReview/reviews/templates/reviews/flux.html index 4ea2071..05192ac 100644 --- a/LITReview/reviews/templates/reviews/flux.html +++ b/LITReview/reviews/templates/reviews/flux.html @@ -2,49 +2,56 @@ {% load reviews_extras %} {% block content %} +
+
-
- -
-
-

Bienvenue {{ request.user }}

-
-
- - - -
- {% for post in posts %} - {% if post.content_type == 'TICKET' %} -
- {% include 'reviews/ticket_detail.html' with ticket=post %} -
- {% if not post.review %} - - {% else %} -
- {% display_owner post.review.user %} créé une critique, le {{ post.time_created|date:"d M Y"}} -
- {% endif %} -
+
+
+
+

Bienvenue {{ request.user }}

- {% elif post.content_type == 'REVIEW' %} -
- {% include 'reviews/review_detail.html' with review=post %} -
- {% endif %} - {% endfor %} -
+
+ -
+
+ +
+ +
+
+ {% for post in posts %} + {% if post.content_type == 'TICKET' %} +
+ {% include 'reviews/ticket_detail.html' with ticket=post %} +
+ {% if not post.review %} + + {% else %} +
+ {% display_owner post.review.user %} créé une critique, le {{ post.time_created|date:"d M Y"}} +
+ {% endif %} +
+
+ {% elif post.content_type == 'REVIEW' %} +
+ {% include 'reviews/review_detail.html' with review=post %} +
+ {% endif %} + {% endfor %} +
+
+ +
+
{% endblock %} diff --git a/LITReview/reviews/templates/reviews/home.html b/LITReview/reviews/templates/reviews/home.html deleted file mode 100644 index 0b6e02f..0000000 --- a/LITReview/reviews/templates/reviews/home.html +++ /dev/null @@ -1,33 +0,0 @@ -{% extends 'base.html' %} - -{% block content %} -
-
-
-

Bienvenue {{ request.user }}

-
-
-
- - -
-
- {% for ticket in tickets %} - {% include 'reviews/ticket_detail.html' %} -
- {% if not ticket.review %} - - {% endif %} -
-
- {% endfor %} -
- - -{% endblock %} diff --git a/LITReview/reviews/templates/reviews/posts.html b/LITReview/reviews/templates/reviews/posts.html index 1825e84..392923d 100644 --- a/LITReview/reviews/templates/reviews/posts.html +++ b/LITReview/reviews/templates/reviews/posts.html @@ -1,42 +1,47 @@ {% extends 'base.html' %} {% block content %} -
- -
-
-

Posts

-
-
- - {% for ticket in tickets %} -
- {% include 'reviews/ticket_detail.html' %} -
-
- Modifier -
-
- Supprimer -
-
-
- {% endfor %} - - {% for review in reviews %} -
- {% include 'reviews/review_detail.html' %} -
-
- Modifier -
-
- Supprimer +
+
+
+
+
+

Posts

+
+ +
+ {% for ticket in tickets %} +
+ {% include 'reviews/ticket_detail.html' %} +
+
+ Modifier +
+
+ Supprimer +
+
+
+ {% endfor %} +
+ +
+ {% for review in reviews %} +
+ {% include 'reviews/review_detail.html' %} +
+
+ Modifier +
+
+ Supprimer +
+
+
+ {% endfor %} +
- {% endfor %} - -
- + {% endblock %} diff --git a/LITReview/reviews/templates/reviews/review_create.html b/LITReview/reviews/templates/reviews/review_create.html index b9516aa..22783ee 100644 --- a/LITReview/reviews/templates/reviews/review_create.html +++ b/LITReview/reviews/templates/reviews/review_create.html @@ -1,31 +1,35 @@ {% extends 'base.html' %} {% block content %} - -
-
-
-

Créer une critique

-
-
-
-

Livre/Article

-
-
- {% include 'reviews/ticket_form.html' %} - {% csrf_token %} +
+
+
+
+

Créer une critique

-
-
-

Critique

-
- {% include 'reviews/review_form.html' %} -
- -
-
+
+
+

Livre/Article

+
+
+ {% include 'reviews/ticket_form.html' %} + {% csrf_token %} +
+
+
+
+
+

Critique

+
+ {% include 'reviews/review_form.html' %} +
+ +
+ +
+
+
-
- +
{% endblock %} diff --git a/LITReview/reviews/templates/reviews/review_delete.html b/LITReview/reviews/templates/reviews/review_delete.html index 8a7a52f..1227927 100644 --- a/LITReview/reviews/templates/reviews/review_delete.html +++ b/LITReview/reviews/templates/reviews/review_delete.html @@ -1,8 +1,8 @@ {% extends 'base.html' %} {% block content %} - -
+
+
{% csrf_token %} @@ -10,7 +10,8 @@
-
+
+ {% endblock %} diff --git a/LITReview/reviews/templates/reviews/review_detail.html b/LITReview/reviews/templates/reviews/review_detail.html index 4dbee9d..b397192 100644 --- a/LITReview/reviews/templates/reviews/review_detail.html +++ b/LITReview/reviews/templates/reviews/review_detail.html @@ -1,19 +1,25 @@ {% load reviews_extras %} -
-
- {% display_owner review.user %} publié une critique -
- -
- {{ review.time_created }} -
-
- -
- {{ review.headline }} - {{ review.rating|rating_stars }} -

{{ review.comment }}

-
- {% include 'reviews/ticket_detail.html' with ticket=review.ticket %} -
-
+
+
+
+
+ {% display_owner review.user %} publié une critique +
+
+ {{ review.time_created }} +
+
+
+
+
+ + {{ review.headline }} - {{ review.rating|rating_stars }} + +

{{ review.comment }}

+
+ {% include 'reviews/ticket_detail.html' with ticket=review.ticket %} +
+
+
+
\ No newline at end of file diff --git a/LITReview/reviews/templates/reviews/review_ticket.html b/LITReview/reviews/templates/reviews/review_ticket.html index 46f250f..af9119d 100644 --- a/LITReview/reviews/templates/reviews/review_ticket.html +++ b/LITReview/reviews/templates/reviews/review_ticket.html @@ -1,35 +1,37 @@ {% extends 'base.html' %} {% block content %} - -
+
+

Créer une critique

-
-

Vous êtes en train de répondre à

-
-
- {% include 'reviews/ticket_detail.html' %} -
-
-
- -
-

Critique

-
+
+
+

Vous êtes en train de répondre à

+
+
+ {% include 'reviews/ticket_detail.html' %} +
+
+
+
+
+
+

Critique

+
- {% csrf_token %} - {% include 'reviews/review_form.html' %} - -
- -
+ {% csrf_token %} + {% include 'reviews/review_form.html' %} +
+ +
+
-
-
- + +
+
{% endblock %} diff --git a/LITReview/reviews/templates/reviews/review_update.html b/LITReview/reviews/templates/reviews/review_update.html index 7b26f3c..20a4555 100644 --- a/LITReview/reviews/templates/reviews/review_update.html +++ b/LITReview/reviews/templates/reviews/review_update.html @@ -2,30 +2,27 @@ {% block content %} -
-
-
-

Modifier votre critique

-
-
- -
-

Vous êtes en train de poster en réponse à

- -
-
- {% include 'reviews/ticket_detail.html' with ticket=review.ticket %} +
+
+
+
+

Modifier votre critique

-
- -
-
-

Critique

-
- -
-
+
+
+

Vous êtes en train de poster en réponse à

+
+
+ {% include 'reviews/ticket_detail.html' with ticket=review.ticket %} +
+
+
+
+
+
+

Critique

+
{% csrf_token %} {% include 'reviews/review_form.html' %} @@ -35,9 +32,9 @@
+
- -
+
{% endblock %} diff --git a/LITReview/reviews/templates/reviews/subscribed.html b/LITReview/reviews/templates/reviews/subscribed.html index 2c682b0..aeb9d8d 100644 --- a/LITReview/reviews/templates/reviews/subscribed.html +++ b/LITReview/reviews/templates/reviews/subscribed.html @@ -2,54 +2,59 @@ {% block content %} -
-
-
-

Suivre d'autres utilisateurs

-
-
-
- {% csrf_token %} -
- {{ user_form }} +
+
+
+
+
+

Suivre d'autres utilisateurs

+
+
+ + {% csrf_token %} +
+ {{ user_form }} +
+
+
+ +
+ +
-
-
- -
- -
+ + +
+
+
+

Abonnements

+
+ + {% for user in followed %} +
+ {{ user.followed_user }} +
+ + + {% endfor %} +
+
+ +
+
+
+

Abonnés

+
+ {% for user in following %} +
+ {{ user.user }} +
+ {% endfor %} +
+
+
- - -
-
-

Abonnements

-
- - {% for user in followed %} -
- {{ user.followed_user }} -
- - - {% endfor %} -
- -
-
-

Abonnés

-
- {% for user in following %} -
- {{ user.user }} -
- {% endfor %} -
-
- -
- + {% endblock %} diff --git a/LITReview/reviews/templates/reviews/ticket_create.html b/LITReview/reviews/templates/reviews/ticket_create.html index dd2d25e..c36c0ec 100644 --- a/LITReview/reviews/templates/reviews/ticket_create.html +++ b/LITReview/reviews/templates/reviews/ticket_create.html @@ -1,24 +1,28 @@ {% extends 'base.html' %} {% block content %} - -
-
-
-

Créer un ticket

+
+
+
+
+

Créer un ticket

+
-
-
-
- {% csrf_token %} - {{ ticket_form.as_p }} -
- -
-
+
+
+

Livre/Article

+
+
+ {% csrf_token %} + {% include 'reviews/ticket_form.html' %} +
+ +
+
+
+
+
-
-
- + {% endblock %} diff --git a/LITReview/reviews/templates/reviews/ticket_delete.html b/LITReview/reviews/templates/reviews/ticket_delete.html index ac9b247..1c90a09 100644 --- a/LITReview/reviews/templates/reviews/ticket_delete.html +++ b/LITReview/reviews/templates/reviews/ticket_delete.html @@ -1,8 +1,8 @@ {% extends 'base.html' %} {% block content %} - -
+
+
{% csrf_token %} @@ -10,7 +10,8 @@
-
+
+ {% endblock %} diff --git a/LITReview/reviews/templates/reviews/ticket_detail.html b/LITReview/reviews/templates/reviews/ticket_detail.html index 437f330..020a6e4 100644 --- a/LITReview/reviews/templates/reviews/ticket_detail.html +++ b/LITReview/reviews/templates/reviews/ticket_detail.html @@ -1,17 +1,21 @@ {% load reviews_extras %} -
-
- {% display_owner ticket.user %} publié une demande -
-
- {{ ticket.time_created }} -
-
- -

{{ ticket.title }}

-

{{ ticket.desc }}

- -
- Couverture de {{ ticket.title }} -
\ No newline at end of file +
+
+
+
+ {% display_owner ticket.user %} publié une demande +
+
+ {{ ticket.time_created }} +
+
+
+
+

{{ ticket.title }}

+

{{ ticket.desc }}

+
+ Couverture de {{ ticket.title }} +
+
+
\ No newline at end of file diff --git a/LITReview/reviews/templates/reviews/ticket_update.html b/LITReview/reviews/templates/reviews/ticket_update.html index e9294c9..2c1572c 100644 --- a/LITReview/reviews/templates/reviews/ticket_update.html +++ b/LITReview/reviews/templates/reviews/ticket_update.html @@ -1,16 +1,30 @@ {% extends 'base.html' %} {% block content %} - -
-
-

Modifier la demande {{ ticket.title }}

+
+
+
+
+

Modifier la demande "{{ ticket.title }}"

+
+
+
+
+

Livre/Article

+
+
+ {% csrf_token %} + {% include 'reviews/ticket_form.html' %} +
+ +
+
+
+
+
+
-
- {% include 'reviews/ticket_form.html' %} -
-
- + {% endblock %} diff --git a/LITReview/reviews/templates/reviews/unsubscribe.html b/LITReview/reviews/templates/reviews/unsubscribe.html index 3d50351..e3c4ff4 100644 --- a/LITReview/reviews/templates/reviews/unsubscribe.html +++ b/LITReview/reviews/templates/reviews/unsubscribe.html @@ -1,8 +1,8 @@ {% extends 'base.html' %} {% block content %} - -
+
+
{% csrf_token %} @@ -10,5 +10,6 @@
-
+
+ {% endblock %} \ No newline at end of file diff --git a/LITReview/reviews/views.py b/LITReview/reviews/views.py index 8196d8f..70fc454 100644 --- a/LITReview/reviews/views.py +++ b/LITReview/reviews/views.py @@ -7,14 +7,6 @@ from reviews.forms import TicketForm, ReviewForm, ToFollowForm from itertools import chain -@login_required -def home(request): - tickets = Ticket.objects.all() - return render(request, - 'reviews/home.html', - {'tickets': tickets}) - - @login_required def flux(request): """ @@ -67,6 +59,7 @@ def ticket(request, ticket_id): 'reviews/ticket.html', {'ticket': ticket}) + @login_required def create_ticket(request): """ @@ -107,7 +100,7 @@ def update_ticket(request, ticket_id): return render(request, 'reviews/ticket_update.html', - {'ticket_form': ticket_form}) + {'ticket_form': ticket_form, 'ticket': ticket}) @login_required diff --git a/LITReview/templates/base.html b/LITReview/templates/base.html index 0bf067c..d20e955 100644 --- a/LITReview/templates/base.html +++ b/LITReview/templates/base.html @@ -26,7 +26,8 @@ {% block content %}{% endblock %} - +