Freelancer profile page handler

template for the profile page and the template for the redirection to the profile page
This commit is contained in:
Tina_Azure
2023-05-10 23:12:51 +02:00
parent 8cadf0cad6
commit dd64311766
3 changed files with 66 additions and 0 deletions

View File

@ -624,6 +624,20 @@ int main(int argc, char *argv[]) {
return page.render(ctx);
});
/*
* Page for freelancer to sign up
*/
CROW_ROUTE(app, "/freelancer/profile")
([&, configuration](const crow::request& getRequest ) {
auto& cookieCtx = app.get_context<crow::CookieParser>(getRequest);
crow::mustache::context ctx;
string templateHTML = TEMPLATE_FREELANCER_PROFILE;
if (Utilities::checkCookieLoginState(configuration, cookieCtx))
ctx[MUSTACHE_COOKIE_LOGGED_IN] = true;
auto page = crow::mustache::load(templateHTML);
return page.render(ctx);
});

View File

@ -0,0 +1,35 @@
<!DOCTYPE html>
<html>
<head>
{{> templateIncludes/style.css.html}}
</head>
<body>
<h2>Freelancer Profile</h2>
{{^COOKIE_LOGGED_IN}}
Please Log in.
{{/COOKIE_LOGGED_IN}}
{{#COOKIE_LOGGED_IN}}
<div>
<form action="/freelancer/inbox" method="get">
<button type="submit" class="button">Commission Inbox</button>
</form>
<form action="/freelancer/createInvoice" method="get">
<button type="submit" class="button">Create Invoice</button>
</form>
</div>
<br>
<div>
<form action="/freelancer/settings" method="get">
<button type="submit" class="button">Change Account Settings</button>
</form>
<form action="/freelancer/aliasSetup" method="get">
<button type="submit" class="button">Create/Remove Alias</button>
</form>
</div>
{{/COOKIE_LOGGED_IN}}
{{> templateIncludes/freelancerLoginSignupProfileLogoutInterface.html.html}}
</body>
</html>

View File

@ -0,0 +1,17 @@
<!DOCTYPE html>
<html>
<head>
{{> templateIncludes/style.css.html}}
</head>
<body>
<h2>Already Logged In</h2>
<div>
<form action="/freelancer/profile" method="get">
<button type="submit" class="button">Proceed to Profile</button>
</form>
</div>
</body>
</html>