Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2015-09-21 12:19:32 +0300
committerDouwe Maan <douwe@gitlab.com>2015-09-21 12:19:32 +0300
commit183892fde98308c0d77f5ba7a9bdb23d79eebe43 (patch)
tree9cc63e2422b514e33337e9c3288c965a22bf7f97 /app/assets
parent2460d290af892a24996b348c786757eb5398adc1 (diff)
parent47e926bec0a9da28daaca7dc92415b25f2301daf (diff)
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/assets')
-rw-r--r--app/assets/javascripts/project.js.coffee16
-rw-r--r--app/assets/stylesheets/pages/projects.scss4
2 files changed, 20 insertions, 0 deletions
diff --git a/app/assets/javascripts/project.js.coffee b/app/assets/javascripts/project.js.coffee
index 39a433dfc91..0ea8fffce07 100644
--- a/app/assets/javascripts/project.js.coffee
+++ b/app/assets/javascripts/project.js.coffee
@@ -24,3 +24,19 @@ class @Project
$.cookie('hide_no_password_message', 'false', { path: path })
$(@).parents('.no-password-message').remove()
e.preventDefault()
+
+ $('.update-notification').on 'click', (e) ->
+ e.preventDefault()
+ notification_level = $(@).data 'notification-level'
+ $('#notification_level').val(notification_level)
+ $('#notification-form').submit()
+ label = null
+ switch notification_level
+ when 0 then label = ' Disabled '
+ when 1 then label = ' Participating '
+ when 2 then label = ' Watching '
+ when 3 then label = ' Global '
+ when 4 then label = ' On Mention '
+ $('#notifications-button').empty().append("<i class='fa fa-bell'></i>" + label + "<i class='fa fa-angle-down'></i>")
+ $(@).parents('ul').find('li.active').removeClass 'active'
+ $(@).parent().addClass 'active' \ No newline at end of file
diff --git a/app/assets/stylesheets/pages/projects.scss b/app/assets/stylesheets/pages/projects.scss
index 53004fca350..a986fafff07 100644
--- a/app/assets/stylesheets/pages/projects.scss
+++ b/app/assets/stylesheets/pages/projects.scss
@@ -329,3 +329,7 @@ pre.light-well {
margin-top: -1px;
}
}
+
+.inline-form {
+ display: inline-block;
+}