1
/* Copyright 2011 Canonical Ltd. This software is licensed under the
2
* GNU Affero General Public License version 3 (see the file LICENSE).
4
* Setup for managing subscribers list for bugs.
7
* @submodule subscribers
10
YUI.add('lp.bugs.subscribers', function(Y) {
12
var namespace = Y.namespace('lp.bugs.subscribers');
15
* Possible subscriber levels with descriptive headers for
16
* sections that will hold them.
18
* These match BugNotificationLevel enum options (as defined in
19
* lib/lp/bugs/enum.py).
21
var subscriber_levels = {
22
'Discussion': 'Notified of all changes',
23
'Details': 'Notified of all changes except comments',
24
'Lifecycle': 'Notified when the bug is closed or reopened',
25
'Maybe': 'May be notified'
29
* Order of subscribers sections.
31
var subscriber_level_order = ['Discussion', 'Details', 'Lifecycle', 'Maybe'];
35
* Create the SubscribersLoader instance which will load subscribers for
36
* a bug and put them in the web page.
38
* @param config {Object} Defines `container_box' CSS selector for the
39
* SubscribersList container box, `context' holding context metadata (at
40
* least with `web_link') and `subscribers_details_view' holding
41
* a relative URI to load subscribers' details from.
43
function createBugSubscribersLoader(config) {
44
config.subscriber_levels = subscriber_levels;
45
config.subscriber_level_order = subscriber_level_order;
46
config.context = config.bug;
47
config.subscribe_someone_else_level = 'Discussion';
48
config.default_subscriber_level = 'Maybe';
49
var module = Y.lp.app.subscribers.subscribers_list;
50
return new module.SubscribersLoader(config);
52
namespace.createBugSubscribersLoader = createBugSubscribersLoader;
54
}, "0.1", {"requires": ["lp.app.subscribers.subscribers_list"]});