BigW Consortium Gitlab

show.html.haml 1.78 KB
Newer Older
1
- page_title "Notifications"
2

3 4
%div
  - if @user.errors.any?
5 6 7 8 9
    %div.alert.alert-danger
      %ul
        - @user.errors.full_messages.each do |msg|
          %li= msg

10
  = hidden_field_tag :notification_type, 'global'
11 12 13 14 15 16 17 18 19 20 21
  .row
    .col-lg-3.profile-settings-sidebar
      %h4
        = page_title
      %p
        You can specify notification level per group or per project.
      %p
        By default, all projects and groups will use the global notifications setting.
    .col-lg-9
      %h5
        Global notification settings
22

23 24 25 26 27
      = form_for @user, url: profile_notifications_path, method: :put, html: { class: 'update-notifications prepend-top-default' } do |f|
        .form-group
          = f.label :notification_email, class: "label-light"
          = f.select :notification_email, @user.all_emails, { include_blank: false }, class: "select2"

28 29 30
      = label_tag :global_notification_level, "Global notification level", class: "label-light"
      %br
      .clearfix
31
      .form-group.pull-left.global-notification-setting
32
        = render 'shared/notifications/button', notification_setting: @global_notification_setting, left_align: true
33 34 35

      .clearfix

36 37
      %hr
      %h5
38
        Groups (#{@group_notifications.count})
39 40
      %div
        %ul.bordered-list
41
          - @group_notifications.each do |setting|
42
            = render 'group_settings', setting: setting, group: setting.source
43
      %h5
44
        Projects (#{@project_notifications.count})
45
      %p.account-well
46
        To specify the notification level per project of a group you belong to, you need to visit project page and change notification level there.
47 48
      .append-bottom-default
        %ul.bordered-list
49
          - @project_notifications.each do |setting|
50
            = render 'project_settings', setting: setting, project: setting.source