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
1=== modified file 'css/status.css'
2--- css/status.css 2011-12-21 07:44:02 +0000
3+++ css/status.css 2012-01-17 11:59:24 +0000
4@@ -47,38 +47,61 @@
5 }
6
7
8+.roadmap_progress_text {
9+ position: absolute;
10+ top:0; left:0;
11+
12+ padding-top: 5px;
13+
14+ color: #ffffff;
15+ text-align: center;
16+ width: 100%;
17+}
18+
19 .roadmap_wrap {
20+ border: 1px solid black;
21 position: relative;
22 margin-top: 2px;
23- margin-bottom: 6px;
24+ margin-bottom: 3px;
25 margin-left: auto;
26 margin-right: auto;
27+ background-color: #bdbdbd;
28+}
29+
30+.roadmap_wrap, .roadmap_value {
31+ width: 300px;
32+ height: 28px;
33+}
34+
35+table .roadmap_wrap, table .roadmap_value {
36+ border: 0px;
37+ width: 155px;
38+ height: 1.4em;
39 background-color: #ffffff;
40 }
41
42-.roadmap_wrap, .roadmap_value {
43- width: 155px;
44- height: 13px;
45-}
46-
47 .roadmap_value {
48- float: left
49+ float: left;
50 }
51
52 .roadmap_value .Completed {
53 background-color: green;
54+ height: inherit
55 }
56
57 .roadmap_value .Blocked {
58 background-color: red;
59+ height: inherit
60 }
61
62 .roadmap_value .InProgress {
63 background-color: gray;
64+ height: inherit
65 }
66
67 .roadmap_value .Planned {
68 background-color: orange;
69+ height: inherit
70 }
71
72 .progress_wrap {
73
74=== modified file 'html-report'
75--- html-report 2011-12-22 14:27:18 +0000
76+++ html-report 2012-01-17 11:59:24 +0000
77@@ -471,6 +471,7 @@
78 lane = report_tools.lane(store, opts.lane)
79 lanes = report_tools.lanes(store)
80 statuses = []
81+ bp_status_totals = {'Completed': 0, 'Total': 0, 'Percentage': 0}
82 for status, cards in report_tools.statuses(store, lane):
83 cards_with_bps = []
84 for card in cards:
85@@ -478,9 +479,11 @@
86 blueprint_status_counts = report_tools.card_bp_status_counts(
87 store, card.roadmap_id)
88 total = sum(blueprint_status_counts.values())
89- bp_percentages = {}
90+ bp_percentages = dict.fromkeys(ROADMAP_ORDERED_STATUSES, 0)
91+ bp_status_totals['Completed'] += \
92+ blueprint_status_counts['Completed']
93 for key in ROADMAP_STATUSES_MAP:
94- bp_percentages[key] = 0
95+ bp_status_totals['Total'] += blueprint_status_counts[key]
96 if total > 0:
97 bp_percentages[key] = (
98 100.0 * blueprint_status_counts[key] / total)
99@@ -489,8 +492,12 @@
100 'bp_statuses': blueprint_status_counts,
101 'bp_percentages': bp_percentages})
102 statuses.append(dict(name=status, cards=cards_with_bps))
103+ if bp_status_totals['Total'] > 0:
104+ bp_status_totals['Percentage'] = (100 * bp_status_totals['Completed'] /
105+ bp_status_totals['Total'])
106
107 data.update(dict(statuses=statuses))
108+ data.update(dict(bp_status_totals=bp_status_totals))
109 data.update(dict(status_order=ROADMAP_ORDERED_STATUSES))
110 data.update(dict(page_type="roadmap_lane"))
111 data.update(dict(lane_title=title))
112@@ -515,17 +522,17 @@
113 title = opts.title
114
115 blueprints = report_tools.card_blueprints_by_status(store, card.roadmap_id)
116- blueprint_status_count = WorkitemTarget()
117- blueprint_status_count.todo = len(blueprints['Planned'])
118- blueprint_status_count.blocked = len(blueprints['Blocked'])
119- blueprint_status_count.inprogress = len(blueprints['In Progress'])
120- blueprint_status_count.postponed = 0
121- blueprint_status_count.done = len(blueprints['Completed'])
122- card_has_blueprints = (blueprint_status_count.todo +
123- blueprint_status_count.blocked +
124- blueprint_status_count.inprogress +
125- blueprint_status_count.postponed +
126- blueprint_status_count.done) > 0
127+ bp_status_totals = {'Completed': 0, 'Total': 0, 'Percentage': 0}
128+ bp_status_totals['Total'] = (len(blueprints['Planned']) +
129+ len(blueprints['Blocked']) +
130+ len(blueprints['In Progress']) +
131+ len(blueprints['Completed']))
132+ bp_status_totals['Completed'] = len(blueprints['Completed'])
133+ if bp_status_totals['Total'] > 0:
134+ bp_status_totals['Percentage'] = (100 * bp_status_totals['Completed'] /
135+ bp_status_totals['Total'])
136+
137+ card_has_blueprints = bp_status_totals['Total'] > 0
138
139 status_order = ROADMAP_ORDERED_STATUSES[:]
140 status_order.reverse()
141@@ -537,7 +544,7 @@
142 data.update(dict(lane=lane.name))
143 data.update(dict(status_order=status_order))
144 data.update(dict(blueprints=blueprints))
145- data.update(dict(blueprint_status_count=blueprint_status_count))
146+ data.update(dict(bp_status_totals=bp_status_totals))
147 data.update(dict(card_has_blueprints=card_has_blueprints))
148
149 print report_tools.fill_template(
150
151=== modified file 'templates/roadmap_card.html'
152--- templates/roadmap_card.html 2011-12-21 14:05:45 +0000
153+++ templates/roadmap_card.html 2012-01-17 11:59:24 +0000
154@@ -35,7 +35,11 @@
155 </ul>
156
157 <div style="clear:both; text-align: center">Overall blueprint completion</div>
158-${util.progress_bar(blueprint_status_count) if card_has_blueprints else '<center><i>Progress graph pending linked blueprints.</i></center>'}
159+% if card_has_blueprints:
160+${util.roadmap_progress_bar(bp_status_totals)}
161+% else:
162+<center><i>Progress graph pending linked blueprints.</i></center>
163+% endif
164
165 <h3>Description</h3> ${card.description if card.description is not None else '<i>No description could be found.</i>'}
166 <p><a href="${card.url}">Read the full description</a>.
167
168=== modified file 'templates/roadmap_lane.html'
169--- templates/roadmap_lane.html 2011-12-22 11:57:53 +0000
170+++ templates/roadmap_lane.html 2012-01-17 11:59:24 +0000
171@@ -17,6 +17,7 @@
172 % endfor
173 </select>
174 <h1>${title()}</h1>
175+${util.roadmap_progress_bar(bp_status_totals)}
176 <p>
177 <table width="100%">
178 <thead><tr><th>Card</th><th>Status</th><th>Team</th><th>Priority</th><th>Blueprints</th><th>Health</th></tr></thead>
179
180=== modified file 'templates/util.html'
181--- templates/util.html 2011-06-01 20:55:59 +0000
182+++ templates/util.html 2012-01-17 11:59:24 +0000
183@@ -23,6 +23,15 @@
184 </div>
185 </%def>
186
187+<%def name="roadmap_progress_bar(item)">
188+<div class="roadmap_wrap" title="${item['Completed']} blueprints complete of ${item['Total']}">
189+ <div class="roadmap_value" style="width:${item['Percentage']}%">
190+ <div class="Completed">&nbsp;</div>
191+ </div>
192+ <div class="roadmap_progress_text">${item['Percentage']} % complete of ${item['Total']}</div>
193+</div>
194+</%def>
195+
196 <%def name="url(end)">${root}${end}</%def>
197
198 <%def name="burndown_chart(chart_url, large=False)">

Subscribers

People subscribed via source and target branches