Improve member views

This commit is contained in:
Andrew Tomaka 2025-06-10 23:20:42 -04:00
parent de63e27bac
commit 92b3cdbd8c
Signed by: atomaka
GPG key ID: 61209BF70A5B18BE
6 changed files with 439 additions and 57 deletions

View file

@ -1,9 +1,13 @@
<%= form_with(model: member, class: "contents") do |form| %> <%= form_with(model: member, class: "space-y-8") do |form| %>
<% if member.errors.any? %> <% if member.errors.any? %>
<div id="error_explanation" class="bg-red-50 text-red-500 px-3 py-2 font-medium rounded-lg mt-3"> <div id="error_explanation" class="bg-red-50 border border-red-200 text-red-600 px-4 py-3 rounded-lg">
<h2><%= pluralize(member.errors.count, "error") %> prohibited this member from being saved:</h2> <div class="flex items-center mb-2">
<svg class="w-5 h-5 mr-2" fill="currentColor" viewBox="0 0 20 20">
<ul> <path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7 4a1 1 0 11-2 0 1 1 0 012 0zm-1-9a1 1 0 00-1 1v4a1 1 0 102 0V6a1 1 0 00-1-1z" clip-rule="evenodd"/>
</svg>
<h3 class="text-sm font-medium"><%= pluralize(member.errors.count, "error") %> prohibited this member from being saved:</h3>
</div>
<ul class="list-disc list-inside text-sm space-y-1">
<% member.errors.each do |error| %> <% member.errors.each do |error| %>
<li><%= error.full_message %></li> <li><%= error.full_message %></li>
<% end %> <% end %>
@ -11,17 +15,52 @@
</div> </div>
<% end %> <% end %>
<div class="my-5"> <!-- Basic Information -->
<%= form.label :name %> <div class="bg-white rounded-lg shadow-sm border border-gray-200 p-6">
<%= form.text_field :name, class: "block shadow rounded-md border border-gray-200 outline-none px-3 py-2 mt-2 w-full" %> <h3 class="text-lg font-medium text-gray-900 mb-6">Basic Information</h3>
<div class="grid grid-cols-1 gap-6">
<div>
<%= form.label :name, class: "block text-sm font-medium text-gray-700 mb-2" %>
<%= form.text_field :name,
class: "block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 sm:text-sm",
placeholder: "Enter member name..." %>
</div>
</div>
</div> </div>
<div class="my-5"> <!-- Budget Settings -->
<%= form.label :pays %> <div class="bg-white rounded-lg shadow-sm border border-gray-200 p-6">
<%= form.check_box :pays, class: "block mt-2 h-5 w-5" %> <h3 class="text-lg font-medium text-gray-900 mb-6">Budget Role</h3>
<div class="flex items-center justify-between">
<div class="flex-1">
<%= form.label :pays, "Contributing Member", class: "block text-sm font-medium text-gray-700" %>
<p class="text-sm text-gray-500 mt-1">Whether this member contributes financially to the household budget</p>
</div>
<div class="ml-6">
<%= form.check_box :pays, class: "toggle-checkbox sr-only" %>
<label for="member_pays" class="toggle-label relative inline-flex h-6 w-11 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus-within:outline-none focus-within:ring-2 focus-within:ring-blue-500 focus-within:ring-offset-2 bg-gray-200">
<span class="toggle-switch pointer-events-none inline-block h-5 w-5 transform rounded-full bg-white shadow ring-0 transition duration-200 ease-in-out translate-x-0"></span>
</label>
</div>
</div>
</div> </div>
<div class="inline"> <!-- Form Actions -->
<%= form.submit class: "rounded-lg py-3 px-5 bg-blue-600 text-white inline-block font-medium cursor-pointer" %> <div class="flex justify-end space-x-3 pt-6 border-t border-gray-200">
<%= link_to members_path, class: "inline-flex items-center px-4 py-2 border border-gray-300 rounded-md shadow-sm text-sm font-medium text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500" do %>
Cancel
<% end %>
<%= form.submit class: "inline-flex items-center px-4 py-2 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 cursor-pointer" %>
</div> </div>
<style>
.toggle-checkbox:checked + .toggle-label {
background-color: #3B82F6;
}
.toggle-checkbox:checked + .toggle-label .toggle-switch {
transform: translateX(1.25rem);
}
</style>
<% end %> <% end %>

