Merge lp:~sinzui/launchpad/ask-a-question-bug-438467 into lp:launchpad

Proposed by Curtis Hovey
Status: Merged
Merged at revision: not available
Proposed branch: lp:~sinzui/launchpad/ask-a-question-bug-438467
Merge into: lp:launchpad
Diff against target: 75 lines (+17/-12)
3 files modified
lib/lp/answers/browser/questiontarget.py (+10/-7)
lib/lp/answers/stories/question-add.txt (+6/-0)
lib/lp/answers/templates/question-listing.pt (+1/-5)
To merge this branch: bzr merge lp:~sinzui/launchpad/ask-a-question-bug-438467
Reviewer Review Type Date Requested Status
Abel Deuring (community) code Approve
Canonical Launchpad Engineering ui code Pending
Review via email: mp+14766@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Curtis Hovey (sinzui) wrote :

This is my branch to solve 1.0 action buttons must die die die.

    lp:~sinzui/launchpad/ask-a-question-bug-438467
    Diff size: 76
    Launchpad bug: https://bugs.launchpad.net/bugs/438467
    Test command: ./bin/test -vvt "question-add"
    Pre-implementation: no one
    Target release: 3.1.11

= 1.0 action buttons must die die die =

The 1.0 - 2.0 Ask a question button should be replaced with the 3.0 Ask a
question involvement menu. I imaging this should be the same way the Report a
bug was added tot he bug listing.

== Rules ==

    * Updated the markup for the +ask-a-question-button to return the
      involvement style menu.
    * See http://people.canonical.com/~curtis/ask-a-question.png

== QA ==

    * Visit the answers host for any project.
    * Verify that the 1.0 button is gone.
    * Verify there is an Ask a question link in the involvement menu.

== Lint ==

Linting changed files:
  lib/lp/answers/browser/questiontarget.py
  lib/lp/answers/stories/question-add.txt
  lib/lp/answers/templates/question-listing.pt

== Test ==

    * lib/lp/answers/stories/question-add.txt
      * Add an explicit test for the involvement menu. The other tests were
        implicit and since we added the create a question link to the menu in
        3.0, it was no longer clear of the button was still on the page.

== Implementation ==

    * lib/lp/answers/browser/questiontarget.py
      * Updated the markup of the +ask-a-question view's __call__ method.
    * lib/lp/answers/templates/question-listing.pt
      * Moved the call to +ask-a-question from the content to the side bar.

Revision history for this message
Abel Deuring (adeuring) wrote :

Hi Curtis,

a nice change! I ony wondered if we should place a "report a bug" link above or below the "ask a question", similar to the two links shown on the bugs page.

review: Approve (code)
Revision history for this message
Curtis Hovey (sinzui) wrote :

The need to report a bug from Answers is much less than from Bugs. "Ask a question" is on the bugs page because few users know they can ask for help. User's ask for help do not need to report a bug until a conversation has taken place, and there is a report bug link immediately below the conversation.

Answer contacts have been very clear about what they want from the application. There are no requests to add the "Report a bug" button so I do not think it is needed.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/answers/browser/questiontarget.py'
2--- lib/lp/answers/browser/questiontarget.py 2009-09-23 13:20:15 +0000
3+++ lib/lp/answers/browser/questiontarget.py 2009-11-14 05:41:11 +0000
4@@ -66,13 +66,16 @@
5 target = IQuestionTarget(self.context)
6
7 return """
8- <a href="%s/+addquestion">
9- <img
10- alt="Ask a question"
11- src="/+icing/but-sml-askaquestion.gif"
12- />
13- </a>
14- """ % canonical_url(target, rootsite='answers')
15+ <div id="involvement" class="portlet involvement">
16+ <ul>
17+ <li style="border: none">
18+ <a class="menu-link-ask_question sprite answers"
19+ href="%s">Ask a question</a>
20+ </li>
21+ </ul>
22+ </div>
23+ """ % canonical_url(
24+ target, view_name='+addquestion', rootsite='answers')
25
26
27 class UserSupportLanguagesMixin:
28
29=== modified file 'lib/lp/answers/stories/question-add.txt'
30--- lib/lp/answers/stories/question-add.txt 2009-11-01 04:47:40 +0000
31+++ lib/lp/answers/stories/question-add.txt 2009-11-14 05:41:11 +0000
32@@ -8,6 +8,12 @@
33 >>> print browser.title
34 Questions : Ubuntu
35
36+The user sees an involvement link to ask a question.
37+
38+ >>> link = find_tag_by_id(browser.contents, 'involvement').a
39+ >>> print extract_text(link)
40+ Ask a question
41+
42 Asking a new question requires logging in:
43
44 >>> browser.getLink('Ask a question').click()
45
46=== modified file 'lib/lp/answers/templates/question-listing.pt'
47--- lib/lp/answers/templates/question-listing.pt 2009-09-18 17:45:15 +0000
48+++ lib/lp/answers/templates/question-listing.pt 2009-11-14 05:41:11 +0000
49@@ -10,6 +10,7 @@
50 <body>
51
52 <metal:side fill-slot="side">
53+ <div tal:content="structure context/@@+ask-a-question-button" />
54 <div tal:replace="structure context/@@+global-actions" />
55 <div tal:replace="structure context/@@+portlet-answercontacts|nothing" />
56 <div tal:condition="context/distribution|nothing"
57@@ -30,7 +31,6 @@
58
59 <div metal:fill-slot="main"
60 tal:define="questions view/searchResults">
61-
62 <p tal:define="unspoken_languages view/unspoken_languages"
63 tal:condition="unspoken_languages">
64 <span tal:replace="context/displayname">Mozilla Firefox</span> has
65@@ -43,10 +43,6 @@
66 <div>
67 <form method="get" id="question-search-form" action=""
68 tal:attributes="action request/URL">
69-
70- <div style="float: right;"
71- tal:content="structure context/@@+ask-a-question-button" />
72-
73 <tal:searchbox replace="structure view/widgets/search_text" />
74
75 <tal:sort replace="structure view/widgets/sort" />