~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
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
<tal:root
  xmlns:tal="http://xml.zope.org/namespaces/tal"
  xmlns:metal="http://xml.zope.org/namespaces/metal"
  omit-tag="">

<metal:expandable_table_js define-macro="expandable-table-js">
  <tal:comment replace="nothing">
    Javascript needed for expanding/collapsing archive package list
    row containing extra publication information via XHR.
  </tal:comment>

<script type="text/javascript">
LPS.use('node', 'io-base', 'lp.anim', 'lp.soyuz.base',
        'lp.app.widgets.expander', function(Y) {


/*
 * Communicate the update has failed and allow the user to retry
 * the operation.
 */
function informFailure(transaction_id, response, args) {
    var failure_message = Y.lp.soyuz.base.makeFailureNode(
        'Failed to fetch package details.');

    args.expander.receive(failure_message);

    var anim = Y.lp.anim.red_flash({
        node: args.expander.content_node
        });
    anim.run();
}


/*
 * Update the row with the XHR response.
 */
function doUpdate(transaction_id, response, args) {
    var node = Y.Node.create('<div />')
                 .set('innerHTML', response.responseText);
    args.expander.receive(node);
}


/**
 * Dispatch a XHR to load the given container.
 */
function loadDetails(expander) {

    var config = {
        on: {
            'success': doUpdate,
            'failure': informFailure
        },
        arguments: {
            'expander': expander
        }
    };

    /**
     * If a page wants to use this outside of an archive context then it
     * can define LP.cache['archive_context'], which should be a
     * full or relative URL to the context archive page required.
     */
    var base_url = (
        typeof(LP.cache['archive_context_url']) != "undefined")
            ? LP.cache['archive_context_url']
            : '';
    if (base_url !== '') {
        base_url += '/';
    }
    var pub_id = expander.content_node.get('id')
                   .replace('pub', '')
                   .replace('-container', '');
    var uri = base_url + '+sourcepub/' + pub_id + '/+listing-archive-extra';
    Y.io(uri, config);
}

/**
 * Setup expander handlers.
 */
function setupPackageListExpanders() {
    var expanders = Y.all('#packages_list a.expander');
    var widget;
    if (expanders !== null) {
       function setupExpander(expander) {
         var base_id = expander.get('id').replace('-expander', '');
         var container = Y.one('#' + base_id);
         var content = container.one('td div.package-details');
         var in_progress_message = Y.lp.soyuz.base.makeInProgressNode(
           'Fetching package details ...');
         content.empty();
         content.appendChild(in_progress_message);

         widget = new Y.lp.app.widgets.expander.Expander(
             expander, container, { loader: loadDetails,
                                    animate_node: content });
         widget.setUp();
       };
       expanders.each(setupExpander);
    }
}

Y.on('domready', setupPackageListExpanders);
});
</script>

<style type="text/css" media="screen, print">
div.package-details {
    padding-left: 4em;
    padding-bottom: 1em;
}
</style>


</metal:expandable_table_js>

<metal:source_package_list define-macro="source-package-list">
  <tal:comment replace="nothing">
    Presents a table listing all the published source packages for an
    archive.
  </tal:comment>

  <div style="padding-top: 1em;" tal:define="batch view/batched_sources">

    <tal:navigation_top
        replace="structure view/batchnav/@@+navigation-links-upper" />

    <table class="listing" id="packages_list"
           tal:condition="batch">
      <thead>
        <tr class="archive_package_row">
        <th colspan="2">Source</th>
        <th tal:condition="context/owner/is_team">Uploader</th>
        <th>Published</th>
        <th>Status</th>
        <th>Series</th>
        <th>Section</th>
        <th>Build Status</th>
        </tr>
      </thead>
      <tbody>
        <tal:non_selectable repeat="publishing batch"
                   replace="structure publishing/@@+listing-archive-detailed"
                   condition="not:view/selectable_sources">
        </tal:non_selectable>
        <tal:selectable condition="view/selectable_sources">
          <tal:each_term define="widget nocall:view/widgets/selected_sources"
                         repeat="term widget/vocabulary">
            <tal:block
              define="pub term/value"
              replace="structure pub/@@+listing-archive-detailed-selectable" />
          </tal:each_term>
        </tal:selectable>
      </tbody>
    </table>

    <tal:navigation_bottom
        replace="structure view/batchnav/@@+navigation-links-lower" />

    <div id="empty-result"
            tal:define="name_filter view/specified_name_filter|nothing"
            tal:condition="not: batch">
      No matching package for '<tal:name_filter replace="name_filter" />'.
    </div>

    <metal:js
      use-macro="context/@@+macros/expandable-table-js" />

  </div>

</metal:source_package_list>

