From 81a6c7b7bebb06c2e9711451e6795f65b34d59ca Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Sat, 13 Aug 2011 13:25:41 +0100 Subject: [PATCH] Get the note browse pages into a vaguely working state --- app/helpers/application_helper.rb | 4 + app/helpers/browse_helper.rb | 8 ++ app/views/browse/_map.html.erb | 24 +++++- app/views/browse/note.html.erb | 129 ++++++++++++------------------ config/locales/en.yml | 10 ++- public/stylesheets/common.css | 17 ++++ 6 files changed, 107 insertions(+), 85 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 6e2ecd323..59ba7d171 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -129,6 +129,10 @@ module ApplicationHelper end end + def friendly_date(date) + content_tag(:span, time_ago_in_words(date), :title => l(date, :format => :friendly)) + end + private def javascript_strings_for_key(key) diff --git a/app/helpers/browse_helper.rb b/app/helpers/browse_helper.rb index a41b39a3d..9a49abd67 100644 --- a/app/helpers/browse_helper.rb +++ b/app/helpers/browse_helper.rb @@ -42,6 +42,14 @@ module BrowseHelper end end + def note_author(object) + if object.author.nil? + h(object.author_name) + else + link_to h(object.author_name), :controller => "user", :action => "view", :display_name => object.author_name + end + end + private ICON_TAGS = [ diff --git a/app/views/browse/_map.html.erb b/app/views/browse/_map.html.erb index d2695ebe6..9ff93b365 100644 --- a/app/views/browse/_map.html.erb +++ b/app/views/browse/_map.html.erb @@ -6,14 +6,14 @@
- <% if map.instance_of? Changeset or (map.instance_of? Node and map.version > 1) or map.visible %> + <% if map.instance_of? Changeset or (map.instance_of? Node and map.version > 1) or map.visible? %>
<%= t 'browse.map.loading' %> <%= link_to(t("browse.map.larger.area"), { :controller => :site, :action => :index, :box => "yes" }, { :id => "area_larger_map", :class => "geolink bbox" }) %>
<%= link_to(t("browse.map.edit.area"), { :controller => :site, :action => :edit }, { :id => "area_edit", :class => "geolink bbox" }) %> - <% unless map.instance_of? Changeset %> + <% unless map.instance_of? Changeset or map.instance_of? Note %>
<%= link_to("", { :controller => :site, :action => :index }, { :id => "object_larger_map", :class => "geolink object" }) %>
@@ -40,7 +40,7 @@
-<% if map.instance_of? Changeset or (map.instance_of? Node and map.version > 1) or map.visible %> +<% if map.instance_of? Changeset or (map.instance_of? Node and map.version > 1) or map.visible? %>