BigW Consortium Gitlab

show.html.haml 2.75 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 28 29 30 31 32 33 34
      = 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"
        .form-group
          = f.label :notification_level, class: 'label-light'
          .radio
            = f.label :notification_level, value: :disabled do
              = f.radio_button :notification_level, :disabled
              .level-title
                Disabled
              %p You will not get any notifications via email
35

36 37 38 39 40 41
          .radio
            = f.label :notification_level, value: :mention do
              = f.radio_button :notification_level, :mention
              .level-title
                On Mention
              %p You will receive notifications only for comments in which you were @mentioned
42

43 44 45 46 47 48
          .radio
            = f.label :notification_level, value: :participating do
              = f.radio_button :notification_level, :participating
              .level-title
                Participating
              %p You will only receive notifications from related resources (e.g. from your commits or assigned issues)
49

50 51 52 53 54 55 56 57 58
          .radio
            = f.label :notification_level, value: :watch do
              = f.radio_button :notification_level, :watch
              .level-title
                Watch
              %p You will receive notifications for any activity

        .prepend-top-default
          = f.submit 'Update settings', class: "btn btn-create"
59 60
      %hr
      %h5
61
        Groups (#{@group_notifications.count})
62 63
      %div
        %ul.bordered-list
64
          - @group_notifications.each do |setting|
65
            = render 'group_settings', setting: setting, group: setting.source
66
      %h5
67
        Projects (#{@project_notifications.count})
68
      %p.account-well
69
        To specify the notification level per project of a group you belong to, you need to visit project page and change notification level there.
70 71
      .append-bottom-default
        %ul.bordered-list
72
          - @project_notifications.each do |setting|
73
            = render 'project_settings', setting: setting, project: setting.source