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-13 10:34:31 +01:00

40 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" href="{%bot_id%}/detail" {%(bot.approved?"":"style='background-color:red;'")%}>
<table>
<tr>
<td>
<img src="{%bot.avatar_url%}" style="width:128px;height:128px;">
</td>
<td style="padding:10px;">
<h1 style="line-height:0px;">{%bot.name%}</h1>
<p>{%bot.short_description%}</p>
<%c++ if (not bot.approved) {%>
<i>Not yet approved</i>
<%c++ }%>
</td>
</tr>
</table>
</a>
<%c++ }%>
</div>