Commit 313ade165d9e0c341763e764ff7c060e5bdc0fc3

Added progress bars to roadmap

Commit diff

app/helpers/application_helper.rb

 
340340 acts << %Q{<li>#{link_to("New Article", new_project_article_path(@project.slug))}</li>} if flags[:new_article] && is_member
341341 acts << %Q{<li>#{link_to("New Ticket", new_project_ticket_path(@project.slug))}</li>} if flags[:new_ticket]
342342 acts << %Q{<li>#{link_to("New Milestone", new_project_milestone_path(@project.slug))}</li>} if flags[:new_milestone] && is_member
343 acts << %Q{<li>#{link_to("Completed Milestones", root_path)}</li>} if flags[:completed_milestones]
343344 acts << %Q{<li>#{link_to("Clone Mainline", new_project_repository_path(@project.slug, @repository))}</li>} if flags[:clone_mainline] && logged_in?
344345 out << %Q{<tr><td><ul>#{acts}</ul></td></tr>} if acts != ""
345346 out << %Q{<tr><td>#{actionbox_default(flags)}</td></tr>}
toggle raw diff

app/helpers/projects_helper.rb

 
118118 out << actionbox_basic(:allow_shortcuts => true)
119119 end
120120 when PRJ_TAB_ROADMAP
121 out << actionbox_complex(:allow_shortcuts => true, :new_milestone => true)
121 out << actionbox_complex(:allow_shortcuts => true, :new_milestone => true, :completed_milestones => true)
122122 when PRJ_TAB_TICKETS
123123 out << actionbox_complex(:allow_shortcuts => true, :new_ticket => true)
124124 out << actionbox_ticket_filter
175175 @milestones = Milestone.roadmap(@project.id, current_user)
176176 if @milestones.size > 0 then
177177 for milestone in @milestones
178
178179 # milestone title
179 out << "<h2>"
180 out << "<h3>"
180181 out << format_date_ddbbyy(milestone.due_date)
181182 out << " - " << milestone.name << " (" << milestone.status.to_s.capitalize << ")"
182 out << "</h2>"
183 out << "</h3>"
184
185 # milestone progress bar
186 out << "<table class='progress'>"
187 out << "<tr>"
188 out << "<td class='closed' style='width: " << milestone.progress.to_s << "%'><a href='/query?status=closed&amp;milestone=2.x' title='903 of 2501 tickets closed'></a></td>"
189 out << "<td class='open' style='width: " << (100 - milestone.progress).to_s << "%'><a href='/query?status=new&amp;status=assigned&amp;status=reopened&amp;milestone=2.x' title='1598 of 2501 tickets active'></a></td>"
190 out << "</tr>"
191 out << "</table>"
192
193
183194 # tickets for milestone
184195 @tickets = Ticket.find_by_milestone(milestone.id)
185196 if @tickets.size > 0 then
186197 # tasks list
187198 out << "<table class='public' width='100%'>"
188199 out << "<tr>"
189 out << "<th>Due</th>"
190200 out << "<th>Task</th>"
191201 out << "<th>Assignee</th>"
192202 out << "<th>Status</th>"
206206 #
207207 for ticket in @tickets
208208 out << "<tr>"
209 #
210 out << "<td>"
211 #FIXME must be a better way of handling nils like ||=
212 if ticket.due_date != nil then
213 out << format_date_ddbbyy(ticket.due_date)
214 end
215 out << "</td>"
216 #
217209 out << "<td>" << ticket.title << "</td>"
218210 out << "<td>" << ticket.assignee.fullname << "</td>"
219211 out << "<td>" << ticket.status.to_s.capitalize << "</td>"
toggle raw diff

app/models/milestone.rb

 
3535 #to display roadmap, except it's now also used by the project summary tab
3636 def self.roadmap(project_id, curruser)
3737 projects_allowed = Project.list_for_user(curruser)
38 find(:all, :conditions => ["project_id = '#{project_id}' AND ( audience = '#{:public}' OR project_id IN (" << projects_allowed << ") )"], :order => "due_date ASC")
38 find(:all, :conditions => ["project_id = '#{project_id}' AND NOT status = 'complete' AND ( audience = '#{:public}' OR project_id IN (" << projects_allowed << ") )"], :order => "due_date ASC")
3939 end
4040
4141 #
toggle raw diff

app/views/layouts/application.html.erb

 
88<link rel="shortcut icon" href="/favicon.ico">
99<link rel='alternate' type='application/rss+xml' title='RSS Feed' href='/rss.xml'/>
1010<title><%= yield(:title) %> - <%= SITENAME %></title>
11<%= stylesheet_link_tag 'gitlab' %>
11<%= stylesheet_link_tag 'base' %>
1212</head>
1313
1414<body>
toggle raw diff

app/views/projects/ac_roadmap.html.erb

 
55
66<div id='todo'>
77<p>Show milestones and allow tickets to be dragged between them, show unmilestoned tickets, clicking ticket goes to ticket tab.</p>
8<p>Make milestone boxes collapsable</p>
89</div>
910
1011<%= render :partial => "ac_project_footer" %>
toggle raw diff

db/migrate/015_create_tickets.rb

 
4141 t.column :impact, :enum, :limit => [:low, :high, :security], :default => :low
4242 t.column :priority, :enum, :limit => [:none, :low, :high, :critical], :default => :none
4343 t.column :audience, :enum, :limit => [:public, :members], :default => :public
44 t.datetime :due_date
4544 t.string :cc, :default => ""
4645 t.datetime :open_date
4746 t.datetime :close_date
toggle raw diff

public/stylesheets/base.css

 
1/* reset */
21/*
3Copyright (c) 2007, Yahoo! Inc. All rights reserved.
4Code licensed under the BSD License:
5http://developer.yahoo.net/yui/license.txt
6version: 2.3.1
2 Gitlab specfic CSS
3
4 Note: CSS for syntax highlighting is in /vendor/coderay/styles/gitlab.rb
75*/
8body { color:#000;background:#FFF; }
9body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,
10 input,textarea,p,blockquote,th,td { margin:0;padding:0; }
11table { border-collapse:collapse;border-spacing:0; }
12fieldset,img { border:0; }
13address,caption,cite,code,dfn,em,strong,th,var {font-style:normal;font-weight:normal; }
14li { list-style:none;}
15caption,th { text-align:left; }
16h1,h2,h3,h4,h5,h6 { font-size:100%;font-weight:normal; }
17q:before,q:after{ content:''; }
18abbr,acronym { border:0;font-variant:normal; }
19sup,sub { line-height:-1px;vertical-align:text-top; }
20sub{ vertical-align:text-bottom; }
21input, textarea, select { font-family:inherit;font-size:inherit;font-weight:inherit; }
22
23/**/
24
25body {
26 font-size: 13px;
27 line-height: 1.461em;
28 background: #fff;
29 color: #000;
30 font-family: Georgia, Times, "Times new Roman", serif;
31 margin: 0;
32 padding: 0;
33}
34h1, h2, h3, h4, h5, h6 {
35 color: #09460f;
36 font-weight: normal;
37}
38h1 {
39 margin: 0;
40 font-size: 1.615em;
41 line-height: 0.904em;
42 margin-bottom: 0.904em;
43}
44h2 {
45 margin: 0;
46 font-size: 1.461em;
47 line-height: 1em;
48 margin-bottom: 1em;
49}
50h3 {
51 margin: 0;
52 font-size: 1.307em;
53 line-height: 1.117em;
54 margin-bottom: 1.117em;
55}
56h4 {
57 margin: 0;
58 font-size: 1.153em;
59 line-height: 1.266em;
60 margin-bottom: 1.266em;
61}
62p, ul, blockquote, pre, td, th, label {
63 margin: 0;
64 font-size: 1em;
65 line-height: 1.461em;
66 margin-bottom: 1.461em;
67}
68p, ul, blockquote, td, th, label {
69 font-family: "Bitstream Vera Serif", Georgia, Times, "Times new Roman", serif;
70}
71
72p.small {
73 margin: 0;
74 font-size: 0.846em;
75 line-height: 1.727em;
76 margin-bottom: 1.727em;
77}
78table {
79 border-collapse: collapse;
80 margin-bottom: 1.461em;
81}
82code, pre, tt {
83 font: 95%/105% "Bitstream Vera Sans Mono", Monaco, "Courier New", Courier, monospace;
84}
85a {
86/* color: #630;*/
87/* color: #811E00;*/
88 color: #e7371a;
89 text-decoration: none;
90}
91a:hover {
92 text-decoration: underline;
93}
94strong, b {
95 font-weight: bold;
96}
97em, i {
98 font-style: italic;
99}
100ul {
101 margin-left: 0.5em;
102 margin-right: 0.5em;
103}
104pre {
105 margin-left: 2em;
106 margin-right: 2em;
107}
108
109ul li h1, ul li h2, ul li h3, ul li h4 {
110 margin-bottom: 0.5em;
111}
112
113abbr {
114 border-bottom: 1px dotted #333;
115}
116/* boxes */
117
118.clear {
119 clear: both;
120 height: 0;
121}
122
123.clear_left {
124 clear: left;
125 height: 0;
126}
127
128#container {
129 width: 90%;
130 margin-top: 20px;
131}
132
133#header {
134 background: #292929;
135 padding-left: 0.5em;
136}
137
138#header #logo {
139 padding: 10px 0 20px 30px;
140 line-height: 100%;
141 margin:0;
142}
143#header #logo a { color: #666; }
144
145#container #main {
146 min-height: 300px;
147 width:100%;
148 float:left;
149 margin-right: -160px;
150}
151#container #content { /* when there's no sidebar*/
152 margin: 0 0 1em 2.5em;
153}
154#container #main #content { /* when there's sidebar contents */
155 margin:0;
156 margin-right: 160px;
157 margin-top: 20px;
158 padding: 0 1em 1em 2em;
159}
160#container #sidebar {
161 margin-top: 20px;
162 padding-left: 5px;
163 min-height: 300px;
164 width: 150px;
165 float:right;
166 border-left: 1px dotted #333;
167}
168
169#sidebar ul.links {
170 margin-left: -5px;
171 padding:0;
172}
173#sidebar ul.links li {
174 border-bottom: 1px dotted #888;
175}
176#sidebar ul.links li a {
177 display: block;
178 padding: 5px 5px 5px 10px;
179}
180#sidebar ul.links li a:hover {
181 color: #fff;
182 background: #630;
183 text-decoration: none;
184}
185
186#container #footer {
187 padding: 10px 30px 0 10px;
188 font-size: 11px;
189 color: #666;
190 text-align: center;
191 clear:both;
192}
193
194#container #footer ul li {
195 display: inline;
196}
197
198.flash_message {
199 clear: both;
200 padding: 5px 5px 5px 20px;
201 margin-bottom: 20px;
202 border-top:1px solid #ccc;
203 border-bottom:1px solid #ccc;
204}
205.flash_message p { margin: 0; }
206.flash_message.notice {
207 color: #588e03;
208 background: #e9fad9;
209 border-color: #588e03;
210}
211
212.flash_message.error {
213 color: #c30000;
214 background: #f2dcdc;
215 border-color: #c30000;
216}
217
218/* menu */
219
220#menu {
221 float: right;
222 margin-top: -50px;
223 margin-right: 20px;
224 list-style: none;
225 padding-top: 2px;
226}
227
228#menu li {
229 display: inline;
230 margin-right: 20px;
231}
232#menu li.secondary {
233 margin-right: 5px;
234 color: #666;
235}
236#menu li a {
237 font-size: 14px;
238 color: #eab239;
239}
240
241#menu li.secondary a {
242 font-size: 11px;
243}
244
245#menu li a:hover {
246 text-decoration: none;
247 border-bottom: 2px solid #eab239;
248}
249
250/* submenu */
251#submenu {
252/* font-size: 90%;*/
253 list-style: none;
254 margin: 0 0 0 30px;
255}
256
257#submenu li {
258 display: inline;
259 margin-right: 20px;
260}
261#submenu li.menu_title {
262 color: #ccc;
263 margin-right: 5px;
264 margin-left: 20px;
265}
266
267#submenu li a {
268 font-size: 12px;
269 background: #9cce2e;
270 color: #09460f;
271 padding: 5px 10px 3px 10px;
272}
273#submenu li.selected a {
274 background: #fff;
275 color: #000;
276}
277
278#submenu li a:hover {
279 text-decoration: none;
280 background: #3b5f02;
281 color: #fff;
282}
283
284#submenu li.selected a:hover {
285 background: #fff;
286 color: #000;
287}
288
289/* Forms */
290
291textarea {
292 width: 90%;
293}
294
295fieldset {
296 padding: 3px;
297 margin: 0 0 10px 0;
298 width: 100%;
299}
300
301legend {
302 font-weight: bold;
303 font-size:12px;
304}
305
306label {
307 font-weight: bold;
308}
309
310.required {
311 color: #aaa;
312 font-size: 10px;
313 font-weight: normal;
314}
315
316form {
317 margin-bottom: 1.5em;
318}
319
320input.text {
321 padding: 3px;
322 width: 350px;
323}
324
325textarea {
326 width: 350px;
327 height: 150px;
328 padding: 3px;
329}
330textarea.text { height: 60px; }
331textarea.wide { width: 100%; }
332textarea.tall { height: 500px; }
333textarea.medium { width: 450px; height: 250px; }
334select { width: 200px; }
335
336input.text, textarea, select {
337 margin: 5px 0 10px 0;
338 border: 1px solid #bbb;
339}
340
341input.text:focus, input.title:focus,
342textarea:focus, select:focus {
343 border: 1px solid #666;
344}
345
346.fieldWithErrors { margin: 0; display: block;}
347.fieldWithErrors input, .fieldWithErrors textarea,
348.fieldWithErrors select {
349 border: 1px solid #c30000;
350}
351
352.errorExplanation {
353 background: #fbe3e4;
354 border: 1px solid #c30000;
355 width: 400px;
356 margin: 0 0 10px 0;
357}
358
359.errorExplanation h2 {
360 font-size: 120%;
361 line-height: 120%;
362 font-weight: normal;
363 padding: 5px;
364 color: #fff;
365 background: #c30000;
366 margin-bottom: 0.2em;
367}
368.errorExplanation p {
369 padding: 2px 2px 2px 5px;
370 margin-bottom: 0;
371 margin-top: 0;
372}
373.errorExplanation ul {
374 padding: 5px 10px 10px 25px;
375 margin-bottom: 0;
376}
377.errorExplanation ul li{
378 list-style-type: disc;
379}
380
381table.listing {
382 width: 100%;
383}
384
385table.listing tr td {
386 padding: 3px;
387}
388
389table.listing tr.odd {
390 background: #eee;
391}
392table.listing thead th {
393 font-weight: bold;
394 padding: 3px;
395 border-bottom: 2px solid #888;
396}
397
398table.repository_list tr.mainline {
399 margin: 10px 0 0 0;
400 padding: 10px;
401}
402table.repository_list tr.mainline td {
403 border-top: 1px solid #408000;
404 border-bottom: 1px solid #408000;
405 background: #dbf7b3;
406 font-weight: bold;
407}
408table.repository_list td {
409 margin: 0;
410 padding: 5px;
411 border-bottom: 1px solid #ccc;
412}
413table.repository_list tr.clone td.name {
414 background: url("/images/clone_indent.png") 10px 50% no-repeat;
415 padding-left: 20px;
416}
417
418.infobox {
419 background: #efefef;
420 padding: 10px;
421 border: 1px solid #ccc;
422}
423
424.infobox li {
425 margin-bottom: 0.2em;
426}
427
428#projects .infobox {
429 float: right;
430 width: 30%;
431 margin: 0 0 10px 10px;
432 font-size: 93%;
433}
434
435#projects .infobox ul {
436 margin-bottom:0;
437}
438
439.commit_list .commit_item {
440 clear:left;
441 margin-bottom: 15px;
442}
443
444.commit_message, .commit_message p {
445 margin-top: 10px;
446 margin-left: 10px;
447 font: 95%/105% "Bitstream Vera Sans Mono", Monaco, "Courier New", Courier, monospace;
448}
449
450.commit_list .commit_item .commit_message {
451 margin-left: 40px;
452}
453
454small.commit_message {
455 margin: 0;
456 font: 85%/95% "Bitstream Vera Sans Mono", Monaco, "Courier New", Courier, monospace;
457}
458
459.commit_message a {
460 color: #000;
461}
462
463.gravatar {
464 background-color: white;
465 border: 1px solid #CCCCCC;
466 float: left;
467 margin-right: 10px;
468 padding: 2px;
469}
470
471.gravatar_tiny {
472 background: transparent;
473 border: none;
474 margin-right: 5px;
475}
476
477.commit_list .commit_item .gravatar {
478 margin-top: 5px;
479}
480
481ul.project_list li {
482 padding-bottom: 1em;
483 margin-bottom: 1em;
484 border-bottom: 1px solid #dedede;
485}
486
487ul.bullet_list li {
488 list-style: disc;
489 margin-left: 2.5em;
490}
491
492.pagination {
493 padding: 3px;
494 margin: 3px;
495 text-align: center;
496}
497.pagination a {
498 padding: 1px 5px 2px 5px;
499 margin: 2px;
500 border: 1px solid #ddd;
501 text-decoration: none;
502}
503.pagination a:hover, .pagination a:active {
504 border-bottom: 1px solid #333;
505 background: #630;
506 color: #fff;
507}
508.pagination span.current {
509 padding: 1px 5px 2px 5px;
510 margin: 2px;
511 border: 1px solid #999;
512 font-weight: bold;
513 color: #000;
514}
515.pagination span.disabled {
516 padding: 1px 5px 2px 5px;
517 margin: 2px;
518 border: 1px solid #eee;
519 color: #ddd;
520}
521
522.section {
523 margin-bottom: 3em;
524}
5256
526ul.path_breadcrumbs { margin: 0 0 5px 0; }
527ul.path_breadcrumbs li {
528 display: inline;
529 margin:0;
530 font-size: 11px;
531}
532
533/* tags */
534
535ul.tag_list li {
536 display:inline;
537}
538
539.tag_size_1 { font-size: 1.0em; }
540.tag_size_2 { font-size: 1.2em; }
541.tag_size_3 { font-size: 1.4em; }
542.tag_size_4 { font-size: 1.6em; }
543
544.large_tags .tag_size_1 { font-size: 1.0em; }
545.large_tags .tag_size_2 { font-size: 1.3em; }
546.large_tags .tag_size_3 { font-size: 1.6em; }
547.large_tags .tag_size_4 { font-size: 1.9em; }
548
549/* "un-ready" objects */
550
551.constructing {
552 color: #999;
553 background: transparent;
554}
555
556div.being_constructed p {
557 padding: 0;
558 padding-top: 2px;
559 margin: 0;
560 color: #333;
561 font-family: "Lucida Grande", Helvetica, Arial, Verdana, sans-serif;
562 font-size: 90%;
563}
564
565div.being_constructed {
566 text-align:center;
567 margin: 1em;
568 padding: 1em;
569 border: 1px solid #A74B42;
570 background: #eee;
571}
572
573
574/* auto completions */
575
576div.auto_complete {
577 width: 350px;
578 background: #fff;
579}
580div.auto_complete ul {
581 border:1px solid #888;
582 margin:0;
583 padding:0;
584 width:100%;
585 list-style-type:none;
586}
587div.auto_complete ul li {
588 margin:0;
589 padding:3px;
590}
591div.auto_complete ul li.selected {
592 background-color: #ffb;
593}
594div.auto_complete ul strong.highlight {
595 color: #800;
596 margin:0;
597 padding:0;
598}
599
600span.tag {
601 border: 1px solid #999;
602 background: #dedede;
603 padding: 0 4px 2px 4px;
604}
605
606.link_to_more {
607 border-top: 1px solid #aaa;
608 padding: 2px;
609 text-align: center;
610}
611
612table.tree tr td {
613 padding: 5px;
614}
615
616table.tree tr:hover {
617 background: #EFECE0;
618}
619
620table.tree tr td.meta {
621 font-size: 85%;
622}
623
624table.tree tr td.meta, table.tree tr td.commit_message a {
625 color: #444;
626}
627
628table.tree tr td.node a {
629 padding-left:25px;
630 background-position: 4px 50%;
631 background-repeat: no-repeat;
632}
633table.tree tr td.file a { background-image: url("/images/icon_file.gif"); }
634table.tree tr td.tree a { background-image: url("/images/folder_grey.png"); }
7body { font-family: Verdana, "Lucida Grande", Geneva, Arial, Helvetica, sans-serif; margin: 0px 0px 0px 0px; }
8
9a:link { color: #e52; text-decoration: underline; }
10a:hover { color: #30f; }
11a:visited { color: #e52; } /* was #666 FIXME not sure about this visited colour */
12a:visited:hover { color: #30f; }
13
14a img { border:none; text-decoration:none; display: block; }
15a:hover img { border:none; text-decoration:none; }
16img.center { display: block; margin-left: auto; margin-right: auto }
17
18h1.bctitle { display: inline; padding: 0; font-size: 1.0em; color: #222; font-weight: 800; } /* Last breadcrumb usually */
19h1.pagetitle { font-size: 1.7em; font-weight: normal; color: #000; letter-spacing: -1px; margin-top: 8px; margin-bottom: 8px; } /* static page title */
20h2 { font-size: 1.7em; font-weight: normal; color: #000; letter-spacing: -1px; margin-top: 8px; margin-bottom: 8px; } /* post titles */
21h3 { font-size: 1.4em; font-weight: normal; color: #222; letter-spacing: -1px; margin-top: 8px; margin-bottom: 8px; } /* smaller section title */
22h4 { font-size: 1.2em; font-weight: normal; color: #222; letter-spacing: -1px; margin-top: 40px; margin-bottom: 8px; } /* submenus */
23h5 { font-size: 0.8em; font-weight: normal; color: #666; margin-top: 2px; margin-bottom: 20px; } /* date, poster */
24/* FIXME this was being used for 'Fig 1.0 for below tables, images' to caption some test posts, they need changning now */
25h6 { font-size: 0.8em; font-weight: normal; color: #444; margin: 4px 0px 4px 0px; } /* small text */
26
27/*hr { border-top: 1px solid #ccc; height: 0px; margin: 0px 0px 30px 0px; }*/
28div.hr { height: 1px; border-top: 1px solid #ccc; margin: 0px 0px 30px 0px; }
29div.hr hr {display: none;}
30
31/* Page holds all sections - header, breadcrumb, content, footer */
32#page { text-align: left; margin: 0 auto; min-width: 800px; } /* holds entire page including header */
33
34/* Header holds the top menu and logo */
35#header { display: block; background: #ededed; border-bottom: 1px solid #aaa; padding: 0px; margin: 0px; width: 100%; height: 29px; }
36
37#menu { float: right; display: block; width: 100%; border: 0px; padding: 0px; margin: 6px 0px 0px 0px; }
38#menu ul { float: right; list-style: none; margin: 0; margin-right: 20px; padding: 0; }
39#menu li { float:left; margin:0; padding:0 0 0 7px; }
40
41#menu .item { font-size: 1.0em; } /* the main menu options */
42</