show.html.haml 2.79 KB
Newer Older
1
%h3.page-title
2
  Notifications Settings
3
%p.light
4
  These are your global notification settings.
5
%hr
6 7 8 9 10 11 12 13

= form_for @user, url: profile_notifications_path, method: :put, html: { class: 'update-notifications form-horizontal global-notifications-form' } do |f|
  -if @user.errors.any?
    %div.alert.alert-danger
      %ul
        - @user.errors.full_messages.each do |msg|
          %li= msg

14
  = hidden_field_tag :notification_type, 'global'
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
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
  .form-group
    = f.label :notification_email, class: "control-label"
    .col-sm-10
      = f.select :notification_email, @user.all_emails, { include_blank: false }, class: "form-control"

  .form-group
    = f.label :notification_level, class: 'control-label'
    .col-sm-10
      .radio
        = f.label :notification_level, value: Notification::N_DISABLED do
          = f.radio_button :notification_level, Notification::N_DISABLED
          .level-title
            Disabled
          %p You will not get any notifications via email

      .radio
        = f.label :notification_level, value: Notification::N_MENTION do
          = f.radio_button :notification_level, Notification::N_MENTION
          .level-title
            Mention
          %p You will receive notifications only for comments in which you were @mentioned

      .radio
        = f.label :notification_level, value: Notification::N_PARTICIPATING do
          = f.radio_button :notification_level, Notification::N_PARTICIPATING
          .level-title
            Participating
          %p You will only receive notifications from related resources (e.g. from your commits or assigned issues)

      .radio
        = f.label :notification_level, value: Notification::N_WATCH do
          = f.radio_button :notification_level, Notification::N_WATCH
          .level-title
            Watch
          %p You will receive all notifications from projects in which you participate

  .form-actions
    = f.submit 'Save changes', class: "btn btn-save"
54

55
.clearfix
56
  %hr
57 58
.row.all-notifications
  .col-md-6
59
    %p
60
      You can also specify notification level per group or per project.
61
      %br
62
      By default, all projects and groups will use the notification level set above.
63 64
    %h4 Groups:
    %ul.bordered-list
65
      - @group_members.each do |users_group|
66 67
        - notification = Notification.new(users_group)
        = render 'settings', type: 'group', membership: users_group, notification: notification
68

69
  .col-md-6
70
    %p
71
      To specify the notification level per project of a group you belong to,
72
      %br
73
      you need to be a member of the project itself, not only its group.
74 75
    %h4 Projects:
    %ul.bordered-list
76 77 78
      - @project_members.each do |project_member|
        - notification = Notification.new(project_member)
        = render 'settings', type: 'project', membership: project_member, notification: notification