Hi,

I've been doing a bit more updating of the dashboard plugin. This was the main commit from this evening which adds some new css and adds markup and logic for the progress bar in the milestone view.

Cheers,
    Gary

On 16/04/12 22:36, [email protected] wrote:
Author: gjm
Date: Mon Apr 16 21:36:47 2012
New Revision: 1326808

URL: http://svn.apache.org/viewvc?rev=1326808&view=rev
Log:
dashboard: Progress bar in milestone view

Added:
     
incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/htdocs/roadmap.css
Modified:
     
incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/web_ui/templates/bhmilestone.html
     
incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/web_ui/ticket/roadmap.py
     
incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/widgets/templates/widget_progress.html

Added: 
incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/htdocs/roadmap.css
URL: 
http://svn.apache.org/viewvc/incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/htdocs/roadmap.css?rev=1326808&view=auto
==============================================================================
--- 
incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/htdocs/roadmap.css 
(added)
+++ 
incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/htdocs/roadmap.css 
Mon Apr 16 21:36:47 2012
@@ -0,0 +1,77 @@
+/* General styles for the progress bars */
+.progress a, .progress :link, .progress :visited,
+.progress :link:hover, .progress :visited:hover {
+ border: none;
+ display: block;
+ width: 100%;
+ height: 1.2em;
+ padding: 0;
+ margin: 0;
+ text-decoration: none
+}
+.progress .bar { display: inline-block }
+.progress .bar.open { background: none !important; }
+
+/* Styles for the roadmap view
+.milestones { margin: 2em 0 0; padding: 0 }
+.milestone { margin-bottom: 4em }
+.milestone .info { white-space: nowrap }
+.milestone .info h2 {
+ background: #f7f7f7;
+ border-bottom: 1px solid #d7d7d7;
+ margin: 0;
+}
+.milestone .info h2 :link, .milestone .info h2 :visited {
+ color: #000;
+ display: block;
+ border-bottom: none;
+}
+.milestone .info h2 :link:hover, .milestone .info h2 :visited:hover {
+ color: #000;
+}
+.milestone .info h2 em { color: #b00; font-style: normal }
+.milestone .info .date {
+ color: #888;
+ font-size: 11px;
+ font-style: italic;
+ margin: 0 0 1em 0;
+}
+.milestone .description { margin-left: 1em }
+
+/* Styles for the milestone view
+.milestone .date { color: #888; font-style: italic; margin: 0 }
+.milestone .description { margin: 1em 0 2em }
+#stats { float: right; margin: 0 0 2em 2em; padding: 0; width: 400px; 
max-width: 40% }
+#stats legend { white-space: nowrap }
+
+/* Styles for progress bars
+.trac-progress .progress, .trac-groupprogress { margin: 0 1em; width: 40em; 
max-width: 70% }
+.trac-progress .legend {
+ font-size: 10px;
+ font-style: italic;
+ margin: 1em 1em 2em;
+ white-space: nowrap;
+ clear: left;
+}
+.trac-progress .legend .interval { margin: 0 .8em }
+.trac-groupprogress table { border-collapse: collapse; width: 100% }
+.trac-groupprogress th, .trac-groupprogress td { font-size: 10px; padding: 0; 
white-space: nowrap }
+.trac-groupprogress th { text-align: right; }
+.trac-groupprogress th :link, .trac-groupprogress th :visited { border: none }
+.trac-groupprogress td { padding-left: 0.5em; width: 100% }
+.trac-groupprogress table.progress  { margin: 3px 1em 3px 0 }
+.trac-groupprogress table.progress td  { padding: 0 }
+.trac-groupprogress p.percent { margin-top: 3px; white-space: nowrap }
+
+/* Styles for the milestone edit form
+#edit fieldset { margin: 1em 0 }
+#edit em { color: #888; font-size: smaller }
+#edit .disabled em { color: #d7d7d7 }
+#edit .field { margin: 0.5em 0 }
+#edit label { padding-left: .2em }
+#edit fieldset.iefix { margin-left: 1px; margin-right: 1px }
+#edit textarea#description { margin-left: -1px; margin-right: -1px; padding: 
0; width: 100% }
+#edit .wikitoolbar { margin-left: -1px }
+#edit div.trac-resizable { width: 100% }
+*/
+

Modified: 
incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/web_ui/templates/bhmilestone.html
URL: 
http://svn.apache.org/viewvc/incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/web_ui/templates/bhmilestone.html?rev=1326808&r1=1326807&r2=1326808&view=diff
==============================================================================
--- 
incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/web_ui/templates/bhmilestone.html
 (original)
+++ 
incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/web_ui/templates/bhmilestone.html
 Mon Apr 16 21:36:47 2012
@@ -3,6 +3,7 @@
      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";>
  <html xmlns="http://www.w3.org/1999/xhtml";
        xmlns:py="http://genshi.edgewall.org/";
