diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/body_controller.rb | 18 | ||||
-rw-r--r-- | app/helpers/body_helper.rb | 2 | ||||
-rw-r--r-- | app/views/body/index.rhtml | 2 | ||||
-rw-r--r-- | app/views/body/show.rhtml | 11 | ||||
-rw-r--r-- | app/views/index/index.rhtml | 21 | ||||
-rw-r--r-- | app/views/layouts/default.rhtml | 15 | ||||
-rw-r--r-- | app/views/list/index.rhtml | 7 | ||||
-rw-r--r-- | app/views/new/index.rhtml | 55 |
8 files changed, 92 insertions, 39 deletions
diff --git a/app/controllers/body_controller.rb b/app/controllers/body_controller.rb new file mode 100644 index 000000000..2027e13a1 --- /dev/null +++ b/app/controllers/body_controller.rb @@ -0,0 +1,18 @@ +# app/controllers/body_controller.rb: +# Show information about a public body. +# +# Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved. +# Email: francis@mysociety.org; WWW: http://www.mysociety.org/ +# +# $Id: body_controller.rb,v 1.1 2007-10-11 22:01:36 francis Exp $ + +class BodyController < ApplicationController + def show + @public_bodies = PublicBody.find(:all, :conditions => [ "short_name = ?", params[:short_name] ]) + if @public_bodies.size > 1 + raise "Two bodies with the same short name: " . params[:short_name] + end + @public_body = @public_bodies[0] + end + +end diff --git a/app/helpers/body_helper.rb b/app/helpers/body_helper.rb new file mode 100644 index 000000000..55c49196a --- /dev/null +++ b/app/helpers/body_helper.rb @@ -0,0 +1,2 @@ +module BodyHelper +end diff --git a/app/views/body/index.rhtml b/app/views/body/index.rhtml new file mode 100644 index 000000000..646269bf7 --- /dev/null +++ b/app/views/body/index.rhtml @@ -0,0 +1,2 @@ +<h1>Body#index</h1> +<p>Find me in app/views/body/index.rhtml</p> diff --git a/app/views/body/show.rhtml b/app/views/body/show.rhtml new file mode 100644 index 000000000..f454a8b4d --- /dev/null +++ b/app/views/body/show.rhtml @@ -0,0 +1,11 @@ +<% @title = h(@public_body.name) + " (" + h(@public_body.short_name) + ")" %> + +<h2><%=@title%></h2> + +<p>Freedom of Information requests made to this body:</p> +<ul> +<% for info_request in @public_body.info_requests %> +<li><%= link_to h(info_request.title), :controller => 'request', :action => 'index', :id => info_request %></li> +<% end %> +</ul> + diff --git a/app/views/index/index.rhtml b/app/views/index/index.rhtml index 65ba3a2e8..f44aa95b3 100644 --- a/app/views/index/index.rhtml +++ b/app/views/index/index.rhtml @@ -1,5 +1,20 @@ +<div id="frontpage"> -<p id="explanation">Make requests for information from the UK Government -<br>Find information that others requested -</p> + <div id="make_requests"> + <h1>Make requests for information from the UK Government</h1> + <% form_for(:info_request, @info_request, :url => { :controller => :new, :action => :index }, :html => { :id => 'public_body_form', :class => 'plaque' } ) do |f| %> + <p>Choose which public body you would like information from.</p> + <%= @public_bodies = PublicBody.find(:all, :order => "name") + f.collection_select(:public_body_id, @public_bodies, :id, :name) %> + <p><%= submit_tag "Submit >>" %></p> + <% end %> + </div> + + <div id="find_information"> + <h1>Find information that others requested</h1> + <p><a href="/list">View all information</a></p> + </div> + + +</div> diff --git a/app/views/layouts/default.rhtml b/app/views/layouts/default.rhtml index 3c7d86ce7..1153ce602 100644 --- a/app/views/layouts/default.rhtml +++ b/app/views/layouts/default.rhtml @@ -6,14 +6,13 @@ <%= stylesheet_link_tag 'main' %> </head> <body> - <h1 id="header"> - <% if controller.controller_name == 'index' and controller.action_name == 'index' %> - Freedom of Information Filer and Archive - <% else %> - <a href="/">Freedom of Information Filer and Archive</a> - <% end %> - <span id="beta">Beta</span> - </h1> + <div id="header"> + <h1> + <a href="/">Government Spy</a> + <span id="beta">Beta</span> + </h1> + <div id="tagline">Freeing your information from them</div> + </div> <ul id="navigation"> <li><a href="/list">All Requests</a></li> <li><a href="/new">New Request</a></li> diff --git a/app/views/list/index.rhtml b/app/views/list/index.rhtml index 60d1ae0ba..47b3bfc55 100644 --- a/app/views/list/index.rhtml +++ b/app/views/list/index.rhtml @@ -1,10 +1,10 @@ -<% @title = "All FOI requests" %> +<% @title = "Recent Freedom of Information requests" %> <h2><%=@title%></h2> -<p> -<table> +<table id="list_requests"> <tr> + <th>Public body</th> <th>Title</th> <th>Requester</th> <th>Created</th> @@ -13,6 +13,7 @@ <% for info_request in @info_requests %> <tr class="<%= cycle('odd', 'even') %>"> + <td><%= link_to h(info_request.public_body.short_name), :controller => 'body', :action => 'show', :short_name => info_request.public_body.short_name %></td> <td><%= link_to h(info_request.title), :controller => 'request', :action => 'index', :id => info_request %></td> <td><%= link_to h(info_request.user.name), :controller => 'user', :action => 'index', :name => info_request.user.name %></td> <td><%= simple_date(info_request.created_at) %></td> diff --git a/app/views/new/index.rhtml b/app/views/new/index.rhtml index 84d0198bc..b513c9a4c 100644 --- a/app/views/new/index.rhtml +++ b/app/views/new/index.rhtml @@ -4,37 +4,42 @@ <% form_for(:info_request, @info_request, :url => { :action => :create }, :html => { :id => 'writeForm' } ) do |f| %> - <h1>New FOI request</h1> + <label for="heading"> </label> + <h1>New Freedom of Information request</h1> - <p><strong>Privacy warning:</strong> All information that you enter, except - for your email address, will be displayed publically on this website.</p> - - <p> + <p> <label for="public_body_id">Public body:</label> - <%= + <%= @public_bodies = PublicBody.find(:all, :order => "name") f.collection_select(:public_body_id, @public_bodies, :id, :name) - %> - </p> - - - <p> - <label for="info_request_title">Summary:</label> - <%= f.text_field :title, :size => 50 %> - <br>(a one line summary of the information you are requesting, e.g. 'Crime statistics by ward level for Wales') - </p> - - <% fields_for :outgoing_message do |o| %> - <p> - <label for="outgoing_message_body">Your letter:</label> + %> + </p> + + + <p> + <label for="info_request_title">Summary:</label> + <%= f.text_field :title, :size => 50 %> + </p> + <div class="form_note"> + (a one line summary of the information you are requesting, + <br>e.g. 'Crime statistics by ward level for Wales') + </div> + + <% fields_for :outgoing_message do |o| %> + <p> + <label for="outgoing_message_body">Your letter:</label> <%= o.text_area :body, :rows => 20, :cols => 60 %> - </p> - <% end %> + </p> + <% end %> + + <p class="form_note"> + <strong>Privacy warning:</strong> All information that you enter, except + for your email address, will be displayed publically on this website. + </p> - <p> - <label for="commit"> </label> - <%= submit_tag "Create request >>" %> - </p> + <div class="form_button"> + <%= submit_tag "Create public request >>" %> + </div> </div> <% end %> |