31 lines
		
	
	
		
			1.4 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
			
		
		
	
	
			31 lines
		
	
	
		
			1.4 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
| {{define "main"}}
 | |
| 	{{ if not . }}
 | |
| 		{{template "login"}}
 | |
| 	{{ else if ne .LinkLogin "" }}
 | |
| 		{{template "linklogin" .LinkLogin}}
 | |
| 	{{ else if not .State.RoomID }}
 | |
| 		<div id="hello-user" class="grid grid-cols-3 items-center text-xl py-2">
 | |
| 			<div class="text-left">
 | |
| 			<a href="/stats" class="bg-indigo-600 text-white font-semibold text-sm px-4 py-2 rounded hover:bg-indigo-500 visited:text-white">
 | |
| 				stats
 | |
| 			</a>
 | |
| 			</div>
 | |
| 			<p class="text-center">Hello {{.State.Username}}</p>
 | |
| 			<div class="text-right">
 | |
| 				<a href="/signout"><button class="bg-indigo-600 text-white font-semibold text-sm px-4 py-2 rounded hover:bg-indigo-500">signout</button></a>
 | |
| 			</div>
 | |
| 		</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}}
 | |
| 		<div id="sse-listener" sse-connect="/sub/sse" hx-trigger="sse:roomupdate_{{.State.RoomID}}" hx-get="/room" hx-target="#room-interier" hx-swap="none" style="display:none;"></div>
 | |
| 		<div id="room">
 | |
| 		{{template "room" .}}
 | |
| 		</div>
 | |
| 	{{end}}
 | |
| {{end}}
 | 
