aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfrancis <francis>2007-10-09 20:02:07 +0000
committerfrancis <francis>2007-10-09 20:02:07 +0000
commita0d1b8aadedfd2a3d9dfcb903014c63fbfb8cd39 (patch)
treee14e2048b468fabe64a1ed6678232d87b23c4b69
parentc3ade0115f44cfe055d7450cef07954de9668440 (diff)
Display dates more nicely.
-rw-r--r--app/helpers/application_helper.rb7
-rw-r--r--app/views/list/index.rhtml2
-rw-r--r--app/views/request/index.rhtml2
-rw-r--r--app/views/user/index.rhtml4
-rw-r--r--todo.txt4
5 files changed, 10 insertions, 9 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 7ad5d5b31..b3c62fc5e 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -4,7 +4,7 @@
# Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved.
# Email: francis@mysociety.org; WWW: http://www.mysociety.org/
#
-# $Id: application_helper.rb,v 1.5 2007-09-12 08:52:23 francis Exp $
+# $Id: application_helper.rb,v 1.6 2007-10-09 20:02:13 francis Exp $
module ApplicationHelper
@@ -34,5 +34,10 @@ module ApplicationHelper
end
end
+ # Basic date format
+ def simple_date(date)
+ return date.strftime("%e %B %Y")
+ end
+
end
diff --git a/app/views/list/index.rhtml b/app/views/list/index.rhtml
index 7161ff10d..60d1ae0ba 100644
--- a/app/views/list/index.rhtml
+++ b/app/views/list/index.rhtml
@@ -15,7 +15,7 @@
<tr class="<%= cycle('odd', 'even') %>">
<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><%= info_request.created_at %></td>
+ <td><%= simple_date(info_request.created_at) %></td>
</tr>
<% end %>
</table>
diff --git a/app/views/request/index.rhtml b/app/views/request/index.rhtml
index 3c61ce179..950ecd8e9 100644
--- a/app/views/request/index.rhtml
+++ b/app/views/request/index.rhtml
@@ -9,7 +9,7 @@ Request to <%=h @info_request.public_body.name%>
<p>
Created by
<%= link_to h(@info_request.user.name), :controller => 'user', :action => 'index', :name => @info_request.user.name %>
-on <%= @info_request.created_at %>
+on <%= simple_date(@info_request.created_at) %>
</p>
diff --git a/app/views/user/index.rhtml b/app/views/user/index.rhtml
index 5e7b8a67e..535eab8d9 100644
--- a/app/views/user/index.rhtml
+++ b/app/views/user/index.rhtml
@@ -7,11 +7,11 @@
<% for display_user in @display_users %>
<h2><%=@title%></h2>
- <p>Registered <%= display_user.created_at %></p>
+ <p>Registered on <%= simple_date(display_user.created_at) %></p>
<p>Freedom of Information requests made by this person:</p>
<ul>
<% for info_request in display_user.info_requests %>
- <li><%= link_to h(info_request.title), :controller => 'request', :action => 'index', :id => info_request %></td>
+ <li><%= link_to h(info_request.title), :controller => 'request', :action => 'index', :id => info_request %></li>
<% end %>
</ul>
<% end %>
diff --git a/todo.txt b/todo.txt
index f33df7c8e..8d0947378 100644
--- a/todo.txt
+++ b/todo.txt
@@ -10,10 +10,6 @@ Make it say "dear" as default letter
Write some tests (try it their way, at every level)
-Check all controllers to be sure non-action functions are private
-
-Format dates nicely
-
Rename back links in admin interface
Tidying