[% INCLUDE top.tt %]
<div class="left" id="left">[% INCLUDE index_left.tt %]
</div><!-- end of left -->
<div class="center" id="center">
[% IF error_message %][% error_message %][% END %]
</div><!-- end of center -->
<div class="right" id="right">[% INCLUDE index_right.tt %]
</div><!-- end of right -->
[% INCLUDE bottom.tt %]
[%#
This Program is distributed under version 1.0 of the Rinza Public
License Agreement, that is bundled with this package in the file
LICENSE, and is available through the website at the following URL:
http://www.tyzoh.jp/rinza/licenses/LICENSE-1.0.txt.
This is the Original Program.
The Initial Developer of the Original Program is Nihon Unisys, Ltd.
The Original Program is copyrighted (C) 2006-2007 by Nihon Unisys, Ltd. with
all rights reserved.
There is NO WARRANTY OF ANY KIND by the Initial Developer of the
Original Program.
%]center ブロックにファイルを読み込むのではなく,default アクションで指定する error_messsage を出力するようにしました.
root/template/top.tt の の間に以下を挿入.
[% IF pagetitle -%]
<title>[% pagetitle %]</title>
[% END -%]--- lib/SecureSBM.pm
+++ lib/SecureSBM.pm
@@ -56,8 +56,10 @@
sub default : Private {
my ( $self, $c ) = @_;
- # Hello World
- $c->response->body( '要求されたページは存在しません.' );
+ $c->stash->{pagetitle} = "Secure-SBM Error Page";
+ $c->stash->{error_message}
+ = "<h1>Error</h1><span style='color:#ff0000'>
+ 要求されたページは存在しません.</span>";
}
#--- lib/SecureSBM/Controller/Admin.pm
+++ lib/SecureSBM/Controller/Admin.pm
@@ -29,6 +29,7 @@
sub index : Private {
my ( $self, $c ) = @_;
+ $c->stash->{pagetitle} = "Secure-SBM Admin Page";
$c->stash->{template} = 'admin.tt';
}
--- lib/SecureSBM/Controller/Root.pm
+++ lib/SecureSBM/Controller/Root.pm
@@ -27,8 +27,12 @@
Index of SecureSBM
=cut
-sub index : Private { }
+sub index : Private {
+ my ( $self, $c ) = @_;
+ $c->stash->{pagetitle} = "Secure-SBM Top Page";
+}
+
=head2 end
Attempt to render a view, if needed.sub listusers : Local {
my ( $self, $c ) = @_;
$c->stash->{pagetitle} = "Secure-SBM Admin User List";
$c->stash->{users} = [$c->model('SecureSBMDB::User')->all];
$c->stash->{template} = 'admin/listusers.tt';
}<table>
<tr><th></th><th></th><th>ID</th><th>Email (login 名)</th>
<th>姓</th><th>名</th></tr>
[% FOREACH user_v IN users -%]
<tr><td>
<button id="edituser_button[% user_v.user_id %]">編集</button></td>
<td><button id="deleteuser_button[% user_v.user_id %]">
削除</button></td>
<td align="right">[% user_v.user_id %]</td>
<td>[% user_v.user_email %]</td>
<td>[% user_v.user_surname %]</td><td>[% user_v.user_name %]</td>
</tr>
...
(省略)
[% END -%]$ export DBIC_TRACE=1$ env DBIC_TRACE=1 ./script/securesbm_server.pl -rSELECT me.user_id, me.user_email, me.user_password, me.user_name,
me.user_surname FROM users me:
[info] *** Request 1 (0.011/s) [27860] [Thu Mar 22 11:09:52 2007] ***
[debug] "GET" request for "admin/listusers" from "127.0.0.1"
(以下略)
Keyword: Perl Catalyst Secure-SBM SSBM セキュア・ソーシャル・ブックマーク
タグ:Secure-SBM
<< [Secure-SBM:008] データベース管理処理 (1) | Main | [Secure-SBM:010] データベース管理処理 (3) >>
いかちょー (2007-05-30 21:48) | コメント(0)| トラックバック(1)
トラックバックURL:
Cheap soma watson. - Buy cheap soma. (2010年11月 9日 04:19)
Buy cheap soma. Cheap soma. 続きを読む
月別アーカイブ
Copyright (C) 2004-2011 Nihon Unisys, Ltd. All Rights Reserved.
Powered by Movable Type Open Source