File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1111 </ a >
1212 </ div >
1313 {% endif %}
14- < div class ="bg-gray-50 rounded-lg border border-gray-200 p-6 mb-6 ">
14+ < div class ="bg-gray-100 rounded-lg border border-gray-200 p-6 mb-6 ">
1515 < div class ="flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4 ">
1616 < div >
1717 < h3 class ="text-sm font-medium text-gray-900 mb-1 "> Invite Reviewers</ h3 >
@@ -20,7 +20,7 @@ <h3 class="text-sm font-medium text-gray-900 mb-1">Invite Reviewers</h3>
2020 < div class ="flex items-center gap-3 ">
2121 < div class ="flex items-center bg-white rounded-lg border border-gray-300 overflow-hidden ">
2222 < code id ="join-code " class ="px-4 py-2 text-lg font-mono font-bold text-gray-900 "> {{ program.join_code|default:program.slug }}</ code >
23- < button onclick ="copyCode() " class ="px-3 py-2 bg-gray-100 hover:bg-gray-200 text-gray-600 border-l border-gray-300 transition-colors " title ="Copy code ">
23+ < button onclick ="copyCode() " class ="px-3 py-2 bg-gray-100 hover:bg-gray-200 text-gray-600 border-l border-gray-300 transition-colors " title ="Copy join link ">
2424 < i class ="fas fa-copy "> </ i >
2525 </ button >
2626 </ div >
@@ -37,7 +37,8 @@ <h3 class="text-sm font-medium text-gray-900 mb-1">Invite Reviewers</h3>
3737 < script >
3838 function copyCode ( ) {
3939 const code = document . getElementById ( 'join-code' ) . textContent ;
40- navigator . clipboard . writeText ( code ) . then ( ( ) => {
40+ const joinUrl = window . location . origin + '/join/?code=' + encodeURIComponent ( code ) ;
41+ navigator . clipboard . writeText ( joinUrl ) . then ( ( ) => {
4142 const btn = event . target . closest ( 'button' ) ;
4243 const icon = btn . querySelector ( 'i' ) ;
4344 icon . className = 'fas fa-check' ;
Original file line number Diff line number Diff line change @@ -43,7 +43,11 @@ def register(request):
4343 )
4444 return redirect ("/" )
4545 else :
46- form = RegisterForm ()
46+ # Pre-fill code from query parameter if provided
47+ initial = {}
48+ if code := request .GET .get ("code" ):
49+ initial ["program_code" ] = code
50+ form = RegisterForm (initial = initial )
4751 return render (request , "register.html" , {"form" : form })
4852
4953
@@ -58,5 +62,9 @@ def join(request):
5862 program .save ()
5963 return redirect ("/" )
6064 else :
61- form = JoinForm ()
65+ # Pre-fill code from query parameter if provided
66+ initial = {}
67+ if code := request .GET .get ("code" ):
68+ initial ["program_code" ] = code
69+ form = JoinForm (initial = initial )
6270 return render (request , "join.html" , {"form" : form })
You can’t perform that action at this time.
0 commit comments