1
0
Fork 0
mirror of https://gitlab.com/niansa/discordlistforbots.git synced 2025-03-06 20:49:22 +01:00

Added imprint

This commit is contained in:
Nils 2021-06-11 19:07:35 +02:00
parent c018d190af
commit 4945cffee8
12 changed files with 41 additions and 16 deletions

View file

@ -16,9 +16,9 @@ Create a file named `config.h` in the root then paste and edit the following:
#define OAUTH_URL "https://discord.com/api/oauth2/authorize?client_id=795612465130897420&redirect_uri=http%3A%2F%2Flocalhost:8082%2Fdiscordauth&response_type=code&scope=identify"
#define CLIENT_ID "795612465130897420"
#define CLIENT_SECRET "EfXdBUarb8ZSZyyYQggSAzXYwIdXa3-y"
#define CLIENT_SECRET "<your secret here>"
#define REDIRECT_URI "http://localhost:8082/discordauth"
#define BOT_TOKEN "Nzk1NjEyNDY1MTMwODk3NDIw.X_L52Q.tr_WaAmgp-QvtS8EPSaJnZhG4Gk"
#define BOT_TOKEN "<your bot token here>"
#define LOG_WEBHOOK "824208240333291561/eI39bQGclrizr0OzRGrB_W7QI3gfY7tlYpWv8RkkDVzIOVFRDTjgkuavE7YfkIzDcGsy"
#define MODERATORS {609486822715818000, 703944517048598568, 705557092802625576, 664869643567235097, 775017772358434817}
@ -28,6 +28,8 @@ Create a file named `config.h` in the root then paste and edit the following:
#define SHORT_NAME "DFB"
#define LONG_NAME "Discordlist for Bots"
#define DESCRIPTION "Find a lot of bots that will be useful to your server"
#define IMPRINT "<your imprint here>"
(Original config.h, no longer in use)

View file

@ -171,6 +171,13 @@ void views::start(
callback(HttpResponse::newRedirectionResponse("/bots/@all", HttpStatusCode::k301MovedPermanently));
}
void views::imprint(
const HttpRequestPtr&, std::function<void (const HttpResponsePtr &)> &&callback
)
{
callback(HttpResponse::newHttpViewResponse("imprint.csp", {}));
}
void views::menu(
const HttpRequestPtr& req, std::function<void (const HttpResponsePtr &)> &&callback
)

View file

@ -55,6 +55,7 @@ public:
views();
static std::string htmlBr(const std::string&);
void start(const HttpRequestPtr&, std::function<void (const HttpResponsePtr &)> &&);
void imprint(const HttpRequestPtr&, std::function<void (const HttpResponsePtr &)> &&);
void menu(const HttpRequestPtr&, std::function<void (const HttpResponsePtr &)> &&);
void botlist(const HttpRequestPtr&, std::function<void (const HttpResponsePtr &)> &&);
void botdetail(const HttpRequestPtr&, std::function<void (const HttpResponsePtr &)> &&, uint64_t);
@ -67,6 +68,7 @@ public:
METHOD_LIST_BEGIN
ADD_METHOD_TO(views::start, "/", Get);
ADD_METHOD_TO(views::imprint, "/imprint", Get);
ADD_METHOD_TO(views::botlist, "/bots/@all", Get);
ADD_METHOD_TO(views::botlist, "/bots/@me", Get, "LoginFilter");
ADD_METHOD_TO(views::botlist, "/bots/@unapproved", Get, "LoginFilter");

View file

@ -126,3 +126,7 @@ body {
display:block;
}
}
.imprint_link {
color: white;
}

View file

@ -16,9 +16,9 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
%>
<%inc#include "controllers/views.h"
#include "controllers/views.h"
#include "config.h" %>
<%c++ auto sessionData = @@.get<SessionDataPtr>("sessionData");%>
<%layout global_layout%>

View file

@ -16,9 +16,9 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
%>
<%inc#include "controllers/views.h"
#include "controllers/views.h"
#include "config.h" %>
<%c++ auto bot = @@.get<Bot>("bot");%>
<%c++ auto canVote = @@.get<bool>("canVote");%>

View file

@ -16,9 +16,9 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
%>
<%inc#include "controllers/views.h"
#include "controllers/views.h"
#include "config.h" %>
<%c++ auto bot = @@.get<Bot>("bot");%>
<%layout global_layout%>

View file

@ -16,9 +16,9 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
%>
<%inc#include "controllers/views.h"
#include "controllers/views.h"
#include "config.h" %>
<%c++ auto modView = @@.get<bool>("modView");%>
<%c++ auto justMine = @@.get<bool>("justMine");%>

View file

@ -16,9 +16,9 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
%>
<%inc#include "controllers/views.h"
#include "controllers/views.h"
#include "config.h" %>
<%c++ auto sessionData = @@.get<SessionDataPtr>("sessionData");%>
<%c++ auto error = @@.get<std::string>("error");%>

View file

@ -16,9 +16,9 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
%>
<%inc#include "controllers/views.h"
#include "controllers/views.h"
#include "config.h" %>
<%c++ auto sessionData = @@.get<SessionDataPtr>("sessionData");%>
@ -67,6 +67,10 @@
[[]]
<div style="position:fixed;bottom:0;">
<a class="imprint_link" href="/imprint">Imprint</a>
</div>
</body>
</html>

6
views/imprint.csp Normal file
View file

@ -0,0 +1,6 @@
<%inc#include "config.h" %>
<%layout global_layout%>
<p>
{%IMPRINT%}
</p>

View file

@ -16,9 +16,9 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
%>
<%inc#include "controllers/views.h"
#include "controllers/views.h"
#include "config.h" %>
<%c++ auto ref = @@.get<std::string>("ref");%>
<%c++ auto sessionData = @@.get<SessionDataPtr>("sessionData");%>