-
Notifications
You must be signed in to change notification settings - Fork 1
/
rails_best_practices_output.html
176 lines (170 loc) · 5.5 KB
/
rails_best_practices_output.html
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
173
174
175
176
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta charset='UTF-8' />
<title>Output of rails_best_practices</title>
<style type="text/css">
body {
color: #333;
background: #eee;
padding: 0 20px;
}
h1 {
color: ##4E4E4E;
}
p {
margin: 5px 0;
}
table {
background: white;
border: 1px solid #666;
border-collapse: collapse;
margin: 10px 0;
font-size: 14px;
}
table.result th, table.result td {
padding: 4px;
border: 1px solid #D0D0D0;
}
table.result th {
background-color: #DFC;
color: #337022;
}
table.result td.filename {
color: #ED1556;
}
table.result tr:hover {
background-color: #FFFFC0;
}
ul {
clear: both;
display: inline-block;
padding: 0;
margin: 0;
}
ul li {
list-style: none;
display: none;
float: left;
}
.result tbody tr{
display: none;
}
</style>
</head>
<body>
<h1>rails_best_practices output</h1>
<p>
Please go to
<a href='http://rails-bestpractices.com' target='_blank'>http://rails-bestpractices.com</a>
to see more useful Rails Best Practices.
</p>
<p>
Found 4 warnings.
</p>
<table>
<tr>
<td>
<input type="checkbox" class="error-type" id="RemoveEmptyHelpersReview" value="RemoveEmptyHelpersReview"
/> <label for="RemoveEmptyHelpersReview">Remove Empty Helpers</label>
</td>
<td>
<input type="checkbox" class="error-type" id="RemoveUnusedMethodsInHelpersReview" value="RemoveUnusedMethodsInHelpersReview"
/> <label for="RemoveUnusedMethodsInHelpersReview">Remove Unused Methods In Helpers</label>
</td>
</tr>
<tr>
<td colspan="3">
<button id="show-all">Check all</button>
<button id="show-none">Uncheck all</button>
</td>
</tr>
</table>
<table class="result">
<thead>
<tr>
<th>Filename</th>
<th>Line Number</th>
<th>Warning Message</th>
</tr>
</thead>
<tbody>
<tr class="RemoveEmptyHelpersReview">
<td class='filename'>
app/helpers/admin_helper.rb
</td>
<td class='line'>1</td>
<td class='message'>
<a href='http://rails-bestpractices.com/posts/2011/04/09/remove-empty-helpers/' target='_blank'>remove empty helpers</a>
</td>
</tr>
<tr class="RemoveEmptyHelpersReview">
<td class='filename'>
app/helpers/private_helper.rb
</td>
<td class='line'>1</td>
<td class='message'>
<a href='http://rails-bestpractices.com/posts/2011/04/09/remove-empty-helpers/' target='_blank'>remove empty helpers</a>
</td>
</tr>
<tr class="RemoveEmptyHelpersReview">
<td class='filename'>
app/helpers/public_helper.rb
</td>
<td class='line'>1</td>
<td class='message'>
<a href='http://rails-bestpractices.com/posts/2011/04/09/remove-empty-helpers/' target='_blank'>remove empty helpers</a>
</td>
</tr>
<tr class="RemoveUnusedMethodsInHelpersReview">
<td class='filename'>
app/helpers/devise_helper.rb
</td>
<td class='line'>4</td>
<td class='message'>
<a href='' target='_blank'>remove unused methods (DeviseHelper#devise_error_messages!)</a>
</td>
</tr>
</tbody>
</table>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script type="text/javascript">
$(function() {
keys = location.hash.slice(2).split("|");
keys = keys.filter(function(item){
return item != "";
});
keys.forEach(function(item){
$('.'+item).show();
$('input.error-type#'+item+'[type=checkbox]').prop('checked', true);
});
$('input.error-type[type=checkbox]').click(function() {
if ($(this).attr('checked')) {
$(this).prop('checked', true);
$('.'+$(this).val()).show();
new_hash = location.hash.replace("|"+$(this).val().toString(), "");
location.hash = new_hash+"|"+$(this).val();
} else {
$(this).prop('checked', false);
$('.'+$(this).val()).hide();
new_hash = location.hash.replace("|"+$(this).val().toString(), "");
location.hash = new_hash
}
});
$('#show-all').click(function() {
$('input.error-type[type=checkbox]').each(function(index, item){
new_hash = location.hash.replace("|"+$(item).val().toString(), "");
location.hash = new_hash+"|"+$(item).val();
});
$('input.error-type[type=checkbox]').prop('checked', true);
$('table.result tbody tr').show();
});
$('#show-none').click(function() {
$('input.error-type[type=checkbox]').prop('checked', false);
$('table.result tbody tr').hide();
location.hash = "";
});
});
</script>
</body>
</html>