1
0
Fork 0
mirror of https://gitlab.com/niansa/discordlistforbots.git synced 2025-03-06 20:49:22 +01:00
discordlistforbots/views/botlist.csp
2021-01-14 08:46:44 +01:00

38 lines
1.3 KiB
Text

<%inc#include "controllers/views.h" %>
<%c++ auto modView = @@.get<bool>("modView");%>
<%c++ auto justMine = @@.get<bool>("justMine");%>
<%layout global_layout%>
<title>DFB</title>
<div class="container text-center">
<img style="width:15%;height:15%;" src="/logo.png">
<p class="title">Discordlist for Bots</p>
<p>Find a lot of bots that will be useful to your server</p>
<%c++ if (@@.get<bool>("authed")) {%>
<%c++ if (justMine) {%>
<a class="special-button" href="@all">All bots</a>
<%c++ } else {%>
<a class="special-button" href="@me">My bots</a>
<%c++ }%>
<a class="special-button" href="register">Register bot</a>
<%c++ }%>
<hr>
<br>
<%c++ for (const auto& [bot_id, bot] : @@.get<std::map<uint64_t, Bot>>("bots")) {%>
<a class="special-button tile" href="{%bot_id%}/detail" style="background-color:{%(bot.approved?"#222222":"red")%};color:white;">
<img src="{%bot.avatar_url%}" style="width:128px;height:128px;">
<center>
<div class="votesbox">
<p class="votestext">Votes: <b>{%bot.votes%}</b></p>
</div>
</center>
<p style="line-height:0px;font-size:20px;">{%bot.name%}</p>
<p>{%bot.short_description%}</p>
<%c++ if (not bot.approved) {%>
<i>Not yet approved</i>
<%c++ }%>
</a>
<hr class="tilespacer">
<%c++ }%>
</div>