QString mailer_mailView::toString() { responsebody.reserve(2035); responsebody += tr("\n"); responsebody += tr("\n"); tfetch(Users, userTo); tfetch(Users, userFrom); tfetch(PrivateMessages, message); responsebody += tr("\nSubject: SaveCode.RU сообщает о новом личном сообщении\nFrom: SaveCode.RU <*****@*****.**>\nTo: "); responsebody += THttpUtility::htmlEscape(userTo.username()); responsebody += tr(" <"); responsebody += THttpUtility::htmlEscape(userTo.email()); responsebody += tr(">\n\nЭТО СООБЩЕНИЕ БЫЛО ОТПРАВЛЕНО АВТОМАТИЧЕСКИ, НЕ ОТВЕЧАЙТЕ НА НЕГО!\n***************************\n\nУважаемый(ая) "); responsebody += THttpUtility::htmlEscape(userTo.username()); responsebody += tr(",\n\nSaveCode.RU информирует Вас, что Вы получили новое личное сообщение на SaveCode.RU от пользователя "); responsebody += THttpUtility::htmlEscape(userFrom.username()); responsebody += tr(" с заголовком \""); responsebody += THttpUtility::htmlEscape(message.title()); responsebody += tr("\".\n\nЧтобы прочитать сообщение в оригинале, ответить и/или удалить сообщение, Вам следует пройти по данной ссылке:\nhttp://savecode.ru/pm/inbox/"); responsebody += THttpUtility::htmlEscape(message.id()); responsebody += tr(".html\n\nТекст сообщения:\n***************\n"); responsebody += THttpUtility::htmlEscape(message.text()); responsebody += tr("\nbbcode_to_html({\n 'Quote' => [\n /\\[quote(:.*)?=(?:"|')?([-_.!? :a-zA-Z0-9А-ЯЁа-яё]*?[-_.!? :a-zA-Z0-9А-ЯЁа-яё][-_.!? :a-zA-Z0-9А-ЯЁа-яё]*?)(?:"|')?\\](.*?)\\[\\/quote\\1?\\]/miu,\n \"---Цитата (сообщение от \\\\2)---\\n\\\\3\\n---Конец цитаты---\",\n 'Quote with citation',\n '[quote=mike]please quote me[/quote]',\n :quote\n ],\n })\n\n***************\n\nНе отвечайте на данное электронное письмо! Чтобы ответить на сообщение, Вам следует пройти по данной ссылке:\nhttp://savecode.ru/pm/inbox/"); responsebody += THttpUtility::htmlEscape(message.id()); responsebody += tr(".html\n\nС наилучшими пожеланиями,\nSaveCode.RU\n"); return responsebody; }
QString codes_entryView::toString() { responsebody.reserve(4599); tfetch(QVariantMap, codes); responsebody += tr("\n<h3>"); responsebody += THttpUtility::htmlEscape(H::tr("Adding new code")); responsebody += tr("</h3>\n\n"); responsebody += QVariant(formTag(H::createUrl({"codes", "create"}, httpRequest().queryItemValue("page", "1")), Tf::Post, true)).toString(); responsebody += tr("\n\n\n <div class=\"field\">\n <label>"); responsebody += THttpUtility::htmlEscape(H::tr("Title")); responsebody += tr("</label>\n <input type=\"text\" name=\"codes[title]\" value=\"\" style=\"width: 400px\" class=\"form-input\" />\n </div>\n <div class=\"bbcodes\">\n <div class=\"bold\">\n "); responsebody += QVariant(linkTo("B", QUrl("#"), Tf::Get, "", a("class", "bbcode html") | a("data-editor", "b"))).toString(); responsebody += tr("\n "); responsebody += QVariant(linkTo("I", QUrl("#"), Tf::Get, "", a("class", "bbcode cursive") | a("data-editor", "i"))).toString(); responsebody += tr("\n "); responsebody += QVariant(linkTo("U", QUrl("#"), Tf::Get, "", a("class", "bbcode underline") | a("data-editor", "u"))).toString(); responsebody += tr("\n "); responsebody += QVariant(linkTo("S", QUrl("#"), Tf::Get, "", a("class", "bbcode del") | a("data-editor", "s"))).toString(); responsebody += tr("\n "); responsebody += QVariant(linkTo("IMG", QUrl("#"), Tf::Get, "", a("class", "bbcode html") | a("data-editor", "img"))).toString(); responsebody += tr("\n "); responsebody += QVariant(linkTo("URL", QUrl("#"), Tf::Get, "", a("class", "bbcode html") | a("data-editor", "url"))).toString(); responsebody += tr("\n </div>\n "); for(const auto& tag: H::codesTitles().toStdMap()) {; responsebody += tr(" "); responsebody += QVariant(linkTo(tag.first, QUrl("#"), Tf::Get, a("class", "bbcode") | a("data-editor", tag.second))).toString(); responsebody += tr("\n "); }; responsebody += tr(" </div>\n <br>\n <div class=\"field\" style=\"\">\n\n <textarea rows=\"15\" style=\"width:700px\" class=\"editor\" data-editor=\"javascript\" class=\"form-input\" required></textarea>\n </div>\n<input type=\"hidden\" id=\"code\" name=\"codes[code]\" value=\"\">\n\n <div class=\"field\">\n <small><i>"); responsebody += THttpUtility::htmlEscape(H::tr("Note: If picture less than 150x150, it will be resized to it")); responsebody += tr("</i></small><br>\n <label>"); responsebody += THttpUtility::htmlEscape(H::tr("Image")); responsebody += tr("</label>\n <input type=\"file\" name=\"attachments[]\" multiple>\n </div>\n\n"); if(controller()->isUserLoggedIn()) {; responsebody += tr(" <div class=\"field\">\n <label>"); responsebody += THttpUtility::htmlEscape(H::tr("Status")); responsebody += tr("</label>\n <input type=\"checkbox\" name=\"codes[status]\" value=\"1\" checked>\n </div>\n <div class=\"field\">\n <label>"); responsebody += THttpUtility::htmlEscape(H::tr("Editable")); responsebody += tr("</label>\n <input type=\"checkbox\" name=\"codes[editable]\" value=\"1\" checked>\n </div>\n <div class=\"field\">\n <label>"); responsebody += THttpUtility::htmlEscape(H::tr("Show from")); responsebody += tr("</label>\n <input type=\"text\" name=\"codes[showFrom]\" value=\"\">\n </div>\n"); } else {; responsebody += tr("\n"); tfetch(QString, captcha); responsebody += tr("\n<div class=\"field\">\n <img id=\"captcha_code\" src=\"data:image/png;base64,"); responsebody += THttpUtility::htmlEscape(captcha); responsebody += tr("\"><br>\n <small><a href=\"#\" id=\"update_captcha\" class=\"link\">"); responsebody += THttpUtility::htmlEscape(H::tr("Update code")); responsebody += tr("</a></small><br>\n <input type=\"text\" name=\"captcha\" value=\"\">\n</div>\n<script type=\"text/javascript\">\n$(\"#update_captcha\").click(function() {\n $.post('/captcha.html', function(data) {\n $(\"#captcha_code\").attr(\"src\", \"data:image/png;base64,\" + data);\n })\n return false;\n})\n</script>\n\n"); }; responsebody += tr(" <div class=\"actions\" style=\"margin-top: 20px;\">\n <input type=\"submit\" id=\"save_code\" value=\""); responsebody += THttpUtility::htmlEscape(H::tr("Save")); responsebody += tr("\" />\n </div>\n </form>\n"); return responsebody; }
QString users_editView::toString() { responsebody.reserve(2251); responsebody += QLatin1String("<!DOCTYPE html>\n"); tfetch(QVariantMap, users); responsebody += QLatin1String("<html>\n<head>\n <meta http-equiv=\"content-type\" content=\"text/html;charset=UTF-8\" />\n <title>"); responsebody += THttpUtility::htmlEscape(controller()->name() + ": " + controller()->activeAction()); responsebody += QLatin1String("</title>\n</head>\n<body>\n<p style=\"color: red\">"); tehex(error); responsebody += QLatin1String("</p>\n<p style=\"color: green\">"); tehex(notice); responsebody += QLatin1String("</p>\n\n<h1>Editing Users</h1>\n\n"); responsebody += QVariant(formTag(urla("save", users["id"]), Tf::Post)).toString(); responsebody += QLatin1String("\n <p>\n <label>ID<br /><input type=\"text\" name=\"users[id]\" value=\""); responsebody += THttpUtility::htmlEscape(users["id"]); responsebody += QLatin1String("\" readonly=\"readonly\" /></label>\n </p>\n <p>\n <label>Name<br /><input type=\"text\" name=\"users[name]\" value=\""); responsebody += THttpUtility::htmlEscape(users["name"]); responsebody += QLatin1String("\" /></label>\n </p>\n <p>\n <label>Code<br /><input type=\"text\" name=\"users[code]\" value=\""); responsebody += THttpUtility::htmlEscape(users["code"]); responsebody += QLatin1String("\" /></label>\n </p>\n <p>\n <label>Real Name<br /><input type=\"text\" name=\"users[realName]\" value=\""); responsebody += THttpUtility::htmlEscape(users["realName"]); responsebody += QLatin1String("\" /></label>\n </p>\n <p>\n <label>Sex<br /><input type=\"text\" name=\"users[sex]\" value=\""); responsebody += THttpUtility::htmlEscape(users["sex"]); responsebody += QLatin1String("\" /></label>\n </p>\n <p>\n <label>Avatar<br /><input type=\"text\" name=\"users[avatar]\" value=\""); responsebody += THttpUtility::htmlEscape(users["avatar"]); responsebody += QLatin1String("\" /></label>\n </p>\n <p>\n <input type=\"submit\" value=\"Update\" />\n </p>\n</form>\n\n"); responsebody += QVariant(linkTo("Show", urla("show", users["id"]))).toString(); responsebody += QLatin1String(" |\n"); responsebody += QVariant(linkTo("Back", urla("index"))).toString(); responsebody += QLatin1String("\n</body>\n</html>\n"); return responsebody; }
QString parkingqrcodes_indexView::toString() { responsebody.reserve(1688); responsebody += QLatin1String("<!DOCTYPE html>\n"); responsebody += QLatin1String("<html>\n<head>\n <meta http-equiv=\"content-type\" content=\"text/html;charset=UTF-8\" />\n <title>"); responsebody += THttpUtility::htmlEscape(controller()->name() + ": " + controller()->activeAction()); responsebody += QLatin1String("</title>\n</head>\n<body>\n\n<h1>Listing Parking Qrcodes</h1>\n\n"); responsebody += QVariant(linkTo("New entry", urla("entry"))).toString(); responsebody += QLatin1String("<br />\n<br />\n<table border=\"1\" cellpadding=\"5\" style=\"border: 1px #d0d0d0 solid; border-collapse: collapse;\">\n <tr>\n <th>ID</th>\n <th>Description</th>\n <th>Path</th>\n </tr>\n"); tfetch(QList<ParkingQrcodes>, parkingQrcodesList); for (const auto &i : parkingQrcodesList) {; responsebody += QLatin1String(" <tr>\n <td>"); responsebody += THttpUtility::htmlEscape(i.id()); responsebody += QLatin1String("</td>\n <td>"); responsebody += THttpUtility::htmlEscape(i.description()); responsebody += QLatin1String("</td>\n <td>"); responsebody += THttpUtility::htmlEscape(i.path()); responsebody += QLatin1String("</td>\n <td>\n "); responsebody += QVariant(linkTo("Show", urla("show", i.id()))).toString(); responsebody += QLatin1String("\n "); responsebody += QVariant(linkTo("Edit", urla("edit", i.id()))).toString(); responsebody += QLatin1String("\n "); responsebody += QVariant(linkTo("Remove", urla("remove", i.id()), Tf::Post, "confirm('Are you sure?')")).toString(); responsebody += QLatin1String("\n </td>\n </tr>\n"); }; responsebody += QLatin1String("</table>\n\n</body>\n</html>\n"); return responsebody; }
QString accountsrecharge_editView::toString() { responsebody.reserve(2212); responsebody += QLatin1String("<!DOCTYPE html>\n"); tfetch(QVariantMap, accountsRecharge); responsebody += QLatin1String("<html>\n<head>\n <meta http-equiv=\"content-type\" content=\"text/html;charset=UTF-8\" />\n <title>"); responsebody += THttpUtility::htmlEscape(controller()->name() + ": " + controller()->activeAction()); responsebody += QLatin1String("</title>\n</head>\n<body>\n<p style=\"color: red\">"); tehex(error); responsebody += QLatin1String("</p>\n<p style=\"color: green\">"); tehex(notice); responsebody += QLatin1String("</p>\n\n<h1>Editing Accounts Recharge</h1>\n\n"); responsebody += QVariant(formTag(urla("save", accountsRecharge["id"]), Tf::Post)).toString(); responsebody += QLatin1String("\n <p>\n <label>ID<br /><input type=\"text\" name=\"accountsRecharge[id]\" value=\""); responsebody += THttpUtility::htmlEscape(accountsRecharge["id"]); responsebody += QLatin1String("\" readonly=\"readonly\" /></label>\n </p>\n <p>\n <label>User ID<br /><input type=\"text\" name=\"accountsRecharge[userId]\" value=\""); responsebody += THttpUtility::htmlEscape(accountsRecharge["userId"]); responsebody += QLatin1String("\" /></label>\n </p>\n <p>\n <label>Amount<br /><input type=\"text\" name=\"accountsRecharge[amount]\" value=\""); responsebody += THttpUtility::htmlEscape(accountsRecharge["amount"]); responsebody += QLatin1String("\" /></label>\n </p>\n <p>\n <label>Source<br /><input type=\"text\" name=\"accountsRecharge[source]\" value=\""); responsebody += THttpUtility::htmlEscape(accountsRecharge["source"]); responsebody += QLatin1String("\" /></label>\n </p>\n <p>\n <label>Memo<br /><input type=\"text\" name=\"accountsRecharge[memo]\" value=\""); responsebody += THttpUtility::htmlEscape(accountsRecharge["memo"]); responsebody += QLatin1String("\" /></label>\n </p>\n <p>\n <input type=\"submit\" value=\"Update\" />\n </p>\n</form>\n\n"); responsebody += QVariant(linkTo("Show", urla("show", accountsRecharge["id"]))).toString(); responsebody += QLatin1String(" |\n"); responsebody += QVariant(linkTo("Back", urla("index"))).toString(); responsebody += QLatin1String("\n</body>\n</html>\n"); return responsebody; }
QString vehicle_indexView::toString() { responsebody.reserve(2070); responsebody += QLatin1String("<!DOCTYPE html>\n"); responsebody += QLatin1String("<html>\n<head>\n <meta http-equiv=\"content-type\" content=\"text/html;charset=UTF-8\" />\n <title>"); responsebody += THttpUtility::htmlEscape(controller()->name() + ": " + controller()->activeAction()); responsebody += QLatin1String("</title>\n</head>\n<body>\n\n<h1>Listing Vehicle</h1>\n\n"); responsebody += QVariant(linkTo("New entry", urla("entry"))).toString(); responsebody += QLatin1String("<br />\n<br />\n<table border=\"1\" cellpadding=\"5\" style=\"border: 1px #d0d0d0 solid; border-collapse: collapse;\">\n <tr>\n <th>ID</th>\n <th>Plate</th>\n <th>Engine No</th>\n <th>Frame No</th>\n <th>Register Time</th>\n <th>Vehicle Type</th>\n </tr>\n"); tfetch(QList<Vehicle>, vehicleList); for (const auto &i : vehicleList) {; responsebody += QLatin1String(" <tr>\n <td>"); responsebody += THttpUtility::htmlEscape(i.id()); responsebody += QLatin1String("</td>\n <td>"); responsebody += THttpUtility::htmlEscape(i.plate()); responsebody += QLatin1String("</td>\n <td>"); responsebody += THttpUtility::htmlEscape(i.engineNo()); responsebody += QLatin1String("</td>\n <td>"); responsebody += THttpUtility::htmlEscape(i.frameNo()); responsebody += QLatin1String("</td>\n <td>"); responsebody += THttpUtility::htmlEscape(i.registerTime()); responsebody += QLatin1String("</td>\n <td>"); responsebody += THttpUtility::htmlEscape(i.vehicleType()); responsebody += QLatin1String("</td>\n <td>\n "); responsebody += QVariant(linkTo("Show", urla("show", i.id()))).toString(); responsebody += QLatin1String("\n "); responsebody += QVariant(linkTo("Edit", urla("edit", i.id()))).toString(); responsebody += QLatin1String("\n "); responsebody += QVariant(linkTo("Remove", urla("remove", i.id()), Tf::Post, "confirm('Are you sure?')")).toString(); responsebody += QLatin1String("\n </td>\n </tr>\n"); }; responsebody += QLatin1String("</table>\n\n</body>\n</html>\n"); return responsebody; }
QString accountsrecharge_showView::toString() { responsebody.reserve(1715); responsebody += QLatin1String("<!DOCTYPE html>\n"); tfetch(AccountsRecharge, accountsRecharge); responsebody += QLatin1String("<html>\n<head>\n <meta http-equiv=\"content-type\" content=\"text/html;charset=UTF-8\" />\n <title>"); responsebody += THttpUtility::htmlEscape(controller()->name() + ": " + controller()->activeAction()); responsebody += QLatin1String("</title>\n</head>\n<body>\n<p style=\"color: red\">"); tehex(error); responsebody += QLatin1String("</p>\n<p style=\"color: green\">"); tehex(notice); responsebody += QLatin1String("</p>\n\n<h1>Showing Accounts Recharge</h1>\n<dt>ID</dt><dd>"); responsebody += THttpUtility::htmlEscape(accountsRecharge.id()); responsebody += QLatin1String("</dd><br />\n<dt>User ID</dt><dd>"); responsebody += THttpUtility::htmlEscape(accountsRecharge.userId()); responsebody += QLatin1String("</dd><br />\n<dt>Amount</dt><dd>"); responsebody += THttpUtility::htmlEscape(accountsRecharge.amount()); responsebody += QLatin1String("</dd><br />\n<dt>Source</dt><dd>"); responsebody += THttpUtility::htmlEscape(accountsRecharge.source()); responsebody += QLatin1String("</dd><br />\n<dt>Created at</dt><dd>"); responsebody += THttpUtility::htmlEscape(accountsRecharge.createdAt()); responsebody += QLatin1String("</dd><br />\n<dt>Memo</dt><dd>"); responsebody += THttpUtility::htmlEscape(accountsRecharge.memo()); responsebody += QLatin1String("</dd><br />\n\n"); responsebody += QVariant(linkTo("Edit", urla("edit", accountsRecharge.id()))).toString(); responsebody += QLatin1String(" |\n"); responsebody += QVariant(linkTo("Back", urla("index"))).toString(); responsebody += QLatin1String("\n\n</body>\n</html>\n"); return responsebody; }
QString user_editView::toString() { responsebody.reserve(1467); responsebody += tr("\n"); tfetch(QVariantMap, user); responsebody += tr("\n<p style=\"color: red\">"); tehex(error); responsebody += tr("</p>\n<p style=\"color: green\">"); tehex(notice); responsebody += tr("</p>\n\n<h1>Editing User</h1>\n\n"); responsebody += QVariant(formTag(urla("save", user["username"]), Tf::Post)).toString(); responsebody += tr("\n <p>\n <label>Username<br /><input type=\"text\" name=\"user[username]\" value=\""); responsebody += THttpUtility::htmlEscape(user["username"]); responsebody += tr("\" readonly=\"readonly\" /></label>\n </p>\n <p>\n <label>Email<br /><input type=\"text\" name=\"user[email]\" value=\""); responsebody += THttpUtility::htmlEscape(user["email"]); responsebody += tr("\" /></label>\n </p>\n <p>\n <label>Fullname<br /><input type=\"text\" name=\"user[fullname]\" value=\""); responsebody += THttpUtility::htmlEscape(user["fullname"]); responsebody += tr("\" /></label>\n </p>\n <p>\n <label>Password<br /><input type=\"text\" name=\"user[password]\" value=\""); responsebody += THttpUtility::htmlEscape(user["password"]); responsebody += tr("\" /></label>\n </p>\n <p>\n <input type=\"submit\" value=\"Update\" />\n </p>\n</form>\n\n"); responsebody += QVariant(linkTo("Show", urla("show", user["username"]))).toString(); responsebody += tr(" |\n"); responsebody += QVariant(linkTo("Back", urla("index"))).toString(); responsebody += tr("\n\n"); return responsebody; }
QString attachments_indexView::toString() { responsebody.reserve(2069); responsebody += tr("<h1>"); responsebody += THttpUtility::htmlEscape(H::tr("Listing pictures")); responsebody += tr("</h1>\n\n"); tfetch(QList<Attachments>, attachmentsList); responsebody += tr("\n\n"); if(attachmentsList.isEmpty()) {; responsebody += tr(" "); responsebody += THttpUtility::htmlEscape(H::tr("no_pictures")); responsebody += tr("\n"); } else {; responsebody += tr(" <div class=\"attachchments\">\n "); for (const auto &attachment : attachmentsList) {; responsebody += tr("\n <div class=\"attach_item\">\n\n "); if(attachment.codeId()) {; responsebody += tr(" "); responsebody += QVariant(linkTo(H::tr("View code"), H::createUrl({"codes", QString::number(attachment.code().id())}), Tf::Get, a("class", "link"))).toString(); responsebody += tr("\n "); }; responsebody += tr("\n <a href=\"/images/uploads/"); responsebody += THttpUtility::htmlEscape(attachment.image()); responsebody += tr("\" rel=\"prettyPhoto[gallery]\">\n "); responsebody += QVariant(imageTag("/images/uploads/" + attachment.image(), a("class", "attach"))).toString(); responsebody += tr("\n </a>\n\n "); responsebody += QVariant(linkTo(H::tr("Edit"), H::createUrl({"attachments", QString::number(attachment.id()), "edit"}), Tf::Get, a("class", "link"))).toString(); responsebody += tr("\n "); tfetch(Users, user); responsebody += tr(" "); if(attachment.canBeDeleted(user)) {; responsebody += tr(" "); responsebody += QVariant(linkTo(H::tr("Destroy"), H::createUrl({"attachments", QString::number(attachment.id()), "remove"}), Tf::Post, QString("confirm('%1')").arg(H::tr("Are you sure?")), a("class", "link"))).toString(); responsebody += tr("\n "); }; responsebody += tr(" </div>\n "); }; responsebody += tr(" </div>\n"); }; return responsebody; }
QString partial__form_headerView::toString() { responsebody.reserve(192); tfetch(QString, header); responsebody += tr("<div class=\"post\">\n <h2>"); responsebody += QVariant(H::tr(header.toStdString().c_str())).toString(); responsebody += tr("</h2>\n"); return responsebody; }
QString blog_editView::toString() { responsebody.reserve(1698); tfetch(QVariantMap, blog); tfetch(QList<User>, users); responsebody += tr("\n<p style=\"color: red\">"); tehex(error); responsebody += tr("</p>\n<p style=\"color: green\">"); tehex(notice); responsebody += tr("</p>\n\n<h1>Editing Blog</h1>\n\n"); responsebody += QVariant(formTag(urla("save", blog["id"]), Tf::Post)).toString(); responsebody += tr("\n <p>\n <label>ID<br />\n <b>"); responsebody += THttpUtility::htmlEscape(blog["id"]); responsebody += tr("</b>\n </p>\n <p>\n <label>Username<br />\n <select name=\"post[username]\" selected=\""); responsebody += THttpUtility::htmlEscape(blog["username"]); responsebody += tr("\">\n "); foreach (User user, users) {; responsebody += tr(" <option value=\""); responsebody += THttpUtility::htmlEscape(user.username()); responsebody += tr("\" >"); responsebody += THttpUtility::htmlEscape(user.fullname()); responsebody += tr("</option>\n "); };
QString version_indexView::toString() { responsebody.reserve(2335); responsebody += QLatin1String("<!DOCTYPE html>\n"); responsebody += QLatin1String("<html>\n<head>\n <meta http-equiv=\"content-type\" content=\"text/html;charset=UTF-8\" />\n <title>"); responsebody += THttpUtility::htmlEscape(controller()->name() + ": " + controller()->activeAction()); responsebody += QLatin1String("</title>\n</head>\n<body>\n\n<h1>Listing Version</h1>\n\n"); responsebody += QVariant(linkTo("New entry", urla("entry"))).toString(); responsebody += QLatin1String("<br />\n<br />\n<table border=\"1\" cellpadding=\"5\" style=\"border: 1px #d0d0d0 solid; border-collapse: collapse;\">\n <tr>\n <th>ID</th>\n <th>Appid</th>\n <th>Major Version</th>\n <th>Minor Version</th>\n <th>Revision</th>\n <th>Content</th>\n <th>Help</th>\n <th>Download Url</th>\n </tr>\n"); tfetch(QList<Version>, versionList); for (const auto &i : versionList) {; responsebody += QLatin1String(" <tr>\n <td>"); responsebody += THttpUtility::htmlEscape(i.id()); responsebody += QLatin1String("</td>\n <td>"); responsebody += THttpUtility::htmlEscape(i.appid()); responsebody += QLatin1String("</td>\n <td>"); responsebody += THttpUtility::htmlEscape(i.majorVersion()); responsebody += QLatin1String("</td>\n <td>"); responsebody += THttpUtility::htmlEscape(i.minorVersion()); responsebody += QLatin1String("</td>\n <td>"); responsebody += THttpUtility::htmlEscape(i.revision()); responsebody += QLatin1String("</td>\n <td>"); responsebody += THttpUtility::htmlEscape(i.content()); responsebody += QLatin1String("</td>\n <td>"); responsebody += THttpUtility::htmlEscape(i.help()); responsebody += QLatin1String("</td>\n <td>"); responsebody += THttpUtility::htmlEscape(i.downloadUrl()); responsebody += QLatin1String("</td>\n <td>\n "); responsebody += QVariant(linkTo("Show", urla("show", i.id()))).toString(); responsebody += QLatin1String("\n "); responsebody += QVariant(linkTo("Edit", urla("edit", i.id()))).toString(); responsebody += QLatin1String("\n "); responsebody += QVariant(linkTo("Remove", urla("remove", i.id()), Tf::Post, "confirm('Are you sure?')")).toString(); responsebody += QLatin1String("\n </td>\n </tr>\n"); }; responsebody += QLatin1String("</table>\n\n</body>\n</html>\n"); return responsebody; }
QString cms_editView::toString() { responsebody.reserve(2769); responsebody += tr("<!DOCTYPE html>\r\n"); tfetch(QVariantMap, cms); responsebody += tr("<html>\r\n<head>\r\n <meta http-equiv=\"content-type\" content=\"text/html;charset=UTF-8\" />\r\n <title>"); responsebody += THttpUtility::htmlEscape(controller()->name() + ": " + controller()->activeAction()); responsebody += tr("</title>\r\n</head>\r\n<body>\r\n<p style=\"color: red\">"); tehex(error); responsebody += tr("</p>\r\n<p style=\"color: green\">"); tehex(notice); responsebody += tr("</p>\r\n\r\n<h1>Editing Cms</h1>\r\n\r\n"); responsebody += QVariant(formTag(urla("save", cms["numberID"]), Tf::Post)).toString(); responsebody += tr("\r\n <p>\r\n <label>NumberID<br /><input type=\"text\" name=\"cms[numberID]\" value=\""); responsebody += THttpUtility::htmlEscape(cms["numberID"]); responsebody += tr("\" readonly=\"readonly\" /></label>\r\n </p>\r\n <p>\r\n <label>Name<br /><input type=\"text\" name=\"cms[name]\" value=\""); responsebody += THttpUtility::htmlEscape(cms["name"]); responsebody += tr("\" /></label>\r\n </p>\r\n <p>\r\n <label>Nickname<br /><input type=\"text\" name=\"cms[nickname]\" value=\""); responsebody += THttpUtility::htmlEscape(cms["nickname"]); responsebody += tr("\" /></label>\r\n </p>\r\n <p>\r\n <label>Password<br /><input type=\"text\" name=\"cms[password]\" value=\""); responsebody += THttpUtility::htmlEscape(cms["password"]); responsebody += tr("\" /></label>\r\n </p>\r\n <p>\r\n <label>ID<br /><input type=\"text\" name=\"cms[id]\" value=\""); responsebody += THttpUtility::htmlEscape(cms["id"]); responsebody += tr("\" /></label>\r\n </p>\r\n <p>\r\n <label>Phone<br /><input type=\"text\" name=\"cms[phone]\" value=\""); responsebody += THttpUtility::htmlEscape(cms["phone"]); responsebody += tr("\" /></label>\r\n </p>\r\n <p>\r\n <label>Belong<br /><input type=\"text\" name=\"cms[belong]\" value=\""); responsebody += THttpUtility::htmlEscape(cms["belong"]); responsebody += tr("\" /></label>\r\n </p>\r\n <p>\r\n <label>User Number<br /><input type=\"text\" name=\"cms[userNumber]\" value=\""); responsebody += THttpUtility::htmlEscape(cms["userNumber"]); responsebody += tr("\" /></label>\r\n </p>\r\n <p>\r\n <label>Role<br /><input type=\"text\" name=\"cms[role]\" value=\""); responsebody += THttpUtility::htmlEscape(cms["role"]); responsebody += tr("\" /></label>\r\n </p>\r\n <p>\r\n <input type=\"submit\" value=\"Update\" />\r\n </p>\r\n</form>\r\n\r\n"); responsebody += QVariant(linkTo("Show", urla("show", cms["numberID"]))).toString(); responsebody += tr(" |\r\n"); responsebody += QVariant(linkTo("Back", urla("index"))).toString(); responsebody += tr("\r\n</body>\r\n</html>\r\n"); return responsebody; }
QString version_editView::toString() { responsebody.reserve(2765); responsebody += QLatin1String("<!DOCTYPE html>\n"); tfetch(QVariantMap, version); responsebody += QLatin1String("<html>\n<head>\n <meta http-equiv=\"content-type\" content=\"text/html;charset=UTF-8\" />\n <title>"); responsebody += THttpUtility::htmlEscape(controller()->name() + ": " + controller()->activeAction()); responsebody += QLatin1String("</title>\n</head>\n<body>\n<p style=\"color: red\">"); tehex(error); responsebody += QLatin1String("</p>\n<p style=\"color: green\">"); tehex(notice); responsebody += QLatin1String("</p>\n\n<h1>Editing Version</h1>\n\n"); responsebody += QVariant(formTag(urla("save", version["id"]), Tf::Post)).toString(); responsebody += QLatin1String("\n <p>\n <label>ID<br /><input type=\"text\" name=\"version[id]\" value=\""); responsebody += THttpUtility::htmlEscape(version["id"]); responsebody += QLatin1String("\" readonly=\"readonly\" /></label>\n </p>\n <p>\n <label>Appid<br /><input type=\"text\" name=\"version[appid]\" value=\""); responsebody += THttpUtility::htmlEscape(version["appid"]); responsebody += QLatin1String("\" /></label>\n </p>\n <p>\n <label>Major Version<br /><input type=\"text\" name=\"version[majorVersion]\" value=\""); responsebody += THttpUtility::htmlEscape(version["majorVersion"]); responsebody += QLatin1String("\" /></label>\n </p>\n <p>\n <label>Minor Version<br /><input type=\"text\" name=\"version[minorVersion]\" value=\""); responsebody += THttpUtility::htmlEscape(version["minorVersion"]); responsebody += QLatin1String("\" /></label>\n </p>\n <p>\n <label>Revision<br /><input type=\"text\" name=\"version[revision]\" value=\""); responsebody += THttpUtility::htmlEscape(version["revision"]); responsebody += QLatin1String("\" /></label>\n </p>\n <p>\n <label>Content<br /><input type=\"text\" name=\"version[content]\" value=\""); responsebody += THttpUtility::htmlEscape(version["content"]); responsebody += QLatin1String("\" /></label>\n </p>\n <p>\n <label>Help<br /><input type=\"text\" name=\"version[help]\" value=\""); responsebody += THttpUtility::htmlEscape(version["help"]); responsebody += QLatin1String("\" /></label>\n </p>\n <p>\n <label>Download Url<br /><input type=\"text\" name=\"version[downloadUrl]\" value=\""); responsebody += THttpUtility::htmlEscape(version["downloadUrl"]); responsebody += QLatin1String("\" /></label>\n </p>\n <p>\n <input type=\"submit\" value=\"Update\" />\n </p>\n</form>\n\n"); responsebody += QVariant(linkTo("Show", urla("show", version["id"]))).toString(); responsebody += QLatin1String(" |\n"); responsebody += QVariant(linkTo("Back", urla("index"))).toString(); responsebody += QLatin1String("\n</body>\n</html>\n"); return responsebody; }
QString sysinfo_editView::toString() { responsebody.reserve(2760); responsebody += QLatin1String("<!DOCTYPE html>\n"); tfetch(QVariantMap, sysinfo); responsebody += QLatin1String("<html>\n<head>\n <meta http-equiv=\"content-type\" content=\"text/html;charset=UTF-8\" />\n <title>"); responsebody += THttpUtility::htmlEscape(controller()->name() + ": " + controller()->activeAction()); responsebody += QLatin1String("</title>\n</head>\n<body>\n<p style=\"color: red\">"); tehex(error); responsebody += QLatin1String("</p>\n<p style=\"color: green\">"); tehex(notice); responsebody += QLatin1String("</p>\n\n<h1>Editing Sysinfo</h1>\n\n"); responsebody += QVariant(formTag(urla("save", sysinfo["id"]), Tf::Post)).toString(); responsebody += QLatin1String("\n <p>\n <label>ID<br /><input type=\"text\" name=\"sysinfo[id]\" value=\""); responsebody += THttpUtility::htmlEscape(sysinfo["id"]); responsebody += QLatin1String("\" readonly=\"readonly\" /></label>\n </p>\n <p>\n <label>Company<br /><input type=\"text\" name=\"sysinfo[company]\" value=\""); responsebody += THttpUtility::htmlEscape(sysinfo["company"]); responsebody += QLatin1String("\" /></label>\n </p>\n <p>\n <label>Slogan<br /><input type=\"text\" name=\"sysinfo[slogan]\" value=\""); responsebody += THttpUtility::htmlEscape(sysinfo["slogan"]); responsebody += QLatin1String("\" /></label>\n </p>\n <p>\n <label>Website<br /><input type=\"text\" name=\"sysinfo[website]\" value=\""); responsebody += THttpUtility::htmlEscape(sysinfo["website"]); responsebody += QLatin1String("\" /></label>\n </p>\n <p>\n <label>Contact Hotline<br /><input type=\"text\" name=\"sysinfo[contactHotline]\" value=\""); responsebody += THttpUtility::htmlEscape(sysinfo["contactHotline"]); responsebody += QLatin1String("\" /></label>\n </p>\n <p>\n <label>Serv Ver<br /><input type=\"text\" name=\"sysinfo[servVer]\" value=\""); responsebody += THttpUtility::htmlEscape(sysinfo["servVer"]); responsebody += QLatin1String("\" /></label>\n </p>\n <p>\n <label>App Ver<br /><input type=\"text\" name=\"sysinfo[appVer]\" value=\""); responsebody += THttpUtility::htmlEscape(sysinfo["appVer"]); responsebody += QLatin1String("\" /></label>\n </p>\n <p>\n <label>Handset Ver<br /><input type=\"text\" name=\"sysinfo[handsetVer]\" value=\""); responsebody += THttpUtility::htmlEscape(sysinfo["handsetVer"]); responsebody += QLatin1String("\" /></label>\n </p>\n <p>\n <input type=\"submit\" value=\"Update\" />\n </p>\n</form>\n\n"); responsebody += QVariant(linkTo("Show", urla("show", sysinfo["id"]))).toString(); responsebody += QLatin1String(" |\n"); responsebody += QVariant(linkTo("Back", urla("index"))).toString(); responsebody += QLatin1String("\n</body>\n</html>\n"); return responsebody; }
QString privatemessages_showView::toString() { responsebody.reserve(5749); responsebody += tr("\n"); responsebody += QVariant(renderPartial("private_messages_links")).toString(); responsebody += tr("\n<br><br>\n\n"); tfetch(PrivateMessages, message); tfetch(QString, action); responsebody += tr("<div class=\"field\">\n<label>"); responsebody += THttpUtility::htmlEscape(H::tr("Title")); responsebody += tr("</label>\n<input type=\"text\" name=\"codes[title]\" value=\""); responsebody += THttpUtility::htmlEscape(message.title()); responsebody += tr("\" style=\"width: 400px\" class=\"form-input\" />\n</div>\n"); if(action == "inbox") {; responsebody += tr(" <p>\n <label>"); responsebody += THttpUtility::htmlEscape(H::tr("From")); responsebody += tr(":<label>\n<strong><span"); responsebody += THttpUtility::htmlEscape(H::specifiedClass(message.userFrom().username())); responsebody += tr(">\n "); responsebody += QVariant(H::specifiedText(message.userFrom().username(), linkTo(message.userFrom().username(), H::createUrl({"user", QString::number(message.userFrom().id())}), Tf::Get, "", a("class", "link")))).toString(); responsebody += tr("\n</span></strong>\n </p>\n"); } else {; responsebody += tr(" <p>\n <label>"); responsebody += THttpUtility::htmlEscape(H::tr("To")); responsebody += tr(":<label>\n<strong><span"); responsebody += THttpUtility::htmlEscape(H::specifiedClass(message.userTo().username())); responsebody += tr(">\n "); responsebody += QVariant(H::specifiedText(message.userTo().username(), linkTo(message.userTo().username(), H::createUrl({"user", QString::number(message.userTo().id())}), Tf::Get, "", a("class", "link")))).toString(); responsebody += tr("\n</span></strong>\n </p>\n"); }; responsebody += tr("<p>\n Текст сообщения:\n<hr style=\"margin:3px;margin-top:-2px;\">\n<div style=\"padding:15px\">\n "); responsebody += QVariant(H::parseCode(message.text())).toString(); responsebody += tr("\n</div>\n</p>\n\n"); if (!message.file().isEmpty() && H::fileExists(message.file())) {; responsebody += tr(" <p>\n <strong>Скачать:</strong>\n"); responsebody += QVariant(linkTo(QString("%1 (%2)").arg(H::tr("file")).arg(message.file()), QUrl("/private_messages/" + message.file()), Tf::Get, "", a("class", "link"))).toString(); responsebody += tr("\n </p>\n"); }; responsebody += tr("<hr style=\"margin:0;margin-bottom:30px\">\n\n\n <div class=\"bbcodes\">\n <div class=\"bold\">\n "); responsebody += QVariant(linkTo("B", QUrl("#"), Tf::Get, "", a("class", "bbcode html") | a("data-editor", "b"))).toString(); responsebody += tr("\n "); responsebody += QVariant(linkTo("I", QUrl("#"), Tf::Get, "", a("class", "bbcode cursive") | a("data-editor", "i"))).toString(); responsebody += tr("\n "); responsebody += QVariant(linkTo("U", QUrl("#"), Tf::Get, "", a("class", "bbcode underline") | a("data-editor", "u"))).toString(); responsebody += tr("\n "); responsebody += QVariant(linkTo("S", QUrl("#"), Tf::Get, "", a("class", "bbcode del") | a("data-editor", "s"))).toString(); responsebody += tr("\n "); responsebody += QVariant(linkTo("IMG", QUrl("#"), Tf::Get, "", a("class", "bbcode html") | a("data-editor", "img"))).toString(); responsebody += tr("\n "); responsebody += QVariant(linkTo("URL", QUrl("#"), Tf::Get, "", a("class", "bbcode html") | a("data-editor", "url"))).toString(); responsebody += tr("\n </div>\n "); for(const auto& tag: H::codesTitles().toStdMap()) {; responsebody += tr(" "); responsebody += QVariant(linkTo(tag.first, QUrl("#"), Tf::Get, a("class", "bbcode") | a("data-editor", tag.second))).toString(); responsebody += tr("\n "); }; responsebody += tr(" </div>\n <br>\n <div class=\"field\" style=\"\">\n\n <textarea rows=\"15\" style=\"width:700px\" class=\"editor\" data-editor=\"javascript\" class=\"form-input\" required>"); responsebody += THttpUtility::htmlEscape(message.text()); responsebody += tr("</textarea>\n </div>\n<input type=\"hidden\" id=\"code\" name=\"codes[code]\" value=\""); responsebody += THttpUtility::htmlEscape(message.text()); responsebody += tr("\">\n\n <div class=\"field\">\n <small><i>"); responsebody += THttpUtility::htmlEscape(H::tr("Note: If picture less than 150x150, it will be resized to it")); responsebody += tr("</i></small><br>\n <label>"); responsebody += THttpUtility::htmlEscape(H::tr("Image")); responsebody += tr("</label>\n <input type=\"file\" name=\"attachments[]\" multiple>\n </div>\n\n <script type=\"text/javascript\">\n var editors = [], i = 0;\n $('.editor').each(function(key, editor) {\n editors[i] = ace.edit(editor);\n editors[i].setTheme(\"ace/theme/eclipse\");\n editors[i].getSession().setMode(\"ace/mode/\" + (editor.lang ? editor.lang.toLowerCase() : 'javascript'));\n editor.style.fontSize='16px';\n var height = editors[i].getSession().getLength() * 18;\n editor.style.height = (height > 500 ? 500 : (height < 150 ? 150 : height)) + 'px'\n editors[i].setReadOnly(true)\n ++i;\n })\n\n var editor = document.getElementById('message')\n\n editors[i] = ace.edit('message');\n editors[i].setTheme(\"ace/theme/eclipse\");\n editors[i].getSession().setMode(\"ace/mode/\" + (editor.lang ? editor.lang.toLowerCase() : 'javascript'));\n editor.style.fontSize='16px';\n editor.style.height = '500px'\n </script>\n"); return responsebody; }