Premier commit
This commit is contained in:
47
resources/views/admin/municipalities/index.blade.php
Normal file
47
resources/views/admin/municipalities/index.blade.php
Normal file
@@ -0,0 +1,47 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<h2 class="mb-4">Gestion des Communes</h2>
|
||||
|
||||
<div class="card shadow-sm">
|
||||
<div class="card-body">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover align-middle">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Nom</th>
|
||||
<th>Code Postal</th>
|
||||
<th>Statut</th>
|
||||
<th>Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($municipalities as $municipality)
|
||||
<tr class="{{ $municipality->is_active ? '' : 'table-warning' }}">
|
||||
<td>{{ $municipality->name }}</td>
|
||||
<td>{{ $municipality->zip_code }}</td>
|
||||
<td>
|
||||
@if($municipality->is_active)
|
||||
<span class="badge bg-success">Active</span>
|
||||
@else
|
||||
<span class="badge bg-secondary">Désactivée</span>
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
<form action="{{ route('admin.municipalities.toggle', $municipality) }}" method="POST">
|
||||
@csrf
|
||||
<button type="submit" class="btn btn-sm {{ $municipality->is_active ? 'btn-outline-danger' : 'btn-outline-success' }}">
|
||||
{{ $municipality->is_active ? 'Désactiver' : 'Activer' }}
|
||||
</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
Reference in New Issue
Block a user