Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add: Itinerary page #251

Merged
merged 5 commits into from
Nov 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions lib/bike_brigade_web/components/layouts.ex
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,16 @@ defmodule BikeBrigadeWeb.Layouts do
</:icon>
My Profile
</.sidebar_link>
<!-- Rider Specific links -->
<div :if={!@is_dispatcher}>
<.sidebar_link selected={@current_page == :itinerary} href={~p"/itinerary"}>
<:icon>
<Heroicons.calendar_days solid />
</:icon>
Itinerary
</.sidebar_link>
</div>

<.sidebar_link selected={@current_page == :logout} href={~p"/logout"} method="post">
<:icon>
<Heroicons.arrow_left_on_rectangle solid />
Expand Down
6 changes: 2 additions & 4 deletions lib/bike_brigade_web/live/itinerary_live/index.html.heex
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<nav
class="flex items-end justify-between px-4 py-3 mb-1 border-b-2 border-gray-200"
class="flex items-end justify-between px-4 py-3 border-b-2 border-gray-200 mb-4"
aria-label="Pagination"
>
<div class="items-center block font-medium xl:flex">
Expand Down Expand Up @@ -45,8 +45,7 @@
</div>
</nav>
<%= if @campaign_riders != [] do %>
<%= for cr <- @campaign_riders do %>
<div class="flex w-full bg-white shadow sm:my-1 sm:rounded-md">
<div :for={cr <- @campaign_riders} class="flex w-full bg-white shadow mb-2 md:mb-4 sm:rounded-md">
<ul role="list" class="w-full divide-y divide-gray-200">
<li id={"campaign-#{cr.campaign.id}"}>
<div class="px-4 py-4">
Expand Down Expand Up @@ -95,7 +94,6 @@
</li>
</ul>
</div>
<% end %>
<% else %>
<div class="py-4 pl-4">No campaigns found for this day.</div>
<% end %>
3 changes: 1 addition & 2 deletions lib/bike_brigade_web/router.ex
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ defmodule BikeBrigadeWeb.Router do
get "/", Plugs.RedirectUser,
unauthenticated: [to: "/login"],
dispatcher: [to: "/campaigns"],
default: [to: "/profile"]
default: [to: "/itinerary"]
end

scope "/", BikeBrigadeWeb do
Expand All @@ -106,7 +106,6 @@ defmodule BikeBrigadeWeb.Router do
end

post "/logout", Authentication, :logout

end

scope "/", BikeBrigadeWeb do
Expand Down
Loading