Freelancer Template base Managment page
This commit is contained in:
42
src/main.cpp
42
src/main.cpp
@ -625,7 +625,7 @@ int main(int argc, char *argv[]) {
|
||||
});
|
||||
|
||||
/*
|
||||
* Page for freelancer to sign up
|
||||
* Freelancer Profile page
|
||||
*/
|
||||
CROW_ROUTE(app, "/freelancer/profile")
|
||||
([&, configuration](const crow::request& getRequest ) {
|
||||
@ -638,6 +638,46 @@ int main(int argc, char *argv[]) {
|
||||
return page.render(ctx);
|
||||
});
|
||||
|
||||
/*
|
||||
* Page for freelancer to create/delete/edit Templates
|
||||
*/
|
||||
CROW_ROUTE(app, "/freelancer/templateManagement")
|
||||
([&, configuration](const crow::request& getRequest ) {
|
||||
auto& cookieCtx = app.get_context<crow::CookieParser>(getRequest);
|
||||
crow::mustache::context ctx;
|
||||
string templateHTML = TEMPLATE_FREELANCER_TEMPLATE_MANAGEMENT;
|
||||
if (Utilities::checkCookieLoginState(configuration, cookieCtx)) {
|
||||
ctx = Utilities::getFreelancerTemplates(configuration, cookieCtx.get_cookie(COOKIE_FREELANCER_EMAIL));
|
||||
ctx[MUSTACHE_COOKIE_LOGGED_IN] = true;
|
||||
}
|
||||
auto page = crow::mustache::load(templateHTML);
|
||||
return page.render(ctx);
|
||||
});
|
||||
|
||||
/*
|
||||
* Page for freelancer to create/delete/edit Templates
|
||||
*/
|
||||
CROW_ROUTE(app, "/freelancer/templateManagement/template/<string>").methods("POST"_method)
|
||||
([&, configuration](const crow::request& getRequest, string templateName ) {
|
||||
auto& cookieCtx = app.get_context<crow::CookieParser>(getRequest);
|
||||
crow::mustache::context ctx;
|
||||
string templateHTML = TEMPLATE_FREELANCER_TEMPLATE_MANAGEMENT;
|
||||
if (Utilities::checkCookieLoginState(configuration, cookieCtx))
|
||||
ctx[MUSTACHE_COOKIE_LOGGED_IN] = true;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
auto page = crow::mustache::load(templateHTML);
|
||||
return page.render(ctx);
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user