diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/list_controller.rb | 10 | ||||
-rw-r--r-- | app/controllers/request_controller.rb | 15 | ||||
-rw-r--r-- | app/helpers/request_helper.rb | 2 | ||||
-rw-r--r-- | app/views/layouts/default.rhtml | 4 | ||||
-rw-r--r-- | app/views/list/index.rhtml | 9 | ||||
-rw-r--r-- | app/views/request/index.rhtml | 14 |
6 files changed, 44 insertions, 10 deletions
diff --git a/app/controllers/list_controller.rb b/app/controllers/list_controller.rb index 16a0d0695..117b93c7a 100644 --- a/app/controllers/list_controller.rb +++ b/app/controllers/list_controller.rb @@ -4,12 +4,12 @@ # Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved. # Email: francis@mysociety.org; WWW: http://www.mysociety.org/ # -# $Id: list_controller.rb,v 1.1 2007-10-08 15:16:22 francis Exp $ - +# $Id: list_controller.rb,v 1.2 2007-10-09 11:30:01 francis Exp $ class ListController < ApplicationController - def index - @info_request_pages, @info_requests = paginate :info_requests, :per_page => 25 - end + def index + @info_request_pages, @info_requests = paginate :info_requests, :per_page => 25, :order => "created_at desc" + end + end diff --git a/app/controllers/request_controller.rb b/app/controllers/request_controller.rb new file mode 100644 index 000000000..b1c994531 --- /dev/null +++ b/app/controllers/request_controller.rb @@ -0,0 +1,15 @@ +# app/controllers/request_controller.rb: +# Show information about one particular request. +# +# Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved. +# Email: francis@mysociety.org; WWW: http://www.mysociety.org/ +# +# $Id: request_controller.rb,v 1.1 2007-10-09 11:30:01 francis Exp $ + +class RequestController < ApplicationController + + def index + @info_request = InfoRequest.find(params[:id]) + end + +end diff --git a/app/helpers/request_helper.rb b/app/helpers/request_helper.rb new file mode 100644 index 000000000..082eb971f --- /dev/null +++ b/app/helpers/request_helper.rb @@ -0,0 +1,2 @@ +module RequestHelper +end diff --git a/app/views/layouts/default.rhtml b/app/views/layouts/default.rhtml index 6045e5f93..3fa1884b8 100644 --- a/app/views/layouts/default.rhtml +++ b/app/views/layouts/default.rhtml @@ -8,7 +8,9 @@ <body> <h1 id="header">Freedom of Information Filer and Archive <span id="beta">Beta</span></h1> <ul id="navigation"> - <li>Home</li> + <li><a href="/">Home</a></li> + <li><a href="/list">All Requests</a></li> + <li><a href="/new">New Request</a></li> </ul> <% if flash[:notice] %> diff --git a/app/views/list/index.rhtml b/app/views/list/index.rhtml index 6ec13b488..617e6afbc 100644 --- a/app/views/list/index.rhtml +++ b/app/views/list/index.rhtml @@ -1,18 +1,19 @@ +<% @title = "All FOI requests" %> +<h2><%=@title%></h2> -<h1>All FOI requests</h1> - +<p. <table> <tr> <th>Title</th> - <th>Requester</th> + <th>Requester</th> <th>Created</th> </tr> <% for info_request in @info_requests %> <tr class="<%= cycle('odd', 'even') %>"> - <td><%= link_to info_request.title, :action => 'show', :id => info_request %></td> + <td><%= link_to info_request.title, :controller => 'request', :action => 'index', :id => info_request %></td> <td><%= info_request.user.name %></td> <td><%= info_request.created_at %></td> </tr> diff --git a/app/views/request/index.rhtml b/app/views/request/index.rhtml new file mode 100644 index 000000000..20ed122c3 --- /dev/null +++ b/app/views/request/index.rhtml @@ -0,0 +1,14 @@ +<% @title = @info_request.title %> + +<h2><%=@title%></h2> + +<p> +Request to <%=@info_request.public_body.name%> +</p> + +<p> +Created by <%= @info_request.user.name %></td> on <%= @info_request.created_at %> +</p> + + + |