base templates
This commit is contained in:
100
src/main.cpp
100
src/main.cpp
@ -945,6 +945,106 @@ int main(int argc, char *argv[]) {
|
||||
});
|
||||
|
||||
|
||||
/*
|
||||
* Page for freelancer to manage submissions for commissions
|
||||
*/
|
||||
CROW_ROUTE(app, "/freelancer/submissionManagement")
|
||||
([&, configuration](const crow::request& getRequest ) {
|
||||
auto& cookieCtx = app.get_context<crow::CookieParser>(getRequest);
|
||||
crow::mustache::context ctx;
|
||||
if (Utilities::checkCookieLoginState(configuration, cookieCtx)) {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
ctx[MUSTACHE_COOKIE_LOGGED_IN] = true;
|
||||
}
|
||||
auto page = crow::mustache::load(TEMPLATE_FREELANCER_SUBMISSION_MANAGEMENT);
|
||||
return page.render(ctx);
|
||||
});
|
||||
|
||||
/*
|
||||
* Page for freelancer to add a new submissions for a commission
|
||||
*/
|
||||
CROW_ROUTE(app, "/freelancer/submissionManagement/add")
|
||||
([&, configuration](const crow::request& getRequest ) {
|
||||
auto& cookieCtx = app.get_context<crow::CookieParser>(getRequest);
|
||||
crow::mustache::context ctx;
|
||||
if (Utilities::checkCookieLoginState(configuration, cookieCtx)) {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
ctx[MUSTACHE_COOKIE_LOGGED_IN] = true;
|
||||
}
|
||||
auto page = crow::mustache::load(TEMPLATE_FREELANCER_SUBMISSION_MANAGEMENT_ADD);
|
||||
return page.render(ctx);
|
||||
});
|
||||
|
||||
/*
|
||||
* Page for freelancer to view existing submissions
|
||||
*/
|
||||
CROW_ROUTE(app, "/freelancer/submissionManagement/view")
|
||||
([&, configuration](const crow::request& getRequest ) {
|
||||
auto& cookieCtx = app.get_context<crow::CookieParser>(getRequest);
|
||||
crow::mustache::context ctx;
|
||||
if (Utilities::checkCookieLoginState(configuration, cookieCtx)) {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
ctx[MUSTACHE_COOKIE_LOGGED_IN] = true;
|
||||
}
|
||||
auto page = crow::mustache::load(TEMPLATE_FREELANCER_SUBMISSION_MANAGEMENT_VIEW);
|
||||
return page.render(ctx);
|
||||
});
|
||||
|
||||
/*
|
||||
* Execute adding of submission
|
||||
*/
|
||||
CROW_ROUTE(app, "/freelancer/submissionManagement/add/fulfillment")
|
||||
([&, configuration](const crow::request& getRequest ) {
|
||||
auto& cookieCtx = app.get_context<crow::CookieParser>(getRequest);
|
||||
crow::mustache::context ctx;
|
||||
if (Utilities::checkCookieLoginState(configuration, cookieCtx)) {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
ctx[MUSTACHE_COOKIE_LOGGED_IN] = true;
|
||||
}
|
||||
auto page = crow::mustache::load(TEMPLATE_FREELANCER_SUBMISSION_MANAGEMENT_ADD);
|
||||
return page.render(ctx);
|
||||
});
|
||||
|
||||
/*
|
||||
* Page for freelancer to generate link to a particular submission
|
||||
*/
|
||||
CROW_ROUTE(app, "/freelancer/submissionManagement/view/generateLink")
|
||||
([&, configuration](const crow::request& getRequest ) {
|
||||
auto& cookieCtx = app.get_context<crow::CookieParser>(getRequest);
|
||||
crow::mustache::context ctx;
|
||||
if (Utilities::checkCookieLoginState(configuration, cookieCtx)) {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
ctx[MUSTACHE_COOKIE_LOGGED_IN] = true;
|
||||
}
|
||||
auto page = crow::mustache::load(TEMPLATE_FREELANCER_SUBMISSION_MANAGEMENT_VIEW_GENERATE_LINK);
|
||||
return page.render(ctx);
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -33,6 +33,10 @@ namespace TemplateConstCollection {
|
||||
const static std::string TEMPLATE_FREELANCER_ALIAS_MANAGEMENT_DELETE = "freelancer_Alias_Management_Delete.html";
|
||||
const static std::string TEMPLATE_FREELANCER_ALIAS_MANAGEMENT_NEW = "freelancer_Alias_Management_New.html";
|
||||
const static std::string TEMPLATE_FREELANCER_ALIAS_MANAGEMENT_NEW_FULFILMENT = "freelancer_Alias_Management_New_Fulfilment.html";
|
||||
const static std::string TEMPLATE_FREELANCER_SUBMISSION_MANAGEMENT = "freelancer_Submission_Management.html";
|
||||
const static std::string TEMPLATE_FREELANCER_SUBMISSION_MANAGEMENT_ADD = "freelancer_Submission_Management_Add.html";
|
||||
const static std::string TEMPLATE_FREELANCER_SUBMISSION_MANAGEMENT_VIEW = "freelancer_Submission_Management_View.html";
|
||||
const static std::string TEMPLATE_FREELANCER_SUBMISSION_MANAGEMENT_VIEW_GENERATE_LINK = "freelancer_Submission_Management_View_Generate_link.html";
|
||||
|
||||
//Mustache Error/Success variable names
|
||||
const static std::string MUSTACHE_ERROR_COMMISSIONS_CLOSED = "ERROR_COMMISSIONS_CLOSED";
|
||||
|
@ -16,6 +16,9 @@
|
||||
<form action="/freelancer/createInvoice" method="get">
|
||||
<button type="submit" class="button">Create Invoice</button>
|
||||
</form>
|
||||
<form action="/freelancer/submissionManagement" method="get">
|
||||
<button type="submit" class="button">Commission Submission Management</button>
|
||||
</form>
|
||||
</div>
|
||||
<br>
|
||||
<div>
|
||||
|
26
templates/freelancer_Submission_Management.html
Normal file
26
templates/freelancer_Submission_Management.html
Normal file
@ -0,0 +1,26 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
{{> templateIncludes/style.css.html}}
|
||||
</head>
|
||||
<body>
|
||||
{{^COOKIE_LOGGED_IN}}
|
||||
Please Log in.
|
||||
{{/COOKIE_LOGGED_IN}}
|
||||
{{#COOKIE_LOGGED_IN}}
|
||||
<form action="/freelancer/submissionManagement/add" method="get">
|
||||
<button type="submit" class="button">Add a submission for a commission</button>
|
||||
</form>
|
||||
<form action="/freelancer/submissionManagement/view" method="get">
|
||||
<button type="submit" class="button">View Submissions</button>
|
||||
</form>
|
||||
{{/COOKIE_LOGGED_IN}}
|
||||
{{> templateIncludes/freelancerLoginSignupProfileLogoutInterface.html.html}}
|
||||
<br>
|
||||
{{> templateIncludes/returnToIndexButton.html.html}}
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
|
||||
|
23
templates/freelancer_Submission_Management_Add.html
Normal file
23
templates/freelancer_Submission_Management_Add.html
Normal file
@ -0,0 +1,23 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
{{> templateIncludes/style.css.html}}
|
||||
</head>
|
||||
<body>
|
||||
{{^COOKIE_LOGGED_IN}}
|
||||
Please Log in.
|
||||
{{/COOKIE_LOGGED_IN}}
|
||||
{{#COOKIE_LOGGED_IN}}
|
||||
<form action="/freelancer/submissionManagement/add/fulfillment" method="post">
|
||||
<button type="submit" class="button">Add a submission for a commission</button>
|
||||
</form>
|
||||
{{/COOKIE_LOGGED_IN}}
|
||||
{{> templateIncludes/freelancerLoginSignupProfileLogoutInterface.html.html}}
|
||||
<br>
|
||||
{{> templateIncludes/returnToIndexButton.html.html}}
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
|
||||
|
26
templates/freelancer_Submission_Management_View.html
Normal file
26
templates/freelancer_Submission_Management_View.html
Normal file
@ -0,0 +1,26 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
{{> templateIncludes/style.css.html}}
|
||||
</head>
|
||||
<body>
|
||||
{{^COOKIE_LOGGED_IN}}
|
||||
Please Log in.
|
||||
{{/COOKIE_LOGGED_IN}}
|
||||
{{#COOKIE_LOGGED_IN}}
|
||||
<form action="/freelancer/submissionManagement/view/delete" method="post">
|
||||
<button type="submit" class="button">Delete Submission</button>
|
||||
</form>
|
||||
<form action="/freelancer/submissionManagement/view/generateLink" method="post">
|
||||
<button type="submit" class="button">Generate Link to submission</button>
|
||||
</form>
|
||||
{{/COOKIE_LOGGED_IN}}
|
||||
{{> templateIncludes/freelancerLoginSignupProfileLogoutInterface.html.html}}
|
||||
<br>
|
||||
{{> templateIncludes/returnToIndexButton.html.html}}
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user