- working party

- working friend
- working attendent
This commit is contained in:
2025-11-22 20:59:19 +01:00
parent e51d911bd0
commit 6b96c100a5
12 changed files with 66 additions and 22 deletions

View File

@ -0,0 +1,6 @@
<div id="<%= "party-#{party.id}-#{friend.id}" %>"
class="flex justify-between w-full border rounded mb-2 p-2 <%= 'bg-green-400 text-white' if member %>">
<%= link_to party_toggle_attendent_path(party.id, friend.id) do %>
<span class="p-2"><%= friend.fullname %></span>
<% end %>
</div>

View File

@ -18,8 +18,8 @@
<div>
<p class="text-lg font-semibold relative">
<%= party.title %>
<span class="m-2 -top-2 absolute text-[10px] bg-green-400 text-white rounded-full p-0.5">
12
<span class="m-2 -top-2 absolute text-[10px] bg-green-600 text-white rounded-full py-0.5 px-2">
<%= party.attendents.count %>
</span>
</p>
<p class="text-gray-600 text-sm">
@ -30,7 +30,7 @@
</div>
<div class="flex space-x-3">
<%= link_to edit_party_path(party),
<%= link_to party_path(party),
class: "hover:bg-green-400 hover:text-white font-medium rounded border px-2 py-1" do %>
<svg class="h-6 w-6 " fill="currentColor" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M10.644 17.08c2.866-.662 4.539-1.241 3.246-3.682-3.932-7.427-1.042-11.398 3.111-11.398 4.235 0 7.054 4.124 3.11 11.398-1.332 2.455.437 3.034 3.242 3.682 2.483.574 2.647 1.787 2.647 3.889v1.031h-18c0-2.745-.22-4.258 2.644-4.92zm-12.644 4.92h7.809c-.035-8.177 3.436-5.313 3.436-11.127 0-2.511-1.639-3.873-3.748-3.873-3.115 0-5.282 2.979-2.333 8.549.969 1.83-1.031 2.265-3.181 2.761-1.862.43-1.983 1.34-1.983 2.917v.773z"/></svg>
<% end %>

View File

@ -5,9 +5,18 @@
<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 %>
<h1 class="font-bold text-4xl">Showing party</h1>
<h1 class="font-bold text-4xl">Party People</h1>
<div class="mt-6 mb-6 flex w-full gap-4">
<div class="mt-4 w-1/2">
<% @friends.each do |friend| %>
<%= render 'parties/attendent',
party: @party, friend: friend,
member: @party.attendents.exists?( friend_id: friend.id ) %>
<% end %>
</div>
</div>
<%= link_to "Übersicht", parties_path, class: 'btn-show' %>
<%= link_to "Edit this party", 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" %>
<%= link_to "Back to parties", parties_path, class: "w-full sm:w-auto text-center mt-2 sm:mt-0 sm:ml-2 rounded-md px-3.5 py-2.5 bg-gray-100 hover:bg-gray-50 inline-block font-medium" %>
<%= button_to "Destroy this party", @party, method: :delete, form_class: "sm:inline-block mt-2 sm:mt-0 sm:ml-2", class: "w-full 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>