View file

@ -1,17 +1,48 @@
<div id="<%= dom_id member %>"> <div id="<%= dom_id member %>" class="bg-white rounded-lg shadow hover:shadow-md transition-shadow">
<p class="my-5"> <div class="p-6">
<strong class="block font-medium mb-1">Name:</strong> <div class="flex items-center justify-between mb-4">
<%= member.name %> <div class="flex items-center">
</p> <div class="h-12 w-12 rounded-full bg-gradient-to-r from-blue-500 to-purple-600 flex items-center justify-center">
<span class="text-white text-lg font-medium"><%= member.name.first.upcase %></span>
</div>
<div class="ml-4">
<h3 class="text-lg font-semibold text-gray-900"><%= member.name %></h3>
<p class="text-sm text-gray-500">Household Member</p>
</div>
</div>
<% if member.pays %>
<span class="inline-flex items-center px-3 py-1 rounded-full text-sm font-medium bg-green-100 text-green-800">
<svg class="w-4 h-4 mr-1" fill="currentColor" viewBox="0 0 20 20">
<path fill-rule="evenodd" d="M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z" clip-rule="evenodd"/>
</svg>
contributing
</span>
<% else %>
<span class="inline-flex items-center px-3 py-1 rounded-full text-sm font-medium bg-gray-100 text-gray-800">
<svg class="w-4 h-4 mr-1" fill="currentColor" viewBox="0 0 20 20">
<path fill-rule="evenodd" d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z" clip-rule="evenodd"/>
</svg>
non-contributing
</span>
<% end %>
</div>
<p class="my-5"> <% if action_name != "show" %>
<strong class="block font-medium mb-1">Pays:</strong> <div class="flex gap-2 pt-4 border-t border-gray-200">
<%= member.pays %> <%= link_to member, class: "flex-1 inline-flex items-center justify-center px-4 py-2 text-sm font-medium text-blue-600 bg-blue-50 hover:bg-blue-100 rounded-md transition-colors" do %>
</p> <svg class="w-4 h-4 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"/>
<% if action_name != "show" %> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"/>
<%= link_to "Show this member", member, class: "rounded-lg py-3 px-5 bg-gray-100 inline-block font-medium" %> </svg>
<%= link_to 'Edit this member', edit_member_path(member), class: "rounded-lg py-3 ml-2 px-5 bg-gray-100 inline-block font-medium" %> View
<hr class="mt-6"> <% end %>
<% end %> <%= link_to edit_member_path(member), class: "flex-1 inline-flex items-center justify-center px-4 py-2 text-sm font-medium text-indigo-600 bg-indigo-50 hover:bg-indigo-100 rounded-md transition-colors" do %>
<svg class="w-4 h-4 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"/>
</svg>
Edit
<% end %>
</div>
<% end %>
</div>
</div> </div>

View file

