Skip to content

Commit 3a681dc

Browse files
committed
misc
1 parent dc1916d commit 3a681dc

File tree

2 files changed

+59
-42
lines changed

2 files changed

+59
-42
lines changed

lib/algora_web/forms/contract_form.ex

Lines changed: 33 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -51,38 +51,40 @@ defmodule AlgoraWeb.Forms.ContractForm do
5151
<div class="space-y-4">
5252
<.input label="Title" field={@form[:title]} />
5353
<.input label="Description (optional)" field={@form[:description]} type="textarea" />
54-
<label class="block text-sm font-semibold leading-6 text-foreground mb-2">
55-
Payment
56-
</label>
57-
<div class="grid grid-cols-2 gap-4" phx-update="ignore" id="main-contract-form-tabs">
58-
<%= for {label, value} <- type_options() do %>
59-
<label class={[
60-
"group relative flex cursor-pointer rounded-lg px-3 py-2 shadow-sm focus:outline-none",
61-
"border-2 bg-background transition-all duration-200 hover:border-primary hover:bg-primary/10",
62-
"border-border has-[:checked]:border-primary has-[:checked]:bg-primary/10"
63-
]}>
64-
<.input
65-
id={"main-contract-form-type-#{value}"}
66-
type="radio"
67-
field={@form[:type]}
68-
checked={@form[:type].value == value}
69-
value={value}
70-
class="sr-only"
71-
phx-click={
72-
%JS{}
73-
|> JS.hide(to: "#main-contract-form [data-tab]:not([data-tab=#{value}])")
74-
|> JS.show(to: "#main-contract-form [data-tab=#{value}]")
75-
}
76-
/>
77-
<span class="flex flex-1 items-center justify-between">
78-
<span class="text-sm font-medium">{label}</span>
79-
<.icon
80-
name="tabler-check"
81-
class="invisible size-5 text-primary group-has-[:checked]:visible"
54+
<div>
55+
<label class="block text-sm font-semibold leading-6 text-foreground mb-2">
56+
Payment
57+
</label>
58+
<div class="grid grid-cols-2 gap-4" phx-update="ignore" id="main-contract-form-tabs">
59+
<%= for {label, value} <- type_options() do %>
60+
<label class={[
61+
"group relative flex cursor-pointer rounded-lg px-3 py-2 shadow-sm focus:outline-none",
62+
"border-2 bg-background transition-all duration-200 hover:border-primary hover:bg-primary/10",
63+
"border-border has-[:checked]:border-primary has-[:checked]:bg-primary/10"
64+
]}>
65+
<.input
66+
id={"main-contract-form-type-#{value}"}
67+
type="radio"
68+
field={@form[:type]}
69+
checked={@form[:type].value == value}
70+
value={value}
71+
class="sr-only"
72+
phx-click={
73+
%JS{}
74+
|> JS.hide(to: "#main-contract-form [data-tab]:not([data-tab=#{value}])")
75+
|> JS.show(to: "#main-contract-form [data-tab=#{value}]")
76+
}
8277
/>
83-
</span>
84-
</label>
85-
<% end %>
78+
<span class="flex flex-1 items-center justify-between">
79+
<span class="text-sm font-medium">{label}</span>
80+
<.icon
81+
name="tabler-check"
82+
class="invisible size-5 text-primary group-has-[:checked]:visible"
83+
/>
84+
</span>
85+
</label>
86+
<% end %>
87+
</div>
8688
</div>
8789
8890
<div data-tab="fixed">

lib/algora_web/live/contract_live.ex

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -259,18 +259,30 @@ defmodule AlgoraWeb.ContractLive do
259259
</div>
260260
<div>
261261
<h1 class="text-2xl font-semibold">
262-
Contract with {@contractor.name}
262+
{@bounty.ticket.title}
263263
</h1>
264-
<p class="text-sm text-muted-foreground">
265-
Started {Calendar.strftime(@bounty.inserted_at, "%b %d, %Y")}
266-
</p>
264+
<div class="text-sm text-muted-foreground space-x-2">
265+
<span>Created {Calendar.strftime(@bounty.inserted_at, "%b %d, %Y")}</span>
266+
<span
267+
:if={@bounty.hours_per_week && @bounty.hours_per_week > 0}
268+
class="space-x-2"
269+
>
270+
<span>&bull;</span>
271+
<span>
272+
<.icon name="tabler-clock" class="h-4 w-4" />
273+
{@bounty.hours_per_week} hours per week
274+
</span>
275+
</span>
276+
</div>
267277
</div>
268278
</div>
269279
270280
<div class="flex flex-col gap-4">
271281
<div class="font-display tabular-nums text-5xl text-success-400 font-bold">
272-
{Money.to_string!(@bounty.amount)}
273-
<span :if={@bounty.hours_per_week && @bounty.hours_per_week > 0} class="text-base">
282+
{Money.to_string!(@bounty.amount)}<span
283+
:if={@bounty.hours_per_week && @bounty.hours_per_week > 0}
284+
class="text-base"
285+
>
274286
/wk
275287
</span>
276288
</div>
@@ -287,7 +299,7 @@ defmodule AlgoraWeb.ContractLive do
287299
Description
288300
</.card_title>
289301
</.card_header>
290-
<.card_content>
302+
<.card_content class="pt-0">
291303
<div class="prose prose-invert">
292304
{Phoenix.HTML.raw(@ticket_body_html)}
293305
</div>
@@ -306,13 +318,16 @@ defmodule AlgoraWeb.ContractLive do
306318
{Util.initials(@contractor.name)}
307319
</.avatar_fallback>
308320
</.avatar>
309-
<div class="absolute right-0 bottom-0 h-3 w-3 rounded-full border-2 border-background bg-success">
310-
</div>
321+
<%!-- <div class="absolute right-0 bottom-0 h-3 w-3 rounded-full border-2 border-background bg-success">
322+
</div> --%>
311323
</div>
312324
<div>
313325
<h2 class="text-lg font-semibold">{@contractor.name}</h2>
314-
<p class="text-xs text-muted-foreground">
315-
<%!-- Active {Util.time_ago(@contractor.last_active_at)} --%>
326+
<p :if={@contractor.last_active_at} class="text-xs text-muted-foreground">
327+
Active {Util.time_ago(@contractor.last_active_at)}
328+
</p>
329+
<p :if={!@contractor.last_active_at} class="text-xs text-muted-foreground">
330+
Offline
316331
</p>
317332
</div>
318333
</div>

0 commit comments

Comments
 (0)