diff options
Diffstat (limited to 'basicConfig/templates')
-rw-r--r-- | basicConfig/templates/residency.html | 312 |
1 files changed, 162 insertions, 150 deletions
diff --git a/basicConfig/templates/residency.html b/basicConfig/templates/residency.html index 9dc1153d..b434b9f9 100644 --- a/basicConfig/templates/residency.html +++ b/basicConfig/templates/residency.html @@ -5,168 +5,180 @@ th:with="lang=${#locale.language}" th:lang="${lang}"> <head> - <meta content="text/html; charset=utf-8" http-equiv="Content-Type"> - <meta name="viewport" content="width=device-width, initial-scale=1"> - <link rel="stylesheet" href="$contextPath/static/css/css_country.css" th:href="@{/static/css/css_country.css}"/> - <script type="text/javascript" src="$contextPath/static/js/jquery-3.6.0.js" - th:attr="src=@{/static/js/jquery-3.6.0.min.js}"></script> - <title th:text="#{gui.residency.title}">Österreichischer Wohnsitz</title> - <script type="text/javascript" th:inline="javascript"> - $(document).ready(function () { - $("#textResult").hide(); - $("#tableResult").hide(); - $("#loading").hide(); - $.ajaxSetup({ - beforeSend: function () { - $("#loading").show(); - }, - complete: function () { - $("#loading").hide(); - } - }); - }); + <meta content="text/html; charset=utf-8" http-equiv="Content-Type"> + <meta name="viewport" content="width=device-width, initial-scale=1"> + <link rel="stylesheet" href="$contextPath/static/css/css_country.css" th:href="@{/static/css/css_country.css}"/> + <script type="text/javascript" src="$contextPath/static/js/jquery-3.6.0.js" + th:attr="src=@{/static/js/jquery-3.6.0.min.js}"></script> + <title th:text="#{gui.residency.title}">Österreichischer Wohnsitz</title> + <script type="text/javascript" th:inline="javascript"> + $(document).ready(function () { + $("#textResult").hide(); + $("#tableResult").hide(); + $("#loading").hide(); + $.ajaxSetup({ + beforeSend: function () { + $("#loading").show(); + }, + complete: function () { + $("#loading").hide(); + } + }); + }); - function search() { - let updatedText = /*[[#{gui.residency.updated}]]*/ 'Updated text'; - let errorText = /*[[#{gui.residency.error}]]*/ 'Error'; - let applyText = /*[[#{gui.residency.apply}]]*/ 'Apply'; - let foundText = /*[[#{gui.residency.found}]]*/ 'Found {0}'; - let uniqueText = /*[[#{gui.residency.unique}]]*/ 'Unique'; - let invalidInputText = /*[[#{gui.residency.header.inputinvalid}]]*/ 'Invalid'; - if (!$("#inputForm #inputMunicipality").val().trim() && !$("#inputForm #inputVillage").val().trim()) { - $("#textResult").show().text(invalidInputText); - return; - } - $.ajax({ - type: "POST", - url: "http://localhost:8080/ms_connector/residency/search", - data: $("#inputForm").serialize() - }).done(function (data, textStatus, jqXHR) { - if (data["resultCount"] == 1) { - $("#textResult").show().text(uniqueText); - $("#tableResult tbody").empty(); - $("#tableResult").hide(); - $("#inputForm #inputMunicipality").val(data["results"][0]["municipality"]); - $("#inputForm #inputVillage").val(data["results"][0]["village"]); - $("#inputForm #inputStreet").val(data["results"][0]["street"]); - $("#inputForm #inputNumber").val(data["results"][0]["number"]); - return; + function search() { + let updatedText = /*[[#{gui.residency.updated}]]*/ 'Updated text'; + let errorText = /*[[#{gui.residency.error}]]*/ 'Error'; + let applyText = /*[[#{gui.residency.apply}]]*/ 'Apply'; + let foundText = /*[[#{gui.residency.found}]]*/ 'Found {0}'; + let uniqueText = /*[[#{gui.residency.unique}]]*/ 'Unique'; + let invalidInputText = /*[[#{gui.residency.header.inputinvalid}]]*/ 'Invalid'; + if (!$("#inputForm #inputMunicipality").val().trim() && !$("#inputForm #inputPostleitzahl").val().trim() && + !$("#inputForm #inputVillage").val().trim()) { + $("#textResult").show().text(invalidInputText); + return; + } + $.ajax({ + type: "POST", + url: "http://localhost:8080/ms_connector/residency/search", + data: $("#inputForm").serialize() + }).done(function (data, textStatus, jqXHR) { + if (data["resultCount"] == 1) { + $("#textResult").show().text(uniqueText); + $("#tableResult tbody").empty(); + $("#tableResult").hide(); + $("#inputForm #inputPostleitzahl").val(data["results"][0]["postleitzahl"]); + $("#inputForm #inputMunicipality").val(data["results"][0]["municipality"]); + $("#inputForm #inputVillage").val(data["results"][0]["village"]); + $("#inputForm #inputStreet").val(data["results"][0]["street"]); + $("#inputForm #inputNumber").val(data["results"][0]["number"]); + return; + } + $("#textResult").show().text(foundText.replace("{0}", data["resultCount"])); + $("#tableResult").show(); + $("#tableResult tbody").empty(); + $.each(data.results, function (i, output) { + $("#tableResult tbody") + .append($("<tr>") + .append($("<td>").text(output["postleitzahl"] !== null ? output["postleitzahl"] : "")) + .append($("<td>").text(output["municipality"] !== null ? output["municipality"] : "")) + .append($("<td>").text(output["village"] !== null ? output["village"] : "")) + .append($("<td>").text(output["street"] !== null ? output["street"] : "")) + .append($("<td>").text(output["number"] !== null ? output["number"] : "")) + .append($("<td>").text(applyText).attr("href", "#").click(function () { + $("#inputForm #inputPostleitzahl").val($(this).parent().children("td:nth-child(1)").text()); + $("#inputForm #inputMunicipality").val($(this).parent().children("td:nth-child(2)").text()); + $("#inputForm #inputVillage").val($(this).parent().children("td:nth-child(3)").text()); + $("#inputForm #inputStreet").val($(this).parent().children("td:nth-child(4)").text()); + $("#inputForm #inputNumber").val($(this).parent().children("td:nth-child(5)").text()); + $("#textResult").show().text(updatedText); + search(); + })) + ); + }) + if (data.results.length == 0) { + $("#tableResult").hide(); + } + }).fail(function (jqXHR, textStatus, errorThrown) { + $("#textResult").show().text(errorText); + }) } - $("#textResult").show().text(foundText.replace("{0}", data["resultCount"])); - $("#tableResult").show(); - $("#tableResult tbody").empty(); - $.each(data.results, function (i, output) { - $("#tableResult tbody") - .append($("<tr>") - .append($("<td>").text(output["municipality"] !== null ? output["municipality"] : "")) - .append($("<td>").text(output["village"] !== null ? output["village"] : "")) - .append($("<td>").text(output["street"] !== null ? output["street"] : "")) - .append($("<td>").text(output["number"] !== null ? output["number"] : "")) - .append($("<td>").text(applyText).attr("href", "#").click(function () { - $("#inputForm #inputMunicipality").val($(this).parent().children("td:nth-child(1)").text()); - $("#inputForm #inputVillage").val($(this).parent().children("td:nth-child(2)").text()); - $("#inputForm #inputStreet").val($(this).parent().children("td:nth-child(3)").text()); - $("#inputForm #inputNumber").val($(this).parent().children("td:nth-child(4)").text()); - $("#textResult").show().text(updatedText); - search(); - })) - ); - }) - }).fail(function (jqXHR, textStatus, errorThrown) { - $("#textResult").show().text(errorText); - }) - } - function clearInput() { - $("#inputForm #inputMunicipality").val(""); - $("#inputForm #inputVillage").val(""); - $("#inputForm #inputStreet").val(""); - $("#inputForm #inputNumber").val(""); - $("#textResult").hide(); - $("#tableResult").hide(); - } - </script> - <style> - td { - padding: 0.5em; - margin: 0.5em; - } - </style> + function clearInput() { + $("#inputForm #inputMunicipality").val(""); + $("#inputForm #inputVillage").val(""); + $("#inputForm #inputStreet").val(""); + $("#inputForm #inputNumber").val(""); + $("#textResult").hide(); + $("#tableResult").hide(); + } + </script> + <style> + td { + padding: 0.5em; + margin: 0.5em; + } + </style> </head> <body> <div id="page"> - <div class="languageselection" th:include="language_selection :: selectlanguage"> - LanguageSelectionBlock - </div> + <div class="languageselection" th:include="language_selection :: selectlanguage"> + LanguageSelectionBlock + </div> - <h2 th:text="#{gui.residency.header.selection}">Search your Austrian Residency</h2> + <h2 th:text="#{gui.residency.header.selection}">Search your Austrian Residency</h2> - <div id="residency"> - <form id="inputForm" method="post" action="$contextPath$submitEndpoint" - th:attr="action=@{${submitEndpoint}}"> - <div th:text="#{gui.residency.header.help}">Please enter a Municipality or Village first</div> - <div> - <label for="inputMunicipality" th:text="#{gui.residency.input.municipality}">Municipality</label> - <input type="text" id="inputMunicipality" name="municipality" value=""/> - </div> - <div> - <label for="inputVillage" th:text="#{gui.residency.input.village}">Village</label> - <input type="text" id="inputVillage" name="village" value=""/> - </div> - <div> - <label for="inputStreet" th:text="#{gui.residency.input.street}">Street</label> - <input type="text" id="inputStreet" name="street" value=""/> - </div> - <div> - <label for="inputNumber" th:text="#{gui.residency.input.number}">Number</label> - <input type="text" id="inputNumber" name="number" value=""/> - </div> - <div> - <button type="button" class="block" onclick="search()" th:attr="value=#{gui.residency.search}">Search - </button> - </div> - <div> - <button type="button" class="block" onclick="clearInput()" th:attr="value=#{gui.residency.clear}">Clear - </button> - </div> - <div> - <button type="button" class="block" th:attr="value=#{gui.residency.proceed}">Proceed</button> - </div> - <div> - <img id="loading" src="$contextPath/static/img/ajax-loader.gif" - th:attr="src=@{/static/img/ajax-loader.gif}" /> - </div> - <input type="hidden" name="pendingid" value="$pendingid" th:attr="value=${pendingid}"/> - </form> - </div> - - <div id="result"> - <div> - <p><span id="textResult"></span></p> + <div id="residency"> + <form id="inputForm" method="post" action="$contextPath$submitEndpoint" + th:attr="action=@{${submitEndpoint}}"> + <div th:text="#{gui.residency.header.help}">Please enter a Municipality or Village first</div> + <div> + <label for="inputPostleitzahl" th:text="#{gui.residency.input.postleitzahl}">Postleitzahl</label> + <input type="text" id="inputPostleitzahl" name="postleitzahl" value=""/> + </div> + <div> + <label for="inputMunicipality" th:text="#{gui.residency.input.municipality}">Municipality</label> + <input type="text" id="inputMunicipality" name="municipality" value=""/> + </div> + <div> + <label for="inputVillage" th:text="#{gui.residency.input.village}">Village</label> + <input type="text" id="inputVillage" name="village" value=""/> + </div> + <div> + <label for="inputStreet" th:text="#{gui.residency.input.street}">Street</label> + <input type="text" id="inputStreet" name="street" value=""/> + </div> + <div> + <label for="inputNumber" th:text="#{gui.residency.input.number}">Number</label> + <input type="text" id="inputNumber" name="number" value=""/> + </div> + <div> + <button type="button" class="block" onclick="search()" th:attr="value=#{gui.residency.search}">Search + </button> + </div> + <div> + <button type="button" class="block" onclick="clearInput()" th:attr="value=#{gui.residency.clear}">Clear + </button> + </div> + <div> + <button type="button" class="block" th:attr="value=#{gui.residency.proceed}">Proceed</button> + </div> + <div> + <img id="loading" src="$contextPath/static/img/ajax-loader.gif" + th:attr="src=@{/static/img/ajax-loader.gif}"/> + </div> + <input type="hidden" name="pendingid" value="$pendingid" th:attr="value=${pendingid}"/> + </form> </div> - <table id="tableResult"> - <thead> - <tr> - <th th:text="#{gui.residency.input.municipality}">Municipality</th> - <th th:text="#{gui.residency.input.village}">Village</th> - <th th:text="#{gui.residency.input.street}">Street</th> - <th th:text="#{gui.residency.input.number}">Number</th> - <th th:text="#{gui.residency.apply}">Apply</th> - </tr> - </thead> - <tbody> - </tbody> - </table> - </div> + <div id="result"> + <div> + <p><span id="textResult"></span></p> + </div> + <table id="tableResult"> + <thead> + <tr> + <th th:text="#{gui.residency.input.postleitzahl}">Postleitzahl</th> + <th th:text="#{gui.residency.input.municipality}">Municipality</th> + <th th:text="#{gui.residency.input.village}">Village</th> + <th th:text="#{gui.residency.input.street}">Street</th> + <th th:text="#{gui.residency.input.number}">Number</th> + <th th:text="#{gui.residency.apply}">Apply</th> + </tr> + </thead> + <tbody> + + </tbody> + </table> + </div> - <form class="block" method="post" action="$contextPath$submitEndpoint" th:attr="action=@{${submitEndpoint}}"> - <input type="submit" class="btn btn-outline-primary btn-block" value="Abbrechen/Cancel" - th:attr="value=#{gui.residency.cancel}"> - <input type="hidden" name="stopAuthProcess" value="true"> - <input type="hidden" name="pendingid" value="$pendingid" th:attr="value=${pendingid}"> - </form> + <form class="block" method="post" action="$contextPath$submitEndpoint" th:attr="action=@{${submitEndpoint}}"> + <input type="submit" class="btn btn-outline-primary btn-block" value="Abbrechen/Cancel" + th:attr="value=#{gui.residency.cancel}"> + <input type="hidden" name="stopAuthProcess" value="true"> + <input type="hidden" name="pendingid" value="$pendingid" th:attr="value=${pendingid}"> + </form> </div> </body> |