@ -1,8 +1,42 @@
<div class="mx-auto md:w-2/3 w-full"> <div class="w-full px-4 py-8">
<h1 class="font-bold text-4xl">Editing member</h1> <!-- Breadcrumb -->
<nav class="flex mb-6" aria-label="Breadcrumb">
<ol class="inline-flex items-center space-x-1 md:space-x-3">
<li class="inline-flex items-center">
<%= link_to members_path, class: "inline-flex items-center text-sm font-medium text-gray-700 hover:text-blue-600" do %>
<svg class="w-4 h-4 mr-2" fill="currentColor" viewBox="0 0 20 20">
<path d="M10.707 2.293a1 1 0 00-1.414 0l-7 7a1 1 0 001.414 1.414L4 10.414V17a1 1 0 001 1h2a1 1 0 001-1v-2a1 1 0 011-1h2a1 1 0 011 1v2a1 1 0 001 1h2a1 1 0 001-1v-6.586l.293.293a1 1 0 001.414-1.414l-7-7z"/>
</svg>
Members
<% end %>
</li>
<li>
<div class="flex items-center">
<svg class="w-6 h-6 text-gray-400" fill="currentColor" viewBox="0 0 20 20">
<path fill-rule="evenodd" d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z" clip-rule="evenodd"/>
</svg>
<%= link_to @member, class: "ml-1 text-sm font-medium text-gray-700 hover:text-blue-600 md:ml-2" do %>
<%= @member.name %>
<% end %>
</div>
</li>
<li>
<div class="flex items-center">
<svg class="w-6 h-6 text-gray-400" fill="currentColor" viewBox="0 0 20 20">
<path fill-rule="evenodd" d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z" clip-rule="evenodd"/>
</svg>
<span class="ml-1 text-sm font-medium text-gray-500 md:ml-2">Edit</span>
</div>
</li>
</ol>
</nav>
<%= render "form", member: @member %> <div class="max-w-4xl mx-auto">
<div class="mb-8">
<h1 class="font-bold text-3xl sm:text-4xl text-gray-900">Edit Member</h1>
<p class="mt-2 text-sm text-gray-600">Update the details for "<%= @member.name %>"</p>
</div>
<%= link_to "Show this member", @member, class: "ml-2 rounded-lg py-3 px-5 bg-gray-100 inline-block font-medium" %> <%= render "form", member: @member %>
<%= link_to "Back to members", members_path, class: "ml-2 rounded-lg py-3 px-5 bg-gray-100 inline-block font-medium" %> </div>
</div> </div>

View file

