- added parties
- changed layout for index and added svgs
This commit is contained in:
@ -7,23 +7,48 @@
|
||||
|
||||
<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>
|
||||
<%= link_to new_party_path, class: "rounded-md px-3 py-2 bg-slate-800 hover:bg-green-500 text-white block font-medium" do %>
|
||||
<svg class="h-6 w-6 " fill="currentColor" clip-rule="evenodd" fill-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="m11 11h-7.25c-.414 0-.75.336-.75.75s.336.75.75.75h7.25v7.25c0 .414.336.75.75.75s.75-.336.75-.75v-7.25h7.25c.414 0 .75-.336.75-.75s-.336-.75-.75-.75h-7.25v-7.25c0-.414-.336-.75-.75-.75s-.75.336-.75.75z" fill-rule="nonzero"/></svg>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div id="parties" class="mt-10 min-w-full divide-y divide-gray-200 space-y-5">
|
||||
<% @parties.each do |party| %>
|
||||
<div class="py-2 flex items-center justify-between hover:bg-gray-50">
|
||||
<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>
|
||||
</p>
|
||||
<p class="text-gray-600 text-sm">
|
||||
<%= truncate(party.location, length: 100) %>,
|
||||
<%= party.start_date.strftime("%d.%m.%Y") %>
|
||||
um <%= party.start_time.strftime("%H:%M") %>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="flex space-x-3">
|
||||
<%= link_to edit_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 %>
|
||||
|
||||
<%= link_to edit_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" clip-rule="evenodd" fill-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="m11.239 15.533c-1.045 3.004-1.238 3.451-1.238 3.84 0 .441.385.627.627.627.272 0 1.108-.301 3.829-1.249zm.888-.888 3.22 3.22 6.408-6.401c.163-.163.245-.376.245-.591 0-.213-.082-.427-.245-.591-.58-.579-1.458-1.457-2.039-2.036-.163-.163-.377-.245-.591-.245-.213 0-.428.082-.592.245zm-3.127-.895c0-.402-.356-.75-.75-.75-2.561 0-2.939 0-5.5 0-.394 0-.75.348-.75.75s.356.75.75.75h5.5c.394 0 .75-.348.75-.75zm5-3c0-.402-.356-.75-.75-.75-2.561 0-7.939 0-10.5 0-.394 0-.75.348-.75.75s.356.75.75.75h10.5c.394 0 .75-.348.75-.75zm0-3c0-.402-.356-.75-.75-.75-2.561 0-7.939 0-10.5 0-.394 0-.75.348-.75.75s.356.75.75.75h10.5c.394 0 .75-.348.75-.75zm0-3c0-.402-.356-.75-.75-.75-2.561 0-7.939 0-10.5 0-.394 0-.75.348-.75.75s.356.75.75.75h10.5c.394 0 .75-.348.75-.75z" fill-rule="nonzero"/></svg>
|
||||
<% end %>
|
||||
|
||||
<%= button_to party_path(party),
|
||||
method: :delete,
|
||||
data: { confirm: "Löschen?" },
|
||||
class: "hover:bg-red-400 hover:text-white font-medium rounded border px-2 py-1" do %>
|
||||
<svg class="h-6 w-6 " fill="currentColor" clip-rule="evenodd" fill-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="m4.015 5.494h-.253c-.413 0-.747-.335-.747-.747s.334-.747.747-.747h5.253v-1c0-.535.474-1 1-1h4c.526 0 1 .465 1 1v1h5.254c.412 0 .746.335.746.747s-.334.747-.746.747h-.254v15.435c0 .591-.448 1.071-1 1.071-2.873 0-11.127 0-14 0-.552 0-1-.48-1-1.071zm14.5 0h-13v15.006h13zm-4.25 2.506c-.414 0-.75.336-.75.75v8.5c0 .414.336.75.75.75s.75-.336.75-.75v-8.5c0-.414-.336-.75-.75-.75zm-4.5 0c-.414 0-.75.336-.75.75v8.5c0 .414.336.75.75.75s.75-.336.75-.75v-8.5c0-.414-.336-.75-.75-.75zm3.75-4v-.5h-3v.5z" fill-rule="nonzero"/></svg>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user