@@ -35,40 +35,39 @@ sub dependencies : Local : Args(0) : Does('Sortable') {
35
35
$c -> stash( {
36
36
template => ' lab/dependencies.html' ,
37
37
module => $module ,
38
- data => $data
38
+ data => $data ,
39
39
} );
40
40
}
41
41
42
- sub dashboard : Local : Args(0) {
42
+ sub personal_dashboard : Path( ' dashboard ' ) : Args(0) {
43
43
my ( $self , $c ) = @_ ;
44
44
45
- $c -> stash( { template => ' lab/dashboard.html' } );
45
+ if ( my $pauseid = $c -> req-> params-> {' pauseid' } ) {
46
+ $c -> res-> redirect( $c -> uri_for( ' /lab/dashboard' , uc $pauseid ),
47
+ 301 );
48
+ $c -> detach;
49
+ }
46
50
47
- my $user = $c -> model(' API::User' )-> get_profile( $c -> token )-> get;
48
- return unless $user ;
51
+ my $user = $c -> model(' API::User' )-> get_profile( $c -> token )-> get || {};
49
52
50
- my $report ;
51
- my $pauseid = $c -> req-> params-> {' pauseid' };
52
- if ($pauseid ) {
53
- $user = { pauseid => $pauseid };
54
- }
53
+ $c -> res-> header( ' Vary' , ' Cookie' );
54
+ $c -> stash( { personal => 1 } );
55
+ $c -> go( ' dashboard' , [ $user -> {pauseid } ] );
56
+ }
55
57
56
- # I'm not sure if the 300 limit actually corresponds to max distros.
57
- # Setting it at 100 for OALDERS, I got less than 30 results back.
58
+ sub dashboard : Local : Args(1) {
59
+ my ( $self , $c , $pauseid ) = @_ ;
58
60
59
- if ($user ) {
60
- $pauseid = $user -> {pauseid };
61
- if ($pauseid ) {
62
- $report = $c -> model(' API::Lab' )
63
- -> fetch_latest_distros( 300, $pauseid )-> get;
64
- }
61
+ my $report ;
62
+ if ($pauseid ) {
63
+ $report = $c -> model(' API::Lab' )-> fetch_latest_distros( 300, $pauseid )
64
+ -> get;
65
65
}
66
66
67
- $report -> {user } = $user ;
68
-
69
67
$c -> stash( {
70
- pauseid => $pauseid ,
71
- report => $report ,
68
+ pauseid => $pauseid ,
69
+ report => $report ,
70
+ template => ' lab/dashboard.html' ,
72
71
} );
73
72
}
74
73
0 commit comments