@@ -335,6 +335,28 @@ defmodule AlgoraWeb.Org.DashboardLive do
335
335
</ div >
336
336
</ . section >
337
337
338
+ < div
339
+ :if = { length ( @ achievements ) > 1 }
340
+ class = "lg:hidden border ring-1 ring-transparent rounded-xl overflow-hidden "
341
+ >
342
+ < div class = "bg-card/75 flex flex-col h-full p-4 rounded-xl border-t-4 sm:border-t-0 sm:border-l-4 border-emerald-400 " >
343
+ < div class = "p-4 sm:p-6 " >
344
+ < . getting_started
345
+ achievements = {
346
+ if incomplete? ( @ achievements , :complete_signin_status ) ,
347
+ do: @ achievements |> Enum . take ( 1 ) ,
348
+ else: @ achievements
349
+ }
350
+ current_user = { @ current_user }
351
+ current_org = { @ current_org }
352
+ secret = { @ secret }
353
+ login_form = { @ login_form }
354
+ previewed_user = { @ previewed_user }
355
+ />
356
+ </ div >
357
+ </ div >
358
+ </ div >
359
+
338
360
< . section
339
361
:if = { @ matches != [ ] }
340
362
title = "Algora Matches "
@@ -517,7 +539,16 @@ defmodule AlgoraWeb.Org.DashboardLive do
517
539
</ . section >
518
540
</ div >
519
541
</ div >
520
- { sidebar ( assigns ) }
542
+ < . sidebar
543
+ achievements = { @ achievements }
544
+ current_user = { @ current_user }
545
+ current_org = { @ current_org }
546
+ secret = { @ secret }
547
+ login_form = { @ login_form }
548
+ previewed_user = { @ previewed_user }
549
+ show_chat = { @ show_chat }
550
+ messages = { @ messages }
551
+ />
521
552
{ share_drawer ( assigns ) }
522
553
"""
523
554
end
@@ -996,12 +1027,7 @@ defmodule AlgoraWeb.Org.DashboardLive do
996
1027
997
1028
defp achievement_todo ( % { achievement: % { id: :complete_signup_status } } = assigns ) do
998
1029
~H"""
999
- < . simple_form
1000
- :if = { ! @ secret }
1001
- for = { @ login_form }
1002
- id = "send_login_code_form "
1003
- phx-submit = "send_login_code "
1004
- >
1030
+ < . simple_form :if = { ! @ secret } for = { @ login_form } phx-submit = "send_login_code " >
1005
1031
< . input
1006
1032
field = { @ login_form [ :email ] }
1007
1033
type = "email "
@@ -1013,12 +1039,7 @@ defmodule AlgoraWeb.Org.DashboardLive do
1013
1039
Sign up
1014
1040
</ . button >
1015
1041
</ . simple_form >
1016
- < . simple_form
1017
- :if = { @ secret }
1018
- for = { @ login_form }
1019
- id = "send_login_code_form "
1020
- phx-submit = "send_login_code "
1021
- >
1042
+ < . simple_form :if = { @ secret } for = { @ login_form } phx-submit = "send_login_code " >
1022
1043
< . input
1023
1044
field = { @ login_form [ :login_code ] }
1024
1045
type = "text "
@@ -1035,12 +1056,7 @@ defmodule AlgoraWeb.Org.DashboardLive do
1035
1056
1036
1057
defp achievement_todo ( % { achievement: % { id: :complete_signin_status } } = assigns ) do
1037
1058
~H"""
1038
- < . simple_form
1039
- :if = { ! @ secret }
1040
- for = { @ login_form }
1041
- id = "send_login_code_form "
1042
- phx-submit = "send_login_code "
1043
- >
1059
+ < . simple_form :if = { ! @ secret } for = { @ login_form } phx-submit = "send_login_code " >
1044
1060
< . input
1045
1061
field = { @ login_form [ :email ] }
1046
1062
type = "email "
@@ -1052,12 +1068,7 @@ defmodule AlgoraWeb.Org.DashboardLive do
1052
1068
Sign in
1053
1069
</ . button >
1054
1070
</ . simple_form >
1055
- < . simple_form
1056
- :if = { @ secret }
1057
- for = { @ login_form }
1058
- id = "send_login_code_form "
1059
- phx-submit = "send_login_code "
1060
- >
1071
+ < . simple_form :if = { @ secret } for = { @ login_form } phx-submit = "send_login_code " >
1061
1072
< . input
1062
1073
field = { @ login_form [ :login_code ] }
1063
1074
type = "text "
@@ -1557,34 +1568,49 @@ defmodule AlgoraWeb.Org.DashboardLive do
1557
1568
"""
1558
1569
end
1559
1570
1571
+ defp getting_started ( assigns ) do
1572
+ ~H"""
1573
+ < div class = { assigns [ :class ] } >
1574
+ < h2 class = "text-xl font-semibold leading-none tracking-tight " >
1575
+ <%= if @ previewed_user != @ current_org and incomplete? ( @ achievements , :complete_signin_status ) do %>
1576
+ Get back in
1577
+ <% else %>
1578
+ Getting started
1579
+ <% end %>
1580
+ </ h2 >
1581
+ < nav class = "pt-6 " >
1582
+ < ol role = "list " class = "space-y-6 " >
1583
+ <%= for achievement <- @ achievements do %>
1584
+ < li class = "space-y-6 " >
1585
+ < . achievement achievement = { achievement } />
1586
+ < . achievement_todo
1587
+ achievement = { achievement }
1588
+ current_user = { @ current_user }
1589
+ current_org = { @ current_org }
1590
+ secret = { @ secret }
1591
+ login_form = { @ login_form }
1592
+ />
1593
+ </ li >
1594
+ <% end %>
1595
+ </ ol >
1596
+ </ nav >
1597
+ </ div >
1598
+ """
1599
+ end
1600
+
1560
1601
defp sidebar ( assigns ) do
1561
1602
~H"""
1562
1603
< aside class = "scrollbar-thin fixed top-16 right-0 bottom-0 hidden w-96 h-full overflow-y-auto border-l border-border bg-background p-4 pt-6 sm:p-6 md:p-8 lg:flex lg:flex-col " >
1563
- < div :if = { length ( @ achievements ) > 1 } class = "pb-12 " >
1564
- < h2 class = "text-xl font-semibold leading-none tracking-tight " >
1565
- <%= if @ previewed_user != @ current_org do %>
1566
- Get back in
1567
- <% else %>
1568
- Getting started
1569
- <% end %>
1570
- </ h2 >
1571
- < nav class = "pt-6 " >
1572
- < ol role = "list " class = "space-y-6 " >
1573
- <%= for achievement <- @ achievements do %>
1574
- < li class = "space-y-6 " >
1575
- < . achievement achievement = { achievement } />
1576
- < . achievement_todo
1577
- achievement = { achievement }
1578
- current_user = { @ current_user }
1579
- current_org = { @ current_org }
1580
- secret = { @ secret }
1581
- login_form = { @ login_form }
1582
- />
1583
- </ li >
1584
- <% end %>
1585
- </ ol >
1586
- </ nav >
1587
- </ div >
1604
+ < . getting_started
1605
+ :if = { length ( @ achievements ) > 1 }
1606
+ class = "pb-12 "
1607
+ achievements = { @ achievements }
1608
+ current_user = { @ current_user }
1609
+ current_org = { @ current_org }
1610
+ secret = { @ secret }
1611
+ login_form = { @ login_form }
1612
+ previewed_user = { @ previewed_user }
1613
+ />
1588
1614
<%= if @ current_org . handle do %>
1589
1615
< div :if = { not incomplete? ( @ achievements , :create_bounty_status ) } >
1590
1616
< div class = "flex items-center justify-between " >
0 commit comments