CRUD tickets ok, before migration update models
This commit is contained in:
@@ -1,29 +0,0 @@
|
||||
{% extends 'base.html' %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<div class="container">
|
||||
<div class="row d-flex justify-content-center">
|
||||
<div class="col-md-auto form-group mt-5">
|
||||
<h2> Créer un ticket </h2>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row d-flex justify-content-center mt-5">
|
||||
<div class="col-md-auto form-group justify-content-center">
|
||||
<form method='post' enctype='multipart/form-data'>
|
||||
{% csrf_token %}
|
||||
<label for='title'> Titre: </label>
|
||||
<div class="d-flex justify-content-center mb-4">{{ ticket_form.title }}</div>
|
||||
<label for='body'>Description: </label>
|
||||
<div class="d-flex justify-content-center mb-4">{{ ticket_form.body }}</div>
|
||||
<label for='image'>Image: </label>
|
||||
<div class="d-flex justify-content-center mb-4">{{ ticket_form.image }}</div>
|
||||
<div class="d-flex justify-content-end">
|
||||
<button type='submit' class='btn btn-primary ml-auto'> Envoyer</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
9
LITReview/reviews/templates/reviews/delete_confirm.html
Normal file
9
LITReview/reviews/templates/reviews/delete_confirm.html
Normal file
@@ -0,0 +1,9 @@
|
||||
{% extends 'base.html' %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<div class="d-flex align-items-center justify-content-center">
|
||||
<p> Suppression effectuée </p>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
@@ -3,11 +3,11 @@
|
||||
{% block content %}
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="d-flex justify-content-center my-5">
|
||||
<div class="d-flex justify-content-center mt-5">
|
||||
<h2> Bienvenue {{ request.user }}</h2>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row d-flex justify-content-center mt-5">
|
||||
<div class="row d-flex justify-content-center mt-4 mb-3">
|
||||
<div class="col-3 d-flex justify-content-center">
|
||||
<a href="{% url 'ticket-add' %}" type="button" class="btn btn-primary">Demander une critique</a>
|
||||
</div>
|
||||
@@ -15,6 +15,12 @@
|
||||
<a href="{% url 'review-add' %}" type="button" class="btn btn-primary">Créer une critique</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
{% for ticket in tickets %}
|
||||
{% include 'reviews/ticket_detail.html' %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
|
||||
13
LITReview/reviews/templates/reviews/review_form.html
Normal file
13
LITReview/reviews/templates/reviews/review_form.html
Normal file
@@ -0,0 +1,13 @@
|
||||
<form method='post' enctype='multipart/form-data'>
|
||||
{% csrf_token %}
|
||||
<label for='headline'> Titre: </label>
|
||||
<div class="d-flex justify-content-center mb-4">{{ review_form.headline }}</div>
|
||||
<label for='rating'>Note: </label>
|
||||
<div class="d-flex justify-content-center mb-4">{{ review_form.rating }}</div>
|
||||
<label for='body'>Description: </label>
|
||||
<div class="d-flex justify-content-center mb-4">{{ review_form.body }}</div>
|
||||
<div class="d-flex justify-content-end">
|
||||
<button type='submit' class='btn btn-primary ml-auto'> Envoyer</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
7
LITReview/reviews/templates/reviews/ticket.html
Normal file
7
LITReview/reviews/templates/reviews/ticket.html
Normal file
@@ -0,0 +1,7 @@
|
||||
{% extends 'base.html' %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
{% include 'reviews/ticket_detail.html' %}
|
||||
|
||||
{% endblock %}
|
||||
16
LITReview/reviews/templates/reviews/ticket_create.html
Normal file
16
LITReview/reviews/templates/reviews/ticket_create.html
Normal file
@@ -0,0 +1,16 @@
|
||||
{% extends 'base.html' %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<div class="container">
|
||||
<div class="row d-flex justify-content-center">
|
||||
<div class="col-md-auto form-group mt-5">
|
||||
<h2> Créer un ticket </h2>
|
||||
</div>
|
||||
</div>
|
||||
<div class="d-flex justify-content-center mt-5">
|
||||
{% include 'reviews/ticket_form.html' %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
12
LITReview/reviews/templates/reviews/ticket_delete.html
Normal file
12
LITReview/reviews/templates/reviews/ticket_delete.html
Normal file
@@ -0,0 +1,12 @@
|
||||
{% extends 'base.html' %}
|
||||
|
||||
{% block content %}
|
||||
<div class="d-flex justify-content-center align-self-center">
|
||||
<form method="post">
|
||||
{% csrf_token %}
|
||||
<p> Êtes vous sûr de vouloir supprimer {{ ticket.title }} ? </p>
|
||||
<button type="submit" class="btn btn-warning">Supprimer</button>
|
||||
</form>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
28
LITReview/reviews/templates/reviews/ticket_detail.html
Normal file
28
LITReview/reviews/templates/reviews/ticket_detail.html
Normal file
@@ -0,0 +1,28 @@
|
||||
<div class="row border border-2 border-secondary-subtle my-3">
|
||||
<div class="col-8">
|
||||
{% if request.user == ticket.user %}
|
||||
vous avez demandé une critique
|
||||
{% else %}
|
||||
{{ ticket.user }} a demandé une critique
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="col-4 d-flex justify-content-end">
|
||||
{{ ticket.time_created }}
|
||||
</div>
|
||||
<p> {{ ticket.title }} </p>
|
||||
<p> {{ ticket.body }} </p>
|
||||
<div class="col-3 mb-2">
|
||||
<img src="{{ ticket.image.url }}" class="img" style="width: 200px; height: auto" alt="Couverture de {{ ticket.title }}">
|
||||
</div>
|
||||
<div class="col-4 d-flex justify-content-end mb-2">
|
||||
{% if request.user == ticket.user %}
|
||||
<div class="col-3 align-self-end">
|
||||
<a href="{% url 'ticket-update' ticket.id %}" type="button" class="btn btn-primary">Modifier</a>
|
||||
</div>
|
||||
<div class="col-3 align-self-end">
|
||||
<a href="{% url 'ticket-delete' ticket.id %}" type="button" class="btn btn-danger">Supprimer</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
13
LITReview/reviews/templates/reviews/ticket_form.html
Normal file
13
LITReview/reviews/templates/reviews/ticket_form.html
Normal file
@@ -0,0 +1,13 @@
|
||||
<form method='post' enctype='multipart/form-data'>
|
||||
{% csrf_token %}
|
||||
<label for='title'> Titre: </label>
|
||||
<div class="d-flex justify-content-center mb-4">{{ ticket_form.title }}</div>
|
||||
<label for='body'>Description: </label>
|
||||
<div class="d-flex justify-content-center mb-4">{{ ticket_form.body }}</div>
|
||||
<label for='image'>Image: </label>
|
||||
<div class="d-flex justify-content-center mb-4">{{ ticket_form.image }}</div>
|
||||
<div class="d-flex justify-content-end">
|
||||
<button type='submit' class='btn btn-primary ml-auto'> Envoyer</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
16
LITReview/reviews/templates/reviews/ticket_update.html
Normal file
16
LITReview/reviews/templates/reviews/ticket_update.html
Normal file
@@ -0,0 +1,16 @@
|
||||
{% extends 'base.html' %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<div class="container">
|
||||
<div class="row d-flex align-items-center">
|
||||
<h2> Modifier la demande {{ ticket.title }}</h2>
|
||||
</div>
|
||||
<div class="row">
|
||||
{% include 'reviews/ticket_form.html' %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user