This is my branch to update portlets used by pillars to UI 3.0. lp:~sinzui/launchpad/answers-portlets Diff size: 508 Launchpad bug: https://bugs.launchpad.net/bugs/answers-portlets Test command: ./bin/test -vv \ -t "faq-views|question-overview|xx-announcements|xx-karmacontext-topcontributors" Pre-implementation: beuno Target release: 2.2.8 = Update portlets used by pillars to UI 3.0 = There are several portlets that need updating to the new project UI. These portlets will also be used by Distributions and ProjectGroups: top contributors, announcements, and latest questions. They also need a new portlet to show the latest FAQs. == Rules == * Create an FAQ portlet. * Update the latest questions portlet. * Remove it from teams, they cannot ask questions. * Remove it from SourcePackages, the questions really belong to the DistributionSourcePackage. * Update the top contributors portlet. * Update the announcements portlet. == QA == Describe the steps to verify that the project behaves correctly == Lint == Checking for conflicts. and issues in doctests and templates. Running jslint, xmllint, pyflakes, and pylint. Using normal rules. Linting changed files: lib/lp/answers/browser/configure.zcml lib/lp/answers/browser/faqcollection.py lib/lp/answers/browser/questiontarget.py lib/lp/answers/browser/tests/faq-views.txt lib/lp/answers/stories/question-overview.txt lib/lp/answers/templates/faqcollection-portlet-faqs.pt lib/lp/answers/templates/questiontarget-portlet-latestquestions.pt lib/lp/registry/stories/announcements/xx-announcements.txt lib/lp/registry/stories/standalone/xx-karmacontext-topcontributors.txt lib/lp/registry/templates/hasannouncements-portlet-latest.pt lib/lp/registry/templates/karmacontext-portlet-top-contributors.pt lib/lp/registry/templates/sourcepackage-index.pt lib/lp/registry/templates/team-index.pt == Test == * lib/lp/answers/browser/tests/faq-views.txt * Added a test to verify that latest faqs portlet works. * The original test did not make sense. There are already model tests for creating an FAQ. I think this was an incomplete test that was committed. I repurposed it to do a real view test. * lib/lp/answers/stories/question-overview.txt * Updated the test to verify the information presented in the latest questions portlet. * lib/lp/registry/stories/announcements/xx-announcements.txt * Revised the test to verify the layout of the links. * lib/lp/registry/stories/standalone/xx-karmacontext-topcontributors.txt * Revised the test because the headings changed for 3.0. == Implementation == * lib/lp/answers/browser/configure.zcml * Registered +portlet-listfaqs on the existing SearchFAQsView. * lib/lp/answers/browser/faqcollection.py * Added a create_faq link. The templates were/are making this link. They can be updated when they are converted to 3.0 * Added 2 properties to SearchFAQsView to support it's reuse as a portlet. * lib/lp/answers/browser/questiontarget.py * Added a property to the LatestQuestionsView to make links to the answer's facet for the context. * lib/lp/answers/templates/faqcollection-portlet-faqs.pt * Added a new template to show the latest FAQs and permit searching. * lib/lp/answers/templates/questiontarget-portlet-latestquestions.pt * Updated the portlet to the ui 3.0 * There is an XXX in it. The new 'see more' link is not compatible with the distrosourcpackage page. Martin wants the link new link disabled until distrosourcpackage is updated. * lib/lp/registry/templates/hasannouncements-portlet-latest.pt * Updated the template to the 3.0 layout. * lib/lp/registry/templates/karmacontext-portlet-top-contributors.pt * Updated the template to the 3.0 layout. * There is an XXX because the new 'see more' link breaks the distribution page. The XXX can be removed when the distro page is updated. * lib/lp/registry/templates/sourcepackage-index.pt * Removed the latest questions portlet from the page. We should have removed this two years ago when we decided that we did not want questions of SourcePacakges (they are on DistributionSourcePackages) * lib/lp/registry/templates/team-index.pt * Removed the latest questions from the team page...it is not possible to login as a team as ask a question. No user has ever seen this portlet, and there were no tests to verify it.