Merge lp:~linaro-infrastructure/launchpad-work-items-tracker/add-lane-progress-bar into lp:~linaro-automation/launchpad-work-items-tracker/linaro

Proposed by Mattias Backman
Status: Merged
Merged at revision: 327
Proposed branch: lp:~linaro-infrastructure/launchpad-work-items-tracker/add-lane-progress-bar
Merge into: lp:~linaro-automation/launchpad-work-items-tracker/linaro
Diff against target: 198 lines (+66/-22)
5 files modified
css/status.css (+30/-7)
html-report (+21/-14)
templates/roadmap_card.html (+5/-1)
templates/roadmap_lane.html (+1/-0)
templates/util.html (+9/-0)
To merge this branch: bzr merge lp:~linaro-infrastructure/launchpad-work-items-tracker/add-lane-progress-bar
Reviewer Review Type Date Requested Status
Guilherme Salgado (community) Approve
Alexander Sack Pending
Review via email: mp+88511@code.launchpad.net

Description of the change

Hi,

This branch adds a blueprint progress bar on top of the roadmap lane pages.

It also changes the card pages to use the same look instead of the old style progress bar.

Thanks,

Mattias

To post a comment you must log in.
Revision history for this message
Mattias Backman (mabac) wrote :

I've learned that my css skills are somewhat rusty so all suggestions are very welcome. :)

Revision history for this message
Guilherme Salgado (salgado) wrote :

I'm no CSS expert either, but it looked fine to me. I have just one
suggestion below:

On 13/01/12 12:03, Mattias Backman wrote:
> === modified file 'templates/roadmap_card.html'
> --- templates/roadmap_card.html 2011-12-21 14:05:45 +0000
> +++ templates/roadmap_card.html 2012-01-13 15:02:25 +0000
> @@ -35,7 +35,16 @@
> </ul>
>
> <div style="clear:both; text-align: center">Overall blueprint completion</div>
> -${util.progress_bar(blueprint_status_count) if card_has_blueprints else '<center><i>Progress graph pending linked blueprints.</i></center>'}
> +% if card_has_blueprints:
> +<div class="roadmap_wrap" title="${bp_status_totals['Completed']} blueprints complete of ${bp_status_totals['Total']}">
> + <div class="roadmap_value" style="width:${bp_status_totals['Percentage']}%">
> + <div class="Completed">&nbsp;</div>
> + </div>
> + <div class="roadmap_progress_text">${bp_status_totals['Percentage']} % complete of ${bp_status_totals['Total']}</div>
> +</div>

Would it be possible to move this into a function like
util.progress_bar() to avoid duplicating it in roadmap_lane.html?

> +% else:
> +<center><i>Progress graph pending linked blueprints.</i></center>
> +% endif
>
> <h3>Description</h3> ${card.description if card.description is not None else '<i>No description could be found.</i>'}
> <p><a href="${card.url}">Read the full description</a>.
>
> === modified file 'templates/roadmap_lane.html'
> --- templates/roadmap_lane.html 2011-12-22 11:57:53 +0000
> +++ templates/roadmap_lane.html 2012-01-13 15:02:25 +0000
> @@ -17,6 +17,12 @@
> % endfor
> </select>
> <h1>${title()}</h1>
> +<div class="roadmap_wrap" title="${bp_status_totals['Completed']} blueprints complete of ${bp_status_totals['Total']}">
> + <div class="roadmap_value" style="width:${bp_status_totals['Percentage']}%">
> + <div class="Completed">&nbsp;</div>
> + </div>
> + <div class="roadmap_progress_text">${bp_status_totals['Percentage']} % complete of ${bp_status_totals['Total']}</div>
> +</div>
> <p>
> <table width="100%">
> <thead><tr><th>Card</th><th>Status</th><th>Team</th><th>Priority</th><th>Blueprints</th><th>Health</th></tr></thead>
>

329. By Mattias Backman

Break out roadmap progress bar to utils.

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

