Skip to content
This repository has been archived by the owner on Apr 23, 2024. It is now read-only.

Commit

Permalink
fix: Fixes for various admin pages
Browse files Browse the repository at this point in the history
  • Loading branch information
JordanViknar committed Apr 16, 2024
1 parent 892af51 commit ab010e3
Show file tree
Hide file tree
Showing 3 changed files with 95 additions and 89 deletions.
2 changes: 1 addition & 1 deletion resources/views/admin.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<img src="{{ asset('img/Plains_Villager_Base.webp') }}"/>
Gestionnaire Produits & Catégories
</a>
<a href="/admin/contact">
<a href="/admin/contacts">
<img src="{{ asset('img/Book_JE2_BE2.webp') }}"/>
Gestionnaire Contacts
</a>
Expand Down
172 changes: 86 additions & 86 deletions resources/views/admin_contacts.blade.php
Original file line number Diff line number Diff line change
@@ -1,99 +1,99 @@
<h1>Gestionnaire formulaires de contact</h1>
@foreach($errors->all() as $error)
<div class="notif error">
<img src="{{ asset('img/white-cross.png') }}" alt="Croix blanche" onclick="closeWidget(this.parentNode)"/>
<p>{{$error}}</p>
</div>
<div class="notif error">
<img src="{{ asset('img/white-cross.png') }}" alt="Croix blanche" onclick="closeWidget(this.parentNode)"/>
<p>{{$error}}</p>
</div>
@endforeach
<div class=manager>
<div id="contacts_list">
<div class="search_container">
<img class="search_icon" src="{{ asset('img/search-icon.svg') }}" alt="Search icon">
<input type="text" class="search_input" placeholder="Rechercher...">
</div>
<hr>
<div id="contact_table">
<table>
<thead>
<tr>
<th>Id</th>
<th>Subject</th>
</tr>
</thead>
<div class="manager">
<div id="contacts_list">
<div class="search_container">
<img class="search_icon" src="{{ asset('img/search-icon.svg') }}" alt="Search icon">
<input type="text" class="search_input" placeholder="Rechercher...">
</div>
<hr>
<div id="contact_table">
<table>
<thead>
<tr>
<th>Id</th>
<th>Subject</th>
</tr>
</thead>

<tbody>
@foreach(\App\Models\ContactForm::all() as $contact)
<tr onclick="displayContactDetails({{ $contact }})">
<td>{{ $contact->id }}</td>
<td>{{ $contact->subject }}</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
<tbody>
@foreach(\App\Models\ContactForm::all() as $contact)
<tr onclick="displayContactDetails({{ $contact }})">
<td>{{ $contact->id }}</td>
<td>{{ $contact->subject }}</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>

<div id="contact_details">
<div id="contact_details_not_loaded">
<h2>Veuillez sélectionner un utilisateur</h2>
</div>
<div id="contact_details_loaded" class="hidden">
<div id="contact_details">
<div id="contact_details_not_loaded">
<h2>Veuillez sélectionner un utilisateur</h2>
</div>

<table>
<tr>
<td>Prénom:</td><td id="first_name"></td>
</tr>
<tr>
<td>Nom:</td><td id="last_name"></td>
</tr>
<tr>
<td>mail:</td><td id="email"></td>
</tr>
<tr>
<td>Genre:</td><td id="gender"></td>
</tr>
<tr>
<td>Date de naissance:</td><td id="birthday"></td>
</tr>
<tr>
<td>Métier:</td><td id="job"></td>
</tr>
</table>
<div id="contact_details_loaded" class="hidden">
<table>
<tr>
<td>Prénom:</td><td id="first_name"></td>
</tr>
<tr>
<td>Nom:</td><td id="last_name"></td>
</tr>
<tr>
<td>mail:</td><td id="email"></td>
</tr>
<tr>
<td>Genre:</td><td id="gender"></td>
</tr>
<tr>
<td>Date de naissance:</td><td id="birthday"></td>
</tr>
<tr>
<td>Métier:</td><td id="job"></td>
</tr>
</table>

<table>
<tr>
<td id="subject"></td>
</tr>
<tr>
<td id="content"></td>
</tr>
</table>
<table>
<tr>
<td id="subject"></td>
</tr>
<tr>
<td id="content"></td>
</tr>
</table>

<form action="/admin/contact/reply" method="post" autocomplete="off">
@csrf
<form action="/admin/contact/reply" method="post" autocomplete="off">
@csrf

<input type="hidden" id="contact_id" name="id"/>
<input type="hidden" id="contact_id" name="id"/>

<!-- response -->
<div class="contact_details_field">
<label for="mailBody">Réponse :</label>
<textarea id="response" name="mailBody" required/>
</div>
<!-- response -->
<div class="contact_details_field">
<label for="mailBody">Réponse :</label>
<textarea id="response" name="mailBody" required></textarea>
</div>

<!-- Submit -->
<div class="contact_details_field">
<input type="submit" value="Envoyer"/>
</div>
</form>
<!-- Submit -->
<div class="contact_details_field">
<input type="submit" value="Envoyer"/>
</div>
</form>

<!-- Delete button -->
<div class="contact_details_field">
<form action="/admin/contact/remove" method="post">
@csrf
<input type="hidden" id="contact_id_delete" name="id"/>
<input type="submit" value="Supprimer"/>
</form>
</div>
</div>
</div>
<!-- Delete button -->
<div class="contact_details_field">
<form action="/admin/contact/remove" method="post">
@csrf
<input type="hidden" id="contact_id_delete" name="id"/>
<input type="submit" value="Supprimer"/>
</form>
</div>
</div>
</div>
</div>
10 changes: 8 additions & 2 deletions resources/views/admin_products.blade.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
<h1>Gestionnaire produits</h1>
@foreach($errors->all() as $error)
<div class="notif error">
<img src="{{ asset('img/white-cross.png') }}" alt="Croix blanche" onclick="closeWidget(this.parentNode)"/>
<p>{{$error}}</p>
</div>
@endforeach
<div id="product_manager_zone">
<div id="category_list">
@foreach(\App\Models\Category::all()->sortBy('name') as $category)
Expand Down Expand Up @@ -63,8 +69,8 @@

<!-- Price -->
<div class="product_details_field">
<label for="price">Prix :</label>
<input type="number" id="product_price" name="price" step=0.01 min=0 required/>
<label for="unit_price">Prix :</label>
<input type="number" id="product_price" name="unit_price" step=0.01 min=0 required/>
</div>

<!-- Submit -->
Expand Down

0 comments on commit ab010e3

Please sign in to comment.