summaryrefslogtreecommitdiff
path: root/app/views/profiles/notifications/show.html.haml
blob: e98fdfc7a3dd2518359a988d4a7ae8df689c9b31 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
- page_title "Notifications"
- @content_class = "limit-container-width" unless fluid_layout
= render 'profiles/head'

%div
  - if @user.errors.any?
    .alert.alert-danger
      %ul
        - @user.errors.full_messages.each do |msg|
          %li= msg

  = hidden_field_tag :notification_type, 'global'
  .row
    .col-lg-4.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-8
      %h5
        Global notification settings

      = 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"

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

      .clearfix

      = 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

      %hr
      %h5
        Groups (#{@group_notifications.count})
      %div
        %ul.bordered-list
          - @group_notifications.each do |setting|
            = render 'group_settings', setting: setting, group: setting.source
      %h5
        Projects (#{@project_notifications.count})
      %p.account-well
        To specify the notification level per project of a group you belong to, you need to visit project page and change notification level there.
      .append-bottom-default
        %ul.bordered-list
          - @project_notifications.each do |setting|
            = render 'project_settings', setting: setting, project: setting.source