> I'm no CSS expert either, but it looked fine to me. I have just one
> suggestion below:
>
> On 13/01/12 12:03, Mattias Backman wrote:
> > === modified file 'templates/roadmap_card.html'
> > --- templates/roadmap_card.html 2011-12-21 14:05:45 +0000
> > +++ templates/roadmap_card.html 2012-01-13 15:02:25 +0000
> > @@ -35,7 +35,16 @@
> > </ul>
> >
> > <div style="clear:both; text-align: center">Overall blueprint
> completion</div>
> > -${util.progress_bar(blueprint_status_count) if card_has_blueprints else
> '<center><i>Progress graph pending linked blueprints.</i></center>'}
> > +% if card_has_blueprints:
> > +<div class="roadmap_wrap" title="${bp_status_totals['Completed']}
> blueprints complete of ${bp_status_totals['Total']}">
> > + <div class="roadmap_value"
> style="width:${bp_status_totals['Percentage']}%">
> > + <div class="Completed">&nbsp;</div>
> > + </div>
> > + <div class="roadmap_progress_text">${bp_status_totals['Percentage']} %
> complete of ${bp_status_totals['Total']}</div>
> > +</div>
>
> Would it be possible to move this into a function like
> util.progress_bar() to avoid duplicating it in roadmap_lane.html?

Absolutely. Thanks. I've done that and merged the branch to staging, let's see what it looks like in half an hour.

