diff --git a/src/main.cpp b/src/main.cpp index ad00d3d..8284600 100644 --- a/src/main.cpp +++ b/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(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(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(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(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(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); + }); + diff --git a/src/templateConstCollection.cpp b/src/templateConstCollection.cpp index 6284602..dd09f68 100644 --- a/src/templateConstCollection.cpp +++ b/src/templateConstCollection.cpp @@ -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"; diff --git a/templates/freelancer_Profile.html b/templates/freelancer_Profile.html index 45cd2ca..59496a6 100644 --- a/templates/freelancer_Profile.html +++ b/templates/freelancer_Profile.html @@ -16,6 +16,9 @@
+
+ +

diff --git a/templates/freelancer_Submission_Management.html b/templates/freelancer_Submission_Management.html new file mode 100644 index 0000000..e85038e --- /dev/null +++ b/templates/freelancer_Submission_Management.html @@ -0,0 +1,26 @@ + + + + {{> templateIncludes/style.css.html}} + + + {{^COOKIE_LOGGED_IN}} + Please Log in. + {{/COOKIE_LOGGED_IN}} + {{#COOKIE_LOGGED_IN}} +
+ +
+
+ +
+ {{/COOKIE_LOGGED_IN}} + {{> templateIncludes/freelancerLoginSignupProfileLogoutInterface.html.html}} +
+ {{> templateIncludes/returnToIndexButton.html.html}} + + + + + + \ No newline at end of file diff --git a/templates/freelancer_Submission_Management_Add.html b/templates/freelancer_Submission_Management_Add.html new file mode 100644 index 0000000..589ae04 --- /dev/null +++ b/templates/freelancer_Submission_Management_Add.html @@ -0,0 +1,23 @@ + + + + {{> templateIncludes/style.css.html}} + + + {{^COOKIE_LOGGED_IN}} + Please Log in. + {{/COOKIE_LOGGED_IN}} + {{#COOKIE_LOGGED_IN}} +
+ +
+ {{/COOKIE_LOGGED_IN}} + {{> templateIncludes/freelancerLoginSignupProfileLogoutInterface.html.html}} +
+ {{> templateIncludes/returnToIndexButton.html.html}} + + + + + + \ No newline at end of file diff --git a/templates/freelancer_Submission_Management_View.html b/templates/freelancer_Submission_Management_View.html new file mode 100644 index 0000000..9800834 --- /dev/null +++ b/templates/freelancer_Submission_Management_View.html @@ -0,0 +1,26 @@ + + + + {{> templateIncludes/style.css.html}} + + + {{^COOKIE_LOGGED_IN}} + Please Log in. + {{/COOKIE_LOGGED_IN}} + {{#COOKIE_LOGGED_IN}} +
+ +
+
+ +
+ {{/COOKIE_LOGGED_IN}} + {{> templateIncludes/freelancerLoginSignupProfileLogoutInterface.html.html}} +
+ {{> templateIncludes/returnToIndexButton.html.html}} + + + + + + \ No newline at end of file