Commit 03b9914b89a6b546589e41b7b18517665fd3213d

Factorize HTML issue generation.

Commit diff

Manifest.txt

 
44ReleaseNotes
55bin/ditz
66bin/ditz-convert-from-monolith
7lib/component.rhtml
87lib/ditz.rb
98lib/html.rb
109lib/index.rhtml
1110lib/issue.rhtml
11lib/issues.rhtml
1212lib/issue_table.rhtml
1313lib/lowline.rb
1414lib/model-objects.rb
1616lib/operator.rb
1717lib/release.rhtml
1818lib/style.css
19lib/unassigned.rhtml
2019lib/util.rb
toggle raw diff

lib/component.rhtml

 
0<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
1<head>
2<title>Component <%= component.name %></title>
3<meta http-equiv="Content-Type" content="text/html; charset=utf8" />
4<link rel="stylesheet" href="style.css" type="text/css" />
5</head>
6
7<body>
8
9<%= link_to "index", "&laquo; #{project.name} project page" %>
10
11<h1><%= project.name %> component: <%= component.name %></h1>
12
13<%= render "issue_table", :show_component => false, :show_release => true %>
14
15<p class="footer">Generated by <a href="http://ditz.rubyforge.org/">ditz</a>.
16</body>
17</html>
toggle raw diff

lib/issues.rhtml

 
1<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
2<head>
3<title><%= title %></title>
4<meta http-equiv="Content-Type" content="text/html; charset=utf8" />
5<link rel="stylesheet" href="style.css" type="text/css" />
6</head>
7
8<body>
9
10<%= link_to "index", "&laquo; #{project.name} project page" %>
11
12<h1><%= title %></h1>
13
14<%= render "issue_table" %>
15
16<p class="footer">Generated by <a href="http://ditz.rubyforge.org/">ditz</a>.
17</body>
18</html>
toggle raw diff

lib/operator.rb

 
421421 fn = File.join dir, links[c]
422422 puts "Generating #{fn}..."
423423 File.open(fn, "w") do |f|
424 f.puts ErbHtml.new(template_dir, "component", links, :component => c,
424 f.puts ErbHtml.new(template_dir, "issues", links,
425 :title => "#{project.name} component: #{c.name}",
426 :show_component => false, :show_release => true,
425427 :issues => project.issues_for_component(c), :project => project)
426428 end
427429 end
431431 fn = File.join dir, links["unassigned"]
432432 puts "Generating #{fn}..."
433433 File.open(fn, "w") do |f|
434 f.puts ErbHtml.new(template_dir, "unassigned", links,
434 f.puts ErbHtml.new(template_dir, "issues", links,
435 :title => "Issues not assigned to any release",
436 :show_component => true, :show_release => true,
435437 :issues => project.unassigned_issues, :project => project)
436438 end
437439
toggle raw diff

lib/unassigned.rhtml

 
0<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
1<head>
2<title>Issues not assigned to any release</title>
3<meta http-equiv="Content-Type" content="text/html; charset=utf8" />
4<link rel="stylesheet" href="style.css" type="text/css" />
5</head>
6<body>
7
8<h1>Issues not assigned to any release</h1>
9
10<table>
11<% issues.sort_by { |i| i.sort_order }.each do |i| %>
12 <tr>
13 <td class="issuestatus_<%= i.status %>">
14 <%= i.status_string %><% if i.closed? %>: <%= i.disposition_string %><% end %>
15 </td>
16 <td class="issuename">
17 <%= link_to i, i.title %>
18 <%= i.bug? ? '(bug)' : '' %>
19 </td>
20 </tr>
21<% end %>
22</table>
23
24<p class="footer">Generated by <a href="http://ditz.rubyforge.org/">ditz</a>.
25</body>
26</html>
toggle raw diff