+      xmlns:i18n="http://genshi.edgewall.org/i18n";
        xmlns:bh="http://issues.apache.org/bloodhound/wiki/Ui/Dashboard";
        xmlns:xi="http://www.w3.org/2001/XInclude";>
    <xi:include href="layout.html" />
@@ -16,8 +17,41 @@
    <body>
      <div class="row">
        <div class="span8">
+<h1 style="display: inline;">Milestone ${milestone.name}</h1>
+<br/><br/>
+<py:def function="milestone_caption">
+<py:choose test="">
+<py:when test="milestone.completed">
+<i18n:msg params="duration, date">
+                Completed ${dateinfo(milestone.completed)} ago 
(${format_datetime(milestone.completed)})
+</i18n:msg>
+</py:when>
+<py:when test="milestone.is_late">
+<i18n:msg params="duration, date">
+                dateinfo(milestone.due)} late 
(${format_datetime(milestone.due)})
+</i18n:msg>
+</py:when>
+<py:when test="milestone.due">
+<i18n:msg params="duration, date">
+                Due in ${dateinfo(milestone.due)} 
(${format_datetime(milestone.due)})
+</i18n:msg>
+</py:when>
+<py:otherwise>
+              No date set
+</py:otherwise>
+</py:choose>
+<form style="display: inline;"
+              py:if="'MILESTONE_MODIFY' in perm(milestone.resource)">
+&nbsp;
+<input type="hidden" name="action" value="edit" />
+<input type="submit" class="btn btn-mini btn-info"
+                value="${_('Change')}" />
+</form>
+</py:def>
+<xi:include href="widget_progress.html"
+            py:with="caption = milestone_caption(); legend = True;"/>
          <div class="alert">
-<span class="label label-warning">TODO</span>  Include milestone data.
+<span class="label label-warning">TODO</span>  Include button toolbar.
          </div>
        </div>
        <div class="span4">

Modified: 
incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/web_ui/ticket/roadmap.py
URL: 
http://svn.apache.org/viewvc/incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/web_ui/ticket/roadmap.py?rev=1326808&r1=1326807&r2=1326808&view=diff
==============================================================================
--- 
incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/web_ui/ticket/roadmap.py
 (original)
+++ 
incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/web_ui/ticket/roadmap.py
 Mon Apr 16 21:36:47 2012
@@ -54,8 +54,11 @@ class BloodhoundMilestoneModule(Componen
      def post_process_request(self, req, template, data, content_type):
          """Customize milestone view.
          """
+        add_stylesheet(req, 'dashboard/roadmap.css')
          mdl = self.env[MilestoneModule]
          if mdl is not None and mdl.match_request(req):
-            return 'bhmilestone.html', data, content_type
+            return {
+                    'milestone_view.html' : 'bhmilestone.html',
+                }.get(template, template), data, content_type
          else:
              return template, data, content_type

Modified: 
incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/widgets/templates/widget_progress.html
URL: 
http://svn.apache.org/viewvc/incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/widgets/templates/widget_progress.html?rev=1326808&r1=1326807&r2=1326808&view=diff
==============================================================================
--- 
incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/widgets/templates/widget_progress.html
 (original)
+++ 
incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/widgets/templates/widget_progress.html
 Mon Apr 16 21:36:47 2012
@@ -2,7 +2,30 @@
  <div class="well"
      xmlns="http://www.w3.org/1999/xhtml";
      xmlns:py="http://genshi.edgewall.org/";
+    xmlns:i18n="http://genshi.edgewall.org/i18n";
      xmlns:xi="http://www.w3.org/2001/XInclude";>
-  $legend
-<div class="pull-right">${'%d%%' % stats.done_percent}</div>
+<py:if test="caption">$caption</py:if>
+<div class="pull-right">${'%d%%' % stats.done_percent} completed</div>
+<br/><br/>
+<div class="progress progress-danger">
+<div py:for="idx, interval in enumerate(stats.intervals)"
+        class="bar $interval.css_class"
+        style="${'width: %d%%' % interval.percent if interval.percent>  0 else 
'display: none'}">
+<a href="${interval_hrefs[idx] if interval_hrefs else None}"
+          title="${_('%(count)s/%(total)s %(title)s',
+                  count=interval.count, total=stats.count, 
title=interval.title)}"></a>
+</div>
+</div>
+<p py:if="legend">
+<a href="${stats_href}"
+        i18n:msg="unit, count">Total number of ${stats.unit}: 
${stats.count}</a>
+<span class="pull-right">
+<py:for each="idx, interval in enumerate(stats.intervals)">
+<a href="${interval_hrefs[idx] if interval_hrefs else None}"
+            i18n:msg="title, count">
+          ${interval.title} (${interval.count})
+</a>  &nbsp;
+</py:for>
+</span>
+</p>
  </div>



Reply via email to