feat(players): add player profile and schedule views

Implement player-facing views for profile analytics and tournament scheduling.

Changes:
- Add player profile page with partnership statistics
- Add player schedule page with upcoming matches
- Update rankings page to link to player profiles
- Add partnership tracking display in profile
- Include recent games timeline in profile

Note: Schedule view shows upcoming matches and tournament participation
This commit is contained in:
2026-03-27 12:25:14 -07:00
parent e7ddd0f72f
commit 841caa50fa
4 changed files with 387 additions and 0 deletions
+90
View File
@@ -0,0 +1,90 @@
<h1><%= player.name %>'s Schedule</h1>
<div class="schedule-container">
<!-- Upcoming Matches Section -->
<section class="upcoming-matches">
<h2>Upcoming Matches</h2>
<% if upcoming_matches.any? %>
<div class="matches-list">
<% upcoming_matches.each do |match| %>
<div class="match-card">
<div class="match-date">
<%= match[:date]&.strftime('%a, %b %d') || 'TBD' %>
<%= match[:date]&.strftime('%I:%M %p') %>
</div>
<div class="match-details">
<div class="teams">
<div class="team your-team">
<%= match[:player_team].map { |p| p[:name] }.join(' + ') %>
</div>
<div class="vs">vs</div>
<div class="team opponent-team">
<%= match[:opponent_team].map { |p| p[:name] }.join(' + ') %>
</div>
</div>
</div>
<div class="match-actions">
<a href="/admin/matches/<%= match[:id] %>/edit" class="btn btn-small">Record Result</a>
</div>
</div>
<% end %>
</div>
<% else %>
<p class="no-matches">No upcoming matches scheduled.</p>
<% end %>
</section>
<!-- Active Tournaments Section -->
<section class="active-tournaments">
<h2>Active Tournaments</h2>
<% if active_tournaments.any? %>
<div class="tournaments-list">
<% active_tournaments.each do |tournament| %>
<div class="tournament-card">
<div class="tournament-info">
<h3><%= tournament[:name] %></h3>
<p class="tournament-format"><%= tournament[:format].capitalize %> Tournament</p>
</div>
<div class="tournament-status">
<span class="status-badge <%= tournament[:status] %>"><%= tournament[:status].capitalize %></span>
</div>
<div class="tournament-actions">
<a href="/admin/tournaments/<%= tournament[:id] %>" class="btn btn-small">View Details</a>
</div>
</div>
<% end %>
</div>
<% else %>
<p class="no-tournaments">No active tournaments.</p>
<% end %>
</section>
<!-- Tournament Schedule Section -->
<section class="tournament-schedule">
<h2>Tournament Schedule</h2>
<% if tournament_schedule.any? %>
<div class="schedule-by-tournament">
<% tournament_schedule.each do |schedule| %>
<div class="tournament-schedule-item">
<h3><%= schedule[:tournament][:name] %></h3>
<div class="rounds">
<% schedule[:rounds].each do |round| %>
<div class="round">
<span class="round-number">Round <%= round[:round_number] %></span>
<span class="round-status"><%= round[:status] %></span>
</div>
<% end %>
</div>
</div>
<% end %>
</div>
<% else %>
<p class="no-schedule">No tournament schedule available.</p>
<% end %>
</section>
</div>
<p><a href="/players/<%= player.id %>/profile">Back to Profile</a></p>