diff --git a/README.md b/README.md index c2349d1..9c8a162 100644 --- a/README.md +++ b/README.md @@ -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 "" #define REDIRECT_URI "http://localhost:8082/discordauth" - #define BOT_TOKEN "Nzk1NjEyNDY1MTMwODk3NDIw.X_L52Q.tr_WaAmgp-QvtS8EPSaJnZhG4Gk" + #define BOT_TOKEN "" #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 "" (Original config.h, no longer in use) diff --git a/controllers/views.cc b/controllers/views.cc index 6725948..9c6281e 100644 --- a/controllers/views.cc +++ b/controllers/views.cc @@ -171,6 +171,13 @@ void views::start( callback(HttpResponse::newRedirectionResponse("/bots/@all", HttpStatusCode::k301MovedPermanently)); } +void views::imprint( + const HttpRequestPtr&, std::function &&callback + ) +{ + callback(HttpResponse::newHttpViewResponse("imprint.csp", {})); +} + void views::menu( const HttpRequestPtr& req, std::function &&callback ) diff --git a/controllers/views.h b/controllers/views.h index 38a124e..fae4739 100644 --- a/controllers/views.h +++ b/controllers/views.h @@ -55,6 +55,7 @@ public: views(); static std::string htmlBr(const std::string&); void start(const HttpRequestPtr&, std::function &&); + void imprint(const HttpRequestPtr&, std::function &&); void menu(const HttpRequestPtr&, std::function &&); void botlist(const HttpRequestPtr&, std::function &&); void botdetail(const HttpRequestPtr&, std::function &&, 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"); diff --git a/static/global.css b/static/global.css index 0f4cdd2..33c6070 100644 --- a/static/global.css +++ b/static/global.css @@ -126,3 +126,7 @@ body { display:block; } } + +.imprint_link { + color: white; +} diff --git a/views/authsuccess.csp b/views/authsuccess.csp index b1d1ee8..4421fa0 100644 --- a/views/authsuccess.csp +++ b/views/authsuccess.csp @@ -16,9 +16,9 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -%> -<%inc#include "controllers/views.h" + +#include "controllers/views.h" #include "config.h" %> <%c++ auto sessionData = @@.get("sessionData");%> <%layout global_layout%> diff --git a/views/botdetail.csp b/views/botdetail.csp index 63987e7..c0be102 100644 --- a/views/botdetail.csp +++ b/views/botdetail.csp @@ -16,9 +16,9 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -%> -<%inc#include "controllers/views.h" + +#include "controllers/views.h" #include "config.h" %> <%c++ auto bot = @@.get("bot");%> <%c++ auto canVote = @@.get("canVote");%> diff --git a/views/botedit.csp b/views/botedit.csp index d17191b..f7e053a 100644 --- a/views/botedit.csp +++ b/views/botedit.csp @@ -16,9 +16,9 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -%> -<%inc#include "controllers/views.h" + +#include "controllers/views.h" #include "config.h" %> <%c++ auto bot = @@.get("bot");%> <%layout global_layout%> diff --git a/views/botlist.csp b/views/botlist.csp index e7d67af..1c695be 100644 --- a/views/botlist.csp +++ b/views/botlist.csp @@ -16,9 +16,9 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -%> -<%inc#include "controllers/views.h" + +#include "controllers/views.h" #include "config.h" %> <%c++ auto modView = @@.get("modView");%> <%c++ auto justMine = @@.get("justMine");%> diff --git a/views/botregister.csp b/views/botregister.csp index 6a0108c..1818378 100644 --- a/views/botregister.csp +++ b/views/botregister.csp @@ -16,9 +16,9 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -%> -<%inc#include "controllers/views.h" + +#include "controllers/views.h" #include "config.h" %> <%c++ auto sessionData = @@.get("sessionData");%> <%c++ auto error = @@.get("error");%> diff --git a/views/global_layout.csp b/views/global_layout.csp index 5633f32..07d0887 100644 --- a/views/global_layout.csp +++ b/views/global_layout.csp @@ -16,9 +16,9 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -%> -<%inc#include "controllers/views.h" + +#include "controllers/views.h" #include "config.h" %> <%c++ auto sessionData = @@.get("sessionData");%> @@ -67,6 +67,10 @@ [[]] +
+ Imprint +
+ diff --git a/views/imprint.csp b/views/imprint.csp new file mode 100644 index 0000000..30fa8a0 --- /dev/null +++ b/views/imprint.csp @@ -0,0 +1,6 @@ +<%inc#include "config.h" %> +<%layout global_layout%> + +

+{%IMPRINT%} +

diff --git a/views/menu.csp b/views/menu.csp index cb6f46d..1d02ff0 100644 --- a/views/menu.csp +++ b/views/menu.csp @@ -16,9 +16,9 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -%> -<%inc#include "controllers/views.h" + +#include "controllers/views.h" #include "config.h" %> <%c++ auto ref = @@.get("ref");%> <%c++ auto sessionData = @@.get("sessionData");%>