Merge lp://staging/~jcsackett/loggerhead/add-privacy-ribbon into lp://staging/loggerhead
Status: | Merged |
---|---|
Approved by: | John A Meinel |
Approved revision: | 465 |
Merged at revision: | 459 |
Proposed branch: | lp://staging/~jcsackett/loggerhead/add-privacy-ribbon |
Merge into: | lp://staging/loggerhead |
Diff against target: |
236 lines (+165/-5) 5 files modified
loggerhead/apps/branch.py (+8/-1) loggerhead/static/css/global.css (+61/-0) loggerhead/static/javascript/custom.js (+87/-1) loggerhead/templates/macros.pt (+1/-1) loggerhead/tests/test_simple.py (+8/-2) |
To merge this branch: | bzr merge lp://staging/~jcsackett/loggerhead/add-privacy-ribbon |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
John A Meinel | Approve | ||
Ian Booth (community) | code | Approve | |
Review via email: mp+80477@code.staging.launchpad.net |
Commit message
Adds a privacy ribbon display to private branches in loggerhead.
Description of the change
Summary
=======
This branch adds an option privacy ribbon to be displayed when a branch's contents are private. It does so by adding javascript, css, and template changes to emulate the launchpad privacy ribbon.
Preimp
======
Spoke with Curtis Hovey
Implementation
==============
* Privacy functions from launchpad were added to custom.js; they have been modified to work with the YUI modules already existing in loggerhead.
* The global notification CSS has been added to the global.css for loggerhead.
* BranchWSGIApp has been updated to accept a private param, defaulting to False. It also has a method to provide the public or private class for the body element on the base layout.
* The base template for loggerhead sets the body class to "private" or "public" based on the above parameter.
QA
==
* Open a private branch on loggerhead; you should see the privacy ribbon.
* Open a public branch on loggerhead; you should not see the ribbon.
Hi Jon
This looks nice (the answer to my question below notwithstanding). I have a small request and a question.
1. The Request
The method BranchWSGIApp. public_ or_private( ) should be called public_ private_ css() to (i) be consistent with how Launchpad does it, and (ii) better reflect the semantics of what the method is used for.
2. The Question
I assume you needed to run up loggerhead locally to test? I'm confused how it works since I can't see how 'private' is ever set. The new 'private' parameter was added to BranchWSGIApp, but I can't see in the loggerhead code base anywhere this parameter is passed in. There are 2 places I can see where a BranchWSGIApp instance is instantiated with the bzr branch, but none of those call sites pass in the lp branch privacy parameter. So how does 'private' ever get set to anything other than the default = False.
3. Tests
There aren't any. Ah, I see there are no js tests in the loggerhead code base :-/ private_ css() method. Seems trivial I know, so your call whether to add one.
Should there be a test for the public_
Thanks.