From a03f3d6c0f8a5ff3f05f3477038c872d87c81143 Mon Sep 17 00:00:00 2001 From: Dobrica Pavlinusic Date: Fri, 18 Jun 2010 19:58:44 +0200 Subject: [PATCH] load code depends and description --- lib/MojoFacets/Code.pm | 1 + lib/MojoFacets/Data.pm | 8 ++++++-- templates/code/index.html.ep | 5 ++++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/lib/MojoFacets/Code.pm b/lib/MojoFacets/Code.pm index 976321b..5b87a16 100644 --- a/lib/MojoFacets/Code.pm +++ b/lib/MojoFacets/Code.pm @@ -20,6 +20,7 @@ sub index { foreach my $full_path ( glob("$dir/*.pl") ) { my $path = $full_path; $path =~ s/^$dir\/*//; + $path =~ s/\.pl$//; my ( $column, $description ) = split(/\./,$path,2); $snippets->{$column}->{$description} = read_file $full_path; } diff --git a/lib/MojoFacets/Data.pm b/lib/MojoFacets/Data.pm index 3451c6d..b8b7786 100644 --- a/lib/MojoFacets/Data.pm +++ b/lib/MojoFacets/Data.pm @@ -656,8 +656,12 @@ sub items { filters => $self->_current_filters, code => $code, cols_changed => $cols_changed, - code_depends => join(',', grep { defined $cols_changed->{$_} && $cols_changed->{$_} == 1 } @columns ), - code_description => join(',', grep { defined $cols_changed->{$_} && $cols_changed->{$_} == 2 } @columns ), + code_depends => + $self->param('code_depends') || + join(',', grep { defined $cols_changed->{$_} && $cols_changed->{$_} == 1 } @columns ), + code_description => + $self->param('code_description') || + join(',', grep { defined $cols_changed->{$_} && $cols_changed->{$_} == 2 } @columns ), ); } diff --git a/templates/code/index.html.ep b/templates/code/index.html.ep index 87f251a..305b662 100644 --- a/templates/code/index.html.ep +++ b/templates/code/index.html.ep @@ -10,7 +10,10 @@
  • -<%= $desc %> +% my $path = "code/$column.$desc.pl"; +<%= $desc %> + +
    % my $code = $snippets->{$column}->{$desc}; % my $rows = scalar split(/\n/,$code); -- 2.20.1