catbase/plugins/emojy/stats.templ

54 lines
1.4 KiB
Plaintext
Raw Normal View History

2024-02-28 02:43:37 +00:00
package emojy
import "fmt"
templ (p *EmojyPlugin) emojyNav() {
2024-02-28 15:25:43 +00:00
<ul class="menu">
<li>
<a href="/emojy/stats">Stats</a>
</li>
<li>
<a href="/emojy/list">List</a>
</li>
<li>
<a href="/emojy/new">Upload</a>
</li>
</ul>
2024-02-28 02:43:37 +00:00
}
templ (p *EmojyPlugin) statsIndex(emojy emojyMap) {
2024-02-28 15:25:43 +00:00
<div class="grid-container">
<div class="grid-x">
<div class="cell">
<h2>Emojy</h2>
</div>
</div>
<div class="grid-x">
<div class="cell">
@p.emojyNav()
</div>
</div>
<div class="cell">
for categoryName, v := range emojy {
<ul class="no-bullet">
for _, c := range v {
<li class="">
{ fmt.Sprintf("%d", c.Count) } -
if categoryName != "emoji" && c.OnServer {
<span>✅</span>
} else if categoryName != "emoji" {
<span>✅</span>
}
if c.URL != "" {
<img src={ c.URL } alt={ c.Emojy } />
} else {
{ c.Emojy }
}
</li>
}
</ul>
2024-02-28 02:43:37 +00:00
}
</div>
2024-02-28 15:25:43 +00:00
</div>
2024-02-28 02:43:37 +00:00
}