Merge lp:~mabac/launchpad-work-items-tracker/linaro-roadmap-layout-fixes into lp:~linaro-automation/launchpad-work-items-tracker/linaro

Proposed by Mattias Backman
Status: Merged
Merged at revision: 308
Proposed branch: lp:~mabac/launchpad-work-items-tracker/linaro-roadmap-layout-fixes
Merge into: lp:~linaro-automation/launchpad-work-items-tracker/linaro
Diff against target: 44 lines (+8/-2)
2 files modified
html-report (+6/-0)
templates/roadmap_card.html (+2/-2)
To merge this branch: bzr merge lp:~mabac/launchpad-work-items-tracker/linaro-roadmap-layout-fixes
Reviewer Review Type Date Requested Status
Guilherme Salgado (community) Approve
Review via email: mp+83903@code.launchpad.net

Description of the change

Hi,

Here's a leftover change that didn't get merged. It changes the roadmap card view to hide the blueprint table and progress bar when there are no linked blueprints.

Thanks,

Mattias

To post a comment you must log in.
Revision history for this message
Guilherme Salgado (salgado) wrote :

Wow, it felt like I was reviewing PHP with all this code included within the html. ;)

I suppose blueprints.itervalues() would return a sequence of lists (or other sequences) and there's no way a None can end up there, right?

review: Needs Information
320. By Mattias Backman

Determine if card has blueprints outside of html template.

Revision history for this message
Mattias Backman (mabac) wrote :

On Wed, Nov 30, 2011 at 9:15 PM, Guilherme Salgado
<email address hidden> wrote:
> Review: Needs Information
>
> Wow, it felt like I was reviewing PHP with all this code included within the html. ;)

Hehe sorry about that. I'm not too happy with the results when trying
to do smart things in the templates. I have pushed an update to make
it a little less cluttered.

>
> I suppose blueprints.itervalues() would return a sequence of lists (or other sequences) and there's no way a None can end up there, right?

Famous last words: nope, that shouldn't happen. :) They're all
initialized to [] in report_tools.card_blueprints_by_status().

> --
> https://code.launchpad.net/~mabac/launchpad-work-items-tracker/linaro-roadmap-layout-fixes/+merge/83903
> You are the owner of lp:~mabac/launchpad-work-items-tracker/linaro-roadmap-layout-fixes.

Revision history for this message
Guilherme Salgado (salgado) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'html-report'
2--- html-report 2011-11-24 10:39:35 +0000
3+++ html-report 2011-11-30 20:41:24 +0000
4@@ -517,6 +517,11 @@
5 blueprint_status_count.inprogress = len(blueprints['In Progress'])
6 blueprint_status_count.postponed = 0
7 blueprint_status_count.done = len(blueprints['Completed'])
8+ card_has_blueprints = (blueprint_status_count.todo +
9+ blueprint_status_count.blocked +
10+ blueprint_status_count.inprogress +
11+ blueprint_status_count.postponed +
12+ blueprint_status_count.done) > 0
13
14 data.update(dict(page_type="roadmap_card"))
15 data.update(dict(card_title=title))
16@@ -525,6 +530,7 @@
17 data.update(dict(lane=lane.name))
18 data.update(dict(blueprints=blueprints))
19 data.update(dict(blueprint_status_count=blueprint_status_count))
20+ data.update(dict(card_has_blueprints=card_has_blueprints))
21
22 print report_tools.fill_template(
23 "roadmap_card.html", data, theme=opts.theme)
24
25=== modified file 'templates/roadmap_card.html'
26--- templates/roadmap_card.html 2011-11-21 15:06:06 +0000
27+++ templates/roadmap_card.html 2011-11-30 20:41:24 +0000
28@@ -22,14 +22,14 @@
29 </ul>
30
31 <div style="text-align: center">Overall blueprint completion</div>
32-${util.progress_bar(blueprint_status_count)}
33+${util.progress_bar(blueprint_status_count) if card_has_blueprints else '<center><i>Progress graph pending linked blueprints.</i></center>'}
34
35 <h3>Description</h3> ${card.description if card.description is not None else '<i>No description could be found.</i>'}
36 <p><a href="${card.url}">Read the full description</a>.
37 <h3>Acceptance criteria</h3> ${card.acceptance_criteria if card.acceptance_criteria is not None else '<i>No acceptance criteria could be found.</i>'}
38 <p><a href="${card.url}">Read the full acceptance criteria</a>.
39 <p>
40-% if card.status in ['Ready', 'Delivered'] or blueprints.keys() > 0:
41+% if card_has_blueprints:
42 <table>
43 <thead>
44 <tr><th>Title</th>

Subscribers

People subscribed via source and target branches