From: Frank Brehm Date: Tue, 18 Nov 2008 23:56:13 +0000 (+0000) Subject: mit Ausgabe Buch angefangen X-Git-Url: https://git.uhu-banane.net/?a=commitdiff_plain;h=dc6a4b2ba212ae0ec3d98bebec112f9ba7e266ab;p=books.git mit Ausgabe Buch angefangen --- diff --git a/lib/FrBr/Books/Controller/Books.pm b/lib/FrBr/Books/Controller/Books.pm index 7a420c8..c12d303 100644 --- a/lib/FrBr/Books/Controller/Books.pm +++ b/lib/FrBr/Books/Controller/Books.pm @@ -165,6 +165,53 @@ sub form_new : Path('new') { #------------------------------------------------------- +=head2 form_view( ) + +Ansehen eines vorhandenen Buches. + +=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'}; + push @{ $c->stash->{'menu_path'} }, { + 'path' => $c->web_path("/books/view"), + 'name' => "Betrachten" + }; + + $c->stash->{'template'} = 'books/view.tt2'; + push @{$c->stash->{'cssfiles'}}, 'books/view.css'; + + $c->stash->{'error_message'} = ''; + + $self->prepare_data_structures($c); + + $self->bookdata_cgi2session($c); + + if ( $c->request->params->{'neuer_autor'} ) { + $c->session->{'return_target_autor_save'} = $c->stash->{'self_url'}; + $c->detach('/autor/form_new'); + } + + $c->stash->{'book_edit'} = {} unless $c->stash->{'book_edit'}; + $self->bookdata_session2stash($c); + $c->stash->{'book_edit'}{'title'} = "Neues Buch" unless $c->stash->{'book_edit'}{'title'}; + + unless ( $c->request->params->{'book_form_sent'} and $c->request->params->{'do_save'} ) { + return 1; + } + + return $self->do_save_book($c); + +} + +#------------------------------------------------------- + sub do_save_book : Private { my ( $self, $c ) = @_; diff --git a/root/src/books/list.tt2 b/root/src/books/list.tt2 index fbae6d8..37fa76a 100644 --- a/root/src/books/list.tt2 +++ b/root/src/books/list.tt2 @@ -16,7 +16,9 @@ Kategorie Verlag Aufbewahrungsort - ISBN + + + [%- FOREACH book IN books -%][% buch_id = book.id %] @@ -25,7 +27,9 @@ [% tt_cat = [ ]; tt_cat.push(cat) FOREACH cat = book.kategorien %][% tt_cat.join(',
') %] [% book.verlagsname_short %] [% IF book.orts_id %][% book.ortsname %][% ELSE %]unbekannt[% END %] - [% book.isbn %] + Ansehen + Ändern + Löschen [% END -%] diff --git a/root/src/books/view.css b/root/src/books/view.css new file mode 100644 index 0000000..0eb55e8 --- /dev/null +++ b/root/src/books/view.css @@ -0,0 +1,10 @@ +[%# + # Template fuer Stylesheets Buchanzeige + # + # $Id$ + # $URL$ + # +-%] +/* Stylesheets Buchanzeige */ + + diff --git a/root/src/books/view.tt2 b/root/src/books/view.tt2 new file mode 100644 index 0000000..02c829b --- /dev/null +++ b/root/src/books/view.tt2 @@ -0,0 +1,131 @@ +[%# + Template fuer Buchanzeige + + vim: noai : ts=4 fenc=utf-8 filetype=html expandtab : + + $Id$ + $URL$ + +-%] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Buchangaben '[%- book_edit.title | html -%]'
 
Autor (-en):[% FOR autor_id IN autor_list_book %] + [% autor_list.$autor_id %][% END %]
Buchtitel:[% book_edit.title | html %]
Untertitel:[% book_edit.untertitel | html %]
Original-Titel:[% book_edit.original_title | html %]
Verlag:[% book_edit.verlagsname_long %] 
Aufbewahrungsort: 
Bindungsart:
Kategorie(n): + + + + + + + + + +
Verfügbare KategorienKategorien des Buchs


+

+ +
Buchserien: + + + + + + + + + +
Verfügbare BuchserienSerien des Buchs


+

+ +
ISBN:
Buch-Nummer (verlagseigen):
Ausgabejahr:
Druckjahr:
Seiten:
Preis: +  
 
+ +[%- IF error_message %] +
+Fehler: [% error_message %] +
+[% END -%] + +
+

[% 'Zurück' %]

+
+