~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/bugs/templates/bug-portlet-subscription.pt

  • Committer: Gary Poster
  • Date: 2011-05-27 22:55:25 UTC
  • mto: (7675.1194.3 bug-772754-base)
  • mto: This revision was merged to the branch mainline in revision 13243.
  • Revision ID: gary.poster@canonical.com-20110527225525-2bwkwos90r9yi8sw
incremental, to save state.

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
>
9
9
  <div class="section" tal:define="context_menu context/menu:context"
10
10
       metal:define-slot="heading">
11
 
    <div
12
 
      tal:attributes="class view/current_user_subscription_class"
13
 
      tal:content="structure context_menu/subscription/render" />
 
11
    <div id="current_user_subscription"
 
12
         tal:attributes="class python:view.other_subscription_notifications
 
13
                         and 'has_other_subscriptions'">
 
14
      <tal:block condition="not:view/muted">
 
15
        <span tal:condition="not:view/only_other_subscription_notifications"
 
16
              tal:content="view/notifications_text/not_only_other_subscription">
 
17
        You are
 
18
        </span>
 
19
        <span tal:condition="view/only_other_subscription_notifications"
 
20
              tal:content="view/notifications_text/only_other_subscription" />
 
21
        <a tal:attributes="href string:${view/current_bugtask/fmt:url}/+subscribe"
 
22
           class="menu-link-subscription sprite modify edit">
 
23
           <tal:text condition="view/direct_all_notifications"
 
24
                     replace="view/notifications_text/direct_all">
 
25
           subscribed to all notifications for this bug.
 
26
           </tal:text>
 
27
           <tal:text condition="view/direct_metadata_notifications"
 
28
                     replace="view/notifications_text/direct_metadata" />
 
29
           <tal:text condition="view/direct_lifecycle_notifications"
 
30
                     replace="view/notifications_text/direct_lifecycle" />
 
31
           <tal:text condition="not:view/direct_notifications"
 
32
                     replace="view/notifications_text/not_direct" />
 
33
        </a>
 
34
      </tal:block>
 
35
      <span tal:condition="view/muted"
 
36
            tal:content="view/notifications_text/muted" />
 
37
    </div>
14
38
    <div id="sub-unsub-spinner">Subscribing...</div>
15
 
    <div tal:condition="request/features/malone.advanced-structural-subscriptions.enabled"
16
 
        tal:content="structure context_menu/editsubscriptions/render" />
17
39
    <tal:show-mute condition="
18
40
        request/features/malone.advanced-subscriptions.enabled">
19
 
      <div tal:attributes="class view/current_user_mute_class"
 
41
      <div tal:attributes="class python:
 
42
                'hidden' if not view.user_should_see_mute_link else None"
20
43
           id="mute-link-container">
21
44
        <span tal:replace="structure context_menu/mute_subscription/render"
22
45
        />&nbsp;<a target="help" class="sprite maybe mute-help"
23
46
            href="/+help/subscription-mute.html"
24
47
          >&nbsp;<span class="invisible-link">Mute help</span></a>
25
 
        <div style="float: left" id="mute-unmute-spinner">Unmuting...</div>
26
48
      </div>
27
49
    </tal:show-mute>
 
50
    <div tal:condition="request/features/malone.advanced-structural-subscriptions.enabled"
 
51
        tal:content="structure context_menu/editsubscriptions/render" />
28
52
  </div>
29
53
  <script type="text/javascript">
30
54
    LPS.use('io-base', 'node',
31
 
            'lp.bugs.bugtask_index.portlets', function(Y) {
 
55
            'lp.bugs.bugtask_index.portlets',
 
56
            'lp.bugs.bugtask_index.portlets.subscription', function(Y) {
32
57
        // Must be done inline here to ensure the load event fires.
33
58
        // This is a work around for a YUI3 issue with event handling.
34
59
        var subscription_link = Y.one('.menu-link-subscription');
39
64
        }
40
65
 
41
66
        Y.on('domready', function() {
42
 
            if (Y.lp.bugs.bugtask_index.portlets) {
43
 
                Y.lp.bugs.bugtask_index.portlets.load_subscribers_portlet(
44
 
                    subscription_link, subscription_link_handler);
45
 
            }
 
67
            lp.bugs.bugtask_index.portlets.subscription.initialize();
 
68
            Y.lp.bugs.bugtask_index.portlets.load_subscription_portlet(
 
69
                subscription_link, subscription_link_handler);
 
70
            Y.lp.bugs.bugtask_index.portlets.load_subscribers_portlet(
 
71
                subscription_link, subscription_link_handler);
46
72
        });
47
73
    });
48
74
  </script>