Login page

FossilOrigin-Name: 8895885c69f1e4152cbcde2aae429ba59ab63f8b754d230fe51f76aa1b6d6579
This commit is contained in:
me@ow.nekobit.net 2022-02-15 02:56:16 +00:00
parent e5219082ef
commit 3b2b350f10
6 changed files with 79 additions and 1 deletions

View file

@ -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

2
dist/ratfe30.css vendored
View file

@ -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;

39
src/login.c Normal file
View file

@ -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 <https://www.gnu.org/licenses/>.
*/
#include <string.h>
#include <stdio.h>
#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);
}

26
src/login.h Normal file
View file

@ -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 <https://www.gnu.org/licenses/>.
*/
#ifndef LOGIN_H
#define LOGIN_H
#include <stddef.h>
#include <mastodont.h>
void content_login(mastodont_t* api, char** data, size_t data_size);
#endif // LOGIN_H

View file

@ -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 },
};

9
static/login.html Normal file
View file

@ -0,0 +1,9 @@
<h1>Login</h1>
<form action="/ratfe.cgi/login" method="post">
<label for="login-username">Username: </label>
<input type="text" id="login-username" name="username">
<label for="login-password">Password: </label>
<input type="password" id="login-password" name="password">
<input type="submit" value="Login">
</form>