~launchpad-pqm/launchpad/devel

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
<macros
  xmlns="http://www.w3.org/1999/xhtml"
  xmlns:tal="http://xml.zope.org/namespaces/tal"
  xmlns:metal="http://xml.zope.org/namespaces/metal"
  xmlns:i18n="http://xml.zope.org/namespaces/i18n"
  i18n:domain="launchpad"
  tal:omit-tag=""
>

<metal:notifications define-macro="notifications"
  tal:define="notifications notifications|request/notifications">
  <tal:comment replace="nothing">
    This macro expects the following variables:
    :notifications: An object implementing INotificationList.
  </tal:comment>

  <div class="error message"
    tal:repeat="notification notifications/error"
    tal:content="structure notification/message"
  >An error notification message</div>
  <div class="warning message"
    tal:repeat="notification notifications/warning"
    tal:content="structure notification/message"
  >A warning notification message</div>
  <div class="informational message"
    tal:repeat="notification notifications/info"
    tal:content="structure notification/message"
  >An info notification message</div>
  <div class="debug message"
    tal:repeat="notification notifications/debug"
    tal:content="structure notification/message"
  >A debug notification message, only displayed for developers.</div>
</metal:notifications>


<metal:load-javascript define-macro="load-javascript"
  tal:define="
      revno modules/lp.app.versioninfo/revno | string:unknown;
      icingroot string:/+icing/rev${revno};
      devmode modules/lp.services.config/config/devmode;
      yui string:${icingroot}/yui;
      lazr_js string:${icingroot}/lazr/build;
      lp_js string:${icingroot}/build"
  >
  <tal:comment replace="nothing">
    This macro just loads javascript files. It doesn't
    do any initialization.

    We load all of the script files from the same host that served the HTML in
    order to optimize IE caching over SSL. This is inefficient when you cross
    subdomains (from bugs to code for example) but luckily most users stay
    within one or two domains.

    XXX mars 2010-04-08
    We can revisit this IE-only optimization if we remove SSL.  Any changes that
    affect IE should be tested using webpagetest.org. (See the dev.launchpad.net
    wiki for details.)

    XXX mars 2010-01-21
    We have to load MochiKit outside of the main javascript rollup so that the
    rollup's size does not exceed 512Kb.  That magic number triggers a bug
    somewhere in the automated test system that will prevent Windmill from
    executing.
  </tal:comment>
  <script type="text/javascript">
    var LP = {
        cache: {},
        links: {}
    };
  </script>
  <script type="text/javascript"
          tal:attributes="src string:${icingroot}/MochiKit.js"></script>

  <script type="text/javascript"
          tal:attributes="src string:${icingroot}/build/launchpad.js"></script>

  <script type="text/javascript"
      tal:content="string:var cookie_scope = '${request/lp:cookie_scope}';"></script>
  <script type="text/javascript">
    // Define a global YUI sandbox that should be used by everyone.
    var LPS = YUI({
      // Don't try to fetch CSS files.
      fetchCSS: false,
      // For paranoia, set a low timeout to not wait on loading a resource.
      timeout: 50
      });
  </script>
</metal:load-javascript>


