]> Frank Brehm's Git Trees - books.git/commitdiff
Mit Aufbewahrungsort-Bearbeitung angefangen
authorFrank Brehm <frank@brehm-online.com>
Thu, 29 Oct 2009 13:30:45 +0000 (13:30 +0000)
committerFrank Brehm <frank@brehm-online.com>
Thu, 29 Oct 2009 13:30:45 +0000 (13:30 +0000)
lib/FrBr/Books/Controller/Ort.pm
lib/FrBr/Books/Controller/Verlag.pm
lib/FrBr/Books/Db/Orte.pm
lib/FrBr/Books/Util/Ort.pm
lib/FrBr/Books/Util/Verlag.pm
root/src/ort/form.css
root/src/ort/list.tt2 [new file with mode: 0644]
root/src/ort/styles.css
root/src/ort/view.css [new file with mode: 0644]
root/src/ort/view.tt2 [new file with mode: 0644]

index 5cc30d7dd5b2462352baadee8fa6a2656fd6a5f9..6fe4999b936a0bbd91eb7a7d690a97fbb8d7271f 100644 (file)
@@ -59,6 +59,10 @@ sub index : Private {
     my $K = ( caller(0) )[3] . "(): ";
 
     $c->stash->{'template'} = 'ort/index.tt2';
+       $c->session->{'return_target_ort_save'} = $c->web_path("/ort");
+
+       delete $c->session->{'from_ort_list'} if exists $c->session->{'from_ort_list'};
+    delete $c->session->{'ort_data_edit'} if exists $c->session->{'ort_data_edit'};
 }
 
 #-------------------------------------------------------
