Show grouped reciprocal QSOs on main listing, not just search

This commit is contained in:
Graham McIntire 2026-04-01 10:43:41 -05:00
parent 341a04190a
commit b9aac6f688
No known key found for this signature in database
GPG key ID: F4ABF488E6029E59

View file

@ -95,7 +95,6 @@ defmodule MicrowavepropWeb.QsoLive.Index do
</div> </div>
</form> </form>
<%= if @search != "" do %>
<table class="table table-sm w-full"> <table class="table table-sm w-full">
<thead> <thead>
<tr> <tr>
@ -107,14 +106,14 @@ defmodule MicrowavepropWeb.QsoLive.Index do
<th>Band</th> <th>Band</th>
<th>Mode</th> <th>Mode</th>
<th>Distance (km)</th> <th>Distance (km)</th>
<th>Submitted</th>
<th>Timestamp</th> <th>Timestamp</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<%= for {primary, reciprocals} <- @grouped_qsos do %> <%= for {primary, reciprocals} <- @grouped_qsos do %>
<%!-- Spacer row between groups --%> <tr class="h-1">
<tr class="h-2"> <td colspan="10"></td>
<td colspan="9"></td>
</tr> </tr>
<tr <tr
class={[ class={[
@ -139,6 +138,7 @@ defmodule MicrowavepropWeb.QsoLive.Index do
<td>{primary.band}</td> <td>{primary.band}</td>
<td>{primary.mode}</td> <td>{primary.mode}</td>
<td>{primary.distance_km}</td> <td>{primary.distance_km}</td>
<td>{if primary.user_submitted, do: "Yes", else: ""}</td>
<td>{Calendar.strftime(primary.qso_timestamp, "%Y-%m-%d %H:%M")}</td> <td>{Calendar.strftime(primary.qso_timestamp, "%Y-%m-%d %H:%M")}</td>
</tr> </tr>
<%= for recip <- reciprocals do %> <%= for recip <- reciprocals do %>
@ -154,34 +154,13 @@ defmodule MicrowavepropWeb.QsoLive.Index do
<td>{recip.band}</td> <td>{recip.band}</td>
<td>{recip.mode}</td> <td>{recip.mode}</td>
<td>{recip.distance_km}</td> <td>{recip.distance_km}</td>
<td>{if recip.user_submitted, do: "Yes", else: ""}</td>
<td>{Calendar.strftime(recip.qso_timestamp, "%Y-%m-%d %H:%M")}</td> <td>{Calendar.strftime(recip.qso_timestamp, "%Y-%m-%d %H:%M")}</td>
</tr> </tr>
<% end %> <% end %>
<% end %> <% end %>
</tbody> </tbody>
</table> </table>
<% else %>
<.table
id="qsos"
rows={@qsos}
row_id={fn qso -> "qso-#{qso.id}" end}
row_click={fn qso -> JS.navigate(~p"/qsos/#{qso.id}") end}
sort_by={@sort_by}
sort_order={@sort_order}
>
<:col :let={qso} label="Station 1" sort_field="station1">{qso.station1}</:col>
<:col :let={qso} label="Grid 1">{qso.grid1 || ""}</:col>
<:col :let={qso} label="Station 2" sort_field="station2">{qso.station2}</:col>
<:col :let={qso} label="Grid 2">{qso.grid2 || ""}</:col>
<:col :let={qso} label="Band" sort_field="band">{qso.band}</:col>
<:col :let={qso} label="Mode" sort_field="mode">{qso.mode}</:col>
<:col :let={qso} label="Distance (km)" sort_field="distance_km">{qso.distance_km}</:col>
<:col :let={qso} label="Submitted">{if qso.user_submitted, do: "Yes", else: ""}</:col>
<:col :let={qso} label="Timestamp" sort_field="qso_timestamp">
{Calendar.strftime(qso.qso_timestamp, "%Y-%m-%d %H:%M")}
</:col>
</.table>
<% end %>
<div class="flex items-center justify-between pt-4"> <div class="flex items-center justify-between pt-4">
<.link <.link