--- a/incoming.py Sat Jun 25 22:11:38 2016 +0800
+++ b/incoming.py Sun Jun 26 09:26:16 2016 +0800
domain, user, name = parse_project_url(url)
--- a/static/main.css Sat Jun 25 22:11:38 2016 +0800
+++ b/static/main.css Sun Jun 26 09:26:16 2016 +0800
+.check-log a.collapser {
+ text-decoration: underline;
+.check-log a.collapser::before {
+.check-log a.collapser.collapsed::before {
--- a/templates/check.html Sat Jun 25 22:11:38 2016 +0800
+++ b/templates/check.html Sun Jun 26 09:26:16 2016 +0800
<pre class="check-log">{#
#}{% for number, line in enumerate(lines, 1) %}{#
- #}<div id="l{{ number }}"{% if 'cls' in line %} class="{{ line['cls'] }}"{% end %}>{#
+ #}<div id="l{{ number }}"{% if 'task' in line %} data-task="{{ line['task'] }}"{% end %}{% if 'cls' in line %} class="{{ line['cls'] }}"{% end %}>{#
#}<a href="#l{{ number }}" class="lineno" data-line-number="{{ number }}"></a>{#
+ #}{% if line.get('cls') == 'task' and line.get('task') != 'cleanup' %}{#
+ #}<a class="collapser"></a>{#
+ $('.check-log .collapser').each(function() {
+ var $collapser = $(this);
+ var $header = $collapser.closest('div');
+ var task = $header.attr('data-task');
+ var $lines = $header.nextAll('[data-task="' + task + '"]');
+ $collapser.on('click', function() {
+ $collapser.toggleClass('collapsed');
+ var collapsed = $collapser.hasClass('collapsed');
+ $lines.toggleClass('uk-hidden', collapsed);