@ -1,14 +1,164 @@
<div class="w-full"> <div class="w-full px-4 py-8">
<% if notice.present? %> <% if notice.present? %>
<p class="py-2 px-3 bg-green-50 mb-5 text-green-500 font-medium rounded-lg inline-block" id="notice"><%= notice %></p> <div class="mb-6">
<p class="py-3 px-4 bg-green-50 text-green-800 font-medium rounded-lg inline-flex items-center" id="notice">
<svg class="w-5 h-5 mr-2" fill="currentColor" viewBox="0 0 20 20">
<path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z" clip-rule="evenodd"/>
</svg>
<%= notice %>
</p>
</div>
<% end %> <% end %>
<div class="flex justify-between items-center"> <div class="flex flex-col sm:flex-row sm:justify-between sm:items-center mb-8 gap-4">
<h1 class="font-bold text-4xl">Members</h1> <div>
<%= link_to 'New member', new_member_path, class: "rounded-lg py-3 px-5 bg-blue-600 text-white block font-medium" %> <h1 class="font-bold text-3xl sm:text-4xl text-gray-900">Members</h1>
<p class="mt-2 text-sm text-gray-600">Manage household members and their budget roles</p>
</div>
<%= link_to new_member_path, class: "rounded-lg py-2.5 px-4 sm:py-3 sm:px-5 bg-blue-600 hover:bg-blue-700 text-white font-medium transition-colors inline-flex items-center justify-center sm:justify-start" do %>
<svg class="w-5 h-5 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4v16m8-8H4"/>
</svg>
New member
<% end %>
</div> </div>
<div id="members" class="min-w-full"> <% if @members.any? %>
<%= render @members %> <!-- Summary Cards -->
</div> <div class="grid grid-cols-1 md:grid-cols-3 gap-6 mb-8">
<div class="bg-white rounded-lg shadow p-6">
<div class="flex items-center">
<div class="flex-shrink-0">
<svg class="h-8 w-8 text-blue-600" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4.354a4 4 0 110 5.292M15 21H3v-1a6 6 0 0112 0v1zm0 0h6v-1a6 6 0 00-9-5.197m13.5-9a2.5 2.5 0 11-5 0 2.5 2.5 0 015 0z"/>
</svg>
</div>
<div class="ml-4">
<p class="text-sm font-medium text-gray-500">Total Members</p>
<p class="text-2xl font-semibold text-gray-900"><%= @members.count %></p>
</div>
</div>
</div>
<div class="bg-white rounded-lg shadow p-6">
<div class="flex items-center">
<div class="flex-shrink-0">
<svg class="h-8 w-8 text-green-600" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"/>
</svg>
</div>
<div class="ml-4">
<p class="text-sm font-medium text-gray-500">Contributing</p>
<p class="text-2xl font-semibold text-gray-900"><%= @members.where(pays: true).count %></p>
</div>
</div>
</div>
<div class="bg-white rounded-lg shadow p-6">
<div class="flex items-center">
<div class="flex-shrink-0">
<svg class="h-8 w-8 text-gray-600" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M18.364 18.364A9 9 0 005.636 5.636m12.728 12.728L5.636 5.636m12.728 12.728L5.636 5.636"/>
</svg>
</div>
<div class="ml-4">
<p class="text-sm font-medium text-gray-500">Non-Contributing</p>
<p class="text-2xl font-semibold text-gray-900"><%= @members.where(pays: false).count %></p>
</div>
</div>
</div>
</div>
<!-- Desktop Table View -->
<div class="hidden lg:block overflow-x-auto bg-white rounded-lg shadow">
<table class="min-w-full">
<thead class="bg-gray-50 border-b border-gray-200">
<tr>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Member</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Role</th>
<th scope="col" class="px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider">Actions</th>
</tr>
</thead>
<tbody class="bg-white divide-y divide-gray-200">
<% @members.each do |member| %>
<tr class="hover:bg-gray-50 transition-colors">
<td class="px-6 py-4 whitespace-nowrap">
<div class="flex items-center">
<div class="h-10 w-10 rounded-full bg-gradient-to-r from-blue-500 to-purple-600 flex items-center justify-center">
<span class="text-white text-sm font-medium"><%= member.name.first.upcase %></span>
</div>
<div class="ml-4">
<div class="text-sm font-medium text-gray-900"><%= member.name %></div>
</div>
</div>
</td>
<td class="px-6 py-4 whitespace-nowrap">
<% if member.pays %>
<span class="inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-green-100 text-green-800">contributing</span>
<% else %>
<span class="inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-gray-100 text-gray-800">non-contributing</span>
<% end %>
</td>
<td class="px-6 py-4 whitespace-nowrap text-right text-sm font-medium">
<%= link_to "View", member, class: "text-blue-600 hover:text-blue-900 mr-3" %>
<%= link_to "Edit", edit_member_path(member), class: "text-indigo-600 hover:text-indigo-900" %>
</td>
</tr>
<% end %>
</tbody>
</table>
</div>
<!-- Mobile Card View -->
<div class="lg:hidden space-y-4">
<% @members.each do |member| %>
<div class="bg-white rounded-lg shadow p-4 hover:shadow-md transition-shadow">
<div class="flex justify-between items-start mb-3">
<div class="flex items-center">
<div class="h-12 w-12 rounded-full bg-gradient-to-r from-blue-500 to-purple-600 flex items-center justify-center">
<span class="text-white text-lg font-medium"><%= member.name.first.upcase %></span>
</div>
<div class="ml-3">
<h3 class="text-lg font-medium text-gray-900"><%= member.name %></h3>
<% if member.pays %>
<span class="inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-green-100 text-green-800">contributing</span>
<% else %>
<span class="inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-gray-100 text-gray-800">non-contributing</span>
<% end %>
</div>
</div>
<div class="flex gap-2">
<%= link_to member, class: "text-blue-600 hover:text-blue-800" do %>
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"/>
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"/>
</svg>
<% end %>
<%= link_to edit_member_path(member), class: "text-indigo-600 hover:text-indigo-800" do %>
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"/>
</svg>
<% end %>
</div>
</div>
</div>
<% end %>
</div>
<% else %>
<div class="text-center py-12 bg-white rounded-lg shadow">
<svg class="mx-auto h-12 w-12 text-gray-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4.354a4 4 0 110 5.292M15 21H3v-1a6 6 0 0112 0v1zm0 0h6v-1a6 6 0 00-9-5.197m13.5-9a2.5 2.5 0 11-5 0 2.5 2.5 0 015 0z"/>
</svg>
<h3 class="mt-2 text-sm font-medium text-gray-900">No members</h3>
<p class="mt-1 text-sm text-gray-500">Get started by adding your first household member.</p>
<div class="mt-6">
<%= link_to new_member_path, class: "inline-flex items-center px-4 py-2 border border-transparent shadow-sm text-sm font-medium rounded-md text-white bg-blue-600 hover:bg-blue-700" do %>
<svg class="w-5 h-5 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4v16m8-8H4"/>
</svg>
New member
<% end %>
</div>
</div>
<% end %>
</div> </div>

