diff --git a/assets/js/app.js b/assets/js/app.js
index acb29f1942..043af02cb4 100644
--- a/assets/js/app.js
+++ b/assets/js/app.js
@@ -22,6 +22,9 @@ require('./main');
require('webpack-jquery-ui');
require('webpack-jquery-ui/css');
+import Swal from 'sweetalert2';
+window.Swal = Swal;
+
// @todo rework url naming
const homePublicUrl = Routing.generate('home');
const mainUrl = homePublicUrl + 'main/';
diff --git a/assets/js/vendor.js b/assets/js/vendor.js
index 562630106c..f1707b7ead 100644
--- a/assets/js/vendor.js
+++ b/assets/js/vendor.js
@@ -23,7 +23,7 @@ require('jquery.scrollbar');
require('blueimp-file-upload');
require('select2');
require('timeago');
-require('sweetalert/dist/sweetalert.min');
+require('sweetalert2');
require('bootstrap-select/dist/js/bootstrap-select.js');
require('bootstrap-daterangepicker');
require('fullcalendar/dist/fullcalendar.js');
diff --git a/package.json b/package.json
index 4220dc4d55..a5c1d0e7f5 100644
--- a/package.json
+++ b/package.json
@@ -58,7 +58,7 @@
"qtip2": "^3.0.3",
"readmore-js": "^2.2.1",
"select2": "^4.0",
- "sweetalert": "^2.1.2",
+ "sweetalert2": "^9.5.3",
"timeago": "^1.6.7",
"timepicker": "^1.11.14",
"uglifyjs-webpack-plugin": "^1.3.0",
diff --git a/src/ThemeBundle/Resources/views/Layout/base-layout.html.twig b/src/ThemeBundle/Resources/views/Layout/base-layout.html.twig
index 3992d1bf28..b8a00f9a5b 100644
--- a/src/ThemeBundle/Resources/views/Layout/base-layout.html.twig
+++ b/src/ThemeBundle/Resources/views/Layout/base-layout.html.twig
@@ -15,7 +15,6 @@
{% include "@ChamiloTheme/Layout/head.html.twig" %}
{% endblock %}
-
-
-
{% block chamilo_wrap %}
-
+
{% block page_header %}
+
{% include '@ChamiloTheme/Layout/header.html.twig' %}
+
{% endblock %}
-
-
{% block page_sidebar %}
@@ -51,14 +48,14 @@
+
{% endblock %}
-
-
{% block chamilo_footer %}
+
{% include '@ChamiloTheme/Layout/footer.html.twig' %}
+
{% endblock %}
-
@@ -97,23 +94,29 @@
// MODAL DELETE CONFIRM
$('.delete-swal').click(function (e) {
e.preventDefault(); // Prevent the href from redirecting directly
- var linkURL = $(this).attr("href");
+ var url = $(this).attr("href");
var title = $(this).attr("title");
- deleteConfirm(linkURL, title);
- });
- function deleteConfirm(linkURL, title) {
- swal({
- //title: '{{ 'Warning'|trans }}',
- text: title,
- icon: "warning",
- buttons: true,
- dangerMode: true,
- }).then((willDelete) => {
- if (willDelete) {
- window.location.href = linkURL;
+
+ Swal.fire({
+ title: title,
+ text: '',
+ icon: 'warning',
+ showCancelButton: true,
+ cancelButtonText: '{{ 'Cancel' | trans }}',
+ confirmButtonColor: '#3085d6',
+ cancelButtonColor: '#d33',
+ confirmButtonText: '{{ 'Yes' | trans }}',
+ }).then((result) => {
+ if (result.value) {
+ /*Swal.fire(
+ 'Deleted!',
+ 'Your file has been deleted.',
+ 'success'
+ )*/
+ window.location.href = url;
}
});
- }
+ });
diff --git a/yarn.lock b/yarn.lock
index 21724b09a7..b81d7ad7c5 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -2962,11 +2962,6 @@ es6-iterator@2.0.3, es6-iterator@~2.0.3:
es5-ext "^0.10.35"
es6-symbol "^3.1.1"
-es6-object-assign@^1.1.0:
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/es6-object-assign/-/es6-object-assign-1.1.0.tgz#c2c3582656247c39ea107cb1e6652b6f9f24523c"
- integrity sha1-wsNYJlYkfDnqEHyx5mUrb58kUjw=
-
es6-symbol@^3.1.1, es6-symbol@~3.1.3:
version "3.1.3"
resolved "https://registry.yarnpkg.com/es6-symbol/-/es6-symbol-3.1.3.tgz#bad5d3c1bcdac28269f4cb331e431c78ac705d18"
@@ -6345,11 +6340,6 @@ promise-inflight@^1.0.1:
resolved "https://registry.yarnpkg.com/promise-inflight/-/promise-inflight-1.0.1.tgz#98472870bf228132fcbdd868129bad12c3c029e3"
integrity sha1-mEcocL8igTL8vdhoEputEsPAKeM=
-promise-polyfill@^6.0.2:
- version "6.1.0"
- resolved "https://registry.yarnpkg.com/promise-polyfill/-/promise-polyfill-6.1.0.tgz#dfa96943ea9c121fca4de9b5868cb39d3472e057"
- integrity sha1-36lpQ+qcEh/KTem1hoyznTRy4Fc=
-
prop-types@^15.6.2:
version "15.7.2"
resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.7.2.tgz#52c41e75b8c87e72b9d9360e0206b99dcbffa6c5"
@@ -7575,13 +7565,10 @@ svgo@^1.0.0:
unquote "~1.1.1"
util.promisify "~1.0.0"
-sweetalert@^2.1.2:
- version "2.1.2"
- resolved "https://registry.yarnpkg.com/sweetalert/-/sweetalert-2.1.2.tgz#010baaa80d0dbdc86f96bfcaa96b490728594b79"
- integrity sha512-iWx7X4anRBNDa/a+AdTmvAzQtkN1+s4j/JJRWlHpYE8Qimkohs8/XnFcWeYHH2lMA8LRCa5tj2d244If3S/hzA==
- dependencies:
- es6-object-assign "^1.1.0"
- promise-polyfill "^6.0.2"
+sweetalert2@^9.5.3:
+ version "9.5.3"
+ resolved "https://registry.yarnpkg.com/sweetalert2/-/sweetalert2-9.5.3.tgz#b280e218dc387a96fa2b6175b50d75421a708f7d"
+ integrity sha512-4wzLUCmVby3NPQC8XHp0HRJgTm5tbAO7OOaqabATNe0U6JN/oyBTS7iJJG9V83MpcP6MLDUEWcGO/Y8i6g2jYw==
tapable@^1.0.0, tapable@^1.1.3:
version "1.1.3"