Skip to content

Commit

Permalink
Added filtering to the HTML timeline.
Browse files Browse the repository at this point in the history
Rows with minor work are filtered; these are rows that contain very little
work (only dots). The filtering can be toggled by pressing a button.
  • Loading branch information
adam-waldenberg committed May 9, 2013
1 parent e2d54af commit 65481c0
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 6 deletions.
45 changes: 40 additions & 5 deletions html/html.header
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@
}}
}}

var filterTimeLine = function() {{
$("div#timeline table.git tbody tr").filter(function() {{
return $(this).find("td:has(div)").length == 0;
}}).hide();
}}

$("table.git tbody tr td:last-child").filter(function() {{
return parseFloat(this.innerHTML) < MINOR_AUTHOR_PERCENTAGE;
}}).parent().hide();
Expand All @@ -47,6 +53,26 @@
}}).parent().hide();
$("table.git tbody tr:visible").each(colorRows);
}});

filterTimeLine();

if ($("div#timeline table.git tbody tr:hidden").length > 0) {{
$("div#timeline table.git tbody tr:visible").each(colorRows);
$("div#timeline").prepend("<div class=\"button\">Show rows with minor work &or;</div>");

$("div#timeline div.button").hover(function() {{
$(this).addClass("hover");
}}, function() {{
$(this).removeClass("hover");
}}).toggle(function() {{
this.innerHTML = "Hide rows with minor work &and;"
$("div#timeline table.git tbody tr").show().each(colorRows);
}}, function() {{
this.innerHTML = "Show rows with minor work &or;";
filterTimeLine();
$("div#timeline table.git tbody tr:visible").each(colorRows);
}});
}}
}});
</script>
<style type="text/css">
Expand Down Expand Up @@ -108,11 +134,6 @@
border: 1px solid #eee;
text-align: center;
}}
table.git tfoot tr td.hover {{
background-color: #eddede;
border: 1px solid #bbb;
cursor: hand;
}}
table.git td {{
padding: 0.4em;
height: 1em;
Expand Down Expand Up @@ -142,6 +163,20 @@
p.error {{
color: #700;
}}
div.button {{
border-radius: 8px 8px 8px 8px;
-moz-border-radius: 8px 8px 8px 8px;
border: 1px solid #eee;
float: right;
width: auto;
padding: 0.5em;
background-color: #ddcece;
}}
table.git tfoot tr td.hover, div.hover {{
background-color: #eddede;
border: 1px solid #bbb;
cursor: hand;
}}
</style>
</head>
<body>
Expand Down
2 changes: 1 addition & 1 deletion timeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ def output_html(self):
names = timeline_data.get_authors()
max_periods_per_row = 8

timeline_xml = "<div><div class=\"box\">"
timeline_xml = "<div><div id=\"timeline\" class=\"box\">"
timeline_xml += "<p>" + __timeline_info_text__ + ".</p>"
print(timeline_xml)

Expand Down

0 comments on commit 65481c0

Please sign in to comment.