More of the Same.
This commit is contained in:
parent
df28bd545a
commit
a2c7705de5
|
@ -29,7 +29,7 @@ class AdminController < ApplicationController
|
||||||
if params['address']
|
if params['address']
|
||||||
unless (request.post? || ENV["RAILS_ENV"] == "test")
|
unless (request.post? || ENV["RAILS_ENV"] == "test")
|
||||||
headers['Allow'] = 'POST'
|
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
|
return
|
||||||
end
|
end
|
||||||
# form submitted
|
# form submitted
|
||||||
|
@ -56,7 +56,7 @@ class AdminController < ApplicationController
|
||||||
if system_password
|
if system_password
|
||||||
unless (request.post? || ENV["RAILS_ENV"] == "test")
|
unless (request.post? || ENV["RAILS_ENV"] == "test")
|
||||||
headers['Allow'] = 'POST'
|
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
|
return
|
||||||
end
|
end
|
||||||
# form submitted
|
# form submitted
|
||||||
|
@ -93,7 +93,7 @@ class AdminController < ApplicationController
|
||||||
def remove_orphaned_pages
|
def remove_orphaned_pages
|
||||||
unless (request.post? || ENV["RAILS_ENV"] == "test")
|
unless (request.post? || ENV["RAILS_ENV"] == "test")
|
||||||
headers['Allow'] = 'POST'
|
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
|
return
|
||||||
end
|
end
|
||||||
if wiki.authenticate(params['system_password_orphaned'])
|
if wiki.authenticate(params['system_password_orphaned'])
|
||||||
|
|
|
@ -36,7 +36,7 @@ class ApplicationController < ActionController::Base
|
||||||
if @web_name
|
if @web_name
|
||||||
@web = @wiki.webs[@web_name]
|
@web = @wiki.webs[@web_name]
|
||||||
if @web.nil?
|
if @web.nil?
|
||||||
render(:status => 404, :text => "Unknown web '#{@web_name}'")
|
render(:status => 404, :text => "Unknown web '#{@web_name}'", :layout => 'error')
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -14,7 +14,7 @@ class FileController < ApplicationController
|
||||||
if params['file']
|
if params['file']
|
||||||
unless (request.post? || ENV["RAILS_ENV"] == "test")
|
unless (request.post? || ENV["RAILS_ENV"] == "test")
|
||||||
headers['Allow'] = 'POST'
|
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
|
return
|
||||||
end
|
end
|
||||||
# form supplied
|
# form supplied
|
||||||
|
@ -63,7 +63,7 @@ class FileController < ApplicationController
|
||||||
protected
|
protected
|
||||||
|
|
||||||
def check_allow_uploads
|
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?
|
if @web.allow_uploads?
|
||||||
return true
|
return true
|
||||||
else
|
else
|
||||||
|
|
48
app/views/layouts/error.html.erb
Normal file
48
app/views/layouts/error.html.erb
Normal 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>
|
Loading…
Reference in a new issue