added parties

This commit is contained in:
2025-11-22 11:46:40 +01:00
parent 65fd97c8c1
commit 03ee9fefec
14 changed files with 232 additions and 2 deletions

View File

@ -0,0 +1,29 @@
<% content_for :title, "Parties" %>
<div class="w-full">
<% if notice.present? %>
<p class="py-2 px-3 bg-green-50 mb-5 text-green-500 font-medium rounded-md inline-block" id="notice"><%= notice %></p>
<% end %>
<div class="flex justify-between items-center">
<h1 class="font-bold text-4xl">Parties</h1>
<%= link_to "New party", new_party_path, class: "rounded-md px-3.5 py-2.5 bg-blue-600 hover:bg-blue-500 text-white block font-medium" %>
</div>
<div id="parties" class="min-w-full divide-y divide-gray-200 space-y-5">
<% if @parties.any? %>
<% @parties.each do |party| %>
<div class="flex flex-col sm:flex-row justify-between items-center pb-5 sm:pb-0">
<%= render party %>
<div class="w-full sm:w-auto flex flex-col sm:flex-row space-x-2 space-y-2">
<%= link_to "Show", party, class: "w-full sm:w-auto text-center rounded-md px-3.5 py-2.5 bg-gray-100 hover:bg-gray-50 inline-block font-medium" %>
<%= link_to "Edit", edit_party_path(party), class: "w-full sm:w-auto text-center rounded-md px-3.5 py-2.5 bg-gray-100 hover:bg-gray-50 inline-block font-medium" %>
<%= button_to "Destroy", party, method: :delete, class: "w-full sm:w-auto rounded-md px-3.5 py-2.5 text-white bg-red-600 hover:bg-red-500 font-medium cursor-pointer", data: { turbo_confirm: "Are you sure?" } %>
</div>
</div>
<% end %>
<% else %>
<p class="text-center my-10">No parties found.</p>
<% end %>
</div>
</div>