@@ -441,18 +441,18 @@ defmodule AlgoraWeb.ContractLive do
441
441
</ h1 >
442
442
< div class = "text-sm text-muted-foreground space-x-2 " >
443
443
< span > Created { Calendar . strftime ( @ bounty . inserted_at , "%b %d, %Y" ) } </ span >
444
- < span
444
+ <%!-- < span
445
445
:if={@bounty.hours_per_week && @bounty.hours_per_week > 0}
446
446
class="space-x-2"
447
447
>
448
448
<.icon name="tabler-clock" class="h-4 w-4" />
449
449
{@bounty.hours_per_week} hours per week
450
- </ span >
450
+ </span> --%>
451
451
</ div >
452
452
</ div >
453
453
</ div >
454
454
<%= if transaction = Enum . find ( @ transactions , fn tx -> tx . type = = :charge and tx . status = = :requires_capture end ) do %>
455
- <%= if @ current_user && @ current_user . id == @ contractor . id do %>
455
+ <%= if @ current_user && @ current_user . is_admin do %>
456
456
< . button
457
457
phx-click = "accept_contract "
458
458
phx-disable-with = "Accepting... "
@@ -475,26 +475,14 @@ defmodule AlgoraWeb.ContractLive do
475
475
</ div >
476
476
<% end %>
477
477
478
- <%= if @ can_create_bounty && @ transactions == [ ] do %>
478
+ <%= if @ can_create_bounty && @ transactions == [ ] && @ bounty . contract_type != :marketplace do %>
479
479
< . button phx-click = "reward " variant = "secondary " >
480
480
Make payment
481
481
</ . button >
482
482
<% end %>
483
483
</ div >
484
484
</ . card_content >
485
485
</ . card >
486
- < . card :if = { @ ticket_body_html } >
487
- < . card_header >
488
- < . card_title >
489
- Description
490
- </ . card_title >
491
- </ . card_header >
492
- < . card_content class = "pt-0 " >
493
- < div class = "prose prose-invert " >
494
- { Phoenix.HTML . raw ( @ ticket_body_html ) }
495
- </ div >
496
- </ . card_content >
497
- </ . card >
498
486
< . card :if = {
499
487
length ( @ transactions ) == 0 and @ can_create_bounty and
500
488
@ bounty . contract_type == :marketplace
@@ -507,27 +495,34 @@ defmodule AlgoraWeb.ContractLive do
507
495
< . card_content class = "pt-0 " >
508
496
< div class = "flex flex-col xl:flex-row xl:justify-between gap-4 " >
509
497
< ul class = "space-y-2 " >
510
- < li class = "flex items-center " >
511
- < . icon name = "tabler-circle-number-1 mr-2 " class = "size-8 text-success-400 " />
512
- Authorize the payment to share the contract offer with { @ contractor . name }
498
+ < li class = "lg:flex " >
499
+ < . icon
500
+ name = "tabler-circle-number-1 mr-2 "
501
+ class = "shrink-0 size-8 text-success-400 "
502
+ /> Authorize the payment to share the contract offer with { @ contractor . name }
513
503
</ li >
514
- < li class = "flex items-center " >
515
- < . icon name = "tabler-circle-number-2 mr-2 " class = "size-8 text-success-400 " />
516
- When { @ contractor . name } accepts, you will be charged
504
+ < li class = "lg:flex " >
505
+ < . icon
506
+ name = "tabler-circle-number-2 mr-2 "
507
+ class = "shrink-0 size-8 text-success-400 "
508
+ /> When { @ contractor . name } accepts, you will be charged
517
509
< span class = "font-semibold font-display px-1 " >
518
510
{ Money . to_string! (
519
511
Bounties . final_contract_amount ( @ bounty . contract_type , @ bounty . amount )
520
512
) }
521
513
</ span >
522
514
into escrow
523
515
</ li >
524
- < li class = "flex items-center " >
525
- < . icon name = "tabler-circle-number-3 mr-2 " class = "size-8 text-success-400 " />
516
+ < li class = "lg:flex " >
517
+ < . icon
518
+ name = "tabler-circle-number-3 mr-2 "
519
+ class = "shrink-0 size-8 text-success-400 "
520
+ />
526
521
At the end of the week, release or withhold the funds based on { @ contractor . name } 's performance
527
522
</ li >
528
523
</ ul >
529
524
530
- < dl class = "-mt-12 space-y-4 " >
525
+ < dl class = "lg: -mt-12 space-y-4 " >
531
526
< dd class = "font-display tabular-nums text-5xl text-success-400 font-bold " >
532
527
{ Money . to_string! (
533
528
Bounties . final_contract_amount ( @ bounty . contract_type , @ bounty . amount )
@@ -549,6 +544,18 @@ defmodule AlgoraWeb.ContractLive do
549
544
</ div >
550
545
</ . card_content >
551
546
</ . card >
547
+ < . card :if = { @ ticket_body_html } >
548
+ < . card_header >
549
+ < . card_title >
550
+ Description
551
+ </ . card_title >
552
+ </ . card_header >
553
+ < . card_content class = "pt-0 " >
554
+ < div class = "prose prose-invert " >
555
+ { Phoenix.HTML . raw ( @ ticket_body_html ) }
556
+ </ div >
557
+ </ . card_content >
558
+ </ . card >
552
559
< . card :if = { length ( @ transactions ) > 0 } >
553
560
< . card_header >
554
561
< . card_title >
@@ -1077,7 +1084,7 @@ defmodule AlgoraWeb.ContractLive do
1077
1084
tx . type == :charge or
1078
1085
( tx . type == :debit and tx . status in [ :succeeded , :requires_release ] )
1079
1086
1080
- socket . assigns . current_user . id == socket . assigns . contractor . id ->
1087
+ socket . assigns [ :current_user ] && socket . assigns . current_user . id == socket . assigns . contractor . id ->
1081
1088
tx . type == :credit and tx . status == :succeeded
1082
1089
1083
1090
true ->
0 commit comments