~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/bugs/templates/bugtask-index.pt

[r=benji][bug=814414,
        819401] Adds the privacy ribbon notification to private branches and
        private merge proposals.

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
            });
35
35
         });
36
36
      </script>
 
37
      <tal:if condition="request/features/bugs.private_notification.enabled">
 
38
      <script type="text/javascript">
 
39
        LPS.use('base', 'node', 'oop', 'event', 'lp.bugs.bugtask_index',
 
40
                  'lp.bugs.subscribers',
 
41
                  'lp.code.branchmergeproposal.diff', 'lp.comments.hide',
 
42
                  function(Y) {
 
43
            /*
 
44
             * Display the privacy notification if the bug is private
 
45
             */
 
46
            Y.on("domready", function () {
 
47
                if (Y.one(document.body).hasClass('private')) {
 
48
                    var config = {
 
49
                        notification_text: 'This bug is private',
 
50
                        hidden: true
 
51
                    };
 
52
                    Y.lp.app.privacy.setup_privacy_notification(config);
 
53
                    Y.lp.app.privacy.display_privacy_notification();
 
54
                }
 
55
            });
 
56
        });
 
57
      </script>
 
58
      </tal:if>
37
59
      <style type="text/css">
38
60
        /* Align the 'add comment' link to the right of the comment box. */
39
61
        #add-comment-form textarea { width: 100%; }
89
111
    </metal:heading>
90
112
 
91
113
    <div metal:fill-slot="main" tal:define="context_menu context/menu:context">
92
 
      <tal:if condition="request/features/bugs.private_notification.enabled">
93
 
        <div tal:attributes="class string: global-notification ${view/privacy_notice_classes}">
94
 
          <span class="sprite notification-private"></span>
95
 
          This bug is private
96
 
          <a href="#" class="global-notification-close">
97
 
            <span class="sprite notification-close"></span>
98
 
            Hide
99
 
          </a>
100
 
        </div>
101
 
      </tal:if>
102
114
      <div id="tags-autocomplete">
103
115
       <div id="tags-autocomplete-content"></div>
104
116
      </div>