mirror of
https://github.com/hugo-fixit/FixIt.git
synced 2026-08-24 23:38:56 +00:00
39 lines
1.4 KiB
HTML
39 lines
1.4 KiB
HTML
{{- /*
|
|
Post reward panel renderer.
|
|
- Renders reward switch button and reward QR/payment images.
|
|
- Supports optional author prefix and animation mode.
|
|
@param {Object} .Reward reward config object
|
|
@param {String} .Id unique input id for reward toggle
|
|
@param {String} [.Author] optional author name for image alt text
|
|
*/ -}}
|
|
|
|
{{- $reward := .Reward -}}
|
|
{{- $id := .Id -}}
|
|
{{- $author := .Author | default "" -}}
|
|
|
|
{{- if $reward.enable -}}
|
|
<div class="post-reward">
|
|
<div class="comment">{{ $reward.comment }}</div>
|
|
<input type="checkbox" class="reward-input" name="reward" id="{{ $id }}" hidden />
|
|
<label class="reward-button" for="{{ $id }}">
|
|
{{- dict "Class" "fa-solid fa-qrcode" | partial "plugin/icon.html" -}}
|
|
{{- T "single.reward.donate" -}}
|
|
</label>
|
|
<div class="reward-ways"{{ with $reward.mode }} data-mode="{{ . }}"{{ end }}>
|
|
{{- range $way, $image := $reward.ways -}}
|
|
{{- with T (printf "single.reward.%v" $way) -}}{{ $way = . }}{{- end -}}
|
|
{{- if $image -}}
|
|
<div>
|
|
{{-
|
|
dict "Src" $image
|
|
"Alt" (strings.TrimPrefix " " (printf "%v %v" $author $way))
|
|
| partial "plugin/image.html"
|
|
-}}
|
|
<span{{ if $reward.animation }} data-animation{{ end }}>{{ $way }}</span>
|
|
</div>
|
|
{{- end -}}
|
|
{{- end -}}
|
|
</div>
|
|
</div>
|
|
{{- end -}}
|