diff options
author | Douwe Maan <douwe@gitlab.com> | 2015-09-21 09:19:32 +0000 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2015-09-21 09:19:32 +0000 |
commit | 183892fde98308c0d77f5ba7a9bdb23d79eebe43 (patch) | |
tree | 9cc63e2422b514e33337e9c3288c965a22bf7f97 /app/views | |
parent | 2460d290af892a24996b348c786757eb5398adc1 (diff) | |
parent | 47e926bec0a9da28daaca7dc92415b25f2301daf (diff) | |
download | gitlab-ce-183892fde98308c0d77f5ba7a9bdb23d79eebe43.tar.gz |
Merge branch 'notification-levels' into 'master'
Notification levels can now be set on the Project's main page
![Screen_Shot_2015-09-16_at_7.49.49_PM](https://gitlab.com/gitlab-org/gitlab-ce/uploads/0ac517bdfdc801f0e2115463c3ea9e10/Screen_Shot_2015-09-16_at_7.49.49_PM.png)
The notification settings for a project can now be set directly on the Project's page. The drop down list and the button label reflect the current level.
Saving is done via a remote form submission and if successful shows the user a flash message:
![Screen_Shot_2015-09-16_at_6.09.02_PM](https://gitlab.com/gitlab-org/gitlab-ce/uploads/8a6e1fde5177aa3976cadf59fdb8d375/Screen_Shot_2015-09-16_at_6.09.02_PM.png)
@DouweM can you please review my code. I gave my bestest effort to make in clean and readable.
@rspeicher hopefully we can include it with the 8.0 release, maybe?
/cc @darby
See merge request !1322
Diffstat (limited to 'app/views')
-rw-r--r-- | app/views/profiles/notifications/show.html.haml | 2 | ||||
-rw-r--r-- | app/views/projects/_home_panel.html.haml | 2 | ||||
-rw-r--r-- | app/views/projects/buttons/_notifications.html.haml | 14 |
3 files changed, 17 insertions, 1 deletions
diff --git a/app/views/profiles/notifications/show.html.haml b/app/views/profiles/notifications/show.html.haml index ea4e5f3e182..8eebd96b674 100644 --- a/app/views/profiles/notifications/show.html.haml +++ b/app/views/profiles/notifications/show.html.haml @@ -33,7 +33,7 @@ = f.label :notification_level, value: Notification::N_MENTION do = f.radio_button :notification_level, Notification::N_MENTION .level-title - Mention + On Mention %p You will receive notifications only for comments in which you were @mentioned .radio diff --git a/app/views/projects/_home_panel.html.haml b/app/views/projects/_home_panel.html.haml index b347846c932..c1d5428f676 100644 --- a/app/views/projects/_home_panel.html.haml +++ b/app/views/projects/_home_panel.html.haml @@ -26,6 +26,8 @@ = icon('download fw') Download + = render 'projects/buttons/notifications' + = render 'projects/buttons/dropdown' - if @project.gitlab_ci? diff --git a/app/views/projects/buttons/_notifications.html.haml b/app/views/projects/buttons/_notifications.html.haml new file mode 100644 index 00000000000..57f764178d5 --- /dev/null +++ b/app/views/projects/buttons/_notifications.html.haml @@ -0,0 +1,14 @@ +- return unless @membership + += form_tag profile_notifications_path, method: :put, remote: true, class: 'inline-form', id: 'notification-form' do + = hidden_field_tag :notification_type, 'project' + = hidden_field_tag :notification_id, @membership.id + = hidden_field_tag :notification_level + %span.dropdown + %a.dropdown-toggle.btn.btn-new#notifications-button{href: '#', "data-toggle" => "dropdown"} + = icon('bell') + = notification_label(@membership) + = icon('angle-down') + %ul.dropdown-menu.dropdown-menu-right.project-home-dropdown + - Notification.project_notification_levels.each do |level| + = notification_list_item(level, @membership) |