Loading plugins/survey/survey.cpp +22 −17 Changes for plugins/survey/survey.cpp: 22 added lines, 17 removed lines. Original line number Diff line number Diff line Loading @@ -722,6 +722,7 @@ namespace blogi { bool renderSurvey(const int tid, libhttppp::HttpRequest &req, libhtmlpp::HtmlElement *page, const std::string &sessionid, const SurveyTemplate &tpl) { std::string _lang = getLang(*Args->database[tid]); std::string submitUrl = Args->config->buildurl("survey/" + tpl.name); // +1 for the participant info step size_t totalSteps = tpl.questions.size() + 1; Loading @@ -744,27 +745,31 @@ namespace blogi { // Step 0: Participant info (always required) html << "<div class=\"wizard-step active\" data-step=\"0\" data-required=\"true\">" << "<div class=\"step-counter\">Step 1 / " << totalSteps << "</div>" << "<div class=\"step-counter\">" << tr(_lang, "Step") << " 1 / " << totalSteps << "</div>" << "<div class=\"question\">" << "<div class=\"question-text required\">Your Information</div>" << "<div style=\"margin-bottom:12px;\"><label style=\"display:block;margin-bottom:4px;font-weight:600;\">First Name *</label>" << "<input type=\"text\" name=\"_firstname\" required placeholder=\"First Name\" " << "<div class=\"question-text required\">" << tr(_lang, "Your Information") << "</div>" << "<div style=\"margin-bottom:12px;\"><label style=\"display:block;margin-bottom:4px;font-weight:600;\">" << tr(_lang, "First Name") << " *</label>" << "<input type=\"text\" name=\"_firstname\" required placeholder=\"" << tr(_lang, "First Name") << "\" " << "style=\"width:100%;padding:10px;border:1px solid var(--blogi-border,#ddd);border-radius:6px;font-size:1em;\"/></div>" << "<div style=\"margin-bottom:12px;\"><label style=\"display:block;margin-bottom:4px;font-weight:600;\">Last Name *</label>" << "<input type=\"text\" name=\"_lastname\" required placeholder=\"Last Name\" " << "<div style=\"margin-bottom:12px;\"><label style=\"display:block;margin-bottom:4px;font-weight:600;\">" << tr(_lang, "Last Name") << " *</label>" << "<input type=\"text\" name=\"_lastname\" required placeholder=\"" << tr(_lang, "Last Name") << "\" " << "style=\"width:100%;padding:10px;border:1px solid var(--blogi-border,#ddd);border-radius:6px;font-size:1em;\"/></div>"; if (_companyRequired) { html << "<div style=\"margin-bottom:12px;\"><label style=\"display:block;margin-bottom:4px;font-weight:600;\">Company *</label>" << "<input type=\"text\" name=\"_company\" required placeholder=\"Company\" " html << "<div style=\"margin-bottom:12px;\"><label style=\"display:block;margin-bottom:4px;font-weight:600;\">" << tr(_lang, "Company") << " *</label>" << "<input type=\"text\" name=\"_company\" required placeholder=\"" << tr(_lang, "Company") << "\" " << "style=\"width:100%;padding:10px;border:1px solid var(--blogi-border,#ddd);border-radius:6px;font-size:1em;\"/></div>"; } else { html << "<div style=\"margin-bottom:12px;\"><label style=\"display:block;margin-bottom:4px;font-weight:600;\">" << tr(_lang, "Company (optional)") << "</label>" << "<input type=\"text\" name=\"_company\" placeholder=\"" << tr(_lang, "Company (optional)") << "\" " << "style=\"width:100%;padding:10px;border:1px solid var(--blogi-border,#ddd);border-radius:6px;font-size:1em;\"/></div>"; } html << "<div style=\"margin-bottom:12px;\"><label style=\"display:block;margin-bottom:4px;font-weight:600;\">Email *</label>" << "<input type=\"email\" name=\"_email\" required placeholder=\"your@email.com\" " << "style=\"width:100%;padding:10px;border:1px solid var(--blogi-border,#ddd);border-radius:6px;font-size:1em;\"/></div>" << "</div>" // .question << "<div class=\"step-error\">Please fill in all fields.</div>" << "<div class=\"step-error\">" << tr(_lang, "Please fill in all fields.") << "</div>" << "<div class=\"wizard-nav\"><span></span>" << "<button type=\"button\" class=\"wizard-btn btn-next\">Next</button>" << "<button type=\"button\" class=\"wizard-btn btn-next\">" << tr(_lang, "Next") << "</button>" << "</div></div>"; // Question steps (step 1 .. N) Loading @@ -772,7 +777,7 @@ namespace blogi { for (const auto &q : tpl.questions) { html << "<div class=\"wizard-step\" data-step=\"" << stepIdx << "\" data-required=\"" << (q.required ? "true" : "false") << "\">" << "<div class=\"step-counter\">Step " << (stepIdx + 1) << " / " << totalSteps << "</div>" << "<div class=\"step-counter\">" << tr(_lang, "Step") << " " << (stepIdx + 1) << " / " << totalSteps << "</div>" << "<div class=\"question\">" << "<div class=\"question-text" << (q.required ? " required" : "") << "\">" << q.text << "</div>"; Loading Loading @@ -806,23 +811,23 @@ namespace blogi { << "<input type=\"file\" name=\"" << q.id << "\" id=\"file_" << q.id << "\" accept=\"" << accept << "\" multiple/>" << "<div class=\"upload-icon\">📷</div>" << "<div class=\"upload-text\">Click or drag images here</div>" << "<div class=\"upload-text\">" << tr(_lang, "Click or drag images here") << "</div>" << "<div class=\"file-hint\">Max " << q.maxFileCount << " images, " << (q.maxFileSize / (1024 * 1024)) << " MB each</div>" << "</div>" << "<div class=\"image-list\" id=\"images_" << q.id << "\"></div>"; } else { // text html << "<textarea name=\"" << q.id << "\" placeholder=\"Your answer...\"></textarea>"; html << "<textarea name=\"" << q.id << "\" placeholder=\"" << tr(_lang, "Your answer...") << "\"></textarea>"; } html << "</div>"; // .question html << "<div class=\"step-error\">Please answer this question.</div>"; html << "<div class=\"step-error\">" << tr(_lang, "Please answer this question.") << "</div>"; html << "<div class=\"wizard-nav\">"; html << "<button type=\"button\" class=\"wizard-btn btn-prev\">Back</button>"; html << "<button type=\"button\" class=\"wizard-btn btn-prev\">" << tr(_lang, "Back") << "</button>"; if (stepIdx < (int)totalSteps - 1) html << "<button type=\"button\" class=\"wizard-btn btn-next\">Next</button>"; html << "<button type=\"button\" class=\"wizard-btn btn-next\">" << tr(_lang, "Next") << "</button>"; else html << "<button type=\"button\" class=\"wizard-btn btn-submit\">Submit</button>"; html << "<button type=\"button\" class=\"wizard-btn btn-submit\">" << tr(_lang, "Submit") << "</button>"; html << "</div>"; html << "</div>"; // .wizard-step ++stepIdx; Loading src/translations.h +38 −0 Changes for src/translations.h: 38 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -443,6 +443,44 @@ namespace blogi { // Plugin: youtube {"videos added!", "Videos hinzugefügt!"}, {"Insufficient rights to sync YouTube videos!", "Unzureichende Berechtigungen zum Synchronisieren von YouTube-Videos!"}, // Plugin: survey {"Surveys", "Umfragen"}, {"Add Survey", "Umfrage hinzufügen"}, {"Survey Settings", "Umfrage-Einstellungen"}, {"Email Templates", "E-Mail-Vorlagen"}, {"Survey Name (URL slug)","Umfrage-Name (URL-Slug)"}, {"Survey XML", "Umfrage-XML"}, {"Results", "Ergebnisse"}, {"Survey Results", "Umfrage-Ergebnisse"}, {"No survey specified", "Keine Umfrage angegeben"}, {"Receiver Email", "Empfänger E-Mail"}, {"Company field enabled (required)", "Firmenfeld aktiviert (Pflicht)"}, {"Temp Directory (config.yaml)", "Temp-Verzeichnis (config.yaml)"}, {"Template Name (e.g. survey-slug or 'default')", "Vorlagenname (z.B. Umfrage-Slug oder 'default')"}, {"HTML Template", "HTML-Vorlage"}, {"Added successfully!", "Erfolgreich hinzugefügt!"}, {"Deleted successfully", "Erfolgreich gelöscht"}, {"Invalid XML format", "Ungültiges XML-Format"}, {"Survey name already exists or DB error", "Umfragename existiert bereits oder DB-Fehler"}, {"Back to list", "Zurück zur Liste"}, {"Your Information", "Ihre Angaben"}, {"First Name", "Vorname"}, {"Last Name", "Nachname"}, {"Company", "Firma"}, {"Company (optional)", "Firma (optional)"}, {"Next", "Weiter"}, {"Back", "Zurück"}, {"Submit", "Absenden"}, {"Please fill in all fields.", "Bitte füllen Sie alle Felder aus."}, {"Please answer this question.", "Bitte beantworten Sie diese Frage."}, {"Your answer...", "Ihre Antwort..."}, {"Click or drag images here", "Klicken oder Bilder hierher ziehen"}, {"Step", "Schritt"}, {"Questions", "Fragen"}, {"Date", "Datum"}, {"Response", "Antwort"}, {"Options", "Optionen"}, {"Preview", "Vorschau"}, }; return m; } Loading Loading
plugins/survey/survey.cpp +22 −17 Changes for plugins/survey/survey.cpp: 22 added lines, 17 removed lines. Original line number Diff line number Diff line Loading @@ -722,6 +722,7 @@ namespace blogi { bool renderSurvey(const int tid, libhttppp::HttpRequest &req, libhtmlpp::HtmlElement *page, const std::string &sessionid, const SurveyTemplate &tpl) { std::string _lang = getLang(*Args->database[tid]); std::string submitUrl = Args->config->buildurl("survey/" + tpl.name); // +1 for the participant info step size_t totalSteps = tpl.questions.size() + 1; Loading @@ -744,27 +745,31 @@ namespace blogi { // Step 0: Participant info (always required) html << "<div class=\"wizard-step active\" data-step=\"0\" data-required=\"true\">" << "<div class=\"step-counter\">Step 1 / " << totalSteps << "</div>" << "<div class=\"step-counter\">" << tr(_lang, "Step") << " 1 / " << totalSteps << "</div>" << "<div class=\"question\">" << "<div class=\"question-text required\">Your Information</div>" << "<div style=\"margin-bottom:12px;\"><label style=\"display:block;margin-bottom:4px;font-weight:600;\">First Name *</label>" << "<input type=\"text\" name=\"_firstname\" required placeholder=\"First Name\" " << "<div class=\"question-text required\">" << tr(_lang, "Your Information") << "</div>" << "<div style=\"margin-bottom:12px;\"><label style=\"display:block;margin-bottom:4px;font-weight:600;\">" << tr(_lang, "First Name") << " *</label>" << "<input type=\"text\" name=\"_firstname\" required placeholder=\"" << tr(_lang, "First Name") << "\" " << "style=\"width:100%;padding:10px;border:1px solid var(--blogi-border,#ddd);border-radius:6px;font-size:1em;\"/></div>" << "<div style=\"margin-bottom:12px;\"><label style=\"display:block;margin-bottom:4px;font-weight:600;\">Last Name *</label>" << "<input type=\"text\" name=\"_lastname\" required placeholder=\"Last Name\" " << "<div style=\"margin-bottom:12px;\"><label style=\"display:block;margin-bottom:4px;font-weight:600;\">" << tr(_lang, "Last Name") << " *</label>" << "<input type=\"text\" name=\"_lastname\" required placeholder=\"" << tr(_lang, "Last Name") << "\" " << "style=\"width:100%;padding:10px;border:1px solid var(--blogi-border,#ddd);border-radius:6px;font-size:1em;\"/></div>"; if (_companyRequired) { html << "<div style=\"margin-bottom:12px;\"><label style=\"display:block;margin-bottom:4px;font-weight:600;\">Company *</label>" << "<input type=\"text\" name=\"_company\" required placeholder=\"Company\" " html << "<div style=\"margin-bottom:12px;\"><label style=\"display:block;margin-bottom:4px;font-weight:600;\">" << tr(_lang, "Company") << " *</label>" << "<input type=\"text\" name=\"_company\" required placeholder=\"" << tr(_lang, "Company") << "\" " << "style=\"width:100%;padding:10px;border:1px solid var(--blogi-border,#ddd);border-radius:6px;font-size:1em;\"/></div>"; } else { html << "<div style=\"margin-bottom:12px;\"><label style=\"display:block;margin-bottom:4px;font-weight:600;\">" << tr(_lang, "Company (optional)") << "</label>" << "<input type=\"text\" name=\"_company\" placeholder=\"" << tr(_lang, "Company (optional)") << "\" " << "style=\"width:100%;padding:10px;border:1px solid var(--blogi-border,#ddd);border-radius:6px;font-size:1em;\"/></div>"; } html << "<div style=\"margin-bottom:12px;\"><label style=\"display:block;margin-bottom:4px;font-weight:600;\">Email *</label>" << "<input type=\"email\" name=\"_email\" required placeholder=\"your@email.com\" " << "style=\"width:100%;padding:10px;border:1px solid var(--blogi-border,#ddd);border-radius:6px;font-size:1em;\"/></div>" << "</div>" // .question << "<div class=\"step-error\">Please fill in all fields.</div>" << "<div class=\"step-error\">" << tr(_lang, "Please fill in all fields.") << "</div>" << "<div class=\"wizard-nav\"><span></span>" << "<button type=\"button\" class=\"wizard-btn btn-next\">Next</button>" << "<button type=\"button\" class=\"wizard-btn btn-next\">" << tr(_lang, "Next") << "</button>" << "</div></div>"; // Question steps (step 1 .. N) Loading @@ -772,7 +777,7 @@ namespace blogi { for (const auto &q : tpl.questions) { html << "<div class=\"wizard-step\" data-step=\"" << stepIdx << "\" data-required=\"" << (q.required ? "true" : "false") << "\">" << "<div class=\"step-counter\">Step " << (stepIdx + 1) << " / " << totalSteps << "</div>" << "<div class=\"step-counter\">" << tr(_lang, "Step") << " " << (stepIdx + 1) << " / " << totalSteps << "</div>" << "<div class=\"question\">" << "<div class=\"question-text" << (q.required ? " required" : "") << "\">" << q.text << "</div>"; Loading Loading @@ -806,23 +811,23 @@ namespace blogi { << "<input type=\"file\" name=\"" << q.id << "\" id=\"file_" << q.id << "\" accept=\"" << accept << "\" multiple/>" << "<div class=\"upload-icon\">📷</div>" << "<div class=\"upload-text\">Click or drag images here</div>" << "<div class=\"upload-text\">" << tr(_lang, "Click or drag images here") << "</div>" << "<div class=\"file-hint\">Max " << q.maxFileCount << " images, " << (q.maxFileSize / (1024 * 1024)) << " MB each</div>" << "</div>" << "<div class=\"image-list\" id=\"images_" << q.id << "\"></div>"; } else { // text html << "<textarea name=\"" << q.id << "\" placeholder=\"Your answer...\"></textarea>"; html << "<textarea name=\"" << q.id << "\" placeholder=\"" << tr(_lang, "Your answer...") << "\"></textarea>"; } html << "</div>"; // .question html << "<div class=\"step-error\">Please answer this question.</div>"; html << "<div class=\"step-error\">" << tr(_lang, "Please answer this question.") << "</div>"; html << "<div class=\"wizard-nav\">"; html << "<button type=\"button\" class=\"wizard-btn btn-prev\">Back</button>"; html << "<button type=\"button\" class=\"wizard-btn btn-prev\">" << tr(_lang, "Back") << "</button>"; if (stepIdx < (int)totalSteps - 1) html << "<button type=\"button\" class=\"wizard-btn btn-next\">Next</button>"; html << "<button type=\"button\" class=\"wizard-btn btn-next\">" << tr(_lang, "Next") << "</button>"; else html << "<button type=\"button\" class=\"wizard-btn btn-submit\">Submit</button>"; html << "<button type=\"button\" class=\"wizard-btn btn-submit\">" << tr(_lang, "Submit") << "</button>"; html << "</div>"; html << "</div>"; // .wizard-step ++stepIdx; Loading
src/translations.h +38 −0 Changes for src/translations.h: 38 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -443,6 +443,44 @@ namespace blogi { // Plugin: youtube {"videos added!", "Videos hinzugefügt!"}, {"Insufficient rights to sync YouTube videos!", "Unzureichende Berechtigungen zum Synchronisieren von YouTube-Videos!"}, // Plugin: survey {"Surveys", "Umfragen"}, {"Add Survey", "Umfrage hinzufügen"}, {"Survey Settings", "Umfrage-Einstellungen"}, {"Email Templates", "E-Mail-Vorlagen"}, {"Survey Name (URL slug)","Umfrage-Name (URL-Slug)"}, {"Survey XML", "Umfrage-XML"}, {"Results", "Ergebnisse"}, {"Survey Results", "Umfrage-Ergebnisse"}, {"No survey specified", "Keine Umfrage angegeben"}, {"Receiver Email", "Empfänger E-Mail"}, {"Company field enabled (required)", "Firmenfeld aktiviert (Pflicht)"}, {"Temp Directory (config.yaml)", "Temp-Verzeichnis (config.yaml)"}, {"Template Name (e.g. survey-slug or 'default')", "Vorlagenname (z.B. Umfrage-Slug oder 'default')"}, {"HTML Template", "HTML-Vorlage"}, {"Added successfully!", "Erfolgreich hinzugefügt!"}, {"Deleted successfully", "Erfolgreich gelöscht"}, {"Invalid XML format", "Ungültiges XML-Format"}, {"Survey name already exists or DB error", "Umfragename existiert bereits oder DB-Fehler"}, {"Back to list", "Zurück zur Liste"}, {"Your Information", "Ihre Angaben"}, {"First Name", "Vorname"}, {"Last Name", "Nachname"}, {"Company", "Firma"}, {"Company (optional)", "Firma (optional)"}, {"Next", "Weiter"}, {"Back", "Zurück"}, {"Submit", "Absenden"}, {"Please fill in all fields.", "Bitte füllen Sie alle Felder aus."}, {"Please answer this question.", "Bitte beantworten Sie diese Frage."}, {"Your answer...", "Ihre Antwort..."}, {"Click or drag images here", "Klicken oder Bilder hierher ziehen"}, {"Step", "Schritt"}, {"Questions", "Fragen"}, {"Date", "Datum"}, {"Response", "Antwort"}, {"Options", "Optionen"}, {"Preview", "Vorschau"}, }; return m; } Loading