62 lines
2.8 KiB
ERB
62 lines
2.8 KiB
ERB
<% content_for :title, t("tournaments.index.title", name: @club.name) %>
|
||
<% content_for :robots, "noindex, nofollow" %>
|
||
|
||
<div class="wrap wrap--portal tournament-hub" style="padding-top:20px">
|
||
<nav class="team-dashboard-nav">
|
||
<%= link_to "← #{@club.name}", public_club_path(@club), class: "team-dashboard-nav__club" %>
|
||
</nav>
|
||
|
||
<header style="margin:16px 0 20px;display:flex;flex-wrap:wrap;gap:12px;align-items:flex-start;justify-content:space-between">
|
||
<div>
|
||
<h1><%= t("tournaments.index.heading") %></h1>
|
||
<p style="color:#888;margin:8px 0 0"><%= t("tournaments.index.lead") %></p>
|
||
</div>
|
||
<% if @can_create %>
|
||
<%= link_to t("tournaments.index.new"), public_new_club_tournament_path(@club), class: "btn btn-primary" %>
|
||
<% end %>
|
||
</header>
|
||
|
||
<% unless @can_create %>
|
||
<div class="flash alert"><%= t("tournaments.index.upgrade") %> <%= link_to t("club.dashboard.subscription"), public_club_billing_path(@club) %></div>
|
||
<% end %>
|
||
|
||
<div class="card">
|
||
<% if @tournaments.any? %>
|
||
<div class="tournament-table-wrap">
|
||
<table class="data">
|
||
<thead>
|
||
<tr>
|
||
<th><%= t("tournaments.index.col_name") %></th>
|
||
<th><%= t("tournaments.index.col_dates") %></th>
|
||
<th><%= t("tournaments.index.col_status") %></th>
|
||
<th></th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<% @tournaments.each do |tournament| %>
|
||
<tr>
|
||
<td><strong><%= tournament.name %></strong></td>
|
||
<td><%= l(tournament.starts_on) %> – <%= l(tournament.ends_on) %></td>
|
||
<td><%= t("tournaments.status.#{tournament.status}") %></td>
|
||
<td>
|
||
<div class="tournament-index-actions">
|
||
<%= link_to t("tournaments.index.open"), public_tournament_path(tournament), class: "btn btn-secondary", style: "padding:8px 14px;font-size:0.9rem" %>
|
||
<% if tournament.published? %>
|
||
<%= link_to t("tournaments.hub.public_page"), public_tournament_page_path(tournament.slug), class: "btn btn-secondary", style: "padding:8px 14px;font-size:0.9rem", target: "_blank", rel: "noopener" %>
|
||
<% end %>
|
||
<%= button_to t("tournaments.index.delete"), public_tournament_path(tournament), method: :delete,
|
||
class: "btn btn-secondary", style: "padding:8px 14px;font-size:0.9rem",
|
||
form: { data: { turbo_confirm: t("tournaments.hub.delete_confirm", name: tournament.name), confirm_kind: "delete" } } %>
|
||
</div>
|
||
</td>
|
||
</tr>
|
||
<% end %>
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
<% else %>
|
||
<p style="color:#888;margin:0"><%= t("tournaments.index.empty") %></p>
|
||
<% end %>
|
||
</div>
|
||
</div>
|