1 package MojoFacets::Changes;
6 use base 'Mojolicious::Controller';
13 my $max = $self->param('max') || 10;
16 foreach my $path ( sort { $b cmp $a } glob '/tmp/changes/*' ) {
17 if ( $path =~ m{/((\d+\.\d+)\.data\.(.+))$} ) {
18 push @$changes, { uid => $1, t => $2, action => $3 };
19 last if $#$changes >= $max;
21 warn "ignore: $path\n";
25 # Render template "changes/index.html.ep" with message
26 $self->render(message => 'Latest Changes', changes => $changes );
32 my $uid = $self->param('uid');
33 $self->render( change => retrieve( "/tmp/changes/$uid" ), uid => $uid );