-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
30a4206
commit 735069f
Showing
27 changed files
with
828 additions
and
516 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 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,67 @@ | ||
defmodule AtomicWeb.Config do | ||
@moduledoc """ | ||
Web configuration for our pages. | ||
""" | ||
alias AtomicWeb.Router.Helpers, as: Routes | ||
|
||
def pages(conn) do | ||
[ | ||
%{ | ||
key: :activities, | ||
title: "Home", | ||
icon: :home, | ||
url: Routes.activity_index_path(conn, :index), | ||
tabs: [] | ||
}, | ||
%{ | ||
key: :calendar, | ||
title: "Calendar", | ||
icon: :calendar, | ||
url: "", | ||
tabs: [] | ||
}, | ||
%{ | ||
key: :departments, | ||
title: "Departments", | ||
icon: :cube, | ||
url: Routes.department_index_path(conn, :index, :org), | ||
tabs: [] | ||
}, | ||
%{ | ||
key: :instructors, | ||
title: "Activities", | ||
icon: :academic_cap, | ||
url: Routes.activity_index_path(conn, :index), | ||
tabs: [] | ||
}, | ||
%{ | ||
key: :partners, | ||
title: "Partners", | ||
icon: :user_group, | ||
url: Routes.partner_index_path(conn, :index), | ||
tabs: [] | ||
}, | ||
%{ | ||
key: :memberships, | ||
title: "Memberships", | ||
icon: :user_add, | ||
url: Routes.membership_index_path(conn, :index, :org), | ||
tabs: [] | ||
}, | ||
%{ | ||
key: :board, | ||
title: "Board", | ||
icon: :users, | ||
url: Routes.board_index_path(conn, :index, :org), | ||
tabs: [] | ||
}, | ||
%{ | ||
key: :scanner, | ||
title: "Scanner", | ||
icon: :qrcode, | ||
url: Routes.scanner_index_path(conn, :index), | ||
tabs: [] | ||
} | ||
] | ||
end | ||
end |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,92 @@ | ||
<h1>Listing Activities</h1> | ||
<div class="inline-block min-w-full align-middle"> | ||
<div x-data="{ view: 'list' }"> | ||
<div class="bg-white"> | ||
<div class="pt-4 px-4"> | ||
<div class="flex items-center justify-between"> | ||
<div class="min-w-0 flex-1"> | ||
<h2 class="text-xl font-bold leading-7 text-zinc-900 sm:truncate sm:text-4xl"> | ||
<%= gettext("Activities") %> | ||
</h2> | ||
</div> | ||
</div> | ||
<div class="flex flex-col-reverse border-b border-zinc-200 xl:flex-row"> | ||
<div class="flex w-full items-center justify-between"> | ||
<nav class="-mb-px flex flex-1 space-x-6 overflow-x-auto xl:space-x-8" aria-label="Tabs"> | ||
<div x-on:click="open = ! open" x-bind:class="! open ? 'border-transparent' : 'border-zinc-800'" phx-click="open-enrollments" class="text-zinc-500 hover:text-zinc-700 whitespace-nowrap border-b-2 px-1 py-4 text-sm font-medium"> | ||
<%= gettext("Open Enrollments") %> | ||
</div> | ||
|
||
<table> | ||
<thead> | ||
<tr> | ||
<th>Title</th> | ||
<th>Date</th> | ||
<th>Location</th> | ||
<th>Minimum entries</th> | ||
<th>Maximum entries</th> | ||
<div x-on:click="open = ! open" x-bind:class="! open ? 'border-zinc-800' : 'border-transparent'" phx-click="activities-enrolled" class="text-zinc-500 hover:text-zinc-700 whitespace-nowrap border-b-2 px-1 py-4 text-sm font-medium"> | ||
<%= gettext("Activities Enrolled") %> | ||
</div> | ||
</nav> | ||
<div class="hidden lg:block"> | ||
<%= live_patch("New", to: Routes.activity_new_path(@socket, :new), class: "rounded-md bg-orange-500 py-2 px-3.5 text-sm font-medium text-white shadow-sm hover:bg-orange-600 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600") %> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<th></th> | ||
</tr> | ||
</thead> | ||
<tbody id="activities"> | ||
<%= for activity <- @activities do %> | ||
<tr id={"activity-#{activity.id}"}> | ||
<td><%= activity.title %></td> | ||
<td><%= hd(activity.activity_sessions).start %></td> | ||
<td><%= hd(activity.activity_sessions).location.name %></td> | ||
<td><%= activity.minimum_entries %></td> | ||
<td><%= activity.maximum_entries %></td> | ||
|
||
<td> | ||
<span><%= live_redirect("Show", to: Routes.activity_show_path(@socket, :show, activity)) %></span> | ||
</td> | ||
</tr> | ||
<% end %> | ||
</tbody> | ||
</table> | ||
|
||
<span><%= live_patch("New Activity", to: Routes.activity_new_path(@socket, :new)) %></span> | ||
<div> | ||
<div class="overflow-hidden bg-white"> | ||
<ul role="list" class="divide-y divide-zinc-200"> | ||
<%= for activity <- @activities do %> | ||
<li> | ||
<%= live_redirect to: Routes.activity_show_path(@socket, :show, activity), class: "block hover:bg-zinc-50", replace: false do %> | ||
<div class="px-4 py-4 lg:px-6"> | ||
<div class="flex items-center justify-between"> | ||
<p class="truncate text-sm font-medium text-zinc-900"> | ||
<%= activity.title %> | ||
</p> | ||
</div> | ||
<div class="mt-2 lg:flex lg:justify-between"> | ||
<div class="lg:flex lg:space-x-3"> | ||
<p class="mt-2 flex items-center text-sm text-zinc-500 lg:mt-0"> | ||
<Heroicons.Solid.users class="flex-shrink-0 mr-1.5 w-5 h-5 text-zinc-400" /> | ||
<%= Enum.count(activity.enrollments) %> / <%= activity.maximum_entries %> | ||
</p> | ||
<p class="mt-2 flex items-center text-sm text-zinc-500 lg:mt-0"> | ||
<Heroicons.Solid.calendar class="flex-shrink-0 mr-1.5 w-5 h-5 text-zinc-400" /> | ||
<%= if hd(activity.activity_sessions) do %> | ||
<%= display_date(hd(activity.activity_sessions).start) %> | ||
<% end %> | ||
</p> | ||
<%= if not is_nil(hd(activity.activity_sessions).location) do %> | ||
<p class="mt-2 flex items-center text-sm text-zinc-500 lg:mt-0"> | ||
<Heroicons.Solid.location_marker class="flex-shrink-0 mr-1.5 w-5 h-5 text-zinc-400" /> | ||
<%= if hd(activity.activity_sessions).location do %> | ||
<%= hd(activity.activity_sessions).location && hd(activity.activity_sessions).location.name %> | ||
<% end %> | ||
</p> | ||
<% end %> | ||
</div> | ||
</div> | ||
<div class="flex flex-col-reverse lg:flex-row-reverse lg:items-center lg:justify-between"> | ||
<div class="mt-2 flex items-center text-sm text-zinc-500 lg:mt-0"> | ||
<Heroicons.Solid.bell class="flex-shrink-0 mr-1.5 w-5 h-5 text-zinc-400" /> Closing | ||
</div> | ||
<div class="flex flex-row space-x-2"> | ||
<%= for speaker <- activity.speakers do %> | ||
<div class="mt-2 flex items-center"> | ||
<span class="inline-flex justify-center items-center mr-1.5 w-6 h-6 bg-zinc-500 rounded-full"> | ||
<span class="text-xs font-medium leading-none text-white"> | ||
<%= extract_initials(speaker.name) %> | ||
</span> | ||
</span> | ||
<p class="text-sm text-zinc-500"> | ||
<%= extract_first_last_name(speaker.name) %> | ||
</p> | ||
</div> | ||
<% end %> | ||
</div> | ||
</div> | ||
</div> | ||
<% end %> | ||
</li> | ||
<% end %> | ||
</ul> | ||
</div> | ||
</div> | ||
</div> | ||
</div> |
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
Oops, something went wrong.