Changeset 23352
- Timestamp:
- 11/12/08 17:08:00 (5 years ago)
- Location:
- lang/perl/MENTA/trunk
- Files:
-
- 2 added
- 2 modified
-
app/static (added)
-
app/static/style-sites.css (added)
-
app/tmpl/index.html (modified) (1 diff)
-
lib/MENTA.pm (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lang/perl/MENTA/trunk/app/tmpl/index.html
r23336 r23352 1 1 <!doctype html> 2 <html> 3 <head> 2 4 <title><%= config()->{application}->{title} %></title> 5 <link rel="stylesheet" type="text/css" href="/static/style-sites.css"/> 6 </head> 7 <body> 8 <h1><%= config()->{application}->{title} %></h1> 3 9 <p><%= localtime time %></p> 10 </body> 11 </html> -
lang/perl/MENTA/trunk/lib/MENTA.pm
r23336 r23352 49 49 } 50 50 51 { 51 my $static_file = $ENV{PATH_INFO} || ''; 52 $static_file =~ s!^/*!app/!g; 53 if ($static_file !~ /index\.cgi/ && -f $static_file) { 54 if (open my $fh, '<', $static_file) { 55 printf "Content-Type: %s\n\n", guess_mime_type($static_file); 56 while(<$fh>) { print $_ } 57 close $fh; 58 } else { 59 die "ファイルが見つかりません"; 60 } 61 } else { 52 62 my $mode = $REQ->{mode} || 'index'; 53 63 my $meth = "do_$mode"; … … 94 104 } 95 105 106 sub guess_mime_type { 107 my $ext = shift; 108 $ext =~ s/.+\.(.+)$/$1/; 109 110 # TODO should be moved to other. 111 my $mime_map = { 112 css => 'text/css', 113 txt => 'text/plain', 114 }; 115 $mime_map->{$ext} || 'application/octet-stream'; 116 } 117 96 118 1;
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)