Merge lp:~danilo/launchpad/fix-806925 into lp:launchpad

Proposed by Данило Шеган
Status: Merged
Approved by: Данило Шеган
Approved revision: no longer in the source branch.
Merged at revision: 13457
Proposed branch: lp:~danilo/launchpad/fix-806925
Merge into: lp:launchpad
Diff against target: 79 lines (+11/-30)
2 files modified
lib/lp/registry/templates/distributionsourcepackage-index.pt (+10/-29)
lib/lp/soyuz/stories/distribution/xx-distribution-packages.txt (+1/-1)
To merge this branch: bzr merge lp:~danilo/launchpad/fix-806925
Reviewer Review Type Date Requested Status
Abel Deuring (community) code Approve
Review via email: mp+68070@code.launchpad.net

Commit message

[r=adeuring][rollback=13421] Migrate expanders on DistroSourcePackage:+index page so they work with the already replaced JS. QA fix for problem found during QA. (This is not really a rollback but a fix for the revision 13421)

Description of the change

= Bug 806925 QA fix =

William found a problem with DistroSourcePackage:+index page expanders. Basically, I haven't realized that the same JS is used for two different templates (one was for PPA +packages page, which I QAd), so I haven't migrated the template for DSP:+index page.

Migration is simple.

== Demo and Q/A ==

https://launchpad.dev/ubuntu/+source/mozilla-firefox
https://launchpad.dev/ubuntu/+source/iceweasel (has PPAs to test the "related PPAs" expander)

To post a comment you must log in.
Revision history for this message
Abel Deuring (adeuring) :
review: Approve (code)
Revision history for this message
Abel Deuring (adeuring) wrote :

yay for more "code normalisation"!

review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/registry/templates/distributionsourcepackage-index.pt'
2--- lib/lp/registry/templates/distributionsourcepackage-index.pt 2011-06-16 13:50:58 +0000
3+++ lib/lp/registry/templates/distributionsourcepackage-index.pt 2011-07-18 08:56:30 +0000
4@@ -151,9 +151,7 @@
5 <a class="expander"
6 tal:attributes="id string:pub${pubid}-expander;
7 href string:${archive/fmt:url}/+sourcepub/${pubid}/+listing-archive-extra">
8- <img style="padding-right:0.5em;" src="/@@/treeCollapsed"
9- alt="Show details" title="Show details"
10- tal:attributes="id string:pub${pubid}-arrow"/>
11+ &nbsp;
12 </a>
13 <a tal:attributes="href row/version">
14 <img src="/@@/package-source" />
15@@ -174,7 +172,7 @@
16 content="string:(not published)"/>
17 </td>
18 </tr>
19- <tr tal:attributes="id string:pub${pubid}" style="display: none">
20+ <tr tal:attributes="id string:pub${pubid}">
21 <td colspan="3">
22 <div class="package-details"
23 tal:attributes="id string:pub${pubid}-container"></div>
24@@ -240,34 +238,17 @@
25 </p>
26 </div>
27 <script type="text/javascript">
28- LPS.use('node', 'event', 'lazr.effects', function(Y) {
29+LPS.use('node', 'event', 'lp.app.widgets.expander', function(Y) {
30
31 // XXX Michael Nelson 20090702 bug=340497 This slider
32 // needs an integration test.
33- // Collapse the body of the slider widget initially.
34- Y.one('#related-ppa-versions .widget-bd').addClass('lazr-closed');
35-
36- // Ensure that the widget header uses the correct sprite icon
37- // and gets the styling for javascript actions applied.
38- var widget_header = Y.one('#related-ppa-versions .widget-hd');
39- widget_header.addClass('sprite');
40- widget_header.addClass('treeCollapsed');
41- widget_header.addClass('js-action');
42-
43- var slide;
44- Y.on('click', function(e) {
45- if (!slide) {
46- slide = Y.lazr.effects.slide_out('#related-ppa-versions .widget-bd');
47- widget_header.replaceClass('treeCollapsed', 'treeExpanded');
48- } else {
49- slide.set('reverse', !slide.get('reverse'));
50- widget_header.toggleClass('treeExpanded');
51- widget_header.toggleClass('treeCollapsed');
52- }
53- slide.stop();
54- slide.run();
55-
56- }, '#slide-trigger');
57+
58+ var related_ppas = Y.one('#related-ppa-versions');
59+ var widget_header = related_ppas.one('.widget-hd');
60+ var widget_body = related_ppas.one('.widget-bd');
61+ var expander = new Y.lp.app.widgets.expander.Expander(
62+ widget_header, widget_body);
63+ expander.setUp(true);
64 });
65 </script>
66
67
68=== modified file 'lib/lp/soyuz/stories/distribution/xx-distribution-packages.txt'
69--- lib/lp/soyuz/stories/distribution/xx-distribution-packages.txt 2011-06-16 13:50:58 +0000
70+++ lib/lp/soyuz/stories/distribution/xx-distribution-packages.txt 2011-07-18 08:56:30 +0000
71@@ -257,7 +257,7 @@
72 ... user_browser.contents, 'expander')[0]
73 >>> print expander_url
74 <a class="expander" href="/ubuntu/+archive/primary/+sourcepub/26/+listing-archive-extra" id="pub26-expander">
75- <img style... src="/@@/treeCollapsed" alt="Show details" title="Show details" id="pub26-arrow" />
76+ &nbsp;
77 </a>
78
79 >>> browser.open(user_browser.getLink(id="pub26-expander").url)