This commit is contained in:
+8
-2
@@ -12,7 +12,8 @@
|
||||
<header class="topbar">
|
||||
<a class="brand" href="/rooms">SEND.NRW Chat</a>
|
||||
<form method="post" action="/logout">
|
||||
<span class="user-pill">{{.Username}}</span>
|
||||
{{if .CanAdmin}}<a class="ghost link-button" href="/admin">Admin</a>{{end}}
|
||||
<span class="user-pill">{{.Username}} · {{.User.Role}}</span>
|
||||
<button class="ghost" type="submit">Logout</button>
|
||||
</form>
|
||||
</header>
|
||||
@@ -23,7 +24,8 @@
|
||||
<p class="eyebrow">Chatraum</p>
|
||||
<h1>{{.Room.Name}}</h1>
|
||||
<p class="muted">{{.Room.Description}}</p>
|
||||
<div class="hint"></div>
|
||||
<div class="hint">Lesen: {{.Room.ReadAccess}}<br>Schreiben: {{.Room.WriteAccess}}</div>
|
||||
{{if .Room.Members}}<div class="hint">Mitglieder: {{join .Room.Members ", "}}</div>{{end}}
|
||||
</aside>
|
||||
|
||||
<section class="chat-card card">
|
||||
@@ -35,10 +37,14 @@
|
||||
{{end}}
|
||||
</div>
|
||||
|
||||
{{if .CanWrite}}
|
||||
<form id="message-form" class="message-form" hx-post="/rooms/{{.Room.ID}}/messages" hx-swap="none" hx-on::after-request="if(event.detail.successful) this.reset()">
|
||||
<input name="body" placeholder="Nachricht schreiben …" autocomplete="off" required maxlength="2000">
|
||||
<button type="submit">Senden</button>
|
||||
</form>
|
||||
{{else}}
|
||||
<div class="hint">Du hast in diesem Raum nur Leserechte.</div>
|
||||
{{end}}
|
||||
</section>
|
||||
</main>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user