>
> > +% else:
> > +<center><i>Progress graph pending linked blueprints.</i></center>
> > +% endif
> >
> > <h3>Description</h3> ${card.description if card.description is not None
> else '<i>No description could be found.</i>'}
> > <p><a href="${card.url}">Read the full description</a>.
> >
> > === modified file 'templates/roadmap_lane.html'
> > --- templates/roadmap_lane.html 2011-12-22 11:57:53 +0000
> > +++ templates/roadmap_lane.html 2012-01-13 15:02:25 +0000
> > @@ -17,6 +17,12 @@
> > % endfor
> > </select>
> > <h1>${title()}</h1>
> > +<div class="roadmap_wrap" title="${bp_status_totals['Completed']}
> blueprints complete of ${bp_status_totals['Total']}">
> > + <div class="roadmap_value"
> style="width:${bp_status_totals['Percentage']}%">
> > + <div class="Completed">&nbsp;</div>
> > + </div>
> > + <div class="roadmap_progress_text">${bp_status_totals['Percentage']} %
> complete of ${bp_status_totals['Total']}</div>
> > +</div>
> > <p>
> > <table width="100%">
> > <thead><tr><th>Card</th><th>Status</th><th>Team</th><th>Priority</th><th>Bl
> ueprints</th><th>Health</th></tr></thead>
> >

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
=== modified file 'css/status.css'
--- css/status.css 2011-12-21 07:44:02 +0000
+++ css/status.css 2012-01-17 11:59:24 +0000
@@ -47,38 +47,61 @@
47}47}
4848
4949
50.roadmap_progress_text {
51 position: absolute;
52 top:0; left:0;
53
54 padding-top: 5px;
55
56 color: #ffffff;
57 text-align: center;
58 width: 100%;
59}
60
50.roadmap_wrap {61.roadmap_wrap {
62 border: 1px solid black;
51 position: relative;63 position: relative;
52 margin-top: 2px;64 margin-top: 2px;
53 margin-bottom: 6px;65 margin-bottom: 3px;
54 margin-left: auto;66 margin-left: auto;
55 margin-right: auto;67 margin-right: auto;
68 background-color: #bdbdbd;
69}
70
71.roadmap_wrap, .roadmap_value {
72 width: 300px;
73 height: 28px;
74}
75
76table .roadmap_wrap, table .roadmap_value {
77 border: 0px;
78 width: 155px;
79 height: 1.4em;
56 background-color: #ffffff;80 background-color: #ffffff;
57}81}
5882
59.roadmap_wrap, .roadmap_value {
60 width: 155px;
61 height: 13px;
62}
63
64.roadmap_value {83.roadmap_value {
65 float: left84 float: left;
66}85}
6786
68.roadmap_value .Completed {87.roadmap_value .Completed {
69 background-color: green;88 background-color: green;
89 height: inherit
70}90}
7191
72.roadmap_value .Blocked {92.roadmap_value .Blocked {
73 background-color: red;93 background-color: red;
94 height: inherit
74}95}
7596
76.roadmap_value .InProgress {97.roadmap_value .InProgress {
77 background-color: gray;98 background-color: gray;
99 height: inherit
78}100}
79101
80.roadmap_value .Planned {102.roadmap_value .Planned {
81 background-color: orange;103 background-color: orange;
104 height: inherit
82}105}
83106
84.progress_wrap {107.progress_wrap {
85108
=== modified file 'html-report'
--- html-report 2011-12-22 14:27:18 +0000
+++ html-report 2012-01-17 11:59:24 +0000
@@ -471,6 +471,7 @@
471 lane = report_tools.lane(store, opts.lane)471 lane = report_tools.lane(store, opts.lane)
472 lanes = report_tools.lanes(store)472 lanes = report_tools.lanes(store)
473 statuses = []473 statuses = []
474 bp_status_totals = {'Completed': 0, 'Total': 0, 'Percentage': 0}
474 for status, cards in report_tools.statuses(store, lane):475 for status, cards in report_tools.statuses(store, lane):
475 cards_with_bps = []476 cards_with_bps = []
476 for card in cards:477 for card in cards:
@@ -478,9 +479,11 @@
478 blueprint_status_counts = report_tools.card_bp_status_counts(479 blueprint_status_counts = report_tools.card_bp_status_counts(
479 store, card.roadmap_id)480 store, card.roadmap_id)
480 total = sum(blueprint_status_counts.values())481 total = sum(blueprint_status_counts.values())
481 bp_percentages = {}482 bp_percentages = dict.fromkeys(ROADMAP_ORDERED_STATUSES, 0)
483 bp_status_totals['Completed'] += \
484 blueprint_status_counts['Completed']
482 for key in ROADMAP_STATUSES_MAP:485 for key in ROADMAP_STATUSES_MAP:
483 bp_percentages[key] = 0486 bp_status_totals['Total'] += blueprint_status_counts[key]
484 if total > 0:487 if total > 0:
485 bp_percentages[key] = (488 bp_percentages[key] = (
486 100.0 * blueprint_status_counts[key] / total)489 100.0 * blueprint_status_counts[key] / total)
@@ -489,8 +492,12 @@
489 'bp_statuses': blueprint_status_counts,492 'bp_statuses': blueprint_status_counts,
490 'bp_percentages': bp_percentages})493 'bp_percentages': bp_percentages})
491 statuses.append(dict(name=status, cards=cards_with_bps))494 statuses.append(dict(name=status, cards=cards_with_bps))
495 if bp_status_totals['Total'] > 0:
496 bp_status_totals['Percentage'] = (100 * bp_status_totals['Completed'] /
497 bp_status_totals['Total'])
492498
493 data.update(dict(statuses=statuses))499 data.update(dict(statuses=statuses))
500 data.update(dict(bp_status_totals=bp_status_totals))
494 data.update(dict(status_order=ROADMAP_ORDERED_STATUSES))501 data.update(dict(status_order=ROADMAP_ORDERED_STATUSES))
495 data.update(dict(page_type="roadmap_lane"))502 data.update(dict(page_type="roadmap_lane"))
496 data.update(dict(lane_title=title))503 data.update(dict(lane_title=title))
@@ -515,17 +522,17 @@
515 title = opts.title522 title = opts.title
516523
517 blueprints = report_tools.card_blueprints_by_status(store, card.roadmap_id)524 blueprints = report_tools.card_blueprints_by_status(store, card.roadmap_id)
518 blueprint_status_count = WorkitemTarget()525 bp_status_totals = {'Completed': 0, 'Total': 0, 'Percentage': 0}
519 blueprint_status_count.todo = len(blueprints['Planned'])526 bp_status_totals['Total'] = (len(blueprints['Planned']) +
520 blueprint_status_count.blocked = len(blueprints['Blocked'])527 len(blueprints['Blocked']) +
521 blueprint_status_count.inprogress = len(blueprints['In Progress'])528 len(blueprints['In Progress']) +
522 blueprint_status_count.postponed = 0529 len(blueprints['Completed']))
523 blueprint_status_count.done = len(blueprints['Completed'])530 bp_status_totals['Completed'] = len(blueprints['Completed'])
524 card_has_blueprints = (blueprint_status_count.todo +531 if bp_status_totals['Total'] > 0:
525 blueprint_status_count.blocked +532 bp_status_totals['Percentage'] = (100 * bp_status_totals['Completed'] /
526 blueprint_status_count.inprogress +533 bp_status_totals['Total'])
527 blueprint_status_count.postponed +534
528 blueprint_status_count.done) > 0535 card_has_blueprints = bp_status_totals['Total'] > 0
529536
530 status_order = ROADMAP_ORDERED_STATUSES[:]537 status_order = ROADMAP_ORDERED_STATUSES[:]
531 status_order.reverse()538 status_order.reverse()
@@ -537,7 +544,7 @@
537 data.update(dict(lane=lane.name))544 data.update(dict(lane=lane.name))
538 data.update(dict(status_order=status_order))545 data.update(dict(status_order=status_order))
539 data.update(dict(blueprints=blueprints))546 data.update(dict(blueprints=blueprints))
540 data.update(dict(blueprint_status_count=blueprint_status_count))547 data.update(dict(bp_status_totals=bp_status_totals))
541 data.update(dict(card_has_blueprints=card_has_blueprints))548 data.update(dict(card_has_blueprints=card_has_blueprints))
542549
543 print report_tools.fill_template(550 print report_tools.fill_template(
544551
=== modified file 'templates/roadmap_card.html'
--- templates/roadmap_card.html 2011-12-21 14:05:45 +0000
+++ templates/roadmap_card.html 2012-01-17 11:59:24 +0000
@@ -35,7 +35,11 @@
35</ul>35</ul>
3636
37<div style="clear:both; text-align: center">Overall blueprint completion</div>37<div style="clear:both; text-align: center">Overall blueprint completion</div>
38${util.progress_bar(blueprint_status_count) if card_has_blueprints else '<center><i>Progress graph pending linked blueprints.</i></center>'}38% if card_has_blueprints:
39${util.roadmap_progress_bar(bp_status_totals)}
40% else:
41<center><i>Progress graph pending linked blueprints.</i></center>
42% endif
3943
40<h3>Description</h3> ${card.description if card.description is not None else '<i>No description could be found.</i>'}44<h3>Description</h3> ${card.description if card.description is not None else '<i>No description could be found.</i>'}
41<p><a href="${card.url}">Read the full description</a>.45<p><a href="${card.url}">Read the full description</a>.
4246
=== modified file 'templates/roadmap_lane.html'
--- templates/roadmap_lane.html 2011-12-22 11:57:53 +0000
+++ templates/roadmap_lane.html 2012-01-17 11:59:24 +0000
@@ -17,6 +17,7 @@
17% endfor17% endfor
18</select>18</select>
19<h1>${title()}</h1>19<h1>${title()}</h1>
20${util.roadmap_progress_bar(bp_status_totals)}
20<p>21<p>
21<table width="100%">22<table width="100%">
22<thead><tr><th>Card</th><th>Status</th><th>Team</th><th>Priority</th><th>Blueprints</th><th>Health</th></tr></thead>23<thead><tr><th>Card</th><th>Status</th><th>Team</th><th>Priority</th><th>Blueprints</th><th>Health</th></tr></thead>
2324
=== modified file 'templates/util.html'
--- templates/util.html 2011-06-01 20:55:59 +0000
+++ templates/util.html 2012-01-17 11:59:24 +0000
@@ -23,6 +23,15 @@
23 </div>23 </div>
24</%def>24</%def>
2525
26<%def name="roadmap_progress_bar(item)">
27<div class="roadmap_wrap" title="${item['Completed']} blueprints complete of ${item['Total']}">
28 <div class="roadmap_value" style="width:${item['Percentage']}%">
29 <div class="Completed">&nbsp;</div>
30 </div>
31 <div class="roadmap_progress_text">${item['Percentage']} % complete of ${item['Total']}</div>
32</div>
33</%def>
34
26<%def name="url(end)">${root}${end}</%def>35<%def name="url(end)">${root}${end}</%def>
2736
28<%def name="burndown_chart(chart_url, large=False)">37<%def name="burndown_chart(chart_url, large=False)">

Subscribers

People subscribed via source and target branches