<metal:page-javascript define-macro="page-javascript"
  tal:define="
      revno modules/lp.app.versioninfo/revno | string:unknown;
      devmode modules/lp.services.config/config/devmode;
      map_query string:&amp;file=api&amp;v=2&amp;key=${modules/lp.services.config/config/google/maps_api_key};">
  <tal:comment replace="nothing">
    Load and initialize the common script used by all pages.
  </tal:comment>

  <metal:load-lavascript use-macro="context/@@+base-layout-macros/load-javascript" />

    <script type="text/javascript">
      LPS.use('base', 'node', 'oop', 'event', 'lp.app.beta_features',
              'lp.bugs.bugtask_index', 'lp.bugs.subscribers',
                'lp.code.branchmergeproposal.diff', 'lp.comments.hide',
                function(Y) {
          Y.on("domready", function () {
              if (Y.one(document.body).hasClass('private')) {
                  Y.lp.app.privacy.setup_privacy_notification();
                  Y.lp.app.privacy.display_privacy_notification();
              }
              Y.lp.app.beta_features.display_beta_notification();
          });
      });
    </script>

  <script id="base-layout-load-scripts" type="text/javascript">
    LPS.use('node', 'event-delegate', 'lp', 'lp.app.links', 'lp.app.longpoll', function(Y) {
        Y.on('load', function(e) {
            sortables_init();
            initInlineHelp();
            Y.lp.activate_collapsibles();
            activateFoldables();
            activateConstrainBugExpiration();
            Y.lp.app.links.check_valid_lp_links();
            // Longpolling will only start if
            // LP.cache.longpoll is populated.
            // We use Y.later to work around a Safari/Chrome 'feature':
            // The mouse cursor stays 'busy' until all the requests started during
            // page load are finished.  Hence we want the long poll request to start
            // right *after* the page has loaded.
            Y.later(0, Y.lp.app.longpoll, Y.lp.app.longpoll.setupLongPollManager);
        }, window);

        // Hook up the function that dismisses the help window if we click
        // anywhere outside of it.
        Y.on('click', handleClickOnPage, window);

        Y.on('lp:context:web_link:changed', function(e) {
            window.location = e.new_value;
        });
    });
  </script>
</metal:page-javascript>


<metal:launchpad-stylesheet-3-0 define-macro="launchpad-stylesheet-3-0"
  tal:define="
    revno modules/lp.app.versioninfo/revno | string:unknown;
    icingroot string:/+icing/rev${revno}">
  <tal:comment replace="nothing">
    This macro loads a single css file containing all our stylesheets.
    If you need to include a new css file here, add it to
    buildout-templates/bin/combine-css.in instead.

    We load the CSS from the same host that served the HTML in order to optimize
    IE caching over SSL. This is inefficient when you cross subdomains (from
    bugs to code for example) but luckily most users stay within one or two
    domains.

    XXX mars 2010-04-08
    We can revisit this IE-only optimization if we remove SSL.  Any changes that
    affect IE should be tested using webpagetest.org. (See the dev.launchpad.net
    wiki for details.)
    </tal:comment>
  <link
        type="text/css"
        rel="stylesheet"
        media="screen, print"
        tal:attributes="href string:${icingroot}/combo.css" />
</metal:launchpad-stylesheet-3-0>


<metal:lp-client-cache define-macro="lp-client-cache">
  <tal:cache condition="view/user|nothing"
              define="cache request/webservicerequest:cache;
                      links cache/links;
                      objects cache/objects;">
    <script tal:repeat="key links"
      tal:content="string:LP.links['${key}'] =
                   '${links/?key/fmt:api_url}';">
    </script>
  </tal:cache>
  <tal:comment condition="nothing">
    The id of the script block below is used to determine whether this
    page is loaded by test_lp_client_integration.js.
  </tal:comment>
  <script id="json-cache-script"
          tal:content="string:LP.cache = ${view/getCacheJSON};">
  </script>
</metal:lp-client-cache>


<metal:application-buttons define-macro="application-buttons">
  <!-- Application Menu -->
  <ul class="facetmenu"
      tal:define="facetmenu view/menu:facet">
    <tal:facet repeat="link facetmenu">
      <li
        tal:condition="python: link.enabled and link.selected"
        tal:attributes="title link/summary; class string:${link/name} active"
        ><span
          tal:condition="not:link/linked"
          tal:content="structure link/escapedtext"
          /><a
          tal:condition="link/linked"
          tal:attributes="href link/url"
          tal:content="structure link/escapedtext" /></li>
      <li
        tal:condition="python: link.enabled and not link.selected"
        tal:attributes="title link/summary; class link/name"
        ><a
          tal:condition="link/enabled"
          tal:attributes="href link/url"
          tal:content="structure link/escapedtext"
          /></li>
      <li
        tal:condition="not:link/enabled"
        tal:attributes="class string:${link/name} disabled-tab"
        ><span
           tal:content="link/escapedtext" /></li>
    </tal:facet>
  </ul>
</metal:application-buttons>


