{{ trans('cruds.control.fields.action_plan') }}
@@ -334,20 +352,33 @@
items.forEach((item) => {
console.log(item.kind);
if (item.kind === 'file') {
- // adds the file to your dropzone instance
myDropzone.addFile(item.getAsFile())
}
})
}
@if ((Auth::User()->role === 1)||(Auth::User()->role === 2))
- const mde1 = new EasyMDE({
+ const easyMDE = new EasyMDE({
element: document.getElementById('mde1'),
minHeight: "200px",
maxHeight: "200px",
status: false,
spellChecker: false,
});
+
+ // Rendre l'éditeur en lecture seule par défaut
+ easyMDE.codemirror.setOption("readOnly", true);
+ easyMDE.codemirror.getWrapperElement().classList.add('disabled-editor');
+
+ document.getElementById('toggleTextarea').addEventListener('change', function() {
+ if (this.checked) {
+ easyMDE.codemirror.setOption("readOnly", false);
+ easyMDE.codemirror.getWrapperElement().classList.remove('disabled-editor');
+ } else {
+ easyMDE.codemirror.setOption("readOnly", true);
+ easyMDE.codemirror.getWrapperElement().classList.add('disabled-editor');
+ }
+ });
@endif
diff --git a/resources/views/layout.blade.php b/resources/views/layout.blade.php
index d549758..e0c3c7c 100644
--- a/resources/views/layout.blade.php
+++ b/resources/views/layout.blade.php
@@ -11,6 +11,7 @@
+ @yield('style')
diff --git a/routes/web.php b/routes/web.php
index bd4a7d1..fd182a7 100644
--- a/routes/web.php
+++ b/routes/web.php
@@ -108,6 +108,7 @@
Route::post('/action/update', 'ActionplanController@update');
Route::post('/action/save', 'ActionplanController@save');
Route::post('/action/close', 'ActionplanController@doClose');
+ Route::post('/action/delete', 'ActionplanController@delete');
/* Reports */
Route::get('/reports', 'ReportController@show');