Add enable/disable toggle

This commit is contained in:
myrmidex 2025-07-10 11:40:27 +02:00
parent 761d50706a
commit c551b12360

View file

@ -62,9 +62,12 @@
<div class="flex items-center space-x-2"> <div class="flex items-center space-x-2">
<form action="{{ route('routing.toggle', [$feed, $channel]) }}" method="POST" class="inline"> <form action="{{ route('routing.toggle', [$feed, $channel]) }}" method="POST" class="inline">
@csrf @csrf
<button type="submit" class="text-xs px-2 py-1 rounded {{ $channel->pivot->is_active ? 'bg-red-100 text-red-800 hover:bg-red-200' : 'bg-green-100 text-green-800 hover:bg-green-200' }}"> <label class="inline-flex items-center cursor-pointer">
{{ $channel->pivot->is_active ? 'Deactivate' : 'Activate' }} <span class="text-xs text-gray-600 mr-2">{{ $channel->pivot->is_active ? 'Active' : 'Inactive' }}</span>
<button type="submit" class="relative inline-flex h-6 w-11 items-center rounded-full transition-colors {{ $channel->pivot->is_active ? 'bg-green-600' : 'bg-gray-200' }}">
<span class="inline-block h-4 w-4 transform rounded-full bg-white transition-transform {{ $channel->pivot->is_active ? 'translate-x-6' : 'translate-x-1' }}"></span>
</button> </button>
</label>
</form> </form>
<a href="{{ route('routing.edit', [$feed, $channel]) }}" class="text-indigo-600 hover:text-indigo-900 text-xs">Edit</a> <a href="{{ route('routing.edit', [$feed, $channel]) }}" class="text-indigo-600 hover:text-indigo-900 text-xs">Edit</a>
<form action="{{ route('routing.destroy', [$feed, $channel]) }}" method="POST" class="inline" <form action="{{ route('routing.destroy', [$feed, $channel]) }}" method="POST" class="inline"