aligned "Neu" button with datatables search field

This commit is contained in:
eclipse 2025-04-28 17:14:42 +02:00
parent 75984984dd
commit ad6af25a48
2 changed files with 42 additions and 38 deletions

View File

@ -2,7 +2,8 @@
{% block title %}Texte{% endblock title %}
{% block script %}<script>
{% block script %}
<script>
const SCRIPT_ROOT = {{ request.script_root | tojson }};
const textValues = ["Titel", "Untertitel"];
const selectValues = ["Reihe", "Textform", "Sprache"];
@ -51,18 +52,26 @@
}
window.onload = function () {
// add event listeners
document.getElementById ("create-button").addEventListener("click", showCreateModal, false);
for (const el of document.querySelectorAll('.action-update') ) {
el.addEventListener("click", showUpdateModal, false);
}
// initialise DataTable
let table = new DataTable('#text-table', {
paging: false,
order: []
});
deRole("#text-table");
// create and append "New"-button to
let button = document.createElement("button");
button.id = "create-button";
button.setAttribute("title", "Text hinzufügen");
button.innerHTML = "Neu …";
button.addEventListener("click", showCreateModal, false);
document.getElementById("text-table_wrapper").firstElementChild.firstElementChild.appendChild(button);
// add event listeners
document.getElementById ("create-button").addEventListener("click", showCreateModal, false);
for (const el of document.querySelectorAll('.action-update') ) {
el.addEventListener("click", showUpdateModal, false);
}
}
</script>{% endblock script %}
@ -72,13 +81,6 @@
{% include "_icons.svg" %}
<section>
<button id="create-button" onclick="showCreateModal()" title="Text hinzufügen">
<!-- <svg viewbox="0 0 24 24"><use href="#create" /></svg> -->
Neu …
</button>
</section>
<table id="text-table">
<thead>
<tr>

View File

@ -2,7 +2,8 @@
{% block title %}Werke{% endblock title %}
{% block script %}<script>
{% block script %}
<script>
const SCRIPT_ROOT = {{ request.script_root | tojson }};
const textValues = ["Titel", "Untertitel", "Reihennummer", "Erscheinungsdatum", "ISBN_13", "ISBN_10", "ISSN", "Preis", "Klappentext", "Anmerkungen"];
const selectValues = ["Werksform", "Verlag", "Reihe"];
@ -55,20 +56,28 @@
}
window.onload = function () {
// add event listeners
document.getElementById ("create-button").addEventListener("click", showCreateModal, false);
for (const el of document.querySelectorAll('.action-update') ) {
el.addEventListener("click", showUpdateModal, false);
}
// initialise DataTable
let table = new DataTable('#werk-table', {
paging: false,
order: []
});
deRole("#werk-table");
// create and append "New"-button to
let button = document.createElement("button");
button.id = "create-button";
button.setAttribute("title", "Werk hinzufügen");
button.innerHTML = "Neu …";
button.addEventListener("click", showCreateModal, false);
document.getElementById("werk-table_wrapper").firstElementChild.firstElementChild.appendChild(button);
// add event listeners
for (const el of document.querySelectorAll('.action-update') ) {
el.addEventListener("click", showUpdateModal, false);
}
</script>{% endblock script %}
}
</script>
{% endblock script %}
{% block heading %}Werke{% endblock heading %}
@ -76,13 +85,6 @@
{% include "_icons.svg" %}
<section>
<button id="create-button" href="#" title="Werk hinzufügen">
<!-- <svg viewbox="0 0 24 24"><use href="#create" /></svg> -->
Neu …
</button>
</section>
<table id="werk-table">
<thead>
<tr>