From: Tom Hughes Date: Sat, 13 Aug 2011 12:25:41 +0000 (+0100) Subject: Get the note browse pages into a vaguely working state X-Git-Tag: live~5096^2~141 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/81a6c7b7bebb06c2e9711451e6795f65b34d59ca Get the note browse pages into a vaguely working state --- 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? %>