-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: show transit leg summary for short legs (#2057)
- Loading branch information
1 parent
dfba849
commit fdbeba2
Showing
14 changed files
with
236 additions
and
329 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
56 changes: 0 additions & 56 deletions
56
lib/dotcom_web/templates/schedule/_stop_list_expand_link.html.eex
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<div class="leg-summary"> | ||
<div><%= icon_for_route(@route) %></div> | ||
<div> | ||
<strong class="pe-8"> | ||
Ride the <%= @branch_display %> | ||
</strong> | ||
<%= "(#{@intermediate_stop_count} #{Inflex.inflect("Stop", @intermediate_stop_count)}, #{display_seconds_as_minutes(@itinerary_row.duration)} min)" %> | ||
<%= if @itinerary_row.trip do %> | ||
<div class="fs-14"> | ||
<%= Routes.Route.direction_name(@route, @itinerary_row.trip.direction_id) %> | ||
<%= if @itinerary_row.trip.headsign && @itinerary_row.trip.headsign != "" do %> | ||
towards <%= @itinerary_row.trip.headsign %> | ||
<% end %> | ||
</div> | ||
<% end %> | ||
<div class="expand-show-details"> | ||
<span class="expand-show-details--hide">Hide</span> | ||
<span class="expand-show-details--show">Show</span> | ||
Details | ||
<%= if Map.get(assigns, :alerts?, false) do %> | ||
<span class="itinerary-has-alerts-icon"> | ||
<%= fa "exclamation-triangle" %> | ||
</span> | ||
<% end %> | ||
</div> | ||
</div> | ||
</div> |
24 changes: 24 additions & 0 deletions
24
lib/dotcom_web/templates/trip_plan/_stop_list_expand_link.html.eex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<div class="route-branch-stop<%= if @expanded, do: " expanded", else: "" %>"> | ||
<%= | ||
stop_branch = assigns[:stop] && @stop.branch | ||
assigns | ||
|> Map.put(:bubbles, Enum.map(@bubbles, fn {branch, _} -> {branch, :line} end)) | ||
|> DotcomWeb.ScheduleView.StopList.stop_bubble_row_params(false) | ||
|> DotcomWeb.PartialView.StopBubbles.render_stop_bubbles(true, stop_branch) | ||
%> | ||
<div class="route-branch-stop-info"> | ||
<%= if @intermediate_stop_count > 1 do %> | ||
<%= link(to: update_url(assigns.conn, expanded: (if @expanded, do: nil, else: @branch_name)), | ||
class: "toggle-detail-list", | ||
aria: [expanded: if(@expanded, do: "true", else: "false")], | ||
data: [toggle: "collapse", target: "##{@target_id}"]) do %> | ||
<div class="leg-summary-container"> | ||
<%= render("_leg_summary.html", assigns) %> | ||
<span class="c-expandable-block-caret"></span> | ||
</div> | ||
<% end %> | ||
<% else %> | ||
<%= render("_leg_summary.html", assigns) %> | ||
<% end %> | ||
</div> | ||
</div> |
Oops, something went wrong.