--- trunk/lib/Frey/Web.pm 2008/11/20 12:56:37 476 +++ trunk/lib/Frey/Web.pm 2008/11/25 14:14:21 516 @@ -12,6 +12,7 @@ use Frey::Bookmarklet; use Frey::ClassBrowser; +use Frey::SVK; has 'head' => ( is => 'rw', @@ -188,19 +189,43 @@ $body = ''; } + my $warn_colors = { + '#' => '#444', + '##' => '#888', + }; + $status_line - .= qq|warn| - . $self->editor_links( join("", $self->warnings ) ) - . qq|| + .= qq|warn| + . $self->editor_links( + join("", map { + warn "# $_"; + my $style = ''; + $style = $warn_colors->{$1} + ? ' style="color:' . $warn_colors->{$1} . '"' + : '' + if m{^(#+)}; + qq|$_
|; # XXX should be but CSS hates me + } $self->warnings ) + ) + . qq|
| if $self->warnings; + my ($exit,$description) = ('exit','stop server'); + ($exit,$description) = ('restart','restart server') + if $ENV{FREY_RESTART}; # tune labels on exit link + my $right = qq| - $url + $url + $exit |; + my $info = Frey::SVK->info; + my $revision = Frey::SVK->info->{Revision} || ''; + $revision = $1 if $info->{'Mirrored From'} =~ m{Rev\.\s+(\d+)}; + my $html = join("\n", qq||, $self->_head_html, @@ -211,7 +236,7 @@ $body
- Frey $Frey::VERSION + Frey $Frey::VERSION $revision $status_line $right
@@ -224,6 +249,31 @@ return $html; } +=head2 editor + +Create HTML editor link with optional line and title + + my $html = $self->editor( $class, $line, $title ); + +=cut + +sub editor { + my ( $self, $class, $line, $title ) = @_; + confess "need class" unless $class; + $line ||= 1; + qq|$class|; +} + +=head2 editor_links + +Create HTML links to editor for perl error message + + my $html = $self->editor_links( $error ) + +=cut + sub editor_links { my ( $self, $error ) = @_; @@ -251,4 +301,10 @@ ; } +sub add_status { + my ( $self, $data ) = @_; + push @{ $self->status }, $data; + warn "## current status ", $#{ $self->status }, " elements"; +} + 1;