Merge lp:~jcsackett/launchpad/progressively-enhanced-banners into lp:launchpad
Status: | Merged |
---|---|
Approved by: | Curtis Hovey |
Approved revision: | no longer in the source branch. |
Merged at revision: | 15287 |
Proposed branch: | lp:~jcsackett/launchpad/progressively-enhanced-banners |
Merge into: | lp:launchpad |
Diff against target: |
650 lines (+184/-97) 19 files modified
lib/canonical/launchpad/icing/css/base.css (+0/-4) lib/canonical/launchpad/icing/css/components/beta_banner.css (+5/-4) lib/canonical/launchpad/icing/css/components/global_notification.css (+2/-3) lib/canonical/launchpad/icing/css/components/sidebar_components.css (+0/-10) lib/lp/app/browser/configure.zcml (+7/-0) lib/lp/app/browser/tales.py (+13/-15) lib/lp/app/browser/tests/base-layout.txt (+8/-4) lib/lp/app/browser/tests/test_formatters.py (+5/-3) lib/lp/app/doc/tales.txt (+4/-4) lib/lp/app/javascript/banners/banner.js (+2/-11) lib/lp/app/javascript/banners/beta-notification.js (+3/-4) lib/lp/app/javascript/banners/privacy.js (+1/-10) lib/lp/app/javascript/banners/tests/test_banner.js (+1/-2) lib/lp/app/javascript/banners/tests/test_beta_notification.js (+3/-4) lib/lp/app/javascript/banners/tests/test_privacy.js (+1/-11) lib/lp/app/templates/banner-macros.pt (+43/-0) lib/lp/app/templates/base-layout.pt (+5/-1) lib/lp/services/webapp/publisher.py (+32/-7) lib/lp/services/webapp/tests/test_publisher.py (+49/-0) |
To merge this branch: | bzr merge lp:~jcsackett/launchpad/progressively-enhanced-banners |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Curtis Hovey (community) | code | Approve | |
Review via email: mp+106487@code.launchpad.net |
Commit message
Updates the banners to use progressive enhancmenet, so they are still shown without JS.
Description of the change
Summary
=======
The privacy banner (and it's close friend, the beta banner) don't work without
JS. This introduces basic html banners into base-layout that are enhanced by
the JS banners.
Preimp
======
Spoke with Curtis Hovey
Implementation
==============
* CSS rules for the banners have been updated to use the YUI css classes.
* The public private css formatter has been renamed to the global css
formatter, and now adds the global-
it's needed.
* The `private` attribute on the LaunchpadView has been changed to a property
method, encapsulating most of the special work in the
public_
* A `beta_features` method has been added that returns the related_features
that are in beta.
* Banner-macros has been added; it encapsulates the privacy banner and beta
banner html, and uses the private and beta_features attributes on
LaunchpadView to determine if the html is presented.
* Some minor js tweaks were made to work with the new banner html.
The close button doesn't get rendered on static beta banners; making this work
would require some extra investment that didn't seem worth it given the
relatively low usage of non-js browsers with beta features. If it's needed, a
followup branch can always be landed.
Tests
=====
bin/test -vvct base-layout -t test_formatters -t tales
bin/test -vvct beta -t privacy --layer=YUI
QA
==
Disable js in your browser. Check the privacy banner and the beta banner,
everything should be fine.
Enable js in your browser. Check it all again. It should all be fine.
LoC
===
This branch is part of the disclosure arc of work.
Lint
====
Checking for conflicts and issues in changed files.
Linting changed files:
lib/lp/
lib/canonical
lib/canonical
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/canonical
lib/canonical
Lint has been elided; there are some things I will fix before landing, but
most of this was a massive set of css line issues which were introduced by
more css-competent people than me that I'm leery to touch.
The changes look good, but this branch is missing tests. lp/app/ browsers/ tests/test_ formatters. py
lib/
was not updated. The renaming of public_private_css => global_css should have broken the existing tests. I expect to see tests for the new rules.
I am surprised that the change of .beta-banner =>.global- notification in lp/app/ javascript/ banners/ beta-notificati on.js
lib/
did not break a js test because this is a contract between the js and css.
The two new properties in lib/lp/ services/ webapp/ publisher. py need tests.