Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions resources/views/layouts/app.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,16 @@ class="btn-close"
const toastBody = toastElement.querySelector('.toast-body');
const toastTime = toastElement.querySelector('.toast-time');

function decodeHtmlEntities(str) {
if (!str) return '';
const temp = document.createElement('textarea');
temp.innerHTML = str;
return temp.value;
}

function showToast(message, type) {
toastBody.innerText = message;
const decodedMessage = decodeHtmlEntities(message);
toastBody.innerText = decodedMessage;
toastElement.querySelector('.toast-header strong').innerText = type;
const toast = new bootstrap.Toast(toastElement);
toast.show();
Expand All @@ -220,7 +228,6 @@ function showToast(message, type) {
showToast(validationErrors.join(' '), 'Error');
@endif
}

});
</script>

Expand Down
10 changes: 9 additions & 1 deletion resources/views/project/conducting/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,18 @@
@if (session()->has('error'))
<div class='card card-body col-md-12 mt-3'>
<h3 class="h5 mb-3">{{ __('project/conducting.study-selection.tasks') }}</h3>
<div class="alert alert-warning">
<div class="alert alert-warning" id="errorMessage">
{{ session('error') }}
</div>
</div>
<script>
document.addEventListener('DOMContentLoaded', function() {
const errorElement = document.getElementById('errorMessage');
if (errorElement) {
errorElement.innerText = decodeHtmlEntities(errorElement.innerText);
}
});
</script>
@else
@include(
"project.components.project-tabs",
Expand Down
Loading