<metal:package_copy_request_list define-macro="package-copy-request-list">
  <tal:comment replace="nothing">
    Presents a table listing all the package copy requests for a copy
    archive.
  </tal:comment>

  <div id="package-copy-request-list" class="portlet"
       tal:define="requests view/package_copy_requests">
    <h2>Copy archive contents</h2>

    <p tal:condition="not: requests">
      There are currently no requests to copy packages into this archive.
    </p>

    <tal:request_list tal:condition="requests">
      <table id="package-requests" class="wide listing"
        tal:attributes="summary
                        string:Package copy requests for ${context/name}">
        <thead>
          <tr>
            <th>Copied from</th>
            <th>Series</th>
            <th>Requested by</th>
            <th>When Requested</th>
            <th>Status</th>
          </tr>
        </thead>
        <tbody>
          <tr tal:repeat="request requests">
            <td tal:define="archive request/source_archive">
              <a tal:attributes="href archive/fmt:url"
                 tal:content="archive/displayname"
                 tal:condition="archive/is_ppa" />
              <tal:archive_displayname
                 replace="archive/displayname"
                 condition="not: archive/is_ppa" />
            </td>
            <td>
              <tal:distroseries
                  replace="request/source_distroseries/displayname"
                />-<tal:src_pocket
                  replace="request/source_pocket/name/fmt:lower" />
              <tal:component condition="request/source_component">
               (<tal:src_component_name
                  replace="request/source_component/name" />)
              </tal:component>
            </td>
            <td><a tal:replace="structure request/requester/fmt:link" /></td>
            <td tal:content="request/date_created/fmt:approximatedate" />
            <td tal:content="request/status/name/capitalize" />
          </tr>
        </tbody>
      </table>
    </tal:request_list>
  </div> <!-- package-copy-request-list -->

</metal:package_copy_request_list>

<metal:package_counters define-macro="package-counters">

  <tal:comment replace="nothing">
    Presents package counters for a defined IArchive.
    :archive: targeted IArchive.
  </tal:comment>

  <dl tal:define="usage_summary archive/@@+index/repository_usage">
    <dt>Number of packages:</dt>
    <dd><tal:source_label replace="usage_summary/source_label" />
       (<tal:sources_size
          replace="usage_summary/sources_size/fmt:bytes" />)</dd>
    <dd>
       <tal:binary_label replace="usage_summary/binary_label" />
       (<tal:binaries_size
          replace="usage_summary/binaries_size/fmt:bytes" />)</dd>
    <dt>Repository size:</dt>
    <dd><tal:used replace="usage_summary/used/fmt:bytes" />
       (<span tal:attributes="class usage_summary/used_css_class"
              tal:content="string:${usage_summary/used_percentage}%"/>)
        of <tal:quota replace="usage_summary/quota/fmt:bytes" /></dd>
  </dl>

</metal:package_counters>

<metal:build_status_summary define-macro="build-status-summary">

  <tal:comment replace="nothing">
    Present a summary of the packages with build statuses for the archive.
    :archive: targetted IArchive.

    XXX noodles 20090827 bug=419921
    Currently we can only provide a direct link to successful builds
    as there is no single filtering option for failed and pending
    builds.
  </tal:comment>

  <div id="build-count-summary">

    <p>A total of
      <span class="build-count total"
            tal:content="view/build_counters/total">100</span> builds have
      been dispatched for this PPA.</p>

    <dl>
      <dt>Completed builds</dt>
      <dd>
        <a tal:attributes="href context/menu:overview/builds_successful/fmt:url">
          <span class="build-count succeeded"
                tal:content="view/build_counters/succeeded">100</span>
          successful</a></dd>
      <dd>
        <span class="build-count failed"
              tal:content="view/build_counters/failed">100</span>
        failed</dd>
    </dl>

  <p tal:condition="view/build_counters/pending">
    A recent upload has resulted in
    <span class="build-count pending"
          tal:content="view/build_counters/pending">100</span>
    pending builds.
  </p>
  </div>
</metal:build_status_summary>

<metal:package_filter_form define-macro="package-filter-form">
  <tal:comment replace="nothing">
    Present the filtering form used on a few archive pages.
  </tal:comment>

  <form class="package-search-filter" action="" method="GET">
    <label for="name">Package name contains:</label>
    <input id="field.name_filter" title="Package Name" size="20"
            type="text" name="field.name_filter"
            tal:attributes="value request/field.name_filter|nothing"/>
    <tal:status_filter
        replace="structure view/plain_status_filter_widget" /> in
    <tal:series_filter
        replace="structure view/plain_series_filter_widget" />
    <input type="submit" value="Filter" />
  </form>

</metal:package_filter_form>

<metal:latest_updates_portlet define-macro="latest-updates-portlet">
  <tal:comment replace="nothing">
    Present the latest updates for a PPA in a portlet.
  </tal:comment>

  <tal:latest_updates define="updates view/latest_updates">
  <div id="portlet-latest-updates" class="portlet">
    <h2>Latest updates</h2>

    <p tal:condition="not: updates">
      <tal:name replace="context/displayname" /> has no updates.
    </p>
    <tal:updates condition="updates">
      <ul class="latest-ppa-updates">
        <li tal:repeat="update updates"
            tal:attributes="class update/status_class">
          <strong tal:content="update/title">Firefox-3.5</strong>
          <span class="duration">
            <span tal:replace="update/duration/fmt:approximateduration">
              3 minutes
            </span>
            ago
          </span><br />
          <span tal:replace="update/status">Successful</span>
          <span tal:condition="update/builds"
                class="build-details">
            <a tal:repeat="build update/builds"
               tal:attributes="href build/fmt:url"
               tal:content="build/arch_tag">i386</a>
          </span>
        </li>
      </ul>
    </tal:updates>
    </div>
  </tal:latest_updates>
</metal:latest_updates_portlet>

</tal:root>