From dd6431176655041d4854976d48a929ee7d6232f6 Mon Sep 17 00:00:00 2001 From: Tina_Azure <-> Date: Wed, 10 May 2023 23:12:51 +0200 Subject: [PATCH] Freelancer profile page handler template for the profile page and the template for the redirection to the profile page --- src/main.cpp | 14 +++++++++ templates/freelancer_Profile.html | 35 ++++++++++++++++++++++ templates/freelancer_Redirect_Profile.html | 17 +++++++++++ 3 files changed, 66 insertions(+) create mode 100644 templates/freelancer_Profile.html create mode 100644 templates/freelancer_Redirect_Profile.html diff --git a/src/main.cpp b/src/main.cpp index b3fd7de..94a5eda 100644 --- a/src/main.cpp +++ b/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(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); + }); + diff --git a/templates/freelancer_Profile.html b/templates/freelancer_Profile.html new file mode 100644 index 0000000..0ec0c30 --- /dev/null +++ b/templates/freelancer_Profile.html @@ -0,0 +1,35 @@ + + + + {{> templateIncludes/style.css.html}} + + +

Freelancer Profile

+ {{^COOKIE_LOGGED_IN}} + Please Log in. + {{/COOKIE_LOGGED_IN}} + {{#COOKIE_LOGGED_IN}} +
+
+ +
+
+ +
+
+
+
+
+ +
+
+ +
+
+ {{/COOKIE_LOGGED_IN}} + {{> templateIncludes/freelancerLoginSignupProfileLogoutInterface.html.html}} + + + + + diff --git a/templates/freelancer_Redirect_Profile.html b/templates/freelancer_Redirect_Profile.html new file mode 100644 index 0000000..87e1337 --- /dev/null +++ b/templates/freelancer_Redirect_Profile.html @@ -0,0 +1,17 @@ + + + + {{> templateIncludes/style.css.html}} + + +

Already Logged In

+
+
+ +
+
+ + + + +