Merge lp:~jtv/launchpad/bmp-inline-diffs into lp:~spiv/launchpad/bmp-inline-diffs

Proposed by Jeroen T. Vermeulen
Status: Merged
Merged at revision: 13321
Proposed branch: lp:~jtv/launchpad/bmp-inline-diffs
Merge into: lp:~spiv/launchpad/bmp-inline-diffs
Diff against target: 67 lines (+24/-15)
2 files modified
lib/lp/code/templates/branch-macros.pt (+20/-15)
lib/lp/services/features/flags.py (+4/-0)
To merge this branch: bzr merge lp:~jtv/launchpad/bmp-inline-diffs
Reviewer Review Type Date Requested Status
Andrew Bennetts Pending
Review via email: mp+66591@code.launchpad.net

Commit message

ajax_revision_diffs feature flag.

Description of the change

Protect the Ajax expandable inline revision diffs with a feature flag.

To enable this, add a feature rule along the lines of
{{{
code.ajax_revision_diffs.enabled default 1 on
}}}

Also, I removed the js-action CSS class from the expander icon tags. The expander widget now adds this class automatically.

The expander widget itself is currently on approach for landing.

Jeroen

To post a comment you must log in.
Revision history for this message
Andrew Bennetts (spiv) wrote :

Thanks!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/code/templates/branch-macros.pt'
2--- lib/lp/code/templates/branch-macros.pt 2011-06-30 17:03:35 +0000
3+++ lib/lp/code/templates/branch-macros.pt 2011-07-01 12:14:31 +0000
4@@ -202,19 +202,22 @@
5 condition="revisions | nothing">
6 <metal:landing-target use-macro="branch/@@+macros/revision-text"/>
7 </tal:revision>
8- <tal:diff-expander condition="show_diff_expander | nothing">
9- <div class="revision-group-diff" tal:condition="revisions | nothing">
10- <a class="unseen expander-icon js-action"
11- tal:define="start_revno python:revisions[0].sequence;
12- last_revno python:revisions[-1].sequence"
13- tal:attributes="id string:expandable-${start_revno}-${last_revno}"
14- >Changes added by revision <tal:revno replace="start_revno">1</tal:revno>
15- <tal:plural condition="python: start_revno!=last_revno">
16- to revision <tal:revno replace="last_revno">2</tal:revno>
17- </tal:plural></a>
18- <div class="unseen expander-content">Loading diff</div>
19- </div>
20- </tal:diff-expander>
21+ <tal:ajax-revision-diffs
22+ condition="request/features/code.ajax_revision_diffs.enabled">
23+ <tal:diff-expander condition="show_diff_expander | nothing">
24+ <div class="revision-group-diff" tal:condition="revisions | nothing">
25+ <a class="unseen expander-icon"
26+ tal:define="start_revno python:revisions[0].sequence;
27+ last_revno python:revisions[-1].sequence"
28+ tal:attributes="id string:expandable-${start_revno}-${last_revno}"
29+ >Changes added by revision <tal:revno replace="start_revno">1</tal:revno>
30+ <tal:plural condition="python: start_revno!=last_revno">
31+ to revision <tal:revno replace="last_revno">2</tal:revno>
32+ </tal:plural></a>
33+ <div class="unseen expander-content">Loading diff</div>
34+ </div>
35+ </tal:diff-expander>
36+ </tal:ajax-revision-diffs>
37 </dl>
38
39 </metal:branch-revisions>
40@@ -268,8 +271,10 @@
41 The revision commit message.
42 </tal:commit-message>
43 </dd>
44- <div class="revision-expander">
45- <a class="unseen expander-icon js-action"
46+ <div
47+ class="revision-expander"
48+ tal:condition="request/features/code.ajax_revision_diffs.enabled">
49+ <a class="unseen expander-icon"
50 tal:attributes="id string:expandable-${rev_no/sequence}"
51 >Changes</a>
52 <div class="unseen expander-content">
53
54=== modified file 'lib/lp/services/features/flags.py'
55--- lib/lp/services/features/flags.py 2011-06-16 13:50:58 +0000
56+++ lib/lp/services/features/flags.py 2011-07-01 12:14:31 +0000
57@@ -42,6 +42,10 @@
58 'boolean',
59 ('Enables the display of bugtracker components.'),
60 ''),
61+ ('code.ajax_revision_diffs',
62+ 'boolean',
63+ ("Offer expandable inline diffs for branch revisions."),
64+ ''),
65 ('code.branchmergequeue',
66 'boolean',
67 'Enables merge queue pages and lists them on branch pages.',

Subscribers

People subscribed via source and target branches