More of the Same.

This commit is contained in:
Jacques Distler 2007-12-30 03:58:57 -06:00
parent df28bd545a
commit a2c7705de5
4 changed files with 54 additions and 6 deletions

View file

@ -29,7 +29,7 @@ class AdminController < ApplicationController
if params['address']
unless (request.post? || ENV["RAILS_ENV"] == "test")
headers['Allow'] = 'POST'
render(:status => 405, :text => 'You must use an HTTP POST')
render(:status => 405, :text => 'You must use an HTTP POST', :layout => 'error')
return
end
# form submitted
@ -56,7 +56,7 @@ class AdminController < ApplicationController
if system_password
unless (request.post? || ENV["RAILS_ENV"] == "test")
headers['Allow'] = 'POST'
render(:status => 405, :text => 'You must use an HTTP POST')
render(:status => 405, :text => 'You must use an HTTP POST', :layout => 'error')
return
end
# form submitted
@ -93,7 +93,7 @@ class AdminController < ApplicationController
def remove_orphaned_pages
unless (request.post? || ENV["RAILS_ENV"] == "test")
headers['Allow'] = 'POST'
render(:status => 405, :text => 'You must use an HTTP POST')
render(:status => 405, :text => 'You must use an HTTP POST', :layout => 'error')
return
end
if wiki.authenticate(params['system_password_orphaned'])

View file

@ -36,7 +36,7 @@ class ApplicationController < ActionController::Base
if @web_name
@web = @wiki.webs[@web_name]
if @web.nil?
render(:status => 404, :text => "Unknown web '#{@web_name}'")
render(:status => 404, :text => "Unknown web '#{@web_name}'", :layout => 'error')
return false
end
end

View file

@ -14,7 +14,7 @@ class FileController < ApplicationController
if params['file']
unless (request.post? || ENV["RAILS_ENV"] == "test")
headers['Allow'] = 'POST'
render(:status => 405, :text => 'You must use an HTTP POST')
render(:status => 405, :text => 'You must use an HTTP POST', :layout => 'error')
return
end
# form supplied
@ -63,7 +63,7 @@ class FileController < ApplicationController
protected
def check_allow_uploads
render(:status => 404, :text => "Web #{params['web'].inspect} not found") and return false unless @web
render(:status => 404, :text => "Web #{params['web'].inspect} not found", :layout => 'error') and return false unless @web
if @web.allow_uploads?
return true
else

View file

@ -0,0 +1,48 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN" "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg-flat.dtd" >
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>
<%= h headers['Status'] %>
</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="robots" content="<%= @robots_metatag_value %>" />
<%= javascript_include_tag 'page_helper' %>
<style type="text/css">
h1#pageName, .newWikiWord a, a.existingWikiWord, .newWikiWord a:hover, #TextileHelp h3 {
color: #<%= @web ? @web.color : "393" %>;
}
<%= File.read(RAILS_ROOT + '/public/stylesheets/instiki.css') if @inline_style %>
</style>
<%= stylesheet_link_tag 'instiki' unless @inline_style %>
<style type="text/css">
<%= @style_additions %>
<%= @web ? @web.additional_style : '' %>
</style>
<%= javascript_include_tag :defaults %>
<% if @web %>
<%= auto_discovery_link_tag(:atom, :controller => 'wiki', :web => @web.address, :action => 'atom_with_headlines') %>
<%= auto_discovery_link_tag(:atom, :controller => 'wiki', :web => @web.address, :action => 'atom_with_content') %>
<% end %>
</head>
<body>
<div id="Container">
<div id="Content">
<h1>
<%= h headers['Status'] %>
</h1>
<%= h @content_for_layout %>
</div> <!-- Content -->
</div> <!-- Container -->
</body>
</html>