View file

@ -1,7 +1,32 @@
<div class="mx-auto md:w-2/3 w-full"> <div class="w-full px-4 py-8">
<h1 class="font-bold text-4xl">New member</h1> <!-- Breadcrumb -->
<nav class="flex mb-6" aria-label="Breadcrumb">
<ol class="inline-flex items-center space-x-1 md:space-x-3">
<li class="inline-flex items-center">
<%= link_to members_path, class: "inline-flex items-center text-sm font-medium text-gray-700 hover:text-blue-600" do %>
<svg class="w-4 h-4 mr-2" fill="currentColor" viewBox="0 0 20 20">
<path d="M10.707 2.293a1 1 0 00-1.414 0l-7 7a1 1 0 001.414 1.414L4 10.414V17a1 1 0 001 1h2a1 1 0 001-1v-2a1 1 0 011-1h2a1 1 0 011 1v2a1 1 0 001 1h2a1 1 0 001-1v-6.586l.293.293a1 1 0 001.414-1.414l-7-7z"/>
</svg>
Members
<% end %>
</li>
<li>
<div class="flex items-center">
<svg class="w-6 h-6 text-gray-400" fill="currentColor" viewBox="0 0 20 20">
<path fill-rule="evenodd" d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z" clip-rule="evenodd"/>
</svg>
<span class="ml-1 text-sm font-medium text-gray-500 md:ml-2">New Member</span>
</div>
</li>
</ol>
</nav>
<%= render "form", member: @member %> <div class="max-w-4xl mx-auto">
<div class="mb-8">
<h1 class="font-bold text-3xl sm:text-4xl text-gray-900">New Member</h1>
<p class="mt-2 text-sm text-gray-600">Add a new household member and set their budget role</p>
</div>
<%= link_to 'Back to members', members_path, class: "ml-2 rounded-lg py-3 px-5 bg-gray-100 inline-block font-medium" %> <%= render "form", member: @member %>
</div>
</div> </div>

View file

