16 lines
497 B
HTML
16 lines
497 B
HTML
{{$userVote := .UserVote}} {{$roomID := .RoomID}} {{$storyID := .Story.ID}}
|
|
<div class="vote-form" id="vote-form-{{$storyID}}">
|
|
{{range scaleToOptions .Scale}}
|
|
<button
|
|
type="button"
|
|
hx-post="/rooms/{{$roomID}}/vote"
|
|
hx-target="#vote-form-{{$storyID}}"
|
|
hx-swap="outerHTML"
|
|
hx-vals='{"story_id":"{{$storyID}}","value":"{{.}}"}'
|
|
class="vote-option {{if eq . $userVote}}vote-selected{{end}}"
|
|
>
|
|
{{.}}
|
|
</button>
|
|
{{end}}
|
|
</div>
|