5 |
use lib '/rest/cvs/vci/lib'; # FIXME |
use lib '/rest/cvs/vci/lib'; # FIXME |
6 |
use VCI; |
use VCI; |
7 |
|
|
|
use HTML::Entities qw/encode_entities/; |
|
|
|
|
8 |
extends 'Frey'; |
extends 'Frey'; |
9 |
with 'Frey::Web'; |
with 'Frey::Web'; |
10 |
|
with 'Frey::Escape'; |
11 |
|
|
12 |
use Data::Dump qw/dump/; |
use Data::Dump qw/dump/; |
13 |
|
|
38 |
documentation => 'last revision in repository if not specified', |
documentation => 'last revision in repository if not specified', |
39 |
); |
); |
40 |
|
|
|
sub pre_dump { |
|
|
my $o = shift; |
|
|
# because Data::Dumper::HTML sucks |
|
|
my $t; |
|
|
if ( blessed($o) && $o->can('dump') ) { |
|
|
$t = $o->dump; |
|
|
$t =~ s/ {8}/ /gm; |
|
|
} else { |
|
|
$t = dump( $o ); |
|
|
} |
|
|
return '<hr><pre>' . encode_entities($t) . '</pre><hr>'; |
|
|
} |
|
|
|
|
41 |
sub as_markup { |
sub as_markup { |
42 |
my ( $self ) = @_; |
my ( $self ) = @_; |
43 |
|
|
47 |
repo => $self->repo, |
repo => $self->repo, |
48 |
type => $self->type, |
type => $self->type, |
49 |
debug => $self->debug, |
debug => $self->debug, |
50 |
); |
) || die "can't open ",$self->type," ",$self->repo; |
51 |
|
|
52 |
my @projects_available = map { $_->name } @{ $repo->projects }; |
my @projects_available = map { $_->name } @{ $repo->projects }; |
53 |
die $self->project," not one of valid projects ", dump( @projects_available ) unless grep { $self->project } @projects_available; |
die $self->project," not one of valid projects ", dump( @projects_available ) unless grep { $self->project } @projects_available; |
70 |
div( 'commiter', $commit->committer ) . |
div( 'commiter', $commit->committer ) . |
71 |
div( 'date', $commit->time->iso8601 ) . |
div( 'date', $commit->time->iso8601 ) . |
72 |
div( 'message', $commit->message ) . |
div( 'message', $commit->message ) . |
73 |
'<pre>' . encode_entities( $diff->raw ) . '</pre>' . |
'<pre>' . $self->html_escape( $diff->raw ) . '</pre>' . |
74 |
pre_dump( $diff ); |
'<span class="frey-popdown">dump<code>' . $self->html_dump( $diff ) . '</code></span>'; |
75 |
|
|
76 |
$self->title( $self->repo . '/' . $project->name ); |
$self->title( $self->repo . '/' . $project->name ); |
77 |
return $body; |
return $body; |