From 0076d2493f509ef65d074c06d134a0580227dbf0 Mon Sep 17 00:00:00 2001 From: Frank Brehm Date: Sun, 7 Sep 2008 21:40:46 +0000 Subject: [PATCH] Kategorie-Templates dazu --- bin/run_debug.sh | 2 +- lib/FrBr/Books/Controller/Verlag.pm | 11 ++++--- root/src/category/cat_form.tt2 | 36 ++++++++++++++++++++++ root/src/category/form.css | 10 ++++++ root/src/category/index.tt2 | 47 +++++++++++++++++++++++++++++ root/src/category/new.tt2 | 16 ++++++++++ root/src/category/save_success.tt2 | 17 +++++++++++ root/src/category/styles.css | 10 ++++++ root/src/verlag/new.tt2 | 2 +- 9 files changed, 145 insertions(+), 6 deletions(-) create mode 100644 root/src/category/cat_form.tt2 create mode 100644 root/src/category/form.css create mode 100644 root/src/category/index.tt2 create mode 100644 root/src/category/new.tt2 create mode 100644 root/src/category/save_success.tt2 create mode 100644 root/src/category/styles.css diff --git a/bin/run_debug.sh b/bin/run_debug.sh index 776b7fc..4d1b274 100755 --- a/bin/run_debug.sh +++ b/bin/run_debug.sh @@ -9,4 +9,4 @@ cd $DIR || exit 6 pwd -CATALYST_DEBUG=1 DBIC_TRACE=1 script/frbr_books_server.pl +CATALYST_DEBUG=3 DBIC_TRACE=1 script/frbr_books_server.pl diff --git a/lib/FrBr/Books/Controller/Verlag.pm b/lib/FrBr/Books/Controller/Verlag.pm index aa10511..83fcf14 100644 --- a/lib/FrBr/Books/Controller/Verlag.pm +++ b/lib/FrBr/Books/Controller/Verlag.pm @@ -114,8 +114,6 @@ sub form_new : Path('new') { $self->verlag_session2stash($c); $c->stash->{'verlag_edit'}{'name'} = "Neuer Verlag" unless $c->stash->{'verlag_edit'}{'name'}; - $c->stash->{'return_target_verlag_save'} = $c->session->{'return_target_verlag_save'} || $c->web_path('/verlag'); - return 1 unless $c->request->params->{'verlag_form_sent'} and $c->request->params->{'do_save'}; return $self->do_save_verlag($c); @@ -175,10 +173,10 @@ sub verlag_cgi2session : Private { my ( $self, $c ) = @_; my $K = __PACKAGE__ . "::verlag_cgi2session(): "; - return 1 unless $c->request->params->{'verlag_form_sent'}; - $c->session->{'return_target_verlag_save'} = $c->request->params->{'return_target_form'} if $c->request->params->{'return_target_form'}; + return 1 unless $c->request->params->{'verlag_form_sent'}; + # Basis anlegen, wenn notwendig $c->session->{'verlag_data_edit'} = {} unless $c->session->{'verlag_data_edit'}; @@ -212,11 +210,16 @@ sub verlag_session2stash : Private { my ( $self, $c ) = @_; my $K = __PACKAGE__ . "::verlag_session2stash(): "; + $c->log->debug( get_output_string( $K . "Verlag in der Session:", $c->session->{'verlag_data_edit'} ) ) if $c->stash->{'debug_level'} > 2; + $c->log->debug( $K . "Rücksprungadresse in der Session: '" . $c->session->{'return_target_verlag_save'} . "'" ) if $c->stash->{'debug_level'} > 2; + $c->stash->{'verlag_edit'} = {} unless $c->stash->{'verlag_edit'}; $c->stash->{'verlag_edit'}{'id'} = $c->session->{'verlag_data_edit'}{'id'} if $c->session->{'verlag_data_edit'}{'id'}; $c->stash->{'verlag_edit'}{'name'} = $c->session->{'verlag_data_edit'}{'name'} if $c->session->{'verlag_data_edit'}{'name'}; $c->stash->{'verlag_edit'}{'name_long'} = $c->session->{'verlag_data_edit'}{'name_long'} if $c->session->{'verlag_data_edit'}{'desc'}; + $c->stash->{'return_target_verlag_save'} = $c->session->{'return_target_verlag_save'} || $c->web_path('/verlag'); + return 1; } diff --git a/root/src/category/cat_form.tt2 b/root/src/category/cat_form.tt2 new file mode 100644 index 0000000..1901121 --- /dev/null +++ b/root/src/category/cat_form.tt2 @@ -0,0 +1,36 @@ +[%# + + Template für Kategorieangaben + + vim: noai : ts=4 fenc=utf-8 filetype=html expandtab : + + $Id$ + $URL$ + +-%] + + + +
+ +[%- IF category_edit.id %][% END %] + + + + + + + + + + + + + +
[% category_form_title %]
 
Kategorie:
 
+
+[%- IF error_message %] +
+Fehler: [% error_message %] +
+[% END -%] diff --git a/root/src/category/form.css b/root/src/category/form.css new file mode 100644 index 0000000..ae5c535 --- /dev/null +++ b/root/src/category/form.css @@ -0,0 +1,10 @@ +[%# + # Template fuer Stylesheets Kategorieformulare + # + # $Id$ + # $URL$ + # +-%] +/* Stylesheets Kategorie-Formulare */ + + diff --git a/root/src/category/index.tt2 b/root/src/category/index.tt2 new file mode 100644 index 0000000..17c2876 --- /dev/null +++ b/root/src/category/index.tt2 @@ -0,0 +1,47 @@ +[%# + + index.tt2 - Index-Template (Menue) fuer Kategorien + + vim: noai : ts=4 fenc=utf-8 filetype=html expandtab : + + $Id$ + $URL$ + +-%] +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/root/src/category/new.tt2 b/root/src/category/new.tt2 new file mode 100644 index 0000000..82f6b4b --- /dev/null +++ b/root/src/category/new.tt2 @@ -0,0 +1,16 @@ +[%# + + Template für neue Kategorie + + vim: noai : ts=4 fenc=utf-8 filetype=html expandtab : + + $Id$ + $URL$ + +-%] +[%- book_form_title = 'Neue Kategorie' -%] +[% PROCESS category/cat_form.tt2 %] + +
+

[% 'Zurück' %]

+
diff --git a/root/src/category/save_success.tt2 b/root/src/category/save_success.tt2 new file mode 100644 index 0000000..581d5d8 --- /dev/null +++ b/root/src/category/save_success.tt2 @@ -0,0 +1,17 @@ +[%# + + save_success.tt2 - Template fuer erfolgreiches Speichern der Kategorie + + vim: noai : ts=4 fenc=utf-8 filetype=html expandtab : + + $Id$ + $URL$ + +-%] +
+ +Die Kategorie "[% category_edit.name %] wurde erfolgreich gespeichert. + +

OK

+ +
diff --git a/root/src/category/styles.css b/root/src/category/styles.css new file mode 100644 index 0000000..ee3d387 --- /dev/null +++ b/root/src/category/styles.css @@ -0,0 +1,10 @@ +/* [%# + # Template fuer Stylesheets Kategorien + # + # $Id$ + # $URL$ + # +-%] + Stylesheets Kategorien */ + + diff --git a/root/src/verlag/new.tt2 b/root/src/verlag/new.tt2 index c13ea03..b19890e 100644 --- a/root/src/verlag/new.tt2 +++ b/root/src/verlag/new.tt2 @@ -12,5 +12,5 @@ [% PROCESS verlag/verlag_form.tt2 %]
-

[% 'Zurück' %]

+

[% 'Zurück' %]

-- 2.39.5