Merge lp:~michael.nelson/ubuntu-webcatalog/788210-navigate-distroseries-2 into lp:ubuntu-webcatalog
Status: | Merged |
---|---|
Approved by: | Anthony Lenton |
Approved revision: | 45 |
Merged at revision: | 30 |
Proposed branch: | lp:~michael.nelson/ubuntu-webcatalog/788210-navigate-distroseries-2 |
Merge into: | lp:ubuntu-webcatalog |
Diff against target: |
601 lines (+316/-171) 8 files modified
src/webcatalog/models/applications.py (+4/-0) src/webcatalog/templates/webcatalog/install_options_snippet.html (+13/-9) src/webcatalog/templatetags/webcatalog.py (+66/-39) src/webcatalog/tests/__init__.py (+3/-2) src/webcatalog/tests/test_templatetags.py (+150/-0) src/webcatalog/tests/test_views.py (+17/-73) src/webcatalog/utilities.py (+58/-1) src/webcatalog/views.py (+5/-47) |
To merge this branch: | bzr merge lp:~michael.nelson/ubuntu-webcatalog/788210-navigate-distroseries-2 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Anthony Lenton (community) | Approve | ||
Review via email: mp+66326@code.launchpad.net |
Commit message
Thin out the view code, moving get_user_os into a more readable/testable UserAgentString utility.
Description of the change
Overview
========
This branch refactors more of the view code out into utility classes (get_user_os) to make things a bit more maintainable, but also modifies the behavior of what we display depending on the information we have in the user agent.
Details
=======
I've added a UserAgentString utility, but not yet added explicit tests for it (it is still tested via the view and templatetag tests in the same way as the code that it replaces was. We will need to do this.
I refactored the install_options template tag - it should be pretty self-explanatory now, although I want to check with achuni/danny about the decision for linux users.
I added tests for the template tag directly, removed the corresponding tests from the view tests while leaving 2 functional tests in the view.
To test: follow the readme to bootstrap then `fab test` or you can do an import and test manually for a package that is available on your own distroseries as well as another (chromium sends correct user agent, firefox sends only linux).
The only remaining work to finish bug 788210 is to simply add a section to the app details page that lists links to the app in other series (when available) in a sidebar.
There are other issues that I noticed that we should either create bugs for or fix immediately:
* When the /cat/applicatio
* I personally think we should update the urls to use distroseries versions (/cat/applicati
Hi Michael,
+1 to the idea of checking if the app exists at all, and which is the most current distroseries we've got, before blindly redirecting to it.
Hm, and good point about changing codenames for versions too. Let's not worry about these in this branch I'll try to push these two fixes up today in a different branch, together with tests for the UserAgentString utility.
PS: Enjoy your holidays! :)