From b901a0be881a2229ee65e62e35ce4dc2a5c1b7d4 Mon Sep 17 00:00:00 2001 From: Dario Date: Wed, 1 Jul 2020 11:48:10 +0200 Subject: [PATCH] format error message for CheckTransactionPage with new html code --- .../HTTPInterface/CheckTransactionPage.cpp | 4 ++-- src/cpp/lib/ErrorList.cpp | 20 +++++++++++++++++++ src/cpp/lib/ErrorList.h | 1 + src/cpsp/header_navi_chr.cpsp | 2 +- 4 files changed, 24 insertions(+), 3 deletions(-) diff --git a/src/cpp/HTTPInterface/CheckTransactionPage.cpp b/src/cpp/HTTPInterface/CheckTransactionPage.cpp index f4c9b43dd..cbf9b5bb9 100644 --- a/src/cpp/HTTPInterface/CheckTransactionPage.cpp +++ b/src/cpp/HTTPInterface/CheckTransactionPage.cpp @@ -198,9 +198,9 @@ void CheckTransactionPage::handleRequest(Poco::Net::HTTPServerRequest& request, responseStream << "
\n"; responseStream << " menu\n"; responseStream << "
\n"; - responseStream << "
"; + responseStream << "
"; #line 34 "F:\\Gradido\\gradido_login_server\\src\\cpsp\\header_navi_chr.cpsp" - responseStream << ( getErrorsHtml() ); + responseStream << ( getErrorsHtmlNewFormat() ); responseStream << "
\n"; responseStream << "
\n"; responseStream << "
    \n"; diff --git a/src/cpp/lib/ErrorList.cpp b/src/cpp/lib/ErrorList.cpp index ec0ab8670..1e1fbd0fd 100644 --- a/src/cpp/lib/ErrorList.cpp +++ b/src/cpp/lib/ErrorList.cpp @@ -130,6 +130,26 @@ std::string ErrorList::getErrorsHtml() return res; } +std::string ErrorList::getErrorsHtmlNewFormat() +{ + std::string html; + + while (mErrorStack.size() > 0) { + auto error = std::unique_ptr(mErrorStack.top()); + mErrorStack.pop(); + html += "
    "; + html += error->getHtmlString(); + html += "
    "; + } + return html; +} +/* + +*/ + void ErrorList::sendErrorsAsEmail(std::string rawHtml/* = ""*/) { diff --git a/src/cpp/lib/ErrorList.h b/src/cpp/lib/ErrorList.h index 3fcc6cd96..3940a23c7 100644 --- a/src/cpp/lib/ErrorList.h +++ b/src/cpp/lib/ErrorList.h @@ -43,6 +43,7 @@ public: void printErrors(); std::string getErrorsHtml(); + std::string getErrorsHtmlNewFormat(); void sendErrorsAsEmail(std::string rawHtml = ""); diff --git a/src/cpsp/header_navi_chr.cpsp b/src/cpsp/header_navi_chr.cpsp index f72bd1332..cb4acaea4 100644 --- a/src/cpsp/header_navi_chr.cpsp +++ b/src/cpsp/header_navi_chr.cpsp @@ -31,7 +31,7 @@
    menu
    -
    <%= getErrorsHtml() %>
    +
    <%= getErrorsHtmlNewFormat() %>