Skip to content

Commit 291c789

Browse files
committed
miscellanea
1 parent bbb0b27 commit 291c789

File tree

3 files changed

+44
-30
lines changed

3 files changed

+44
-30
lines changed

lib/algora/accounts/schemas/user.ex

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -492,6 +492,7 @@ defmodule Algora.Accounts.User do
492492
:website_url,
493493
:location,
494494
:preferences,
495+
:display_name,
495496
:internal_email,
496497
:internal_notes,
497498
:candidate_notes,

lib/algora_web/live/contract_live.ex

Lines changed: 40 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -140,11 +140,6 @@ defmodule AlgoraWeb.ContractLive do
140140
messages = thread.id |> Chat.list_messages() |> Repo.preload(:sender)
141141
participants = thread.id |> Chat.list_participants() |> Repo.preload(:user)
142142

143-
if connected?(socket) do
144-
Chat.subscribe(thread.id)
145-
Payments.subscribe()
146-
end
147-
148143
share_url =
149144
if socket.assigns.ticket_ref do
150145
url(
@@ -154,28 +149,46 @@ defmodule AlgoraWeb.ContractLive do
154149
url(~p"/#{socket.assigns.bounty.owner.handle}/bounties/#{socket.assigns.bounty.id}")
155150
end
156151

157-
{:ok,
158-
socket
159-
|> assign(:can_create_bounty, Member.can_create_bounty?(socket.assigns.current_user_role))
160-
|> assign(:share_url, share_url)
161-
|> assign(:page_title, bounty.ticket.title)
162-
|> assign(:ticket, bounty.ticket)
163-
|> assign(:total_paid, total_paid)
164-
|> assign(:ticket_body_html, ticket_body_html)
165-
|> assign(:show_reward_modal, false)
166-
|> assign(:show_authorize_modal, false)
167-
|> assign(:show_release_modal, false)
168-
|> assign(:selected_context, nil)
169-
|> assign(:tx_id, nil)
170-
|> assign(:line_items, [])
171-
|> assign(:thread, thread)
172-
|> assign(:messages, messages)
173-
|> assign(:participants, participants)
174-
|> assign(:reward_form, to_form(reward_changeset))
175-
|> assign(:release_form, to_form(release_changeset))
176-
|> assign_contractor(bounty.shared_with)
177-
|> assign_transactions()
178-
|> assign_line_items(reward_changeset)}
152+
socket =
153+
socket
154+
|> assign(:can_create_bounty, Member.can_create_bounty?(socket.assigns.current_user_role))
155+
|> assign(:share_url, share_url)
156+
|> assign(:page_title, bounty.ticket.title)
157+
|> assign(:ticket, bounty.ticket)
158+
|> assign(:total_paid, total_paid)
159+
|> assign(:ticket_body_html, ticket_body_html)
160+
|> assign(:show_reward_modal, false)
161+
|> assign(:show_authorize_modal, false)
162+
|> assign(:show_release_modal, false)
163+
|> assign(:selected_context, nil)
164+
|> assign(:tx_id, nil)
165+
|> assign(:line_items, [])
166+
|> assign(:thread, thread)
167+
|> assign(:messages, messages)
168+
|> assign(:participants, participants)
169+
|> assign(:reward_form, to_form(reward_changeset))
170+
|> assign(:release_form, to_form(release_changeset))
171+
|> assign_contractor(bounty.shared_with)
172+
|> assign_transactions()
173+
|> assign_line_items(reward_changeset)
174+
175+
current_user = socket.assigns[:current_user]
176+
177+
if not is_nil(socket.assigns.contractor) and
178+
(is_nil(current_user) or
179+
(socket.assigns.contractor.id != socket.assigns.current_user.id and socket.assigns.current_user_role == :none)) do
180+
{:ok,
181+
redirect(socket,
182+
to: ~p"/auth/login?return_to=#{~p"/#{socket.assigns.current_org.handle}/contracts/#{socket.assigns.bounty.id}"}"
183+
)}
184+
else
185+
if connected?(socket) do
186+
Chat.subscribe(thread.id)
187+
Payments.subscribe()
188+
end
189+
190+
{:ok, socket}
191+
end
179192
end
180193

181194
@impl true

lib/algora_web/live/org/dashboard_live.ex

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ defmodule AlgoraWeb.Org.DashboardLive do
349349
</div>
350350
</.section>
351351
352-
<%= if @previewed_user.id in ["xT2oJ8z7wTHWgs8g"] or @previewed_user.contract_signed or (not is_nil(@previewed_user.stage) and @previewed_user.stage != :none) do %>
352+
<%= if @previewed_user.id in ["xT2oJ8z7wTHWgs8g", "ETU6LA5QADkB2Dig"] or @previewed_user.contract_signed or (not is_nil(@previewed_user.stage) and @previewed_user.stage != :none) do %>
353353
<.section title={"#{header_prefix(@previewed_user)} Candidates"}>
354354
<.link href={"/#{@previewed_user.handle}/candidates"}>
355355
<img
@@ -1291,9 +1291,9 @@ defmodule AlgoraWeb.Org.DashboardLive do
12911291
12921292
<div class="flex flex-col items-start sm:items-end gap-3">
12931293
<div class="hidden sm:block sm:text-right">
1294-
<div class="whitespace-nowrap text-sm text-muted-foreground">Total contract value</div>
1294+
<div class="whitespace-nowrap text-sm text-muted-foreground">Amount</div>
12951295
<div class="font-display text-lg font-semibold text-foreground">
1296-
{Money.to_string!(@contract.amount)} / wk
1296+
{Money.to_string!(@contract.amount)}
12971297
</div>
12981298
</div>
12991299
<.button

0 commit comments

Comments
 (0)