up edit
This commit is contained in:
parent
16bc549ece
commit
19cb2f6458
5 changed files with 48 additions and 16 deletions
|
@ -17,10 +17,13 @@ import './edit.js';
|
|||
document.addEventListener('DOMContentLoaded', () => {
|
||||
console.log('DOMContentLoaded');
|
||||
|
||||
|
||||
|
||||
const randombg = genererCouleurPastel();
|
||||
// Appliquer la couleur au body
|
||||
document.body.style.backgroundColor = randombg;
|
||||
|
||||
document.querySelectorAll('body, .edit-land, .body-landing').forEach(element => {
|
||||
element.style.backgroundColor = randombg;
|
||||
});
|
||||
|
||||
// Gestion du bouton pour afficher tous les champs
|
||||
const btnShowAllFields = document.querySelector('#showAllFields');
|
||||
|
@ -30,7 +33,9 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||
// Sélectionner tous les inputs dans le formulaire
|
||||
const form = document.querySelector('form');
|
||||
if (form) {
|
||||
const hiddenInputs = form.querySelectorAll('.d-none');
|
||||
// Sélectionner tous les inputs sauf #validation_messages
|
||||
const hiddenInputs = form.querySelectorAll('#advanced_tags');
|
||||
|
||||
hiddenInputs.forEach(input => {
|
||||
input.classList.toggle('d-none');
|
||||
});
|
||||
|
|
|
@ -108,4 +108,8 @@ table.js-sort-table th:active {
|
|||
|
||||
.end-hour {
|
||||
margin-left: -1rem;
|
||||
}
|
||||
|
||||
.good_filled {
|
||||
border-color: green;
|
||||
}
|
|
@ -16,6 +16,29 @@ function colorHeadingTable() {
|
|||
|
||||
|
||||
function check_validity(e) {
|
||||
|
||||
list_inputs_good_to_fill = [
|
||||
'input[name="commerce_tag_value__contact:email"]',
|
||||
'input[name="commerce_tag_value__contact:phone"]',
|
||||
'input[name="commerce_tag_value__contact:website"]',
|
||||
'commerce_tag_value__contact:mastodon',
|
||||
'input[name="commerce_tag_value__address"]',
|
||||
'input[name="custom_opening_hours"]',
|
||||
'input[name="commerce_tag_value__contact:street"]',
|
||||
'input[name="commerce_tag_value__contact:housenumber"]',
|
||||
'input[name="custom__cuisine"]',
|
||||
]
|
||||
|
||||
list_inputs_good_to_fill.forEach(selector => {
|
||||
const input = document.querySelector(selector);
|
||||
if (input) {
|
||||
if (input.value.trim() !== '') {
|
||||
input.classList.add('good_filled');
|
||||
} else {
|
||||
input.classList.remove('good_filled');
|
||||
}
|
||||
}
|
||||
});
|
||||
let errors = [];
|
||||
document.querySelectorAll('.is-invalid').forEach(input => {
|
||||
input.classList.remove('is-invalid');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue