mirror of
https://github.com/ejwa/gitinspector.git
synced 2024-11-16 00:28:25 +01:00
Added filtering to the HTML timeline.
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.
This commit is contained in:
parent
e2d54afade
commit
65481c013e
2 changed files with 41 additions and 6 deletions
|
@ -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() {{
|
$("table.git tbody tr td:last-child").filter(function() {{
|
||||||
return parseFloat(this.innerHTML) < MINOR_AUTHOR_PERCENTAGE;
|
return parseFloat(this.innerHTML) < MINOR_AUTHOR_PERCENTAGE;
|
||||||
}}).parent().hide();
|
}}).parent().hide();
|
||||||
|
@ -47,6 +53,26 @@
|
||||||
}}).parent().hide();
|
}}).parent().hide();
|
||||||
$("table.git tbody tr:visible").each(colorRows);
|
$("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 ∨</div>");
|
||||||
|
|
||||||
|
$("div#timeline div.button").hover(function() {{
|
||||||
|
$(this).addClass("hover");
|
||||||
|
}}, function() {{
|
||||||
|
$(this).removeClass("hover");
|
||||||
|
}}).toggle(function() {{
|
||||||
|
this.innerHTML = "Hide rows with minor work ∧"
|
||||||
|
$("div#timeline table.git tbody tr").show().each(colorRows);
|
||||||
|
}}, function() {{
|
||||||
|
this.innerHTML = "Show rows with minor work ∨";
|
||||||
|
filterTimeLine();
|
||||||
|
$("div#timeline table.git tbody tr:visible").each(colorRows);
|
||||||
|
}});
|
||||||
|
}}
|
||||||
}});
|
}});
|
||||||
</script>
|
</script>
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
|
@ -108,11 +134,6 @@
|
||||||
border: 1px solid #eee;
|
border: 1px solid #eee;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}}
|
}}
|
||||||
table.git tfoot tr td.hover {{
|
|
||||||
background-color: #eddede;
|
|
||||||
border: 1px solid #bbb;
|
|
||||||
cursor: hand;
|
|
||||||
}}
|
|
||||||
table.git td {{
|
table.git td {{
|
||||||
padding: 0.4em;
|
padding: 0.4em;
|
||||||
height: 1em;
|
height: 1em;
|
||||||
|
@ -142,6 +163,20 @@
|
||||||
p.error {{
|
p.error {{
|
||||||
color: #700;
|
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>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
|
@ -188,7 +188,7 @@ class Timeline(Outputable):
|
||||||
names = timeline_data.get_authors()
|
names = timeline_data.get_authors()
|
||||||
max_periods_per_row = 8
|
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>"
|
timeline_xml += "<p>" + __timeline_info_text__ + ".</p>"
|
||||||
print(timeline_xml)
|
print(timeline_xml)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue