From 904287e448554bacd1b5c055200a2d73b6bff86f Mon Sep 17 00:00:00 2001
From: Taylor Smock <tsmock@meta.com>
Date: Thu, 28 Dec 2023 17:08:28 +0000
Subject: [PATCH] Add new ticket guide

Signed-off-by: Taylor Smock <tsmock@meta.com>
---
 site_footer.html | 26 ++++++++++++++++++++++++
 site_head.html   | 51 ++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 77 insertions(+)
 create mode 100644 site_footer.html
 create mode 100644 site_head.html

diff --git a/site_footer.html b/site_footer.html
new file mode 100644
index 0000000..6f653a1
--- /dev/null
+++ b/site_footer.html
@@ -0,0 +1,26 @@
+{#  This file allows customizing the appearance of the Trac installation.
+
+    Add your customizations to the the end of the HTML <body> content here
+    and rename the file to site_footer.html.
+
+    Note that it will take precedence over a global site_footer.html placed
+    in the directory specified by [inherit] templates_dir.
+
+    More information about site appearance customization can be found here:
+
+      https://trac.edgewall.org/wiki/TracInterfaceCustomization#SiteAppearance
+#}
+
+# if req.path_info == '/newticket' and 'preview' not in req.args:
+<div class="warning" id="newticketguide">
+<table style="border:0; border-collapse:separate; border-spacing:0 10px" class="wiki">
+<tr><td style="background:#FFFC75; border:1px solid #ccc; border-right:0" valign="top">
+		<p id="josm_warning_01">${ gettext("You are about to create a new JOSM ticket.") }</p>
+		<p id="josm_warning_02">${ gettext("Please make sure to always use directly in JOSM <a href=\"wiki/Help/Action/ReportBug\">Help/Report bug</a> or the button in <a href=\"wiki/Help/Action/About\">About Dialog</a> (Shift-F1) to come here:") | safe }</p>
+		<img src="raw-attachment/wiki/Help/Action/ReportBug/reportbug.png" alt="${ gettext("Bug report menu entry") }" height="103" width="213" />
+		<p id="josm_warning_03">${ gettext("Using this prefills the bug report with useful information for us (<a href=\"wiki/Help/Action/ShowStatusReport\">Status Report</a>). <b>Please do not create defect tickets without status report!</b>") | safe }</p>
+		<p id="josm_warning_04">${ gettext("In any case, don't be shy :) Please let us contact you if needed (either by <a href=\"register\">creating an account</a> or entering your e-mail address below which is normally not visible, but can be extracted in specific situations), and you will be notified about ticket progress.") | safe }</p>
+</td></tr>
+</table>
+</div>
+# endif
diff --git a/site_head.html b/site_head.html
new file mode 100644
index 0000000..7d5ad46
--- /dev/null
+++ b/site_head.html
@@ -0,0 +1,51 @@
+{#  This file allows customizing the appearance of the Trac installation.
+
+    Add your customizations to the the end of the HTML <head> here
+    and rename the file to site_head.html.
+
+    Note that it will take precedence over a global site_head.html placed
+    in the directory specified by [inherit] templates_dir.
+
+    More information about site appearance customization can be found here:
+
+      https://trac.edgewall.org/wiki/TracInterfaceCustomization#SiteAppearance
+#}
+
+<link rel="stylesheet" type="text/css" href="${href.chrome('site/style.css')}"/>
+
+
+# if req.path_info == '/newticket' and 'preview' not in req.args:
+<script>
+if (navigator.language.indexOf('fr') == 0) {
+  document.getElementById("josm_warning_01").innerHTML = 'Vous êtes sur le point de créer un nouveau ticket JOSM.';
+  document.getElementById("josm_warning_02").innerHTML = 'S\'il vous plaît, assurez-vous de toujours utiliser directement dans JOSM, <a href="wiki/Help/Action/ReportBug">Aide/Rapporter un bug</a> ou ce lien dans la <a href="wiki/Help/Action/About">fenêtre À propos</a> (Shift-F1):';
+  document.getElementById("josm_warning_03").innerHTML = 'Ceci pré-remplit le rapport de bug avec des informations utiles pour nous (<a href="wiki/Help/Action/ShowStatusReport">Rapport d\'état</a>). <b>Merci de pas créer de ticket <i>defect</i> sans rapport d\'état !</b>';
+  document.getElementById("josm_warning_04").innerHTML = 'Merci de rédiger le ticket en anglais. Dans tous les cas, ne soyez pas timides :) Veuillez nous laisser un moyen de vous contacter si nécessaire (soit en <a href="register">créant un compte</a> ou en rentrant une adresse e-mail ci-dessous (elle ne sera pas visible publiquement mais nous permettra de vous joindre, et vous serez notifié de l\'avancement du ticket).';
+} else if (navigator.language.indexOf('de') == 0) {
+  document.getElementById("josm_warning_01").innerHTML = 'Sie sind dabei, ein neues JOSM-Ticket zu erstellen.';
+  document.getElementById("josm_warning_02").innerHTML = 'Bitte nutzen Sie immer direkt in JOSM <a href="wiki/De:Help/Action/ReportBug">Hilfe → Fehler melden</a> oder die Schaltfläche im <a href="wiki/De:Help/Action/About">"Über JOSM..."-Fenster</a>, um hierher zu gelangen:';
+  document.getElementById("josm_warning_03").innerHTML = 'Auf diese Weise wird die Fehlermeldung mit hilfreichen Informationen für uns vorausgefüllt (<a href="wiki/De:Help/Action/ShowStatusReport">Statusübersicht</a>). <b>Bitte erstellen Sie keine Fehlertickets vom Typ <i>defect</i> ohne Statusübersicht!</b>';
+  document.getElementById("josm_warning_04").innerHTML = 'Bitte schreiben Sie wenn möglich die Informationen auf Englisch, damit alle Entwickler das Problem verstehen können. In jedem Fall, seien Sie nicht schüchtern :) Bitte geben Sie uns die Möglichkeit Sie wenn notwendig zu kontaktieren (entweder indem Sie sich <a href="register">einen Account</a> anlegen oder unten Ihre E-Mail-Adresse eingeben, welche normalerweise nicht öffentlich ist, in Spezialfällen aber extrahiert werden kann) und Sie werden über den Ticket-Fortschritt informiert).';
+} else if (navigator.language.indexOf('pt') == 0) {
+  document.getElementById("josm_warning_01").innerHTML = 'Você está prestes a criar um novo ticket JOSM.';
+  document.getElementById("josm_warning_02").innerHTML = 'Por favor, certifique-se de sempre utilizar <a href="wiki/Help/Action/ReportBug">Ajuda/Relatar erro</a> ou este link na <a href="wiki/Help/Action/About">janela Sobre</a> (Shift-F1) para chegar aqui:';
+  document.getElementById("josm_warning_03").innerHTML = 'Isso preenche o relatório de erros com informações úteis para nós (<a href="wiki/Help/Action/ShowStatusReport">Relatório de Status</a>). <b>Por favor, não crie um ticket do tipo <i>defect</i> sem um relatório de status!</b>';
+  document.getElementById("josm_warning_04").innerHTML = 'Em todo caso, não seja tímido :) Por favor, deixe-nos uma maneira de contatá-lo se necessário (quer seja <a href="register">criando uma conta</a> ou digitando seu endereço de e-mail abaixo (não será publicamente visível mas nos permitirá alcançá-lo, e você será notificado sobre o progresso do ticket).';
+} else if (navigator.language.indexOf('ru') == 0) {
+  document.getElementById("josm_warning_01").innerHTML = 'Вы собираетесь создать новую карточку для JOSM.';
+  document.getElementById("josm_warning_02").innerHTML = 'Убедитесь, что Вы использовали пункт меню <a href="wiki/Help/Action/ReportBug">Справка/Показать отчёт о состоянии</a> или ссылку в окне  <a href="wiki/Help/Action/About">"О программе"</a> (Shift-F1), чтобы попасть на эту страницу:';
+  document.getElementById("josm_warning_03").innerHTML = 'В этом случае отчёт об ошибке будет включать в себя полезную для нас информацию (<a href="wiki/Help/Action/ShowStatusReport">отчёт о состоянии</a>). <b>Пожалуйста, не создавайте карточек для <i>дефектов</i> без отчёта о состоянии!</b>';
+  document.getElementById("josm_warning_04").innerHTML = 'И ещё - не стесняйтесь, пожалуйста! :) Оставьте способ с Вами связаться для уточнения деталей. Лучше всего <a href="register">зарегистрироваться</a>, но можно просто ввести e-mail ниже. Адрес не будет выставлен на всеобщее обозрение, но позволит нам найти Вас. На него придут уведомления об обновлениях в этой карточке.';
+} else if (navigator.language.indexOf('es') == 0) {
+  document.getElementById("josm_warning_01").innerHTML = 'Usted está a punto de crear un nuevo ticket en JOSM.';
+  document.getElementById("josm_warning_02").innerHTML = 'Por favor, asegúrese de utilizar siempre <a href="wiki/Es:Help/Action/ReportBug">Ayuda/Reportar error</a> o este enlace en el <a href="wiki/Es:Help/Action/About">diálogo Acerca de</a> (Shift-F1) para venir aquí:';
+  document.getElementById("josm_warning_03").innerHTML = 'Usando esto se rellena el informe de error con información útil para nosotros (<a href="wiki/Es:Help/Action/ShowStatusReport">Informe de estado</a>). ¡Por favor, no crear tickets de tipo <i>defect</i> sin el informe de estado!';
+  document.getElementById("josm_warning_04").innerHTML = 'En cualquier caso, no sea tímido :) Por favor, déjenos una forma de contactarnos con usted de ser necesario (ya sea mediante la <a href="register">creación de una cuenta</a> o introduciendo su dirección de correo electrónico (no será visible públicamente pero nos permitirá comunicarnos con usted, y usted será notificado sobre el progreso del ticket)).';
+}
+  jQuery(function($) {
+    var $ntg = $("#newticketguide");
+    if ($ntg.length)
+	  $("#propertyform").prepend($ntg.detach());
+  });
+</script>
+# endif
-- 
2.39.2


