]> git.openstreetmap.org Git - rails.git/commitdiff
Merge remote-tracking branch 'osmlab/id-editor-embed'
authorTom Hughes <tom@compton.nu>
Tue, 7 May 2013 13:43:45 +0000 (14:43 +0100)
committerTom Hughes <tom@compton.nu>
Tue, 7 May 2013 13:43:45 +0000 (14:43 +0100)
12 files changed:
app/assets/javascripts/application.js
app/assets/javascripts/geocoder.js [new file with mode: 0644]
app/assets/stylesheets/browse.css.scss
app/assets/stylesheets/common.css.scss
app/helpers/geocoder_helper.rb
app/views/browse/node_history.html.erb
app/views/browse/relation_history.html.erb
app/views/browse/way_history.html.erb
app/views/geocoder/results.html.erb
app/views/notes/_comment.html.erb
app/views/notes/feed.rss.builder
config/locales/en.yml

index 284ec77e618576c66f54984e5948c95c7ee1c8b7..4c2b7940370d3d07aa04375456a2d1501cad4861 100644 (file)
@@ -18,6 +18,7 @@
 //= require sidebar
 //= require richtext
 //= require resize
+//= require geocoder
 
 function zoomPrecision(zoom) {
     var decimals = Math.pow(10, Math.floor(zoom/3));
diff --git a/app/assets/javascripts/geocoder.js b/app/assets/javascripts/geocoder.js
new file mode 100644 (file)
index 0000000..0809bef
--- /dev/null
@@ -0,0 +1,14 @@
+$(document).ready(function () {
+  $("body").on("click", ".search_more a", function (e) {
+    e.preventDefault();
+
+    var div = $(this).parents(".search_more");
+
+    div.find(".search_results_entry").hide();
+    div.find(".search_searching").show();
+
+    $.get($(this).attr("href"), function(data) {
+      div.replaceWith(data);
+    });
+  });
+});
index dd1bf30c23bd42d2494e0e42dde4c7811b1f5904..14ea3b289ae9e4313008c853ba43277434ff4786 100644 (file)
@@ -1,6 +1,14 @@
-.node { padding-left: 25px; }
-.way { padding-left: 25px; }
-.relation { padding-left: 25px; }
+/* Make space for icons */
+
+.node, .way, .relation { 
+  padding-left: 25px;
+
+  &:first-child {
+    margin-left: -25px;
+  }
+}
+
+/* Deleted objects */
 
 .deleted { text-decoration: line-through; }
 
index d94f5111487f448c9df5dca95aaf91255959b0af..49a784704ea0d64b2fb5b493361b8b0beb4cf811 100644 (file)
@@ -692,7 +692,12 @@ table {
 }
 
 .search_results_entry {
-  margin-bottom: 0 ;
+  margin-bottom: 0;
+
+  .search_details {
+    display: block;
+    text-align: right;
+  }
 }
 
 .search_results_entry .search_searching {
@@ -947,14 +952,13 @@ ul.results-list li { border-bottom: 1px solid #ccc; }
     margin: 0px;
     padding: 4px 6px;
   }
-  div {
-    clear: left;
-  }
   h4, p {
     margin-bottom: 5px;
   }
-  p, ul, .bbox {
-    margin-left: 33.3333%;
+  p, ul, .bbox, .geo {
+    display: inline-block;
+    vertical-align: top;
+    max-width: 65%;
   }
   ul p {
     margin-left: 0;
@@ -962,7 +966,8 @@ ul.results-list li { border-bottom: 1px solid #ccc; }
   }
   h4 {
     width: 33.3333%;
-    float: left;
+    display: inline-block;
+    vertical-align: top;
   }
 }
 
index 8f662bde73d304e7944b3c1195dca1b2cf407db1..c74cba28e32c062d3e9d54dc1c11fae99f1bb8aa 100644 (file)
@@ -18,6 +18,12 @@ module GeocoderHelper
     html << link_to(result[:name], url, html_options) if result[:name]
     html << result[:suffix] if result[:suffix]
 
+    if result[:type] and result[:id]
+      html << content_tag(:small, :class => ["deemphasize", "search_details"]) do
+        link_to(t("browse.#{result[:type]}_history.view_details"), :controller => :browse, :action => result[:type], :id => result[:id])
+      end
+    end
+
     return raw(html)
   end
 
index 61fc83492beb4b01a4996e5fbae540dce6cd3d86..e37f0e037fdee9323005f565bcee87551f438857 100644 (file)
@@ -2,6 +2,10 @@
 @name = printable_name @node
 @title = t('browse.node_history.node_history') + ' | ' + @name
 %>
+<% content_for :head do %>
+<%= stylesheet_link_tag 'browse' %>
+<% end %>
+
 <% content_for :heading do %>
   <h2><%= raw t'browse.node_history.node_history_title', :node_name => link_to(h(@name), :action => "node", :id => @node.id) %></h2>
   <ul class='secondary-actions clearfix'>
index 022248fba509f5db8cba9f45a0313fcf344b0ab6..e0640d9007c5db99d27a0a6db43228352a8e0521 100644 (file)
@@ -2,6 +2,9 @@
 @name = printable_name @relation
 @title = t('browse.relation_history.relation_history') + ' | ' + @name
 %>
+<% content_for :head do %>
+<%= stylesheet_link_tag 'browse' %>
+<% end %>
 
 <% content_for :heading do %>
   <h2><%= raw t'browse.relation_history.relation_history_title', :relation_name => link_to(h(@name), :action => "relation", :id => @relation.id) %></h2>
index 296ebb3ddbff996c5fe4d59da1d59be58b971f5e..49058edc1013d694911a726524a1682a3c4f8f91 100644 (file)
@@ -2,6 +2,9 @@
 @name = printable_name @way
 @title = t('browse.way_history.way_history') + ' | ' + @name
 %>
+<% content_for :head do %>
+<%= stylesheet_link_tag 'browse' %>
+<% end %>
 
 <% content_for :heading do %>
   <h2><%= raw t'browse.way_history.way_history_title', :way_name => link_to(h(@name), :action => "way", :id => @way.id) %></h2>
index 7fd21775ec81264df6393a9f4f614824770e3f8a..f98f2abc9e3c490f7643c749c8bd1a9138a4a853 100644 (file)
@@ -7,20 +7,11 @@
   <% end %>
 </ul>
   <% if @more_params %>
-    <div id="search_more_<%= @more_params.hash %>">
+    <div class="search_more">
       <div class="inner12 search_results_entry">
-        <%= link_to t('geocoder.results.more_results'), "#", :class => "button" %>
+        <%= link_to t('geocoder.results.more_results'), url_for(@more_params), :class => "button" %>
       </div>
-      <%= image_tag "searching.gif", :class => "search_searching" %>
+      <%= image_tag "searching.gif", :class => ["search_searching", "hidden"] %>
     </div>
-    <script type="text/javascript">
-      $("#search_more_<%= @more_params.hash %> .search_searching").hide();
-
-      $("#search_more_<%= @more_params.hash %> a").click(function () {
-        $("#search_more_<%= @more_params.hash %> .search_results_entry").hide();
-        $("#search_more_<%= @more_params.hash %> .search_searching").show();
-        $("#search_more_<%= @more_params.hash %>").load("<%= raw url_for(@more_params) %>");
-      });
-    </script>
   <% end %>
 <% end %>
index 4fe7b59d56aae8cb4687e28a8b2844c71e4b567a..c0d6e17d32b156efc308a97582c28ecb795efd3a 100644 (file)
@@ -1,8 +1,8 @@
 <div class="note-comment" style="margin-top: 5px">
   <% if comment.author.nil? -%>
-  <div class="note-comment-description" style="font-size: smaller; color: #999999"><%= t "note.description.#{comment.event}_at", :when => friendly_date(comment.created_at) %></div>
+  <div class="note-comment-description" style="font-size: smaller; color: #999999"><%= t "note.description.#{comment.event}_at_html", :when => friendly_date(comment.created_at) %></div>
   <% else -%>
-  <div class="note-comment-description" style="font-size: smaller; color: #999999"><%= t "note.description.#{comment.event}_at_by", :when => friendly_date(comment.created_at), :user => note_author(comment.author, :only_path => false) %></div>
+  <div class="note-comment-description" style="font-size: smaller; color: #999999"><%= t "note.description.#{comment.event}_at_by_html", :when => friendly_date(comment.created_at), :user => note_author(comment.author, :only_path => false) %></div>
   <% end -%>
   <div class="note-comment-text"><%= comment.body %></div>
 </div>
index f17be09cbf4b34d2d8fc81a6d9620905427017cc..df35b70d3bd4fb158a98033e0d40d670272e4fe3 100644 (file)
@@ -25,7 +25,9 @@ xml.rss("version" => "2.0",
         xml.link url_for(:controller => "browse", :action => "note", :id => comment.note.id, :only_path => false)
         xml.guid url_for(:controller => "browse", :action => "note", :id => comment.note.id, :only_path => false)
 
-        xml.description render(:partial => "entry", :object => comment, :formats => [ :html ])
+        xml.description do
+          xml.cdata! render(:partial => "entry", :object => comment, :formats => [ :html ])
+        end
 
         if comment.author
           xml.author comment.author.display_name
index 0186d446d55a04ce650bf8aa4d6edace7ee65762..315cc4aa693760e522ffdb5f50e5cbc403cd4895 100644 (file)
@@ -1996,14 +1996,14 @@ en:
       needs_view: "The user needs to log in before this block will be cleared."
   note:
     description:
-      opened_at: "Created %{when} ago"
-      opened_at_by: "Created %{when} ago by %{user}"
-      commented_at: "Updated %{when} ago"
-      commented_at_by: "Updated %{when} ago by %{user}"
-      closed_at: "Resolved %{when} ago"
-      closed_at_by: "Resolved %{when} ago by %{user}"
-      reopened_at: "Reactivated %{when} ago"
-      reopened_at_by: "Reactivated %{when} ago by %{user}"
+      opened_at_html: "Created %{when} ago"
+      opened_at_by_html: "Created %{when} ago by %{user}"
+      commented_at_html: "Updated %{when} ago"
+      commented_at_by_html: "Updated %{when} ago by %{user}"
+      closed_at_html: "Resolved %{when} ago"
+      closed_at_by_html: "Resolved %{when} ago by %{user}"
+      reopened_at_html: "Reactivated %{when} ago"
+      reopened_at_by_html: "Reactivated %{when} ago by %{user}"
     rss:
       title: "OpenStreetMap Notes"
       description_area: "A list of notes, reported, commented on or closed in your area [(%{min_lat}|%{min_lon}) -- (%{max_lat}|%{max_lon})]"