diff options
author | polo <ordipolo@gmx.fr> | 2025-09-01 18:52:17 +0200 |
---|---|---|
committer | polo <ordipolo@gmx.fr> | 2025-09-01 18:52:17 +0200 |
commit | f477314613beb26b0ce4c61ec0b1900df1de1cb1 (patch) | |
tree | d41ace78a572a11887e7cfa2611c3f02fb04e51c /public | |
parent | e642cd51d7e8599537f8514bef8d5d16096dddf8 (diff) | |
download | cms-f477314613beb26b0ce4c61ec0b1900df1de1cb1.zip |
renommage des présentations,modif présentation des blocs et largeur min (donc nb de colonnes) en mode grid, corrections de bugs et erreurs 404, le param page_modif n'est plus une action, légère symfonyfication du routeur
Diffstat (limited to 'public')
-rw-r--r-- | public/css/body.css | 28 | ||||
-rw-r--r-- | public/css/modif_page.css | 46 | ||||
-rw-r--r-- | public/js/modif_page.js | 75 |
3 files changed, 101 insertions, 48 deletions
diff --git a/public/css/body.css b/public/css/body.css index 17bdad5..af178a8 100644 --- a/public/css/body.css +++ b/public/css/body.css | |||
@@ -49,6 +49,10 @@ main | |||
49 | background-color: #E3F3FF; | 49 | background-color: #E3F3FF; |
50 | padding: 15px 0; | 50 | padding: 15px 0; |
51 | } | 51 | } |
52 | .hidden | ||
53 | { | ||
54 | display: none; | ||
55 | } | ||
52 | section > h3 | 56 | section > h3 |
53 | { | 57 | { |
54 | padding: 15px; | 58 | padding: 15px; |
@@ -62,28 +66,10 @@ section > h3 | |||
62 | padding: 15px; | 66 | padding: 15px; |
63 | } | 67 | } |
64 | 68 | ||
65 | .grid_columns | 69 | .grid > .section_child |
66 | { | 70 | { |
67 | display: grid; | 71 | display: grid; /* et c'est tout */ |
68 | grid-template-columns: repeat(3, 1fr); | 72 | /*grid-template-columns: repeat(auto-fit, minmax(' . $min_width . 'px, 1fr)); */ /* dans PostBlockBuilder et NewsBlockBuilder */ |
69 | } | ||
70 | @media screen and (max-width: 800px) | ||
71 | { | ||
72 | .grid_columns | ||
73 | { | ||
74 | grid-template-columns: repeat(2, 1fr); | ||
75 | } | ||
76 | } | ||
77 | @media screen and (max-width: 600px) | ||
78 | { | ||
79 | article | ||
80 | { | ||
81 | /*margin: 5px;*/ | ||
82 | } | ||
83 | .grid_columns | ||
84 | { | ||
85 | display: block; | ||
86 | } | ||
87 | } | 73 | } |
88 | .galery_photos | 74 | .galery_photos |
89 | { | 75 | { |
diff --git a/public/css/modif_page.css b/public/css/modif_page.css index d6fc23e..9048f05 100644 --- a/public/css/modif_page.css +++ b/public/css/modif_page.css | |||
@@ -5,7 +5,7 @@ | |||
5 | padding: 10px; | 5 | padding: 10px; |
6 | margin: 10px 15px; | 6 | margin: 10px 15px; |
7 | } | 7 | } |
8 | .page_modification form select, .page_modification form input[type=submit] | 8 | .page_modification select, .page_modification input[type=submit] |
9 | { | 9 | { |
10 | color: #ff1d04; | 10 | color: #ff1d04; |
11 | font-size: medium; | 11 | font-size: medium; |
@@ -17,7 +17,7 @@ | |||
17 | { | 17 | { |
18 | cursor: pointer; | 18 | cursor: pointer; |
19 | }*/ | 19 | }*/ |
20 | .page_modification form input[type=submit]:hover | 20 | .page_modification input[type=submit]:hover |
21 | { | 21 | { |
22 | background-color: yellow; | 22 | background-color: yellow; |
23 | border-radius: 4px; | 23 | border-radius: 4px; |
@@ -29,10 +29,10 @@ | |||
29 | flex-wrap: wrap; | 29 | flex-wrap: wrap; |
30 | justify-content: space-evenly; | 30 | justify-content: space-evenly; |
31 | } | 31 | } |
32 | .edit_page_zone, .edit_bloc_zone, .delete_page_zone | 32 | .edit_page_zone, .edit_block_zone, .delete_page_zone |
33 | { | 33 | { |
34 | background-color: #f0f0f0f0; | 34 | background-color: #f0f0f0f0; |
35 | margin: 5px; | 35 | margin: 8px 5px; |
36 | padding: 10px; | 36 | padding: 10px; |
37 | } | 37 | } |
38 | #edit_description | 38 | #edit_description |
@@ -47,32 +47,54 @@ | |||
47 | { | 47 | { |
48 | vertical-align: top; | 48 | vertical-align: top; |
49 | } | 49 | } |
50 | .edit_bloc_zone | 50 | .edit_block_zone |
51 | { | 51 | { |
52 | display: flex; | 52 | display: flex; |
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_bloc_zone p, .edit_page_zone form | 56 | .edit_page_zone p, .edit_block_zone p, .edit_page_zone form |
57 | { | 57 | { |
58 | margin: 5px; | 58 | margin: 5px; |
59 | } | 59 | } |
60 | 60 | ||
61 | .new_bloc #bloc_title | 61 | .new_block #bloc_title |
62 | { | 62 | { |
63 | width: 70%; | 63 | width: 70%; |
64 | max-width: 300px; | 64 | max-width: 300px; |
65 | } | 65 | } |
66 | .modify_bloc > div | 66 | |
67 | .modify_block img | ||
68 | { | ||
69 | vertical-align: middle; | ||
70 | } | ||
71 | .delete_page_zone | ||
72 | { | ||
73 | text-align: center; | ||
74 | } | ||
75 | .modify_one_block | ||
76 | { | ||
77 | background-color: white; | ||
78 | margin: 8px 0; | ||
79 | padding: 5px; | ||
80 | } | ||
81 | .modify_one_block > * | ||
82 | { | ||
83 | /*text-wrap: nowrap;*/ | ||
84 | } | ||
85 | .modify_one_block > div | ||
67 | { | 86 | { |
68 | display: flex; | 87 | display: flex; |
69 | align-items: baseline; | 88 | align-items: baseline; |
70 | } | 89 | } |
71 | .modify_bloc img | 90 | .block_options > * |
72 | { | 91 | { |
73 | vertical-align: middle; | 92 | /*display: flex; |
93 | flex-wrap: wrap;*/ | ||
94 | text-wrap: nowrap; | ||
74 | } | 95 | } |
75 | .delete_page_zone | 96 | .grid_options |
76 | { | 97 | { |
77 | text-align: center; | 98 | /*text-wrap: nowrap;*/ /* saut de la div grid_options */ |
99 | flex-wrap: wrap; /* éléments à l'intérieur de grid_options lorsque lui-même dépasse la largeur dispo (téléphone) */ | ||
78 | } \ No newline at end of file | 100 | } \ No newline at end of file |
diff --git a/public/js/modif_page.js b/public/js/modif_page.js index b307f69..615f34a 100644 --- a/public/js/modif_page.js +++ b/public/js/modif_page.js | |||
@@ -19,9 +19,7 @@ function changePageTitle(page_id){ | |||
19 | 19 | ||
20 | fetch('index.php?page_edit=page_title', { | 20 | fetch('index.php?page_edit=page_title', { |
21 | method: 'POST', | 21 | method: 'POST', |
22 | headers: { | 22 | headers: { 'Content-Type': 'application/json' }, |
23 | 'Content-Type': 'application/json' | ||
24 | }, | ||
25 | body: JSON.stringify({title: page_name.value, page_id: page_id}) | 23 | body: JSON.stringify({title: page_name.value, page_id: page_id}) |
26 | }) | 24 | }) |
27 | .then(response => response.json()) | 25 | .then(response => response.json()) |
@@ -49,9 +47,7 @@ function changePageTitle(page_id){ | |||
49 | 47 | ||
50 | fetch('index.php?page_edit=page_menu_path', { | 48 | fetch('index.php?page_edit=page_menu_path', { |
51 | method: 'POST', | 49 | method: 'POST', |
52 | headers: { | 50 | headers: { 'Content-Type': 'application/json' }, |
53 | 'Content-Type': 'application/json' | ||
54 | }, | ||
55 | body: JSON.stringify({page_menu_path: page_name_path.value, page_id: page_id}) | 51 | body: JSON.stringify({page_menu_path: page_name_path.value, page_id: page_id}) |
56 | }) | 52 | }) |
57 | .then(response => response.json()) | 53 | .then(response => response.json()) |
@@ -88,9 +84,7 @@ function changeDescription(node_data_id){ | |||
88 | 84 | ||
89 | fetch('index.php?page_edit=page_description', { | 85 | fetch('index.php?page_edit=page_description', { |
90 | method: 'POST', | 86 | method: 'POST', |
91 | headers: { | 87 | headers: { 'Content-Type': 'application/json' }, |
92 | 'Content-Type': 'application/json' | ||
93 | }, | ||
94 | body: JSON.stringify({description: textarea.value, node_data_id: node_data_id}) | 88 | body: JSON.stringify({description: textarea.value, node_data_id: node_data_id}) |
95 | }) | 89 | }) |
96 | .then(response => response.json()) | 90 | .then(response => response.json()) |
@@ -117,9 +111,7 @@ function renamePageBloc(bloc_id){ | |||
117 | 111 | ||
118 | fetch('index.php?bloc_edit=rename_page_bloc', { | 112 | fetch('index.php?bloc_edit=rename_page_bloc', { |
119 | method: 'POST', | 113 | method: 'POST', |
120 | headers: { | 114 | headers: { 'Content-Type': 'application/json' }, |
121 | 'Content-Type': 'application/json' | ||
122 | }, | ||
123 | body: JSON.stringify({bloc_title: input.value, bloc_id: bloc_id}) | 115 | body: JSON.stringify({bloc_title: input.value, bloc_id: bloc_id}) |
124 | }) | 116 | }) |
125 | .then(response => response.json()) | 117 | .then(response => response.json()) |
@@ -159,9 +151,7 @@ function switchBlocsPositions(bloc_id, direction, current_page) { | |||
159 | 151 | ||
160 | fetch('index.php?page=' + current_page + '&bloc_edit=switch_blocs_positions', { | 152 | fetch('index.php?page=' + current_page + '&bloc_edit=switch_blocs_positions', { |
161 | method: 'POST', | 153 | method: 'POST', |
162 | headers: { | 154 | headers: { 'Content-Type': 'application/json' }, |
163 | 'Content-Type': 'application/json' | ||
164 | }, | ||
165 | body: JSON.stringify({ id1: bloc_id, id2: parseInt(other_bloc.id) }) | 155 | body: JSON.stringify({ id1: bloc_id, id2: parseInt(other_bloc.id) }) |
166 | }) | 156 | }) |
167 | .then(response => response.json()) | 157 | .then(response => response.json()) |
@@ -187,4 +177,59 @@ function switchBlocsPositions(bloc_id, direction, current_page) { | |||
187 | .catch(error => { | 177 | .catch(error => { |
188 | console.error('Erreur:', error); | 178 | console.error('Erreur:', error); |
189 | }); | 179 | }); |
180 | } | ||
181 | |||
182 | function changePresentation(bloc_id){ | ||
183 | const presentation = document.getElementById('presentation_select_' + bloc_id).value; | ||
184 | |||
185 | fetch('index.php?bloc_edit=change_presentation', { | ||
186 | method: 'POST', | ||
187 | headers: { 'Content-Type': 'application/json' }, | ||
188 | body: JSON.stringify({ id: bloc_id, presentation: presentation }) | ||
189 | }) | ||
190 | .then(response => response.json()) | ||
191 | .then(data => { | ||
192 | if(data.success){ | ||
193 | document.getElementById(bloc_id).className = presentation; | ||
194 | document.getElementById('cols_min_width_edit_' + bloc_id).className = presentation === 'grid' ? '' : 'hidden'; | ||
195 | console.log('changement de présentation'); | ||
196 | } | ||
197 | else{ | ||
198 | console.log('Erreur au changement de présentation côté serveur'); | ||
199 | } | ||
200 | }) | ||
201 | .catch(error => { | ||
202 | console.error('Erreur:', error); | ||
203 | }); | ||
204 | } | ||
205 | |||
206 | function changeColsMinWidth(bloc_id){ | ||
207 | const cols_min_width_input = document.getElementById('cols_min_width_select_' + bloc_id); | ||
208 | |||
209 | if(cols_min_width_input.value < 150){ | ||
210 | cols_min_width_input.value = 150; | ||
211 | } | ||
212 | else if(cols_min_width_input.value > 500){ | ||
213 | cols_min_width_input.value = 500; | ||
214 | } | ||
215 | |||
216 | fetch('index.php?bloc_edit=change_cols_min_width', { | ||
217 | method: 'POST', | ||
218 | headers: { 'Content-Type': 'application/json' }, | ||
219 | body: JSON.stringify({ id: bloc_id, cols_min_width: cols_min_width_input.value }) | ||
220 | }) | ||
221 | .then(response => response.json()) | ||
222 | .then(data => { | ||
223 | if(data.success){ | ||
224 | document.getElementById(bloc_id).className = 'grid'; | ||
225 | document.getElementById(bloc_id).querySelector(".section_child").style.gridTemplateColumns = 'repeat(auto-fit, minmax(' + data.cols_min_width + 'px, 1fr))'; | ||
226 | console.log('changement de la largeur minimum en mode grille'); | ||
227 | } | ||
228 | else{ | ||
229 | console.log('Erreur au changement du nb de colonnes en mode grille côté serveur'); | ||
230 | } | ||
231 | }) | ||
232 | .catch(error => { | ||
233 | console.error('Erreur:', error); | ||
234 | }); | ||
190 | } \ No newline at end of file | 235 | } \ No newline at end of file |