forked from underscorgan/community_management
-
Notifications
You must be signed in to change notification settings - Fork 10
/
pr_review_list.html.erb
172 lines (152 loc) · 5.92 KB
/
pr_review_list.html.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
<html>
<title>Module PRs that require review</title>
<head>
<link rel="stylesheet" type="text/css" href="reviews.css">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css">
<script src="https://code.jquery.com/jquery-1.11.3.min.js"></script>
<script src="https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>
<script src='./web_libraries/sorttable.js'></script><link rel='stylesheet' href='./web_libraries/bootstrap.min.css'>
<script src='./web_libraries/DataTables/datatables.js'></script><link rel='stylesheet' href='./web_libraries/DataTables/datatables.css'>
<script type="text/javascript">
$.fn.dataTable.ext.search.push(
function( settings, data, dataIndex ) {
var min = parseInt( $('#min').val(), 10 );
var max = parseInt( $('#max').val(), 10 );
var age = parseFloat( data[7] ) || 0; // use data for the age column
if ( ( isNaN( min ) && isNaN( max ) ) ||
( isNaN( min ) && age <= max ) ||
( min <= age && isNaN( max ) ) ||
( min <= age && age <= max ) )
{
return true;
}
return false;
}
);
$(document).ready(function() {
var table = $('#reviews').DataTable();
// Event listener to the two range filtering inputs to redraw on input
$('#min, #max').keyup( function() {
table.draw();
} );
} );
$(document).ready(function() {
// Setup - add a text input to each footer cell
$('#reviews thead tr th').each( function () {
var title = $(this).text();
if(title == "age" || title == "pr"){
$(this).append( ' <br> <input class="something" type="text" placeholder=" "style="width: 110%" />' );
}
else{
if(title == "age_comment" || title == "num_comments"){
$(this).append( ' <br> <input class="something" type="text" placeholder=" "style="width: 90%" />' );
}
else{
$(this).append( ' <br> <input class="something" type="text" placeholder="Search " "style="width: 60%" />' );
}
}
} );
// DataTable
var table = $('#reviews').DataTable();
// Apply the search
table.columns().every( function () {
var that = this;
$( 'input.something', this.header() ).on( 'keyup change clear', function () {
if ( that.search() !== this.value ) {
that
.search( this.value )
.draw();
}
} );
} );
$( 'input.something' ).on('click', function(e){
e.stopPropagation();
e.preventDefault();
})
} );
$(document).on("click", '.show-more a', function(e) {
e.preventDefault();
var $this = $(this);
var maxLength = 300;
var $content = $this.parent().prev("div.content");
var linkText = $this.text().toUpperCase();
if(linkText === "SHOW MORE"){
linkText = "Show less";
$content.removeClass('hideContent');
$content.addClass('showContent');
} else {
linkText = "Show more";
$content.removeClass('showContent');
$content.addClass('hideContent');
};
$this.text(linkText);
});
</script>
<!-- Google Analytics -->
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-157301458-1', 'auto');
ga('send', 'pageview', { 'page': location.pathname + location.search + location.hash});
ga('set', 'anonymizeIp', true);
</script>
<!-- End Google Analytics -->
</head>
<body>
<h1 style="text-align:center;">Modules PRs that require review</h1>
<div style="overflow-x:auto;">
<a href="https://puppetlabs.github.io/community_management/report30.html" class="button">30 Days</a>
<a href="https://puppetlabs.github.io/community_management/report60.html" class="button">60 Days</a>
<a href="https://puppetlabs.github.io/community_management/report90.html" class="button">90 Days</a>
<a href="https://puppetlabs.github.io/community_management/report.html" class="button">All</a>
<table border="0" cellspacing="3" cellpadding="3">
<tbody><tr>
<tbody><tr>
<td>Minimum age:</td>
<td><input type="text" id="min" name="min"></td>
</tr>
<tr>
<td>Maximum age:</td>
<td><input type="text" id="max" name="max"></td>
</tr>
</tbody>
<table data-role='table' data-mode='columntoggle' border='1' id='reviews' style='width:relative' class='sortable table table-hover'>
<thead>
<tr>
<% if open_prs.empty? %>
<% puts "nothing to do here, no prs found" %>
<% else %>
<% open_prs.first.keys.each do |header| %>
<% if header == :pr || header == :title || header == :owner || header == :repo || header == :age || header == :by || header == :last_comment %>
<th><%= header %></th>
<% elsif header == :age_comment || header == :no_comment_from_puppet || header== :last_comment_mentions_puppet || header== :num_comments %>
<th data-priority="3"><%= header %></th>
<% elsif header != :address %>
<th data-priority="5"><%= header %></th>
<% end %>
<% end %>
<% end %>
</tr>
</thead>
<% open_prs.each do |row| %>
<tr>
<% row.each do |key, value| %>
<% if key == :pr %>
<td><a target ="_blank" href='<%= row[:address] %>/pull/<%= value %>'><%= value %></a></td>
<% elsif key == :repo %>
<td><a target ="_blank" href='<%= row[:address] %>'><%= value %></a></td>
<% else %>
<% if key != :address %>
<td><%= value %></td>
<% end %>
<% end %>
<% end %>
</tr>
<% end %>
</div>
</table>
</body>
</html>