Feat: enter room: login with link
This commit is contained in:
		| @@ -1,22 +1,26 @@ | ||||
| {{define "main"}} | ||||
| 	<!-- user has no username -> login form --> | ||||
| 	Start of main temp | ||||
| 	{{ if not . }} | ||||
| 	{{template "login"}} | ||||
| 	<!-- user has name but no room id => suggest to create room --> | ||||
| 		login temp | ||||
| 		{{template "login"}} | ||||
| 	{{ else if ne .LinkLogin "" }} | ||||
| 		got to linklogin | ||||
| 		{{template "linklogin" .LinkLogin}} | ||||
| 	{{ else if eq .State.RoomID "" }} | ||||
| 	<div id="hello-user"> | ||||
| 		<p>Hello {{.State.Username}}</p> | ||||
| 	</div> | ||||
| 	<div id="create-room" class="create-room-div"> | ||||
| 	    <button button id="create-form-btn" type="submit" class="justify-center rounded-md bg-indigo-600 px-3 py-1.5 text-sm font-semibold leading-6 text-white shadow-sm hover:bg-indigo-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600" hx-get="/room/createform" hx-swap="outerHTML">SHOW ROOM CREATE FORM</button> | ||||
| 	</div> | ||||
| 	<div> | ||||
| 	{{template "roomlist" .List}} | ||||
| 	</div> | ||||
| 		empty state roomid | ||||
| 		<div id="hello-user"> | ||||
| 			<p>Hello {{.State.Username}}</p> | ||||
| 		</div> | ||||
| 		<div id="create-room" class="create-room-div"> | ||||
| 		    <button button id="create-form-btn" type="submit" class="justify-center rounded-md bg-indigo-600 px-3 py-1.5 text-sm font-semibold leading-6 text-white shadow-sm hover:bg-indigo-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600" hx-get="/room/createform" hx-swap="outerHTML">SHOW ROOM CREATE FORM</button> | ||||
| 		</div> | ||||
| 		<div> | ||||
| 		{{template "roomlist" .List}} | ||||
| 		</div> | ||||
| 	{{else}} | ||||
| 	<!-- instead of having room div; better to replace ancestor completely with room --> | ||||
| 	<div id="room"> | ||||
| 	{{template "room" .}} | ||||
| 	</div> | ||||
| 		else | ||||
| 		<div id="room"> | ||||
| 		{{template "room" .}} | ||||
| 		</div> | ||||
| 	{{end}} | ||||
| {{end}} | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Grail Finder
					Grail Finder