@@ -106,17 +106,36 @@ impl Data {
106
106
let mut wgs = Vec :: new ( ) ;
107
107
let mut project_groups = Vec :: new ( ) ;
108
108
self . teams
109
- . into_iter ( )
109
+ . iter ( )
110
110
. filter ( |team| team. website_data . is_some ( ) )
111
111
. filter ( |team| team. subteam_of . as_ref ( ) == Some ( & main_team. name ) )
112
- . for_each ( |team| match team. kind {
113
- TeamKind :: Team => subteams. push ( team) ,
114
- TeamKind :: WorkingGroup => wgs. push ( team) ,
115
- TeamKind :: ProjectGroup => project_groups. push ( team) ,
112
+ . for_each ( |subteam| match subteam. kind {
113
+ TeamKind :: Team => {
114
+ subteams. push ( subteam. clone ( ) ) ;
115
+
116
+ subteams. extend (
117
+ self . teams
118
+ . iter ( )
119
+ . filter ( |team| team. subteam_of . as_ref ( ) == Some ( & subteam. name ) )
120
+ . filter ( |team| matches ! ( team. kind, TeamKind :: Team ) )
121
+ . filter ( |team| team. website_data . is_some ( ) )
122
+ . cloned ( ) ,
123
+ ) ;
124
+ }
125
+ TeamKind :: WorkingGroup => wgs. push ( subteam. clone ( ) ) ,
126
+ TeamKind :: ProjectGroup => project_groups. push ( subteam. clone ( ) ) ,
116
127
_ => { }
117
128
} ) ;
118
129
119
- subteams. sort_by_key ( |team| Reverse ( team. website_data . as_ref ( ) . unwrap ( ) . weight ) ) ;
130
+ subteams. sort_by_key ( |team| {
131
+ Reverse ( (
132
+ self . teams
133
+ . iter ( )
134
+ . find ( |superteam| team. subteam_of . as_ref ( ) == Some ( & superteam. name ) )
135
+ . and_then ( |team| team. website_data . as_ref ( ) . map ( |data| data. weight ) ) ,
136
+ team. website_data . as_ref ( ) . unwrap ( ) . weight ,
137
+ ) )
138
+ } ) ;
120
139
wgs. sort_by_key ( |team| Reverse ( team. website_data . as_ref ( ) . unwrap ( ) . weight ) ) ;
121
140
project_groups. sort_by_key ( |team| Reverse ( team. website_data . as_ref ( ) . unwrap ( ) . weight ) ) ;
122
141
0 commit comments