Merge lp:~jcsackett/launchpad/mergeproposal-status-icon-589584 into lp:launchpad
Status: | Merged |
---|---|
Approved by: | Gavin Panella |
Approved revision: | no longer in the source branch. |
Merged at revision: | 12159 |
Proposed branch: | lp:~jcsackett/launchpad/mergeproposal-status-icon-589584 |
Merge into: | lp:launchpad |
Diff against target: |
54 lines (+21/-11) 2 files modified
lib/lp/code/javascript/branchmergeproposal.status.js (+2/-2) lib/lp/code/templates/branchmergeproposal-pagelet-summary.pt (+19/-9) |
To merge this branch: | bzr merge lp:~jcsackett/launchpad/mergeproposal-status-icon-589584 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Gavin Panella (community) | Approve | ||
Brad Crittenden (community) | code | Approve | |
Review via email: mp+44531@code.launchpad.net |
Commit message
[r=allenap,
Description of the change
Summary
=======
On a merge proposal (for example, this one), there is both an edit icon link and a colored text section indicating the MP's status. Both are clickable and allow you to set the MP status (assuming you have permission to do so) but the mouse cursor only indicates that the edit icon is clickable.
This branch sets an anchor on the text as well, so it properly indicates that it's a control.
Implementation
==============
lib/lp/
-------
The span that contained the MP status text is now set only to display if the edit link is not enabled. If the link is enabled, an anchor with similar css class as the span is show instead. The span, new anchor, and the anchor around the edit icon are now inside a tal block defining the link variable, since all three elements require it.
Demo & QA
=========
Create an MP on launchpad.dev; when you hover the mouse over the status text, it should change to the cursor type indicating a clickable control (this is usually a hand). Clicking the link or the edit icon should allow you to set the status.
Lint
====
$ make lint
= Launchpad lint =
Checking for conflicts and issues in changed files.
Linting changed files:
lib/lp/
Nice attention to detail.
I've spotted several problems though, and in the course of reviewing
I've come up with an alternative diff. I hope you don't mind. I've put
it at the end if you're interested.
[1]
+ <a tal:condition= "link/enabled" "class string:value mergestatus$ {context/ queue_status/ name};
+ tal:attributes=
+ href link/url">
+ Work in progress
+ </a>
This will always display "Work in progress"... I think a tal:content
is missing :)
[2]
<a tal:define="link context/ menu:context/ edit_status" "link/enabled"
tal: attributes= "href link/url">
- tal:condition=
<img class="editicon" src="/@@/edit" alt="Edit status" />
</a>
This means that the edit status link will always be visible. It can be
clicked by anonymous users, who are asked to log-in, but if they don't
have permission to edit the proposal status once logged-in I suspect
Launchpad will return a 403 Forbidden.
It's probably safest to just do what link/enabled dictates, and hide
the link if it's False.
[3]
<a tal:define="link context/ menu:context/ edit_status"
You could use the link variable defined in tal:merge-status.
[4]
+ <tal:merge-status define="link context/ menu:context/ edit_status" >
You could use the context_menu defined earlier in the template.
My diff:
=== modified file 'lib/lp/ code/templates/ branchmergeprop osal-pagelet- summary. pt' code/templates/ branchmergeprop osal-pagelet- summary. pt 2010-03-15 20:28:52 +0000 code/templates/ branchmergeprop osal-pagelet- summary. pt 2010-12-23 11:24:23 +0000 row-1-status" >
<th>Status: </th> proposal- status- value"> "class string:value mergestatus$ {context/ queue_status/ name}" "context/ queue_status/ title"> menu:context/ edit_status" "link/enabled" "href link/url"> menu/edit_ status" > tag="not: link/enabled" "href link/url"> "context/ queue_status/ title" "status_ name context/ queue_status/ name" "class string:value mergestatus$ {status_ name}"> "link/enabled" "href link/url"> "nothing" >
--- lib/lp/
+++ lib/lp/
@@ -17,15 +17,20 @@
<tr id="summary-
<td id="branchmerge
- <span tal:attributes=
- tal:content=
- Work in progress
- </span>
- <a tal:define="link context/
- tal:condition=
- tal:attributes=
- <img class="editicon" src="/@@/edit" alt="Edit status" />
- </a>
+ <tal:merge-status define="link context_
+ <a tal:omit-
+ tal:attributes=
+ <span tal:content=
+ tal:define=
+ tal:attributes=
+ Work in progress
+ </span>
+ </a>
+ <a tal:condition=
+ tal:attributes=
+ <img class="editicon" src="/@@/edit" alt="Edit status" />
+ </a>
+ </tal:merge-status>
</td>
</tr>
<tal:comment condition=