chore(formatting): djlint templates
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -1,40 +0,0 @@
|
||||
<div
|
||||
class="absolute -translate-y-1/2 p-4 m-auto bg-gray-700 dark:bg-gray-300 rounded-lg shadow w-full text-black dark:text-white"
|
||||
>
|
||||
<span
|
||||
class="inline-flex gap-2 items-center font-medium text-xs inline-block py-1 px-2 uppercase rounded-full {{ if .Error }} bg-red-500 {{ else }} bg-green-600 {{ end }}"
|
||||
>
|
||||
{{ if and (ne .Progress 100) (not .Error) }}
|
||||
{{ template "svg/loading" (dict "Size" 16) }}
|
||||
{{ end }}
|
||||
|
||||
{{ .Message }}
|
||||
</span>
|
||||
<div class="flex flex-col gap-2 mt-2">
|
||||
<div class="relative w-full h-4 bg-gray-300 dark:bg-gray-700 rounded-full">
|
||||
|
||||
{{ if .Error }}
|
||||
<div
|
||||
class="absolute h-full bg-red-500 rounded-full"
|
||||
style="width: 100%"
|
||||
></div>
|
||||
<p class="absolute w-full h-full font-bold text-center text-xs">ERROR</p>
|
||||
{{ else }}
|
||||
<div
|
||||
class="absolute h-full bg-green-600 rounded-full"
|
||||
style="width: {{ .Progress }}%"
|
||||
></div>
|
||||
<p class="absolute w-full h-full font-bold text-center text-xs">
|
||||
{{ .Progress }}%
|
||||
</p>
|
||||
{{ end }}
|
||||
|
||||
</div>
|
||||
|
||||
<a
|
||||
href="{{ .ButtonHref }}"
|
||||
class="w-full text-center font-medium px-2 py-1 text-white bg-gray-500 dark:text-gray-800 hover:bg-gray-800 dark:hover:bg-gray-100"
|
||||
>{{ .ButtonText }}</a
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
22
templates/components/download-progress.tmpl
Normal file
22
templates/components/download-progress.tmpl
Normal file
@@ -0,0 +1,22 @@
|
||||
<div class="absolute -translate-y-1/2 p-4 m-auto bg-gray-700 dark:bg-gray-300 rounded-lg shadow w-full text-black dark:text-white">
|
||||
<span class="inline-flex gap-2 items-center font-medium text-xs inline-block py-1 px-2 uppercase rounded-full {{ if .Error }} bg-red-500 {{ else if true }} bg-green-600 {{ end }}">
|
||||
{{ if and (ne .Progress 100) (not .Error) }}
|
||||
{{ template "svg/loading" (dict "Size" 16) }}
|
||||
{{ end }}
|
||||
{{ .Message }}
|
||||
</span>
|
||||
<div class="flex flex-col gap-2 mt-2">
|
||||
<div class="relative w-full h-4 bg-gray-300 dark:bg-gray-700 rounded-full">
|
||||
{{ if .Error }}
|
||||
<div class="absolute h-full bg-red-500 rounded-full" style="width: 100%"></div>
|
||||
<p class="absolute w-full h-full font-bold text-center text-xs">ERROR</p>
|
||||
{{ else }}
|
||||
<div class="absolute h-full bg-green-600 rounded-full"
|
||||
style="width: {{ .Progress }}%"></div>
|
||||
<p class="absolute w-full h-full font-bold text-center text-xs">{{ .Progress }}%</p>
|
||||
{{ end }}
|
||||
</div>
|
||||
<a href="{{ .ButtonHref }}"
|
||||
class="w-full text-center font-medium px-2 py-1 text-white bg-gray-500 dark:text-gray-800 hover:bg-gray-800 dark:hover:bg-gray-100">{{ .ButtonText }}</a>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,101 +0,0 @@
|
||||
<div class="w-full">
|
||||
<div
|
||||
class="flex flex-col justify-between h-full w-full px-4 py-6 bg-white shadow-lg dark:bg-gray-700 rounded"
|
||||
>
|
||||
<div>
|
||||
<div class="flex justify-between">
|
||||
<p
|
||||
class="text-sm font-semibold text-gray-700 border-b border-gray-200 w-max dark:text-white dark:border-gray-500"
|
||||
>
|
||||
{{ .Name }} Leaderboard
|
||||
</p>
|
||||
<div class="flex gap-2 text-xs text-gray-400 items-center">
|
||||
<label
|
||||
for="all-{{ .Name }}"
|
||||
class="cursor-pointer hover:text-black dark:hover:text-white"
|
||||
>all</label
|
||||
>
|
||||
<label
|
||||
for="year-{{ .Name }}"
|
||||
class="cursor-pointer hover:text-black dark:hover:text-white"
|
||||
>year</label
|
||||
>
|
||||
<label
|
||||
for="month-{{ .Name }}"
|
||||
class="cursor-pointer hover:text-black dark:hover:text-white"
|
||||
>month</label
|
||||
>
|
||||
<label
|
||||
for="week-{{ .Name }}"
|
||||
class="cursor-pointer hover:text-black dark:hover:text-white"
|
||||
>week</label
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<input
|
||||
type="radio"
|
||||
name="options-{{ .Name }}"
|
||||
id="all-{{ .Name }}"
|
||||
class="hidden peer/All"
|
||||
checked
|
||||
/>
|
||||
<input
|
||||
type="radio"
|
||||
name="options-{{ .Name }}"
|
||||
id="year-{{ .Name }}"
|
||||
class="hidden peer/Year"
|
||||
/>
|
||||
<input
|
||||
type="radio"
|
||||
name="options-{{ .Name }}"
|
||||
id="month-{{ .Name }}"
|
||||
class="hidden peer/Month"
|
||||
/>
|
||||
<input
|
||||
type="radio"
|
||||
name="options-{{ .Name }}"
|
||||
id="week-{{ .Name }}"
|
||||
class="hidden peer/Week"
|
||||
/>
|
||||
|
||||
{{ range $key, $data := .Data }}
|
||||
<div class="flex items-end my-6 space-x-2 hidden peer-checked/{{ $key }}:block">
|
||||
|
||||
{{ $length := len $data }}
|
||||
{{ if eq $length 0 }}
|
||||
<p class="text-5xl font-bold text-black dark:text-white">N/A</p>
|
||||
{{ else }}
|
||||
<p class="text-5xl font-bold text-black dark:text-white">
|
||||
{{ (index $data 0).UserID }}
|
||||
</p>
|
||||
{{ end }}
|
||||
|
||||
</div>
|
||||
<div class="hidden dark:text-white peer-checked/{{ $key }}:block">
|
||||
|
||||
{{ range $index, $item := $data }}
|
||||
{{ if lt $index 3 }}
|
||||
{{ if eq $index 0 }}
|
||||
<div class="flex items-center justify-between pt-2 pb-2 text-sm">
|
||||
{{ else }}
|
||||
<div
|
||||
class="flex items-center justify-between pt-2 pb-2 text-sm border-t border-gray-200"
|
||||
>
|
||||
{{ end }}
|
||||
<div>
|
||||
<p>{{ $item.UserID }}</p>
|
||||
</div>
|
||||
<div class="flex items-end font-bold">
|
||||
{{ $item.Value }}
|
||||
</div>
|
||||
</div>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
</div>
|
||||
|
||||
{{ end}}
|
||||
</div>
|
||||
</div>
|
||||
64
templates/components/leaderboard-card.tmpl
Normal file
64
templates/components/leaderboard-card.tmpl
Normal file
@@ -0,0 +1,64 @@
|
||||
<div class="w-full">
|
||||
<div class="flex flex-col justify-between h-full w-full px-4 py-6 bg-white shadow-lg dark:bg-gray-700 rounded">
|
||||
<div>
|
||||
<div class="flex justify-between">
|
||||
<p class="text-sm font-semibold text-gray-700 border-b border-gray-200 w-max dark:text-white dark:border-gray-500">
|
||||
{{ .Name }} Leaderboard
|
||||
</p>
|
||||
<div class="flex gap-2 text-xs text-gray-400 items-center">
|
||||
<label for="all-{{ .Name }}"
|
||||
class="cursor-pointer hover:text-black dark:hover:text-white">all</label>
|
||||
<label for="year-{{ .Name }}"
|
||||
class="cursor-pointer hover:text-black dark:hover:text-white">year</label>
|
||||
<label for="month-{{ .Name }}"
|
||||
class="cursor-pointer hover:text-black dark:hover:text-white">month</label>
|
||||
<label for="week-{{ .Name }}"
|
||||
class="cursor-pointer hover:text-black dark:hover:text-white">week</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<input type="radio"
|
||||
name="options-{{ .Name }}"
|
||||
id="all-{{ .Name }}"
|
||||
class="hidden peer/All"
|
||||
checked />
|
||||
<input type="radio"
|
||||
name="options-{{ .Name }}"
|
||||
id="year-{{ .Name }}"
|
||||
class="hidden peer/Year" />
|
||||
<input type="radio"
|
||||
name="options-{{ .Name }}"
|
||||
id="month-{{ .Name }}"
|
||||
class="hidden peer/Month" />
|
||||
<input type="radio"
|
||||
name="options-{{ .Name }}"
|
||||
id="week-{{ .Name }}"
|
||||
class="hidden peer/Week" />
|
||||
{{ range $key, $data := .Data }}
|
||||
<div class="flex items-end my-6 space-x-2 hidden peer-checked/{{ $key }}:block">
|
||||
{{ $length := len $data }}
|
||||
{{ if eq $length 0 }}
|
||||
<p class="text-5xl font-bold text-black dark:text-white">N/A</p>
|
||||
{{ else }}
|
||||
<p class="text-5xl font-bold text-black dark:text-white">{{ (index $data 0).UserID }}</p>
|
||||
{{ end }}
|
||||
</div>
|
||||
<div class="hidden dark:text-white peer-checked/{{ $key }}:block">
|
||||
{{ range $index, $item := $data }}
|
||||
{{ if lt $index 3 }}
|
||||
{{ if eq $index 0 }}
|
||||
<div class="flex items-center justify-between pt-2 pb-2 text-sm">
|
||||
{{ else }}
|
||||
<div class="flex items-center justify-between pt-2 pb-2 text-sm border-t border-gray-200">
|
||||
{{ end }}
|
||||
<div>
|
||||
<p>{{ $item.UserID }}</p>
|
||||
</div>
|
||||
<div class="flex items-end font-bold">{{ $item.Value }}</div>
|
||||
</div>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ end}}
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user