From 3b2b350f10ded3e16bf27d7886be8231b50d886d Mon Sep 17 00:00:00 2001 From: "me@ow.nekobit.net" Date: Tue, 15 Feb 2022 02:56:16 +0000 Subject: [PATCH] Login page FossilOrigin-Name: 8895885c69f1e4152cbcde2aae429ba59ab63f8b754d230fe51f76aa1b6d6579 --- Makefile | 2 ++ dist/ratfe30.css | 2 +- src/login.c | 39 +++++++++++++++++++++++++++++++++++++++ src/login.h | 26 ++++++++++++++++++++++++++ src/main.c | 2 ++ static/login.html | 9 +++++++++ 6 files changed, 79 insertions(+), 1 deletion(-) create mode 100644 src/login.c create mode 100644 src/login.h create mode 100644 static/login.html diff --git a/Makefile b/Makefile index 8c8f950..61fd53d 100644 --- a/Makefile +++ b/Makefile @@ -34,6 +34,8 @@ $(PAGES_DIR)/config.chtml: $(PAGES_DIR)/config.html ./filec $< data_config_html > $@ $(PAGES_DIR)/account.chtml: $(PAGES_DIR)/account.html ./filec $< data_account_html > $@ +$(PAGES_DIR)/login.chtml: $(PAGES_DIR)/login.html + ./filec $< data_login_html > $@ $(MASTODONT_DIR): git clone $(MASTODONT_URL) || true diff --git a/dist/ratfe30.css b/dist/ratfe30.css index 009cfd5..9029397 100644 --- a/dist/ratfe30.css +++ b/dist/ratfe30.css @@ -110,7 +110,7 @@ input[type=button], input[type=submit], .sidebarbtn, .btn { margin: 4px; border-radius: 3px; - border: 1px solid #fcfcfc; + border: 1px solid #fcfcfc00; color: #000; text-decoration: none; transition: .2s; diff --git a/src/login.c b/src/login.c new file mode 100644 index 0000000..a4ac6f9 --- /dev/null +++ b/src/login.c @@ -0,0 +1,39 @@ +/* + * RatFE - Lightweight frontend for Pleroma + * Copyright (C) 2022 Nekobit + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +#include +#include +#include "base_page.h" +#include "login.h" +#include "../config.h" + +// Files +#include "../static/login.chtml" + +void content_login(mastodont_t* api, char** data, size_t data_size) +{ + + struct base_page b = { + .locale = L10N_EN_US, + .content = data_login_html, + .sidebar_right = NULL + }; + + // Output + render_base_page(&b); +} diff --git a/src/login.h b/src/login.h new file mode 100644 index 0000000..898fbf8 --- /dev/null +++ b/src/login.h @@ -0,0 +1,26 @@ +/* + * RatFE - Lightweight frontend for Pleroma + * Copyright (C) 2022 Nekobit + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +#ifndef LOGIN_H +#define LOGIN_H +#include +#include + +void content_login(mastodont_t* api, char** data, size_t data_size); + +#endif // LOGIN_H diff --git a/src/main.c b/src/main.c index 3cd2b66..b8ec9ee 100644 --- a/src/main.c +++ b/src/main.c @@ -24,6 +24,7 @@ #include "page_config.h" #include "path.h" #include "account.h" +#include "login.h" #include "local_config.h" int main(void) @@ -47,6 +48,7 @@ int main(void) ******************/ struct path_info paths[] = { { "/config", content_config }, + { "/login", content_login }, { "/@:", content_account }, }; diff --git a/static/login.html b/static/login.html new file mode 100644 index 0000000..c8415fa --- /dev/null +++ b/static/login.html @@ -0,0 +1,9 @@ +

Login

+ +
+ + + + + +