Freelancer profile page handler
template for the profile page and the template for the redirection to the profile page
This commit is contained in:
14
src/main.cpp
14
src/main.cpp
@ -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);
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
35
templates/freelancer_Profile.html
Normal file
35
templates/freelancer_Profile.html
Normal 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>
|
||||
|
||||
|
||||
|
17
templates/freelancer_Redirect_Profile.html
Normal file
17
templates/freelancer_Redirect_Profile.html
Normal 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>
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user