mirror of
https://forge.chapril.org/tykayn/osm-commerces
synced 2025-06-20 01:44:42 +02:00
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');
|
||||
|
|
|
@ -124,5 +124,8 @@
|
|||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
||||
{% block completion_progress %}
|
||||
{% endblock %}
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -18,9 +18,7 @@
|
|||
{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<div class="container-fluid mt-4">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-12 col-lg-10 col-xl-8">
|
||||
<div class="container edit-land mt-4">
|
||||
<div class="card shadow-sm">
|
||||
<div class="card-body">
|
||||
<h1 class="card-title h2 mb-4">{{ 'display.welcome'|trans }} {{ commerce_overpass.tags_converted.name }}</h1>
|
||||
|
@ -131,7 +129,7 @@
|
|||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="d-flex flex-column flex-md-row align-items-md-center justify-content-between">
|
||||
<div class="mb-3 mb-md-0">
|
||||
<div class="mb-3 mb-md-0 mr-4">
|
||||
<span class="last-modification">{{ 'display.last_modification'|trans }}: {{ commerce_overpass['@attributes'].timestamp }}</span>,
|
||||
<strong>{{ 'display.days_ago'|trans({'%days%': date(commerce_overpass['@attributes'].timestamp).diff(date()).days}) }}</strong>
|
||||
{{ 'display.by'|trans }}
|
||||
|
@ -149,13 +147,9 @@
|
|||
<button onclick="openInPanoramax()" class="btn btn-outline-secondary ms-2">
|
||||
<i class="bi bi-camera"></i> Voir dans Panoramax
|
||||
</button>
|
||||
</div>
|
||||
{# <a href="{{ path('app_admin_stats', {'zip_code': zone ?? '-1'}) }}" class="btn btn-outline-secondary">
|
||||
<i class="bi bi-bar-chart"></i>
|
||||
{{ 'display.view_stats'|trans }}
|
||||
</a> #}
|
||||
</div>
|
||||
|
||||
<a href="{{ path('app_admin_stats', {'zip_code': zone ?? '-1'}) }}" class="btn btn-outline-secondary">
|
||||
<a href="{{ path('app_public_dashboard' )}}" class="btn btn-outline-secondary">
|
||||
<i class="bi bi-bar-chart"></i>
|
||||
Dashboard
|
||||
</a>
|
||||
|
@ -167,11 +161,13 @@
|
|||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
{% block completion_progress %}
|
||||
<div id="completion_progress" class="">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
|
@ -186,7 +182,6 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
{% block javascripts %}
|
||||
{{ parent() }}
|
||||
|
@ -219,5 +214,7 @@ window.addEventListener('resize', () => {
|
|||
updateMapHeightForLargeScreens();
|
||||
});
|
||||
|
||||
check_validity();
|
||||
|
||||
</script>
|
||||
{% endblock %}
|
Loading…
Add table
Add a link
Reference in a new issue