Jottyfan
2022-10-09 20:36:08 +02:00
parent 3b33368374
commit a3df68e4f7
9 changed files with 206 additions and 5 deletions

View File

@ -0,0 +1,9 @@
class MyAjax {
constructor(url) {
this.url = url;
}
call(destdivid, needle) {
$("[id='" + destdivid + "']").load(this.url + '?needle=' + encodeURI(needle));
}
}

View File

@ -157,10 +157,22 @@
</div>
<div class="accordion-item">
<h2 class="accordion-header" id="searchpanel">
<button class="accordion-button" type="button" data-bs-toggle="collapse" data-bs-target="#searchdiv" aria-expanded="true" aria-control="searchdiv">Suchmaske</button>
<button class="accordion-button" type="button" data-bs-toggle="collapse" data-bs-target="#searchdiv" aria-expanded="true" aria-control="searchdiv">Suchmaske (einzelne Begriffe)</button>
</h2>
<div id="searchdiv" class="accordion-collapse collapse dist8" aria-labelled="searchpanel" data-bs-parent="#mainacc">TODO: add an ajax based search field for persons to directly edit
them</div>
<div id="searchdiv" class="accordion-collapse collapse dist8" aria-labelled="searchpanel" data-bs-parent="#mainacc">
<script th:inline="javascript">
/*<![CDATA[*/
var searchUrl = /*[[@{/confirmation/search}]]*/ '?';
var myAjax = new MyAjax(searchUrl);
/*]]>*/
</script>
<input type="text" placeholder="bitte Suchtext eingeben" class="form-control" onchange="myAjax.call('searchresult', this.value)" />
<div id="searchresult">
Die Suche ist eine einfache Textsuche. Bestenfalls sollte nur ein Begriff zum Suchen verwendet werden, also z.B. nur der Vor- ODER der Nachname, nicht beides.<br />
Es werden nur wenige Felder in der Datenbank durchsucht: Vorname, Nachname, Freizeitname und Freizeitjahr.<br />
Die Suche wird nach dem Verlassen des Suchtext-Eingabefeldes aktiviert.
</div>
</div>
</div>
</div>
</div>

View File

@ -14,6 +14,7 @@
<script th:src="@{/webjars/select2/4.0.13/js/select2.full.min.js}"></script>
<script th:src="@{/js/dataTables.de.js}"></script>
<script th:src="@{/js/mytoggle.js}"></script>
<script th:src="@{/js/myAjax.js}"></script>
<meta th:replace="${libs}"></meta>
</head>
<body>