1
0
mirror of https://github.com/velour/catbase.git synced 2025-04-04 12:11:42 +00:00
catbase/plugins/emojy/stats.templ

54 lines
1.4 KiB
Plaintext
Raw Normal View History

2024-02-27 21:43:37 -05:00
package emojy
import "fmt"
templ (p *EmojyPlugin) emojyNav() {
2024-02-28 10:25:43 -05: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-27 21:43:37 -05:00
}
templ (p *EmojyPlugin) statsIndex(emojy emojyMap) {
2024-02-28 10:25:43 -05: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-27 21:43:37 -05:00
}
</div>
2024-02-28 10:25:43 -05:00
</div>
2024-02-27 21:43:37 -05:00
}