File tree Expand file tree Collapse file tree 2 files changed +20
-6
lines changed
lib/MetaCPAN/Web/Controller Expand file tree Collapse file tree 2 files changed +20
-6
lines changed Original file line number Diff line number Diff line change @@ -30,18 +30,29 @@ sub index : PathPart('release') : Chained('/') : Args {
3030 $out -> {myfavorite } = $favorites -> {myfavorites }-> { $out -> {distribution } };
3131 $out -> {favorites } = $favorites -> {favorites }-> { $out -> {distribution } };
3232
33+ my @root_files = (
34+ sort
35+ map { $_ -> {fields }-> {name } } @{ $root -> {hits }-> {hits } }
36+ );
37+
38+ my $changes = undef ;
39+ foreach my $filename ( @root_files ) {
40+ if ( $filename =~ m {\A Change} i ) {
41+ $changes = $filename ;
42+ last ;
43+ }
44+ }
45+
3346 $c -> stash(
3447 { template => ' release.html' ,
3548 release => $out ,
3649 author => $author ,
50+ changes => $changes ,
3751 total => $modules -> {hits }-> {total },
3852 took => List::Util::max(
3953 $modules -> {took }, $root -> {took }, $versions -> {took }
4054 ),
41- root => [
42- sort { $a -> {name } cmp $b -> {name } }
43- map { $_ -> {fields } } @{ $root -> {hits }-> {hits } }
44- ],
55+ root => \@root_files ,
4556 versions =>
4657 [ map { $_ -> {fields } } @{ $versions -> {hits }-> {hits } } ],
4758 files => [
Original file line number Diff line number Diff line change 88 < ul >
99 < li > < strong class ="relatize "> < % release.date.dt_http %> </ strong > </ li >
1010 < li > < a href ="<% release.download_url %> "> Download</ a > (< % release.stat.size | format_bytes %> )</ li >
11+ < % IF changes %>
12+ < li > < a href ="/source/<% release.author; '/'; release.name; '/'; changes %> "> < % changes %> </ a > </ li >
13+ < % END %>
1114 < li > < a href ="<% api %>/source/<% release.author %>/<% release.name %>/ "> Browse</ a > </ li >
1215 < % PROCESS inc/release-info.html %>
1316 </ ul >
8891
8992< br > < % END %>
9093< % IF root.size %> < strong > Other files</ strong >
91- < % FOREACH file IN root %>
92- < div > < strong > < a href ="/source/<% release.author; '/'; release.name; '/'; file.name %> "> < % file.name %> </ a > </ strong > </ div >
94+ < % FOREACH filename IN root %>
95+ < div > < strong > < a href ="/source/<% release.author; '/'; release.name; '/'; filename %> "> < % filename %> </ a > </ strong > </ div >
9396< % END; END %>
9497
9598</ div >
You can’t perform that action at this time.
0 commit comments