@@ -83,6 +87,132 @@ sub default : Private {
 
 #-------------------------------------------------------
 
+sub add_ortslist_menu : Private {
+
+    my ( $self, $c ) = @_;
+    my $K = ( caller(0) )[3] . "(): ";
+
+    push @{ $c->stash->{'menu_path'} }, {
+        'path' => $c->web_path("/ort/list"),
+        'name' => "Liste"
+    };
+
+}
+
+#-------------------------------------------------------
+
+=head2 list
+    
+Sucht alle Aufbewahrungsorte als Objekt zusammen und übergibt das ort/list.tt2 zur Darstellung.
+    
+=cut
+     
+sub list : Local {
+
+    my ($self, $c) = @_;
+    my $K = ( caller(0) )[3] . "(): ";
+    $c->log->debug( $K . "aufgerufen." ) if $c->stash->{'debug_level'} > 2;
+
+       $self->add_ortslist_menu($c);
+    delete $c->session->{'ort_data_edit'} if exists $c->session->{'ort_data_edit'};
+
+       my $page = $c->session->{'ort_list_page'} || 1;
+    my $list_length = $c->stash->{'list_length'} || 10;
+
+    if ( $c->request->params->{'page'} and to_int( $c->request->params->{'page'} ) ) {
+        $page = to_int( $c->request->params->{'page'} );
+        $c->session->{'ort_list_page'} = $page;
+    }
+
+    my ( $liste, $anzahl ) = get_ortsliste( $c, 'get_books' => undef, 'page' => $page );
+    $c->log->debug( get_output_string( $K, "Erhaltene Liste der Aufbewahrungsorte: ", $liste ) ) if $c->stash->{'debug_level'} >= 2;
+    $c->stash->{'orte'} = $liste;
+
+    my $max_page = 1;
+    if ( $anzahl ) {
+        $max_page = int( $anzahl / $list_length ) + 1;
+        if ( ( $page - 1 ) * $list_length > $anzahl ) {
+            $page = $max_page;
+            $c->session->{'ort_list_page'} = $page;
+        }
+    }
+    else {
+        $page = 1;
+        $c->session->{'ort_list_page'} = 1;
+    }
+
+       my $nav = {
+               'cur'         => $page,
+               'first'       => 1,
+               'last'        => $max_page,
+               'prev'        => ( ( $page > 1 ) ? ( $page - 1 ) : 1 ),
+               'next'        => ( ( ( $page + 1 ) > $max_page ) ? $max_page : ( $page + 1 ) ),
+               'orte'        => $anzahl,
+               'ort_from'    => ( $anzahl ? ( ( $page - 1 ) * $list_length ) + 1 : 0 ),
+               'ort_to'      => ( ( $page * $list_length ) > $anzahl ? $anzahl : ( $page * $list_length ) ),
+       };
+       $c->stash->{'nav'} = $nav;
+    $c->log->debug( get_output_string( $K, "Seitennavigation: ", $nav ) ) if $c->stash->{'debug_level'} >= 2;
+
+    $c->session->{'return_target_view'} = $c->web_path("/ort/list");
+       $c->session->{'return_target_ort_save'} = $c->web_path("/ort/list");
+       $c->session->{'from_ort_list'} = 1;
+    $c->stash->{'template'} = 'ort/list.tt2';
+
+}
+
+#-------------------------------------------------------
+
+=head2 form_view( )
+
+Ansehen eines vorhandenen Aufbewahrungsortes.
+
+=cut
+
+sub form_view : Path('view') {
+
+       my ( $self, $c ) = @_;
+       my $K = ( caller(0) )[3] . "(): ";
+
+       $c->log->debug( $K . "aufgerufen." ) if $c->stash->{'debug_level'} > 2;
+
+       $c->stash->{'menu_path'} = [] unless $c->stash->{'menu_path'};
+       $self->add_ortslist_menu($c) if $c->session->{'from_ort_list'};
+       push @{ $c->stash->{'menu_path'} }, {
+               'path' => $c->web_path("/ort/view"),
+               'name' => "Betrachten"
+       };
+
+       $c->stash->{'error_message'} = '';
+
+       my $orts_id = to_int( $c->request->params->{'view_orts_id'} || 0 );
+       unless ( $orts_id ) {
+               $c->stash->{'template'} = 'error.tt2';
+               $c->stash->{'error'}    = 'Keine oder ung&uuml;ltige Aufbewahrungsorts-Id &uuml;bergeben.';
+               return 1;
+       }
+
+
+       my $ortsliste = get_ortsliste( $c, 'orts_id' => $orts_id, 'get_books' => 1, );
+       $c->log->debug( get_output_string( $K, "Erhaltene Aufbewahrungsortsliste: ", $ortsliste ) ) if $c->stash->{'debug_level'} >= 2;
+
+       unless ( $ortsliste and scalar( @$ortsliste ) ) {
+               $c->stash->{'template'} = 'error.tt2';
+               $c->stash->{'error'}    = 'Zur &uuml;bergebenen Aufbewahrungsorts-Id wurde kein Aufbewahrungsort gefunden.';
+               return 1;
+       }
+
+       $c->stash->{'return_target'} = $c->session->{'return_target_view'} or $c->web_path("/ort/list");
+
+       $c->stash->{'ort'}     = $ortsliste->[0];
+       $ortsliste = undef;
+       $c->stash->{'template'} = 'ort/view.tt2';
+       push @{$c->stash->{'cssfiles'}}, 'ort/view.css';
+
+}
+
+#-------------------------------------------------------
+
 =head2 form_new( )
 
 Erstellen eines neuen Aufbewahrungsortes.
@@ -102,6 +232,7 @@ sub form_new : Path('new') {
     }
 
     $c->stash->{'menu_path'} = [] unless $c->stash->{'menu_path'};
+       $self->add_verlaglist_menu($c) if $c->session->{'from_ort_list'};
     push @{ $c->stash->{'menu_path'} }, {
         'path' => $c->web_path("/ort/new"),
         'name' => "Neu"
index b22a66381ea0608bd275865cea11d0d796875d18..cd6a72a9e1a3fc3f7e4bee102382bf390779e9fb 100644 (file)
@@ -73,7 +73,7 @@ sub index : Private {
 sub default : Private {
 
     my ( $self, $c ) = @_;
-    my $K = __PACKAGE__ . "::default(): ";
+    my $K = ( caller(0) )[3] . "(): ";
 
     $c->stash->{'template'}   = 'not_implemented.tt2';
 
index a34246b66b5681797210d749a0e1946a413edd9a..015fd528cee77173912018236188b71319d1611c 100644 (file)
@@ -20,6 +20,8 @@ __PACKAGE__->set_primary_key("id");
 __PACKAGE__->add_unique_constraint("name", ["name"]);
 
 
+__PACKAGE__->has_many( 'buecher' => 'FrBr::Books::Db::Buecher', { 'foreign.orts_id' => 'self.id' } );
+
 # Created by DBIx::Class::Schema::Loader v0.04004 @ 2008-03-17 17:53:52
 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:QwPjYKNwUnR5b418xxulDg
 
index 3cbb9ccc21b3c829a859574fa73360756cbb8792..fb3cb4243e6bd59320a5747e00dc94f6739fcecc 100644 (file)
@@ -51,22 +51,69 @@ Sammelt alle Aufbewahrungsorte zusammen.
 
 Folgende benannte Parameter koennen ueber $params uebergeben werden:
 
+=over 4
+
+=item B<orts_id>: Die ID eines konkreten Aufbewahrungsortes
+
+=item B<get_books>: Bool. Zeigt an, daß zu den gefundenen Aufbewahrungsorten die dazugehörigen Bücher geholt werden sollen.
+
+=item B<page>
+
+Integer: Zeigt an, welche Seite von Aufbewahrungsorten dargestellt werden soll.
+
+Wenn nicht angegeben, werden alle Aufbewahrungsorte zurückgegeben.
+
+=back
+
 Rueckgabe: Eine Array-Ref von Hash-Refs mit allen Aufbewahrungsorten, die den uebergebenen Suchkriterien entsprechen:
 
   $res = [
-    { 'id'          => 1,
-      'name'        => 'Ausgeliehen',
-      'descr'       => '',
-      'statisch'    => 'y',
+    {
+        'id'          => 1,
+        'name'        => 'Ausgeliehen',
+        'descr'       => '',
+        'statisch'    => 'y',
+               'count_books' => 16,
+               'books'         => [
+                 {
+                       'id'                 => 8,
+                       'title'              => 'Die Elfen',
+                       'title_original'     => undef,
+                       'untertitel'         => undef,
+                       'bindungsart_id'     => 4,
+                       'bindungsart'        => 'Softcover (Taschenbuch)',
+                       'verlags_id'         => 7,
+                       'isbn'               => '3-453-53001-2',
+                       'buch_nr'            => undef,
+                       'ausgabejahr'        => '2004',
+                       'druckjahr'          => '2005',
+                       'seiten'             => 912,
+                       'preis'              => 14,
+            'verlag_name'        => 'Heyne',
+            'verlag_name_long'   => 'Heyne-Verlag usw. GmbH & Co. KG',
+                       'waehrungs_id'       => 1,
+                       'waehrungs_kuerzel'  => '€',
+                       'waehrungs_name'     => 'Euro',
+                       'umrechnung_in_euro' => 1,
+                       'autoren'            => [ 'Bernhard Hennen', 'James Sullivan' ],
+                       'autor_ids'          => [ 10, 12 ],
+          },
+                 {
+                       'id'    => 22,
+                 },
+               ],
     },
-    { 'id'     => 2,
-      ...
+    {
+        'id' => 2,
+        ...
     },
     ...
   ];
 
 Die Liste ist nach den Namen der Aufbewahrungsorte alphabetisch sortiert.
 
+Im Listenkontext wird als zweiter Rückgabewert die Gesamtzahl aller Aufbewahrungsorte zurueckgegeben.
+
 =cut
 
 sub get_ortsliste {
@@ -86,34 +133,181 @@ sub get_ortsliste {
     $c->log->debug(  get_output_string( $K, "Uebergebene Parameter: ", $params ) ) if $c->stash->{'debug_level'} >= 2;
 
     my $list = [];
+    my $anzahl_orte = 0;
 
     my $search_params = undef;
+       if ( $params->{'orts_id'} ) {
+               $search_params = {
+                       'me.id' => $params->{'orts_id'},
+               };
+       }
+
+       my $page = to_int( $params->{'page'} ) ? to_int( $params->{'page'} ) : undef;
+       my $rows = undef;
+       $rows = $c->stash->{'list_length'} || 20 if defined $page;
+
+       $anzahl_orte = $c->model('Schema::Orte')->count( $search_params );
+    $c->log->debug(  get_output_string( $K, "Anzahl gefundene Orte: ", $anzahl_orte ) ) if $c->stash->{'debug_level'} >= 2;
 
     my $other_params = {};
     $other_params->{'order_by'} = [ 'name' ];
     $other_params->{'select'} = [
-        'id',
-        'name',
-        'descr',
-        'statisch',
+        'me.id',
+        'me.name',
+        'me.descr',
+        'me.statisch',
+               { 'count' => 'buecher.id' }
     ];
     $other_params->{'as'} = [
         'id',
         'name',
         'descr',
         'statisch',
+               'count_books',
     ];
+       $other_params->{'join'} = [ 'buecher'];
+       $other_params->{'group_by'} = [ 'me.id' ];
+       if ( $page ) {
+               $other_params->{'rows'} = $rows;
+               $other_params->{'page'} = $page;
+       }
  
     for my $ort_rs ( $c->model('Schema::Orte')->search( $search_params, $other_params )->all() ) {
         my $ort = {};
-        $ort->{'id'}       = $ort_rs->id();
-        $ort->{'name'}     = $ort_rs->name();
-        $ort->{'descr'}    = $ort_rs->descr();
-        $ort->{'statisch'} = $ort_rs->statisch();
+        $ort->{'id'}          = $ort_rs->id();
+        $ort->{'name'}        = $ort_rs->name();
+        $ort->{'descr'}       = $ort_rs->descr();
+        $ort->{'statisch'}    = $ort_rs->statisch();
+        $ort->{'count_books'} = $ort_rs->get_column('count_books');
         push @$list, $ort;
     }
 
-    return $list;
+    return ( wantarray ? ( $list, 0 ) : $list ) unless scalar @$list;
+    return ( wantarray ? ( $list, $anzahl_orte ) : $list ) unless $params->{'get_books'};
+
+
+       for my $ort ( @$list ) {
+
+               $ort->{'books'} = [];
+
+               my $oid = $ort->{'id'};
+               $search_params = {
+                       "orts_id" => $oid,
+               };
+               $other_params = {};
+               $other_params->{'join'}     = [ 'waehrung', 'verlag', 'bindungsart' ];
+               $other_params->{'select'} = [
+                       'me.id',
+                       'me.title',
+                       'me.title_original',
+                       'me.untertitel',
+                       'me.bindungsart_id',
+                       'bindungsart.art_name',
+                       'me.verlags_id',
+                       'me.isbn',
+                       'me.buch_nr',
+                       'me.ausgabejahr',
+                       'me.druckjahr',
+                       'me.seiten',
+                       'me.preis',
+                       'me.waehrungs_id',
+                       'waehrung.waehrungs_kuerzel',
+                       'waehrung.waehrungs_name',
+                       'waehrung.umrechnung_in_euro',
+                       'verlag.name_short',
+                       'verlag.name_long',
+               ];
+               $other_params->{'as'} = [
+                       'id',
+                       'title',
+                       'title_original',
+                       'untertitel',
+                       'bindungsart_id',
+                       'bindungsart',
+                       'verlags_id',
+                       'isbn',
+                       'buch_nr',
+                       'ausgabejahr',
+                       'druckjahr',
+                       'seiten',
+                       'preis',
+                       'waehrungs_id',
+                       'waehrungs_kuerzel',
+                       'waehrungs_name',
+                       'umrechnung_in_euro',
+                       'verlag_name',
+                       'verlag_name_long',
+               ];
+        $other_params->{'order_by'} = [ 'me.title' ];
+
+               for my $book ( $c->model('Schema::Buecher')->search( $search_params, $other_params )->all() ) {
+                       my $buch = {};
+                       $buch->{'id'}                 = $book->id();
+                       $buch->{'title'}              = $book->title();
+                       $buch->{'title_original'}     = $book->title_original();
+                       $buch->{'untertitel'}         = $book->untertitel();
+                       $buch->{'bindungsart_id'}     = $book->bindungsart_id();
+                       $buch->{'bindungsart'}        = $book->get_column('bindungsart');
+                       $buch->{'verlags_id'}         = $book->verlags_id();
+                       $buch->{'isbn'}               = $book->isbn();
+                       $buch->{'buch_nr'}            = $book->buch_nr();
+                       $buch->{'ausgabejahr'}        = $book->ausgabejahr();
+                       $buch->{'druckjahr'}          = $book->druckjahr();
+                       $buch->{'seiten'}             = $book->seiten();
+                       $buch->{'preis'}              = $book->preis();
+                       $buch->{'waehrungs_id'}       = $book->waehrungs_id();
+                       $buch->{'waehrungs_kuerzel'}  = $book->get_column('waehrungs_kuerzel');
+                       $buch->{'waehrungs_name'}     = $book->get_column('waehrungs_name');
+                       $buch->{'umrechnung_in_euro'} = $book->get_column('umrechnung_in_euro');
+                       $buch->{'verlag_name'}        = $book->get_column('verlag_name');
+                       $buch->{'verlag_name_long'}   = $book->get_column('verlag_name_long');
+                       $buch->{'autoren'}            = [];
+                       $buch->{'autor_ids'}          = [];
+
+                       my $a_search_params = {};
+                       $a_search_params->{'buch_id'} = $buch->{'id'};
+                       $other_params = {};
+                       $other_params->{'order_by'} = [ 'ord_num' ];
+                       $other_params->{'join'}     = [ 'autor' ];
+                       $other_params->{'select'} = [
+                               'me.buch_id',
+                               'autor.id',
+                               'autor.titel',
+                               'autor.vorname',
+                               'autor.mittelname',
+                               'autor.nachname',
+                               'autor.name_suffix',
+                       ];
+                       $other_params->{'as'} = [
+                               'buch_id',
+                               'autor_id',
+                               'titel',
+                               'vorname',
+                               'mittelname',
+                               'nachname',
+                               'name_suffix',
+                       ];
+                       for my $ref ( $c->model('Schema::Autor2buch')->search( $a_search_params, $other_params )->all() ) {
+                               my $aid = $ref->get_column('autor_id');
+                               my @N;
+                               push @N, $ref->get_column('titel') if $ref->get_column('titel');
+                               push @N, $ref->get_column('vorname') if $ref->get_column('vorname');
+                               push @N, $ref->get_column('mittelname') if $ref->get_column('mittelname');
+                               push @N, $ref->get_column('nachname');
+                               push @N, $ref->get_column('name_suffix') if $ref->get_column('name_suffix');
+                               my $autor = join( " ", @N );
+                               push @{ $buch->{'autoren'} },   $autor;
+                               push @{ $buch->{'autor_ids'} }, $aid;
+                       }
+
+                       push @{ $ort->{'books'} }, $buch;
+
+               }
+
+       }
+
+    return ( wantarray ? ( $list, $anzahl_orte ) : $list );
 }
 
 #-----------------------------------------------------------------------------------
index ca037585e895be3172d76777cba5479f03de5b6e..388b728da6909ac12c407ca09a080b869330e089 100644 (file)
@@ -71,10 +71,39 @@ Rueckgabe: Im skalaren Kontext eine Array-Ref von Hash-Refs mit allen Verlagen,
 
   $res = [
        {
-               'id'                    => 1,
+               'id'                    => 7,
                'name'                  => 'Heyne',
                'name_long'             => 'Heyne-Verlag usw. GmbH & Co. KG',
                'count_books'   => 22,
+               'books'         => [
+                 {
+                       'id'                 => 8,
+                       'title'              => 'Die Elfen',
+                       'title_original'     => undef,
+                       'untertitel'         => undef,
+                       'bindungsart_id'     => 4,
+                       'bindungsart'        => 'Softcover (Taschenbuch)',
+                       'orts_id'            => 2,
+                       'isbn'               => '3-453-53001-2',
+                       'buch_nr'            => undef,
+                       'ausgabejahr'        => '2004',
+                       'druckjahr'          => '2005',
+                       'seiten'             => 912,
+                       'preis'              => 14,
+                       'waehrungs_id'       => 1,
+                       'waehrungs_kuerzel'  => '€',
+                       'waehrungs_name'     => 'Euro',
+                       'umrechnung_in_euro' => 1,
+                       'ortsname'           => 'Flur - Glasvitrine',
+                       'ort_beschreibung'   => '',
+                       'ort_ist_statisch'   => 'n',
+                       'autoren'            => [ 'Bernhard Hennen', 'James Sullivan' ];
+                       'autor_ids'          => [ 10, 12 ];
+          },
+                 {
+                       'id'    => 22,
+                 },
+               ],
        },
        {
                'id'                    => 2,
index db1f3c09b951c8dfa810e02a6743ea725fd0fc42..3a9255ebd4bad5d8e7c55dca09b5b012ce6b03d4 100644 (file)
@@ -1,10 +1,11 @@
-[%#
+/* [%#
    # Template fuer Stylesheets Aufbewahrungsorte
    #
    # $Id$
    # $URL$
    #
 -%]
-/*  Stylesheets Aufbewahrungsorte */
+Stylesheets Aufbewahrungsorte */
 
+[% PROCESS ftable.css %]
 
diff --git a/root/src/ort/list.tt2 b/root/src/ort/list.tt2
new file mode 100644 (file)
index 0000000..b49cf59
--- /dev/null
@@ -0,0 +1,55 @@
+<!-- [%#
+  ** Template fuer Ortsliste
+  **
+  ** vim: noai : ts=4 fenc=utf-8 filetype=html :
+  **
+  ** $Id$
+  ** $URL$
+  ** -%]
+
+  Ortsliste
+
+-->
+
+[% META title = 'Liste der Aufbewahrungsorte' -%]
+
+[% tab_colspan = 4 %][% IF Catalyst.user_exists %][% tab_colspan = 6 %][% END -%]
+[% BLOCK navrow %]
+  <tr>
+    <td class="nav" colspan="[% tab_colspan %]"><table cellspacing="0" class="nav" width="100%">
+          <tr>
+              <td width="33%" style="text-align: left;"><b>[% IF nav.cur != 1 %]<a href="[% self_url %]?page=1" title="Erste Seite">&lt;&lt;</a>[% ELSE %]&lt;&lt;[% END %]&nbsp;&nbsp;[% IF nav.cur != nav.prev %]<a href="[% self_url %]?page=[% nav.prev %]" title="Vorherige Seite">&lt;</a>[% ELSE %]&lt;[% END %]</b></td>
+              <td width="33%" style="text-align: center;">Aufbewahrungsort [% nav.ort_from %] bis [% nav.ort_to %] von [% nav.orte %]</td>
+              <td width="33%" style="text-align: right;"><b>[% IF nav.cur != nav.next %]<a href="[% self_url %]?page=[% nav.next %]" title="Nächste Seite">&gt;</a>[% ELSE %]&gt;[% END %]&nbsp;&nbsp;[% IF nav.cur != nav.last %]<a href="[% self_url %]?page=[% nav.last %]" title="Letzte Seite">&gt;&gt;</a>[% ELSE %]&gt;&gt;[% END %]</b></td>
+          </tr>
+        </table></td>
+  </tr>
+[% END -%]
+
+<div class="center">
+
+<table class="wrapper" cellspacing="0">
+<tr><th>Liste der Aufbewahrungsorte</th> </tr>
+[% IF Catalyst.user_exists %]<tr><td class="action"><a href="[% path('/ort/new') %]">Neuer Aufbewahrungsort ...</a></td></tr>[% END %]
+<tr><td><table class="ortsliste">
+  <tr>
+    <th>Name des Aufbewahrungsortes</th>
+    <th>Beschreibung</th>
+    <th>Anzahl Bücher</th>
+    <th></th>
+    [% IF Catalyst.user_exists %]<th></th>
+    <th></th>[% END %]
+  </tr>[% PROCESS navrow %]
+[% rowstyle = 'even' %][%- FOREACH ort IN orte -%]
+  <tr>
+    <td class="[% rowstyle %]">[% ort.name %]</td>
+    <td class="[% rowstyle %]">[% ort.descr %]</td>
+    <td class="[% rowstyle %]" style="text-align: right;">[% ort.count_books %]</td>
+    <td class="button [% rowstyle %]"><a href="[% path('/ort/view') %]?view_orts_id=[% ort.id %]">Ansehen</a></td>
+    [% IF Catalyst.user_exists %]<td class="button [% rowstyle %]">[% IF ort.statisch != 'y' %]<a href="[% path('/ort/edit') %]?edit_orts_id=[% ort.id %]">Ändern</a>[% ELSE %]&nbsp;[% END %]</td>
+    <td class="button [% rowstyle %]">[% IF ort.statisch != 'y' %][% IF ort.count_books > 0 %]Löschen[% ELSE %]<a href="[% path('/ort/delete') %]?delete_orts_id=[% ort.id %]">Löschen</a>[% END %][% ELSE %]&nbsp;[% END %]</td>[% END %]
+  </tr>
+[% IF rowstyle == 'even' %][% rowstyle = 'odd'%][% ELSE %][% rowstyle = 'even' %][% END %][% END -%]
+[% PROCESS navrow %]</table></td></tr></table>
+</div>
+<br />
index e2133b436c6c2a4fd06208128107f8a525ba9d6f..75a3af22c44ef06ee142d2fded323a4b32304d84 100644 (file)
@@ -1,10 +1,90 @@
 /* [%#
-   # Template fuer Stylesheets Buchserien
+   # Template fuer Stylesheets Aufbewahrungsorte
    #
    # $Id$
    # $URL$
    #
 -%]
- Stylesheets Buchserien */
+
+Stylesheets Aufbewahrungsorte */
+
+DIV.center {
+  margin:               auto;
+  text-align:           center;
+  width:                auto;
+}
+
+TABLE.wrapper {
+  border-spacing:       0;
+  margin:               auto;
+}
+
+TABLE.wrapper TH {
+  text-align:           center;
+  font-size:            1.2em;
+}
+
+TABLE.wrapper TD {
+  text-align:           left;
+}
+
+TABLE.wrapper TD.action {
+  font-weight:          bolder;
+  padding-top:          1em;
+  padding-bottom:       1em;
+}
+
+TABLE.ortsliste {
+  border-width:                2px;
+  border-style:                solid;
+  border-top-color:     [% site.col.tab_rahmen_hell %];
+  border-left-color:    [% site.col.tab_rahmen_hell %];
+  border-right-color:  [% site.col.tab_rahmen_dkl %];
+  border-bottom-color:  [% site.col.tab_rahmen_dkl %];  
+  border-collapse:     separate;
+  border-spacing:      0;
+}
+
+TABLE.ortsliste TH {
+  vertical-align:      top;
+  text-align:          left; 
+  font-size:            1em;
+  padding:             2px;
+  border-width:                1px;
+  border-style:                solid;
+  border-top-color:     [% site.col.tab_rahmen_dkl %];
+  border-left-color:    [% site.col.tab_rahmen_dkl %];
+  border-right-color:  [% site.col.tab_rahmen_hell %];
+  border-bottom-color:  [% site.col.tab_rahmen_hell %];  
+  background-color:    [% site.col.list_head %];
+}
+
+TABLE.ortsliste TD {
+  vertical-align:      top;
+  font-size:            1em;
+  padding:             2px;
+  border-width:                1px;
+  border-style:                solid;
+  border-top-color:     [% site.col.tab_rahmen_dkl %];
+  border-left-color:    [% site.col.tab_rahmen_dkl %];
+  border-right-color:  [% site.col.tab_rahmen_hell %];
+  border-bottom-color:  [% site.col.tab_rahmen_hell %];  
+  background-color:    [% site.col.list_row_bold %];
+}
+
+TABLE.ortsliste TD.odd {
+  background-color:    [% site.col.list_row %];
+}
+
+TABLE.ortsliste UL {
+  margin:      0;
+}
+
+TABLE.ortsliste TD.button {
+  font-weight:          bolder;
+  text-align:           center;
+  padding-left:         1em;
+  padding-right:        1em;
+}
 
 
diff --git a/root/src/ort/view.css b/root/src/ort/view.css
new file mode 100644 (file)
index 0000000..845c211
--- /dev/null
@@ -0,0 +1,14 @@
+/* [%#
+   # Template fuer Stylesheets Anzeige Aufbewahrungsorte
+   #
+   # vim: noai : ts=4 fenc=utf-8 filetype=css 
+   #
+   # $Id$
+   # $URL$
+   #
+-%]
+
+Stylesheets Anzeige Aufbewahrungsorte */
+
+[% PROCESS ftable.css %]
+
diff --git a/root/src/ort/view.tt2 b/root/src/ort/view.tt2
new file mode 100644 (file)
index 0000000..c126923
--- /dev/null
@@ -0,0 +1,78 @@
+<!-- [%#
+
+    Template fuer Anzeige Aufbewahrungsort
+
+    vim: noai : ts=4 fenc=utf-8 filetype=html
+
+    $Id$
+    $URL$
+
+    Übergebene Struktur in [ort]:
+
+       $ort = {
+               'count_books' => '1',
+               'descr'       => '',
+               'id'          => '1',
+               'name'        => 'Ausgeliehen',
+        'statisch'    => 'y',
+               'books'       => [
+                       {
+                               'id'                 => 8,
+                               'title'              => 'Die Elfen',
+                               'title_original'     => undef,
+                               'untertitel'         => undef,
+                               'bindungsart_id'     => 4,
+                               'bindungsart'        => 'Softcover (Taschenbuch)',
+                               'verlags_id'         => 7,
+                               'isbn'               => '3-453-53001-2',
+                               'buch_nr'            => undef,
+                               'ausgabejahr'        => '2004',
+                               'druckjahr'          => '2005',
+                               'seiten'             => 912,
+                               'preis'              => 14,
+               'verlag_name'        => 'Heyne',
+               'verlag_name_long'   => 'Heyne-Verlag usw. GmbH & Co. KG',
+                               'waehrungs_id'       => 1,
+                               'waehrungs_kuerzel'  => '€',
+                               'waehrungs_name'     => 'Euro',
+                               'umrechnung_in_euro' => 1,
+                               'autoren'            => [ 'Bernhard Hennen', 'James Sullivan' ],
+                               'autor_ids'          => [ 10, 12 ],
+               },
+                       {
+                               ...
+                       },
+               ],
+       };
+
+-%]
+[%- BLOCK book_entry -%]
+[% book.title | html %][% IF book.autoren.size %] ([% book.autoren.join( ', ' ) | html %])[% END %]
+[%- END -%]
+
+
+Anzeige Aufbewahrungsort -->
+
+<table class="ftable" cellspacing="0">
+  <tr>
+    <th colspan="2" class="title">Angaben Aufbewahrungsort '[%- ort.name | html -%]'</th>
+  </tr><tr>
+    <td colspan="2" class="empty"></td>
+  </tr><tr>
+    <th>Aufbewahrungsort:</th>
+    <td>[%- ort.name | html -%]</td>
+  </tr><tr>
+    <th>Beschreibung:</th>
+    <td>[%- ort.descr | html %]</td>
+  </tr><tr>
+    <th>Anzahl Bücher:</th>
+    <td>[%- ort.count_books | html -%]</td>
+  </tr><tr>
+    <th>Bücher:</th>
+    <td>[% IF ort.count_books > 1 %]<ul>[% FOR buch IN ort.books %]<li>[% PROCESS book_entry book=buch %]</li>[% END %]</ul>[% ELSE %][% PROCESS book_entry book=ort.books.0 %][% END %]</td>
+</table>
+
+<div class="back">
+<h2><a href="[% return_target %]">[% 'Zurück' %]</a></h2>
+</div>
+