<metal:footer define-macro="footer">
  <div id="footer" class="footer">
    <div class="lp-arcana" tal:condition="not:view/is_root_page|nothing">
        <div class="lp-branding">
          <a tal:attributes="href string:${rooturl}"><img src="/@@/launchpad-logo-and-name-hierarchy.png" alt="Launchpad"/></a>
          &nbsp;&bull;&nbsp;
          <a tal:attributes="href string:${rooturl}+tour">Take the tour</a>
          &nbsp;&bull;&nbsp;
          <a href="https://help.launchpad.net/">Read the guide</a>
          &nbsp;
          <form id="globalsearch" method="get" accept-charset="UTF-8"
            tal:condition="view/macro:pagehas/globalsearch"
            tal:attributes="action string:${rooturl}+search">
            <input type="search" id="search-text" name="field.text" />
            <input type="image" src="/@@/search" style="vertical-align:5%" alt="Search Launchpad"/>
          </form>
        </div>
        <metal:site-message
          use-macro="context/@@+base-layout-macros/site-message"/>
    </div>

    <div class="colophon">
      &copy; 2004-2012
      <a href="http://canonical.com/">Canonical&nbsp;Ltd.</a>
      &nbsp;&bull;&nbsp;
      <a tal:attributes="href string:${rooturl}legal">Terms of use</a>
      &nbsp;&bull;&nbsp;
      <a tal:condition="not: view/user|nothing"
        href="/feedback">Contact Launchpad Support</a>
      <a tal:condition="view/user|nothing"
        href="/support">Contact Launchpad Support</a>
      &nbsp;&bull;&nbsp;
      <a href="http://blog.launchpad.net/"
	>Blog</a>
      <tal:careers_link condition="not: features/baselayout.careers_link.disabled">
	&nbsp;&bull;&nbsp;
	<a href="http://www.canonical.com/about-canonical/careers"
		>Careers</a>
      </tal:careers_link>
      &nbsp;&bull;&nbsp;
      <a href="http://identi.ca/launchpadstatus"
        >System status</a>
      <span id="lp-version">
      &nbsp;&bull;&nbsp;
        r<tal:revno replace="revno" />
        <tal:devmode condition="devmode">devmode</tal:devmode>
        <tal:demo condition="is_demo">demo site</tal:demo>
        (<a href="https://dev.launchpad.net/"
             >Get the code!</a>)
      </span>
    </div>
  </div>
</metal:footer>

<metal:site-message define-macro="site-message">
  <div class="sitemessage" tal:condition="site_message">
    <tal:site_message tal:content="structure site_message">
      This site is running pre-release code.
    </tal:site_message>
  </div>
</metal:site-message>


<metal:debug-timeline define-macro="debug-timeline">
  <a name="debug_timeline"
    id="debug_timeline"
    class="hidden"
    >
    <table
      tal:condition="request/features/visible_render_time"
      tal:define="timeline_actions modules/lp.services.webapp.adapter/get_timeline_actions"
      class="debug-timeline listing"
      >
      <thead>
	<th>Duration</th>
	<th>Action</th>
      </thead>
      <tr tal:repeat="action timeline_actions">
	<td class="amount" tal:content="action/duration/fmt:millisecondduration"/>
	<td style="font-family: monospace; text-align: left;">
          <pre class="wrap"><span class="action-category" tal:content="action/category"/>: <span class="action-details" tal:content="action/detail"/></pre>
	</td>
      </tr>
    </table>
  </a>
</metal:debug-timeline>


<metal:plural-msg define-macro="plural-message">
  <tal:comment condition="nothing">
    Expected variables to be defined in a containing tag or global:
    count - value to check to determine plural form
    singluar - string to use when count == 1
    plural - string to use when count > 1.  If no plural is given it defaults
    to the singular value + 's'.
  </tal:comment>
  <tal:singular
    condition="python: count == 1"
    replace="singular" /><tal:plural
     define="l_default string:s;
             l_plural plural | string:$singular$l_default;"
    condition="python: count != 1"
    replace="l_plural" /></metal:plural-msg>
</macros>