]> Frank Brehm's Git Trees - books.git/commitdiff
Impressum aufgehübscht
authorFrank Brehm <frank@brehm-online.com>
Sun, 28 Feb 2010 22:11:18 +0000 (22:11 +0000)
committerFrank Brehm <frank@brehm-online.com>
Sun, 28 Feb 2010 22:11:18 +0000 (22:11 +0000)
lib/FrBr/Books/Controller/Impressum.pm
lib/FrBr/Books/Controller/Root.pm
root/src/impressum.tt2

index b7537ab3157071685128ab91d8bd2a3c1dcc218f..03094b57676dc3051b3581fdb2f15ed6438156e0 100644 (file)
@@ -6,6 +6,8 @@ package FrBr::Books::Controller::Impressum;
 use Moose;
 use namespace::autoclean;
 use FrBr::Common;
+use URI;
+use File::Basename;
 
 BEGIN {extends 'Catalyst::Controller'; }
 
@@ -37,6 +39,8 @@ sub index :Path :Args(0) {
     my ( $self, $c ) = @_;
     my $K = ( caller(0) )[3] . "(): ";
 
+    $c->log->debug( $K . "aufgerufen." );
+
     $c->stash->{'menu_path'} = [] unless $c->stash->{'menu_path'};
     push @{ $c->stash->{'menu_path'} }, {
         'path' => $c->web_path("/impressum"),
@@ -56,13 +60,24 @@ sub index :Path :Args(0) {
     $imp->{'mobile'}     = $c->config->{'impressum'}{'mobile'};
     $imp->{'email'}      = $c->config->{'impressum'}{'email'}    || 'frank@brehm-online.com';
 
+    my $url = '$URL$';
+    $url =~ s/^\$url:\s*//i;
+    $url =~ s/\s*\$\s*$//;
+    my $uri_cur_module = URI->new($url);
+    my $module_path = $uri_cur_module->path();
+    my $module_dir = dirname($module_path);
+    my $base_path = $module_dir;
+    $base_path =~ s|/lib/FrBr/Books/Controller$||;
+    $uri_cur_module->path($base_path);
+    $imp->{'repo_uri'} = $uri_cur_module->as_string();
+
     $imp->{'foto'}           = {};
     $imp->{'foto'}{'src'}    = $c->config->{'impressum'}{'foto'}{'src'}    || 'pic/FrankBrehm.jpg';
     $imp->{'foto'}{'width'}  = $c->config->{'impressum'}{'foto'}{'width'}  || 112;
     $imp->{'foto'}{'height'} = $c->config->{'impressum'}{'foto'}{'height'} || 120;
 
     $c->stash->{'impressum'} = $imp;
-    
+    $c->log->debug( get_output_string( $K, "Impressums-Infos: ", $imp ) );
 
     $c->stash->{'template'} = 'impressum.tt2';
 
index 820c1b4bf454a858b5cbd3b40f1b551ff1123701..3bae247639100793521c5ea00bbd80e4011eca54 100644 (file)
@@ -48,6 +48,9 @@ my %LangsToUseInDates = (
 sub default : Private {
 
     my ( $self, $c ) = @_;
+    my $K = ( caller(0) )[3] . "(): ";
+
+    $c->log->debug( $K . "aufgerufen." );
 
     #$c->stash->{'site_title'} = sprintf( $c->localize( "%s's Cookbook" ) , 'Frank Brehm' );
     $c->stash->{'site_title'} = "Willkommen in Franks Büchersammlung";
@@ -69,7 +72,9 @@ Attempt to render a view, if needed.
 sub end : ActionClass('RenderView') {
 
     my ( $self, $c ) = @_;
-    my $K = __PACKAGE__ . "::end(): ";
+    my $K = ( caller(0) )[3] . "(): ";
+
+    $c->log->debug( $K . "aufgerufen." );
 
     #pop @{ $c->stash->{'menu_path'} };
     my $i = 0;
@@ -95,6 +100,8 @@ sub auto : Private {
     my ( $self, $c ) = @_;
     my $K = ( caller(0) )[3] . "(): ";
 
+    $c->log->debug( $K . "aufgerufen." );
+
     my $self_url = $c->request->base . $c->request->path;
     $self_url =~ s#^https?://[^/]+/#/#;
     $c->stash->{'self_url'} = $self_url;
@@ -231,6 +238,8 @@ sub not_allowed : Local {
     my ( $self, $c ) = @_;
     my $K = ( caller(0) )[3] . "(): ";
 
+    $c->log->debug( $K . "aufgerufen." );
+
     $c->stash->{'template'} = 'not_allowed.tt2';
 
 }
index 2a191691a9f7533ebae77ebf1afde3b80a50037a..63b66040e0f3c3861928d7910a8243d5a040d164 100644 (file)
@@ -43,6 +43,7 @@ Impressum -->
             <dd><a href="http://www.mysql.com">MySQL</a></dd>
     </dl>
 </p>
+<p>Software-Repository: <i><a href="[% impressum.repo_uri %]">[% impressum.repo_uri %]</a></i></p>
 <p>Die Anwendung entspricht den Standards <i>HTML 4.01 Transitional</i> und <i>CSS 2.1</i>.</p>
 <p><a href="http://validator.w3.org/check?uri=referer"><img
         style="border: 0;" src="http://www.w3.org/Icons/valid-html401-blue"