@ -1,15 +1,118 @@
<div class="mx-auto md:w-2/3 w-full flex"> <div class="w-full px-4 py-8">
<div class="mx-auto"> <% if notice.present? %>
<% if notice.present? %> <div class="mb-6">
<p class="py-2 px-3 bg-green-50 mb-5 text-green-500 font-medium rounded-lg inline-block" id="notice"><%= notice %></p> <p class="py-3 px-4 bg-green-50 text-green-800 font-medium rounded-lg inline-flex items-center" id="notice">
<% end %> <svg class="w-5 h-5 mr-2" fill="currentColor" viewBox="0 0 20 20">
<path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z" clip-rule="evenodd"/>
<%= render @member %> </svg>
<%= notice %>
<%= link_to 'Edit this member', edit_member_path(@member), class: "mt-2 rounded-lg py-3 px-5 bg-gray-100 inline-block font-medium" %> </p>
<div class="inline-block ml-2"> </div>
<%= button_to 'Destroy this member', member_path(@member), method: :delete, class: "mt-2 rounded-lg py-3 px-5 bg-gray-100 font-medium" %> <% end %>
<!-- Breadcrumb -->
<nav class="flex mb-6" aria-label="Breadcrumb">
<ol class="inline-flex items-center space-x-1 md:space-x-3">
<li class="inline-flex items-center">
<%= link_to members_path, class: "inline-flex items-center text-sm font-medium text-gray-700 hover:text-blue-600" do %>
<svg class="w-4 h-4 mr-2" fill="currentColor" viewBox="0 0 20 20">
<path d="M10.707 2.293a1 1 0 00-1.414 0l-7 7a1 1 0 001.414 1.414L4 10.414V17a1 1 0 001 1h2a1 1 0 001-1v-2a1 1 0 011-1h2a1 1 0 011 1v2a1 1 0 001 1h2a1 1 0 001-1v-6.586l.293.293a1 1 0 001.414-1.414l-7-7z"/>
</svg>
Members
<% end %>
</li>
<li>
<div class="flex items-center">
<svg class="w-6 h-6 text-gray-400" fill="currentColor" viewBox="0 0 20 20">
<path fill-rule="evenodd" d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z" clip-rule="evenodd"/>
</svg>
<span class="ml-1 text-sm font-medium text-gray-500 md:ml-2"><%= @member.name %></span>
</div>
</li>
</ol>
</nav>
<div class="max-w-4xl mx-auto">
<div class="mb-8">
<div class="flex justify-between items-start mb-4">
<div>
<h1 class="font-bold text-3xl sm:text-4xl text-gray-900"><%= @member.name %></h1>
<p class="mt-2 text-sm text-gray-600">Household member details and budget role</p>
</div>
<% if @member.pays %>
<span class="inline-flex items-center px-3 py-1 rounded-full text-sm font-medium bg-green-100 text-green-800">
<svg class="w-4 h-4 mr-1" fill="currentColor" viewBox="0 0 20 20">
<path fill-rule="evenodd" d="M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z" clip-rule="evenodd"/>
</svg>
contributing
</span>
<% else %>
<span class="inline-flex items-center px-3 py-1 rounded-full text-sm font-medium bg-gray-100 text-gray-800">
<svg class="w-4 h-4 mr-1" fill="currentColor" viewBox="0 0 20 20">
<path fill-rule="evenodd" d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z" clip-rule="evenodd"/>
</svg>
non-contributing
</span>
<% end %>
</div>
</div>
<!-- Member Details Card -->
<div class="bg-white rounded-lg shadow-lg overflow-hidden mb-8">
<div class="px-6 py-8">
<div class="flex items-center justify-center">
<div class="text-center">
<div class="h-24 w-24 mx-auto rounded-full bg-gradient-to-r from-blue-500 to-purple-600 flex items-center justify-center mb-4">
<span class="text-white text-3xl font-medium"><%= @member.name.first.upcase %></span>
</div>
<h3 class="text-2xl font-semibold text-gray-900 mb-2"><%= @member.name %></h3>
<p class="text-gray-600 mb-4">Household Member</p>
<div class="inline-flex items-center">
<% if @member.pays %>
<div class="flex items-center text-green-600">
<svg class="w-5 h-5 mr-2" fill="currentColor" viewBox="0 0 20 20">
<path fill-rule="evenodd" d="M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z" clip-rule="evenodd"/>
</svg>
<span class="font-medium">Contributing to budget</span>
</div>
<% else %>
<div class="flex items-center text-gray-600">
<svg class="w-5 h-5 mr-2" fill="currentColor" viewBox="0 0 20 20">
<path fill-rule="evenodd" d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z" clip-rule="evenodd"/>
</svg>
<span class="font-medium">Not contributing to budget</span>
</div>
<% end %>
</div>
</div>
</div>
</div>
</div>
<!-- Actions -->
<div class="flex flex-wrap gap-3">
<%= link_to edit_member_path(@member), class: "inline-flex items-center px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white font-medium rounded-lg transition-colors" do %>
<svg class="w-5 h-5 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"/>
</svg>
Edit Member
<% end %>
<%= button_to member_path(@member), method: :delete,
class: "inline-flex items-center px-4 py-2 bg-red-600 hover:bg-red-700 text-white font-medium rounded-lg transition-colors",
confirm: "Are you sure you want to delete this member?" do %>
<svg class="w-5 h-5 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"/>
</svg>
Delete
<% end %>
<%= link_to members_path, class: "inline-flex items-center px-4 py-2 bg-gray-100 hover:bg-gray-200 text-gray-700 font-medium rounded-lg transition-colors" do %>
<svg class="w-5 h-5 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 19l-7-7m0 0l7-7m-7 7h18"/>
</svg>
Back to Members
<% end %>
</div> </div>
<%= link_to 'Back to members', members_path, class: "ml-2 rounded-lg py-3 px-5 bg-gray-100 inline-block font-medium" %>
</div> </div>
</div> </div>