diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-16 21:25:58 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-16 21:25:58 +0300 |
commit | a5f4bba440d7f9ea47046a0a561d49adf0a1e6d4 (patch) | |
tree | fb69158581673816a8cd895f9d352dcb3c678b1e /app/views/shared/_global_alert.html.haml | |
parent | d16b2e8639e99961de6ddc93909f3bb5c1445ba1 (diff) |
Add latest changes from gitlab-org/gitlab@14-0-stable-eev14.0.0-rc42
Diffstat (limited to 'app/views/shared/_global_alert.html.haml')
-rw-r--r-- | app/views/shared/_global_alert.html.haml | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/app/views/shared/_global_alert.html.haml b/app/views/shared/_global_alert.html.haml new file mode 100644 index 00000000000..bebc72fe428 --- /dev/null +++ b/app/views/shared/_global_alert.html.haml @@ -0,0 +1,20 @@ +- icons = { info: 'information-o', warning: 'warning', success: 'check-circle', danger: 'error', tip: 'bulb' } + +- title = local_assigns.fetch(:title, nil) +- variant = local_assigns.fetch(:variant, :info) +- alert_class = local_assigns.fetch(:alert_class, nil) +- alert_data = local_assigns.fetch(:alert_data, nil) +- close_button_class = local_assigns.fetch(:close_button_class, nil) +- close_button_data = local_assigns.fetch(:close_button_data, nil) +- icon = icons[variant] + +%div{ role: 'alert', class: ["gl-alert-#{variant}", alert_class], data: alert_data } + %div{ class: [container_class, @content_class, 'gl-px-0!'] } + .gl-alert + = sprite_icon(icon, size: 16, css_class: "gl-alert-icon#{' gl-alert-icon-no-title' if title.nil?}") + %button.gl-alert-dismiss.js-close{ type: 'button', aria: { label: _('Close') }, class: close_button_class, data: close_button_data } + = sprite_icon('close', size: 16) + - if title + .gl-alert-title + = title + = yield |