File: index.rhtml

package info (click to toggle)
ditz 0.5-1
  • links: PTS
  • area: main
  • in suites: squeeze, wheezy
  • size: 356 kB
  • ctags: 489
  • sloc: ruby: 3,664; sh: 15; makefile: 12
file content (130 lines) | stat: -rw-r--r-- 3,507 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title><%= project.name %> Issue Tracker</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="style.css" type="text/css" />
</head>
<body>

<div class="main">
<h1><%= project.name %> Issue Tracker</h1>

<h2>Upcoming Releases</h2>
<% if upcoming_releases.empty? %>
  <p>No upcoming releases.</p>
<% else %>
  <table>
    <tbody>
    <% upcoming_releases.each do |r| %>
      <%
        issues = project.issues_for_release r
        num_done = issues.count_of { |i| i.closed? }
        pct_done = issues.size == 0 ? 1.0 : (num_done.to_f / issues.size.to_f)
        open_issues = issues.select { |i| i.open? }
      %>
      <tr><td>
        <%= link_to r, "#{r.name}" %>
        </td>
        <td>
        <% if issues.empty? %>
          no issues
        <% elsif open_issues.empty? %>
            ready for release!
        <% else %>
          <%= progress_meter pct_done %>
          <%= sprintf "%.0f%%", pct_done * 100.0 %> complete
          </td>
          </tr><tr><td></td><td>
          <%= num_done %> / <%= issues.size %> issues.
          <%= link_to r, "See issues &raquo;" %>
        <% end %>
        </td>
      </tr>
    <% end %>
    </tbody>
  </table>
<% end %>

<h2>Past Releases</h2>
<% if past_releases.empty? %>
  <p>No past releases.</p>
<% else %>
  <table>
    <tbody>
    <% past_releases.sort_by { |r| r.release_time }.reverse.each do |r| %>
      <tr><td><%= link_to r, r.name %></td><td class="littledate">on <%= r.release_time.pretty_date %></td></tr>
    <% end %>
    </tbody>
  </table>
<% end %>

<h2>Unassigned issues</h2>
<%
  issues = project.unassigned_issues
  open_issues = issues.select { |i| i.open? }
%>
<p>
  <% if issues.empty? %>
    No unassigned issues.
  <% else %>
    <%= link_to "unassigned", "unassigned issue".pluralize(issues.size).capitalize %> (<%= open_issues.size.to_pretty_s %> open).
  <% end %>
</p>

<% if components.size > 1 %>
  <h2>Open Issues by component</h2>
  <table>
    <tbody>
    <% components.each do |c| %>
      <%
        issues = project.issues_for_component c
        num_done = issues.count_of { |i| i.closed? }
        pct_done = issues.size == 0 ? 1.0 : (num_done.to_f / issues.size.to_f)
        open_issues = issues.select { |i| i.open? }
      %>
      <% if open_issues.empty? %>
        <tr class="dimmed">
      <% else %>
        <tr>
      <% end %>
      <td>
        <%= link_to c, c.name %>
      </td><td>
        <%= "open issue".pluralize(open_issues.size) %>
      </td></tr>
    <% end %>
    </tbody>
  </table>
<% end %>

<h2>Recent activity</h2>

<table class="log">
  <tbody>
  <% project.issues.map { |i| i.log_events.map { |e| [e, i] } }.
        flatten_one_level.
        sort_by { |e| e.first.first }.
        reverse[0 ... 10].
        each_with_index do |((date, who, what, comment), i), idx| %>
    <tr class="<%= idx % 2 == 0 ? "even-row" : "odd-row" %>">
      <td class="date"><%= date.pretty_date %></td>
      <td class="issuename">
        <%= issue_link_for i, :status_image => true %>
      </td>
      <td> <%= what %> </td>
    </tr>
    <tr><td></td></tr>
  <% end %>
  </tbody>
</table>

</div>

<div class="footer">Generated by <a href="http://ditz.rubyforge.org/">ditz</a>.</div>

</body>
</html>