Skip to content

Commit

Permalink
Improve toasts messages display; refs #1786
Browse files Browse the repository at this point in the history
Use top attached position variation
Use close icon
Use Progress bar on messages with display time
  • Loading branch information
gagnieray committed Feb 19, 2024
1 parent 4b5e074 commit 08f9bc1
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 11 deletions.
2 changes: 1 addition & 1 deletion galette/lib/Galette/Controllers/AjaxController.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public function messages(Request $request, Response $response): Response
if (count($errors) > 0) {
$messages['error'] = [
'title' => _T('- ERROR -'),
'icon' => 'times',
'icon' => 'exclamation circle',
'messages' => $errors
];
}
Expand Down
16 changes: 11 additions & 5 deletions galette/templates/default/elements/js/messages.js.twig
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ $('.message.with-transition')
displayTime: 'auto',
minDisplayTime: 5000,
wordsPerMinute: 80,
position: 'top right',
showProgress: 'bottom',
closeIcon: true,
position: 'top attached',
message: '{{ success|e('js') }}',
showIcon: 'check circle outline',
class: 'success'
Expand Down Expand Up @@ -75,7 +77,9 @@ $('.message.with-transition')
displayTime: 'auto',
minDisplayTime: 5000,
wordsPerMinute: 80,
position: 'top right',
showProgress: 'bottom',
closeIcon: true,
position: 'top attached',
title: '{{ info_title|e('js') }}',
message: '{{ i|e('js') }}',
showIcon: 'info',
Expand Down Expand Up @@ -105,9 +109,10 @@ $('.message.with-transition')
$('body')
.toast({
displayTime: 0,
position: 'top right',
closeIcon: true,
position: 'top attached',
message: '{{ error|e('js') }}',
showIcon: 'times',
showIcon: 'exclamation circle',
class: 'error'
})
;
Expand All @@ -126,7 +131,8 @@ $('.message.with-transition')
$('body')
.toast({
displayTime: 0,
position: 'top right',
closeIcon: true,
position: 'top attached',
message: '{{ warning|e('js') }}',
showIcon: 'exclamation triangle',
class: 'warning'
Expand Down
4 changes: 3 additions & 1 deletion galette/templates/default/elements/js/removal.js.twig
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,9 @@
displayTime: dtime,
minDisplayTime: 5000,
wordsPerMinute: 80,
position: 'top right',
showProgress: 'bottom',
closeIcon: true,
position: 'top attached',
title: values[type]['title'],
message: values[type]['messages'].join('<br/>'),
showIcon: values[type]['icon'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
{% if errors is iterable and errors|length > 0 %}
<noscript>
<div class="ui error icon message">
<i class="times icon" aria-hidden="true"></i>
<i class="exclamation circle icon" aria-hidden="true"></i>
<div class="content">
<div class="header">{{ _T("- ERROR -") }}</div>
{% if errors|length > 1 %}
Expand Down
4 changes: 3 additions & 1 deletion galette/templates/default/pages/members_list.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,9 @@
displayTime: dtime,
minDisplayTime: 5000,
wordsPerMinute: 80,
position: 'top right',
showProgress: 'bottom',
closeIcon: true,
position: 'top attached',
title: values[type]['title'],
message: values[type]['messages'].join('<br/>'),
showIcon: values[type]['icon'],
Expand Down
4 changes: 3 additions & 1 deletion galette/templates/default/pages/preferences.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -986,7 +986,9 @@
displayTime: dtime,
minDisplayTime: 5000,
wordsPerMinute: 80,
position: 'top right',
showProgress: 'bottom',
closeIcon: true,
position: 'top attached',
title: values[type]['title'],
message: values[type]['messages'].join('<br/>'),
showIcon: values[type]['icon'],
Expand Down
2 changes: 1 addition & 1 deletion semantic.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@
"permission": "644",
"autoInstall": true,
"rtl": "both",
"components": ["reset", "site", "button", "container", "divider", "header", "icon", "input", "label", "list", "loader", "segment", "step", "form", "grid", "menu", "message", "table", "card", "item", "accordion", "checkbox", "dimmer", "dropdown", "popup", "sidebar", "tab", "transition", "text", "calendar", "toast", "modal", "api", "search", "emoji"],
"components": ["reset", "site", "button", "container", "divider", "header", "icon", "input", "label", "list", "loader", "segment", "step", "form", "grid", "menu", "message", "table", "card", "item", "accordion", "checkbox", "dimmer", "dropdown", "popup", "sidebar", "tab", "transition", "text", "calendar", "progress", "toast", "modal", "api", "search", "emoji"],
"version": "2.9.3"
}

0 comments on commit 08f9bc1

Please sign in to comment.