Feat: room-link copy
This commit is contained in:
		| @@ -3,6 +3,7 @@ | |||||||
| <html lang="en"> | <html lang="en"> | ||||||
| <head> | <head> | ||||||
| 	<title>Alias</title> | 	<title>Alias</title> | ||||||
|  | 	<script src="/assets/helpers.js"></script> | ||||||
| 	<script src="/assets/htmx.min.js"></script> | 	<script src="/assets/htmx.min.js"></script> | ||||||
| 	<script src="/assets/htmx.sse.js"></script> | 	<script src="/assets/htmx.sse.js"></script> | ||||||
|         <script src="/assets/tailwind.css"></script> |         <script src="/assets/tailwind.css"></script> | ||||||
|   | |||||||
| @@ -3,6 +3,7 @@ | |||||||
|   <div id="meta"> |   <div id="meta"> | ||||||
|     <p>Hello {{.State.Username}};</p> |     <p>Hello {{.State.Username}};</p> | ||||||
|     <p>Room created by {{.Room.CreatorName}};</p> |     <p>Room created by {{.Room.CreatorName}};</p> | ||||||
|  |     <p>Room link:</p><p><input id="roomlink" readonly="" onclick="copyText()" value="{{.Room.RoomLink}}"></input></p> | ||||||
|     <p>Game is running: {{.Room.IsRunning}}</p> |     <p>Game is running: {{.Room.IsRunning}}</p> | ||||||
|     <p> |     <p> | ||||||
|       {{if and (eq .State.Username .Room.CreatorName) (not .Room.IsRunning)}} |       {{if and (eq .State.Username .Room.CreatorName) (not .Room.IsRunning)}} | ||||||
|   | |||||||
| @@ -19,6 +19,7 @@ func createRoom(ctx context.Context, req *models.RoomReq) (*models.Room, error) | |||||||
| 		return nil, err | 		return nil, err | ||||||
| 	} | 	} | ||||||
| 	room := req.CreateRoom(creator) | 	room := req.CreateRoom(creator) | ||||||
|  | 	room.RoomLink = cfg.BaseURL + "/room-join?id=" + room.ID | ||||||
| 	if err := saveRoom(room); err != nil { | 	if err := saveRoom(room); err != nil { | ||||||
| 		return nil, err | 		return nil, err | ||||||
| 	} | 	} | ||||||
|   | |||||||
							
								
								
									
										1
									
								
								todos.md
									
									
									
									
									
								
							
							
						
						
									
										1
									
								
								todos.md
									
									
									
									
									
								
							| @@ -1,6 +1,7 @@ | |||||||
| ### feats | ### feats | ||||||
| - auto close room if nothing is going on there (hmm) for ~1h; | - auto close room if nothing is going on there (hmm) for ~1h; | ||||||
| - words database (file) load and form random 25 words; | - words database (file) load and form random 25 words; | ||||||
|  | - different files for each supported lang; | ||||||
| - mark cards (instead of opening them (right click?); | - mark cards (instead of opening them (right click?); | ||||||
| - invite link; | - invite link; | ||||||
| - login with invite link; | - login with invite link; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Grail Finder
					Grail Finder