aboutsummaryrefslogtreecommitdiff
path: root/public
diff options
context:
space:
mode:
Diffstat (limited to 'public')
-rw-r--r--public/css/modif_page.css20
-rw-r--r--public/js/modif_page.js29
2 files changed, 43 insertions, 6 deletions
diff --git a/public/css/modif_page.css b/public/css/modif_page.css
index 8095766..4e38f1b 100644
--- a/public/css/modif_page.css
+++ b/public/css/modif_page.css
@@ -53,16 +53,20 @@
53 justify-content: space-evenly; 53 justify-content: space-evenly;
54 flex-wrap: wrap; 54 flex-wrap: wrap;
55} 55}
56.edit_page_zone p, .edit_block_zone p, .edit_page_zone form 56.new_block
57{ 57{
58 margin: 5px; 58 max-width: 300px;
59} 59}
60
61.new_block #bloc_title 60.new_block #bloc_title
62{ 61{
63 width: 70%; 62 width: 70%;
64 max-width: 300px; 63 max-width: 300px;
65} 64}
65.explanations
66{
67 font-style: italic;
68 font-size: smaller;
69}
66 70
67.modify_block img 71.modify_block img
68{ 72{
@@ -76,17 +80,21 @@
76{ 80{
77 background-color: white; 81 background-color: white;
78 margin: 8px 0; 82 margin: 8px 0;
79 padding: 5px;
80} 83}
81.modify_one_block > * 84.modify_one_block p
82{ 85{
83 /*text-wrap: nowrap;*/ 86 margin: 0px;
84} 87}
85.modify_one_block > div 88.modify_one_block > div
86{ 89{
90 padding: 4px;
87 display: flex; 91 display: flex;
88 align-items: center; 92 align-items: center;
89} 93}
94.modify_one_block > div > *
95{
96 margin: 4px;
97}
90.block_options 98.block_options
91{ 99{
92 flex-wrap: wrap; 100 flex-wrap: wrap;
diff --git a/public/js/modif_page.js b/public/js/modif_page.js
index ee2004b..bf269ee 100644
--- a/public/js/modif_page.js
+++ b/public/js/modif_page.js
@@ -176,6 +176,35 @@ function switchBlocsPositions(bloc_id, direction) {
176 }); 176 });
177} 177}
178 178
179function articlesOrderSelect(bloc_id){
180 const articles_order_select = document.getElementById('articles_order_select_' + bloc_id).value;
181
182 fetch('index.php?bloc_edit=change_articles_order', {
183 method: 'POST',
184 headers: { 'Content-Type': 'application/json' },
185 body: JSON.stringify({ id: bloc_id, chrono_order: articles_order_select })
186 })
187 .then(response => response.json())
188 .then(data => {
189 if(data.success){
190 // inverser l'ordre des articles!!
191 const parent = document.getElementById(bloc_id).querySelector(".section_child");
192 const articles = Array.from(parent.querySelectorAll("article"));
193 articles.reverse().forEach(article => {
194 parent.appendChild(article); // déplace dans le DOM, ne copie pas
195 });
196
197 console.log('ordre ' + articles_order_select);
198 }
199 else{
200 console.log("Erreur au changement de l'ordre d'affichage côté serveur");
201 }
202 })
203 .catch(error => {
204 console.error('Erreur:', error);
205 });
206}
207
179function changePresentation(bloc_id){ 208function changePresentation(bloc_id){
180 const presentation = document.getElementById('presentation_select_' + bloc_id).value; 209 const presentation = document.getElementById('presentation_select_' + bloc_id).value;
181 210