diff options
-rw-r--r-- | .cvsignore | 2 | ||||
-rw-r--r-- | Rakefile | 10 | ||||
-rw-r--r-- | app/controllers/frontpage_controller.rb | 10 | ||||
-rw-r--r-- | app/views/frontpage/index.rhtml | 3 | ||||
-rw-r--r-- | app/views/layouts/default.rhtml | 16 | ||||
-rw-r--r-- | config/routes.rb | 9 | ||||
-rw-r--r-- | public/.htaccess | 40 | ||||
-rw-r--r-- | public/index.html | 277 |
8 files changed, 88 insertions, 279 deletions
diff --git a/.cvsignore b/.cvsignore new file mode 100644 index 000000000..b2b2aa940 --- /dev/null +++ b/.cvsignore @@ -0,0 +1,2 @@ +tmp +log diff --git a/Rakefile b/Rakefile new file mode 100644 index 000000000..3bb0e8592 --- /dev/null +++ b/Rakefile @@ -0,0 +1,10 @@ +# Add your own tasks in files placed in lib/tasks ending in .rake, +# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. + +require(File.join(File.dirname(__FILE__), 'config', 'boot')) + +require 'rake' +require 'rake/testtask' +require 'rake/rdoctask' + +require 'tasks/rails' diff --git a/app/controllers/frontpage_controller.rb b/app/controllers/frontpage_controller.rb new file mode 100644 index 000000000..3eaaf70b6 --- /dev/null +++ b/app/controllers/frontpage_controller.rb @@ -0,0 +1,10 @@ +class FrontpageController < ApplicationController + layout "default" + + def index + respond_to do |format| + format.html + end + end +end + diff --git a/app/views/frontpage/index.rhtml b/app/views/frontpage/index.rhtml new file mode 100644 index 000000000..f5cf1fcbb --- /dev/null +++ b/app/views/frontpage/index.rhtml @@ -0,0 +1,3 @@ + +<p>Make requests for information from the UK Government. + diff --git a/app/views/layouts/default.rhtml b/app/views/layouts/default.rhtml new file mode 100644 index 000000000..fd37dfa9e --- /dev/null +++ b/app/views/layouts/default.rhtml @@ -0,0 +1,16 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html lang="en-gb"> + <head> + <!-- <script type="text/javascript" src="/js.js"></script> --> + <title>Freedom of Information Filer and Archive</title> + <!-- <%= stylesheet_link_tag 'fooble' %> --> + <!-- <link rel="alternate" type="application/rss+xml" title="" href=""> --> + </head> + <body> + <h1>Freedom of Information Filer and Archive</h1> + <ul id="navigation"> + <li>Home</li> + </ul> + <%= yield :layout %> + </body> +</html> diff --git a/config/routes.rb b/config/routes.rb index 9bbc46376..94613f14f 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -18,6 +18,11 @@ ActionController::Routing::Routes.draw do |map| map.connect ':controller/service.wsdl', :action => 'wsdl' # Install the default route as the lowest priority. - map.connect ':controller/:action/:id.:format' - map.connect ':controller/:action/:id' + # FAI: Turned off for now, as to be honest I don't trust it from a security point of view. + #map.connect ':controller/:action/:id.:format' + #map.connect ':controller/:action/:id' + + map.connect "/", :controller => 'frontpage' + end + diff --git a/public/.htaccess b/public/.htaccess new file mode 100644 index 000000000..d3c998345 --- /dev/null +++ b/public/.htaccess @@ -0,0 +1,40 @@ +# General Apache options +AddHandler fastcgi-script .fcgi +AddHandler cgi-script .cgi +Options +FollowSymLinks +ExecCGI + +# If you don't want Rails to look in certain directories, +# use the following rewrite rules so that Apache won't rewrite certain requests +# +# Example: +# RewriteCond %{REQUEST_URI} ^/notrails.* +# RewriteRule .* - [L] + +# Redirect all requests not available on the filesystem to Rails +# By default the cgi dispatcher is used which is very slow +# +# For better performance replace the dispatcher with the fastcgi one +# +# Example: +# RewriteRule ^(.*)$ dispatch.fcgi [QSA,L] +RewriteEngine On + +# If your Rails application is accessed via an Alias directive, +# then you MUST also set the RewriteBase in this htaccess file. +# +# Example: +# Alias /myrailsapp /path/to/myrailsapp/public +# RewriteBase /myrailsapp + +RewriteRule ^$ index.html [QSA] +RewriteRule ^([^.]+)$ $1.html [QSA] +RewriteCond %{REQUEST_FILENAME} !-f +RewriteRule ^(.*)$ dispatch.cgi [QSA,L] + +# In case Rails experiences terminal errors +# Instead of displaying this message you can supply a file here which will be rendered instead +# +# Example: +# ErrorDocument 500 /500.html + +ErrorDocument 500 "<h2>Application error</h2>Rails application failed to start properly"
\ No newline at end of file diff --git a/public/index.html b/public/index.html deleted file mode 100644 index a2daab72b..000000000 --- a/public/index.html +++ /dev/null @@ -1,277 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html> - <head> - <meta http-equiv="Content-type" content="text/html; charset=utf-8" /> - <title>Ruby on Rails: Welcome aboard</title> - <style type="text/css" media="screen"> - body { - margin: 0; - margin-bottom: 25px; - padding: 0; - background-color: #f0f0f0; - font-family: "Lucida Grande", "Bitstream Vera Sans", "Verdana"; - font-size: 13px; - color: #333; - } - - h1 { - font-size: 28px; - color: #000; - } - - a {color: #03c} - a:hover { - background-color: #03c; - color: white; - text-decoration: none; - } - - - #page { - background-color: #f0f0f0; - width: 750px; - margin: 0; - margin-left: auto; - margin-right: auto; - } - - #content { - float: left; - background-color: white; - border: 3px solid #aaa; - border-top: none; - padding: 25px; - width: 500px; - } - - #sidebar { - float: right; - width: 175px; - } - - #footer { - clear: both; - } - - - #header, #about, #getting-started { - padding-left: 75px; - padding-right: 30px; - } - - - #header { - background-image: url("images/rails.png"); - background-repeat: no-repeat; - background-position: top left; - height: 64px; - } - #header h1, #header h2 {margin: 0} - #header h2 { - color: #888; - font-weight: normal; - font-size: 16px; - } - - - #about h3 { - margin: 0; - margin-bottom: 10px; - font-size: 14px; - } - - #about-content { - background-color: #ffd; - border: 1px solid #fc0; - margin-left: -11px; - } - #about-content table { - margin-top: 10px; - margin-bottom: 10px; - font-size: 11px; - border-collapse: collapse; - } - #about-content td { - padding: 10px; - padding-top: 3px; - padding-bottom: 3px; - } - #about-content td.name {color: #555} - #about-content td.value {color: #000} - - #about-content.failure { - background-color: #fcc; - border: 1px solid #f00; - } - #about-content.failure p { - margin: 0; - padding: 10px; - } - - - #getting-started { - border-top: 1px solid #ccc; - margin-top: 25px; - padding-top: 15px; - } - #getting-started h1 { - margin: 0; - font-size: 20px; - } - #getting-started h2 { - margin: 0; - font-size: 14px; - font-weight: normal; - color: #333; - margin-bottom: 25px; - } - #getting-started ol { - margin-left: 0; - padding-left: 0; - } - #getting-started li { - font-size: 18px; - color: #888; - margin-bottom: 25px; - } - #getting-started li h2 { - margin: 0; - font-weight: normal; - font-size: 18px; - color: #333; - } - #getting-started li p { - color: #555; - font-size: 13px; - } - - - #search { - margin: 0; - padding-top: 10px; - padding-bottom: 10px; - font-size: 11px; - } - #search input { - font-size: 11px; - margin: 2px; - } - #search-text {width: 170px} - - - #sidebar ul { - margin-left: 0; - padding-left: 0; - } - #sidebar ul h3 { - margin-top: 25px; - font-size: 16px; - padding-bottom: 10px; - border-bottom: 1px solid #ccc; - } - #sidebar li { - list-style-type: none; - } - #sidebar ul.links li { - margin-bottom: 5px; - } - - </style> - <script type="text/javascript" src="javascripts/prototype.js"></script> - <script type="text/javascript" src="javascripts/effects.js"></script> - <script type="text/javascript"> - function about() { - if (Element.empty('about-content')) { - new Ajax.Updater('about-content', 'rails/info/properties', { - method: 'get', - onFailure: function() {Element.classNames('about-content').add('failure')}, - onComplete: function() {new Effect.BlindDown('about-content', {duration: 0.25})} - }); - } else { - new Effect[Element.visible('about-content') ? - 'BlindUp' : 'BlindDown']('about-content', {duration: 0.25}); - } - } - - window.onload = function() { - $('search-text').value = ''; - $('search').onsubmit = function() { - $('search-text').value = 'site:rubyonrails.org ' + $F('search-text'); - } - } - </script> - </head> - <body> - <div id="page"> - <div id="sidebar"> - <ul id="sidebar-items"> - <li> - <form id="search" action="http://www.google.com/search" method="get"> - <input type="hidden" name="hl" value="en" /> - <input type="text" id="search-text" name="q" value="site:rubyonrails.org " /> - <input type="submit" value="Search" /> the Rails site - </form> - </li> - - <li> - <h3>Join the community</h3> - <ul class="links"> - <li><a href="http://www.rubyonrails.org/">Ruby on Rails</a></li> - <li><a href="http://weblog.rubyonrails.org/">Official weblog</a></li> - <li><a href="http://lists.rubyonrails.org/">Mailing lists</a></li> - <li><a href="http://wiki.rubyonrails.org/rails/pages/IRC">IRC channel</a></li> - <li><a href="http://wiki.rubyonrails.org/">Wiki</a></li> - <li><a href="http://dev.rubyonrails.org/">Bug tracker</a></li> - </ul> - </li> - - <li> - <h3>Browse the documentation</h3> - <ul class="links"> - <li><a href="http://api.rubyonrails.org/">Rails API</a></li> - <li><a href="http://stdlib.rubyonrails.org/">Ruby standard library</a></li> - <li><a href="http://corelib.rubyonrails.org/">Ruby core</a></li> - </ul> - </li> - </ul> - </div> - - <div id="content"> - <div id="header"> - <h1>Welcome aboard</h1> - <h2>You’re riding the Rails!</h2> - </div> - - <div id="about"> - <h3><a href="rails/info/properties" onclick="about(); return false">About your application’s environment</a></h3> - <div id="about-content" style="display: none"></div> - </div> - - <div id="getting-started"> - <h1>Getting started</h1> - <h2>Here’s how to get rolling:</h2> - - <ol> - <li> - <h2>Create your databases and edit <tt>config/database.yml</tt></h2> - <p>Rails needs to know your login and password.</p> - </li> - - <li> - <h2>Use <tt>script/generate</tt> to create your models and controllers</h2> - <p>To see all available options, run it without parameters.</p> - </li> - - <li> - <h2>Set up a default route and remove or rename this file</h2> - <p>Routes are setup in config/routes.rb.</p> - </li> - </ol> - </div> - </div> - - <div id="footer"> </div> - </div> - </body> -</html>
\ No newline at end of file |