11
11
< style >
12
12
blockquote { font-size : 1em ; }
13
13
[ng \:cloak], [ng-cloak ], [data-ng-cloak ], [x-ng-cloak ], .ng-cloak , .x-ng-cloak { display : none !important ; }
14
- .panel .anchor { display : none; }
15
- .panel : hover .anchor { display : inline; color : # fff ; }
14
+
15
+ .form-inline .checkbox { margin-right : 0.6em }
16
+
17
+ .panel-title { display : flex; }
18
+ .panel-title .label { display : inline-block; }
19
+
20
+ .panel-title-name { flex : 1 ; }
21
+ .panel-title-name span { vertical-align : bottom; }
22
+
23
+ .panel .panel-title-name .anchor { display : none; }
24
+ .panel : hover .panel-title-name .anchor { display : inline; color : # fff ; }
16
25
</ style >
17
26
</ head >
18
27
< body >
@@ -23,7 +32,7 @@ <h1>ALL the Clippy Lints</h1>
23
32
24
33
< noscript >
25
34
< div class ="alert alert-danger " role ="alert ">
26
- Sorry, this site only works with JavaScript!
35
+ Sorry, this site only works with JavaScript! :(
27
36
</ div >
28
37
</ noscript >
29
38
@@ -40,15 +49,29 @@ <h1>ALL the Clippy Lints</h1>
40
49
< div class ="panel-body row ">
41
50
< div class ="col-md-6 form-inline ">
42
51
< div class ="form-group form-group-lg ">
43
- < div class ="checkbox " ng-repeat ="(level, enabled) in levels " style ="margin-right: 0.6em ">
52
+ < p class ="h4 "> Lint levels</ p >
53
+ < div class ="checkbox " ng-repeat ="(level, enabled) in levels ">
44
54
< label >
45
55
< input type ="checkbox " ng-model ="levels[level] " />
46
56
{{level}}
47
57
</ label >
48
58
</ div >
49
59
</ div >
50
60
</ div >
51
- < div class ="col-md-6 ">
61
+ < div class ="col-md-6 form-inline ">
62
+ < div class ="form-group form-group-lg ">
63
+ < p class ="h4 "> Lint groups</ p >
64
+ < div class ="checkbox " ng-repeat ="(group, enabled) in groups ">
65
+ < label class ="text-capitalize ">
66
+ < input type ="checkbox " ng-model ="groups[group] " />
67
+ {{group}}
68
+ </ label >
69
+ </ div >
70
+ </ div >
71
+ </ div >
72
+ </ div >
73
+ < div class ="panel-body row ">
74
+ < div class ="col-md-12 form-horizontal ">
52
75
< div class ="input-group ">
53
76
< span class ="input-group-addon " id ="filter-label "> Filter:</ span >
54
77
< input type ="text " class ="form-control " placeholder ="Keywords or search string " aria-describedby ="filter-label " ng-model ="search " />
@@ -63,22 +86,27 @@ <h1>ALL the Clippy Lints</h1>
63
86
</ div >
64
87
65
88
< article class ="panel panel-default " id ="{{lint.id}} "
66
- ng-repeat ="lint in data | filter:byLevels | filter:search | orderBy:'id' track by lint.id " on-finish-render ="ngRepeatFinished ">
89
+ ng-repeat ="lint in data | filter:byLevels | filter:byGroups | filter: search | orderBy:'id' track by lint.id " on-finish-render ="ngRepeatFinished ">
67
90
< header class ="panel-heading " ng-click ="open[lint.id] = !open[lint.id] ">
68
- < button class ="btn btn-default btn-sm pull-right " style ="margin-top: -6px; ">
69
- < span ng-show ="open[lint.id] "> −</ span >
70
- < span ng-hide ="open[lint.id] "> +</ span >
71
- </ button >
72
-
73
91
< h2 class ="panel-title ">
74
- {{lint.id}}
92
+ < div class ="panel-title-name ">
93
+ < span > {{lint.id}}</ span >
94
+ < a href ="#{{lint.id}} " class ="anchor label label-default " ng-click ="open[lint.id] = true; $event.stopPropagation() "> ¶</ a >
95
+ </ div >
96
+
97
+ < div class ="panel-title-addons ">
98
+ < span class ="label label-default text-capitalize "> {{lint.group}}</ span >
75
99
76
- < span ng-if ="lint.level == 'Allow' " class ="label label-info "> Allow</ span >
77
- < span ng-if ="lint.level == 'Warn' " class ="label label-warning "> Warn</ span >
78
- < span ng-if ="lint.level == 'Deny' " class ="label label-danger "> Deny</ span >
79
- < span ng-if ="lint.level == 'Deprecated' " class ="label label-default "> Deprecated</ span >
100
+ < span ng-if ="lint.level == 'Allow' " class ="label label-success "> Allow</ span >
101
+ < span ng-if ="lint.level == 'Warn' " class ="label label-warning "> Warn</ span >
102
+ < span ng-if ="lint.level == 'Deny' " class ="label label-danger "> Deny</ span >
103
+ < span ng-if ="lint.level == 'Deprecated' " class ="label label-default "> Deprecated</ span >
80
104
81
- < a href ="#{{lint.id}} " class ="anchor label label-default " ng-click ="open[lint.id] = true; $event.stopPropagation() "> ¶</ a >
105
+ < button class ="btn btn-default btn-xs ">
106
+ < span ng-show ="open[lint.id] "> −</ span >
107
+ < span ng-hide ="open[lint.id] "> +</ span >
108
+ </ button >
109
+ </ div >
82
110
</ h2 >
83
111
</ header >
84
112
@@ -95,7 +123,7 @@ <h4 class="list-group-item-heading">
95
123
</ div >
96
124
97
125
< a href ="https://github.com/rust-lang-nursery/rust-clippy ">
98
- < img style ="position: absolute; top: 0; right: 0; border: 0; " src ="https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png "/>
126
+ < img style ="position: absolute; top: 0; right: 0; border: 0; " src ="https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png " alt =" Fork me on Github " />
99
127
</ a >
100
128
101
129
< script src ="https://cdnjs.cloudflare.com/ajax/libs/markdown-it/7.0.0/markdown-it.min.js "> </ script >
@@ -166,6 +194,11 @@ <h4 class="list-group-item-heading">
166
194
return $scope . levels [ lint . level ] ;
167
195
} ;
168
196
197
+ $scope . groups = { } ;
198
+ $scope . byGroups = function ( lint ) {
199
+ return $scope . groups [ lint . group ] ;
200
+ } ;
201
+
169
202
// Get data
170
203
$scope . open = { } ;
171
204
$scope . loading = true ;
@@ -181,6 +214,12 @@ <h4 class="list-group-item-heading">
181
214
$scope . data = data ;
182
215
$scope . loading = false ;
183
216
217
+ // Initialize lint groups (the same structure is also used to enable filtering)
218
+ $scope . groups = data . reduce ( function ( result , val ) {
219
+ result [ val . group ] = true ;
220
+ return result ;
221
+ } , { } ) ;
222
+
184
223
scrollToLintByURL ( $scope ) ;
185
224
} )
186
225
. error ( function ( data ) {
0 commit comments