-
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
Showing
9 changed files
with
162 additions
and
44 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
55 changes: 55 additions & 0 deletions
55
lib/atomic_web/live/organization_live/components/membership_banner.ex
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,55 @@ | ||
defmodule AtomicWeb.OrganizationLive.Components.MembershipBanner do | ||
@moduledoc """ | ||
Organization membership banner component. Displays information about the organization's membership benefits and price. | ||
""" | ||
use AtomicWeb, :component | ||
|
||
alias Atomic.Organizations.Organization | ||
|
||
attr :organization, Organization, | ||
required: true, | ||
doc: "the organization which membership banner to display" | ||
|
||
def membership_banner(assigns) do | ||
~H""" | ||
<div class="mx-auto rounded-3xl ring-1 ring-gray-200 lg:mx-0 lg:flex lg:max-w-none"> | ||
<div class="p-8 sm:p-10"> | ||
<h3 class="text-2xl font-bold tracking-tight text-gray-900"><%= gettext("Lifetime membership") %></h3> | ||
<div class="mt-10 flex items-center gap-x-4"> | ||
<h4 class="flex-none text-sm font-semibold leading-6 text-orange-600"><%= gettext("What’s included") %></h4> | ||
<div class="h-px flex-auto bg-gray-100"></div> | ||
</div> | ||
<ul role="list" class="mt-8 grid grid-cols-1 gap-4 text-sm leading-6 text-gray-600 sm:grid-cols-2 sm:gap-6"> | ||
<li class="flex gap-x-3"> | ||
<.icon name={:check} class="h-6 w-5 flex-none text-orange-600" /> | ||
<p>Access to our room facilities</p> | ||
</li> | ||
<li class="flex gap-x-3"> | ||
<.icon name={:check} class="h-6 w-5 flex-none text-orange-600" /> | ||
<p>Free access to all activities</p> | ||
</li> | ||
<li class="flex gap-x-3"> | ||
<.icon name={:check} class="h-6 w-5 flex-none text-orange-600" /> | ||
<p>Official member t-shirt</p> | ||
</li> | ||
</ul> | ||
</div> | ||
<div class="-mt-2 p-2 lg:mt-0 lg:w-full lg:max-w-md lg:flex-shrink-0"> | ||
<div class="ring-gray-900/5 rounded-2xl bg-gray-50 py-10 text-center ring-1 ring-inset lg:flex lg:flex-col lg:justify-center lg:py-16"> | ||
<div class="mx-auto flex max-w-xs flex-col items-center px-8"> | ||
<p class="text-base font-semibold text-gray-600"><%= gettext("Pay once, be a member forever") %></p> | ||
<p class="mt-6 flex items-baseline justify-center gap-x-2"> | ||
<span class="text-5xl font-bold tracking-tight text-gray-900">10€</span> | ||
<span class="text-sm font-semibold leading-6 tracking-wide text-gray-600">EUR</span> | ||
</p> | ||
<.button icon={:banknotes} class="mt-10 text-sm"><%= gettext("Request your membership") %></.button> | ||
<p class="mt-6 text-xs leading-5 text-gray-600"><%= gettext("Payments should be made within our location.") %> <%= @organization.location %></p> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
""" | ||
end | ||
end |
52 changes: 52 additions & 0 deletions
52
lib/atomic_web/live/organization_live/components/memberships_table.ex
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,52 @@ | ||
defmodule AtomicWeb.OrganizationLive.Components.MembershipsTable do | ||
@moduledoc """ | ||
Internal organization-related component for displaying its memberships in the form of a table. | ||
""" | ||
use AtomicWeb, :component | ||
|
||
import AtomicWeb.Components.Avatar | ||
|
||
attr :members, :list, required: true, doc: "the list of memberships to display" | ||
|
||
# TODO: Make use of table component | ||
def memberships_table(assigns) do | ||
~H""" | ||
<div class="mt-8 flow-root"> | ||
<div class="-mx-4 -my-2 overflow-x-auto sm:-mx-6 lg:-mx-8"> | ||
<div class="inline-block min-w-full py-2 align-middle sm:px-6 lg:px-8"> | ||
<table class="min-w-full divide-y divide-gray-300"> | ||
<thead> | ||
<tr> | ||
<th scope="col" class="py-3 pr-3 pl-4 text-left text-xs font-medium uppercase tracking-wide text-gray-500 sm:pl-0"><%= gettext("Name") %></th> | ||
<th scope="col" class="px-3 py-3 text-left text-xs font-medium uppercase tracking-wide text-gray-500"><%= gettext("Role") %></th> | ||
<th scope="col" class="px-3 py-3 text-left text-xs font-medium uppercase tracking-wide text-gray-500"><%= gettext("Joined At") %></th> | ||
</tr> | ||
</thead> | ||
<tbody class="divide-y divide-gray-200 bg-white"> | ||
<tr :for={member <- @members} class="hover:cursor-pointer hover:bg-gray-50" phx-click={row_click(member)}> | ||
<td class="whitespace-nowrap py-5 pr-3 pl-4 text-sm sm:pl-0"> | ||
<div class="flex items-center"> | ||
<.avatar name={member.user.name} size={:sm} color={:light_gray} class="ring-1 ring-white" /> | ||
<div class="ml-4"> | ||
<div class="font-medium text-gray-900"><%= member.user.name %></div> | ||
<div class="mt-1 text-gray-500"><%= member.user.email %></div> | ||
</div> | ||
</div> | ||
</td> | ||
<td class="whitespace-nowrap px-3 py-5 text-sm text-gray-900"><%= capitalize_first_letter(member.role) %></td> | ||
<td class="whitespace-nowrap px-3 py-5 text-sm text-gray-500"><%= relative_datetime(member.inserted_at) %></td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</div> | ||
</div> | ||
</div> | ||
""" | ||
end | ||
|
||
defp row_click(member) do | ||
Routes.profile_show_path(AtomicWeb.Endpoint, :show, member.user) | ||
|> JS.navigate() | ||
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