Module: tools Branch: master Commit: f91a28465e6e263798285a664e6bb7f007e40650 URL: http://source.winehq.org/git/tools.git/?a=commit;h=f91a28465e6e263798285a664...
Author: Alexandre Julliard julliard@winehq.org Date: Thu Oct 15 20:49:38 2015 +0900
patches: Expand the sign-off list when the checkmark is clicked.
Signed-off-by: Alexandre Julliard julliard@winehq.org
---
patches/patches.css | 1 + patches/update | 18 +++++++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-)
diff --git a/patches/patches.css b/patches/patches.css index 99cc055..091052d 100644 --- a/patches/patches.css +++ b/patches/patches.css @@ -141,6 +141,7 @@ tr.odd { background-color: #f8e8e8; } .id, .status, .testbot { text-align: center; } .id, .status, .author { white-space: nowrap; padding: 0 3px; } .checkmark { text-align: center; color:green; } +.signoffextra { color: #A50D0D; border: 1px solid #601919; } .sha1 { white-space: nowrap; font-family: monospace; padding: 2px 12px; }
.id :link, .sha1 :link, .subject :link { color: #A50D0D; text-decoration: none; } diff --git a/patches/update b/patches/update index 97ff543..e084b77 100755 --- a/patches/update +++ b/patches/update @@ -96,10 +96,20 @@ sub format_author($) return $str; }
+my $js = <<END; +function toggle_display(id) +{ + var e = document.getElementById(id); + var display = e.style.display; + e.style.display = display == "none" ? "" : "none"; +} +END + open INDEX, ">:utf8", "$dest/index.html.new" or die "cannot create $dest/index.html.new";
print INDEX start_html(-title=>"Patches list", -encoding=>"utf-8", + -script=>$js, -style=>{src=>"patches.css"});
print INDEX "<div id="logo_glass"><a href="/patches/"><img src="//winehq.org/images/winehq_logo_glass_sm.png"></a></div>\n"; @@ -219,7 +229,7 @@ foreach my $file (sort { $patches{$b}->{"order"} <=> $patches{$a}->{"order"} } k } if (defined($patch->{"signoff"})) { - printf INDEX "<td class="checkmark"><a title="%s">✓</a></td>", join("\n",@{$patch->{"signoff"}}); + printf INDEX "<td class="checkmark" onclick="toggle_display('$file.signoff')">✓</td>"; } else { @@ -244,6 +254,12 @@ foreach my $file (sort { $patches{$b}->{"order"} <=> $patches{$a}->{"order"} } k print INDEX "<td></td>"; } print INDEX "</tr>\n"; + if (defined($patch->{"signoff"})) + { + printf INDEX "<tr class="%s" id="$file.signoff" style="display: none;" onclick="toggle_display('$file.signoff')">" . + "<td colspan="4" /><td colspan="4" class="signoffextra author">%s</td></tr>\n", + $row & 1 ? "odd" : "even", join("", map { "Signed-off-by: " . escapeHTML($_) . "<br/>"; } @{$patch->{"signoff"}}); + } $row++; } print INDEX "</table></div>\n";