diff options
Diffstat (limited to 'app/views/shared/_namespace_storage_limit_alert.html.haml')
-rw-r--r-- | app/views/shared/_namespace_storage_limit_alert.html.haml | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/app/views/shared/_namespace_storage_limit_alert.html.haml b/app/views/shared/_namespace_storage_limit_alert.html.haml new file mode 100644 index 00000000000..95f27cde15b --- /dev/null +++ b/app/views/shared/_namespace_storage_limit_alert.html.haml @@ -0,0 +1,26 @@ +- return unless current_user + +- payload = namespace_storage_alert(namespace) +- return if payload.empty? + +- alert_level = payload[:alert_level] +- root_namespace = payload[:root_namespace] + +- style = namespace_storage_alert_style(alert_level) +- icon = namespace_storage_alert_icon(alert_level) +- link = namespace_storage_usage_link(root_namespace) + +%div{ class: [classes, 'js-namespace-storage-alert'] } + .gl-pt-5.gl-pb-3 + .gl-alert{ class: "gl-alert-#{style}", role: 'alert' } + = sprite_icon(icon, css_class: "gl-icon gl-alert-icon") + .gl-alert-title + %h4.gl-alert-title= payload[:usage_message] + - if alert_level != :error + %button.js-namespace-storage-alert-dismiss.gl-alert-dismiss.gl-cursor-pointer{ type: 'button', 'aria-label' => _('Dismiss'), data: { id: root_namespace.id, level: alert_level } } + = sprite_icon('close', size: 16, css_class: 'gl-icon') + .gl-alert-body + = payload[:explanation_message] + - if link + .gl-alert-actions + = link_to(_('Manage storage usage'), link, class: "btn gl-alert-action btn-md gl-button btn-#{style}") |