show.html.haml 2.0 KB
Newer Older
D
Douwe Maan 已提交
1
- page_title "Notifications"
C
Connor Shea 已提交
2
= render 'profiles/head'
3

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

11
  = hidden_field_tag :notification_type, 'global'
P
Phil Hughes 已提交
12 13 14 15 16 17 18 19 20 21 22
  .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
D
Dmitriy Zaporozhets 已提交
23

24 25 26 27 28
      = 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"

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

      .clearfix

37 38 39 40 41
      = form_for @user, url: profile_notifications_path, method: :put do |f|
        %label{ for: 'user_notified_of_own_activity' }
          = f.check_box :notified_of_own_activity
          %span Receive notifications about your own activity

P
Phil Hughes 已提交
42 43
      %hr
      %h5
44
        Groups (#{@group_notifications.count})
P
Phil Hughes 已提交
45 46
      %div
        %ul.bordered-list
47
          - @group_notifications.each do |setting|
48
            = render 'group_settings', setting: setting, group: setting.source
P
Phil Hughes 已提交
49
      %h5
50
        Projects (#{@project_notifications.count})
P
Phil Hughes 已提交
51
      %p.account-well
52
        To specify the notification level per project of a group you belong to, you need to visit project page and change notification level there.
P
Phil Hughes 已提交
53 54
      .append-bottom-default
        %ul.bordered-list
55
          - @project_notifications.each do |setting|
56
            = render 'project_settings', setting: setting, project: setting.source