<p></p>
<p><b>@tomhughes</b> requested changes on this pull request.</p>
<hr>
<p>In <a href="https://github.com/openstreetmap/openstreetmap-website/pull/3535#discussion_r857599351">db/structure.sql</a>:</p>
<pre style='color:#555'>> @@ -142,8 +142,6 @@ $$;
SET default_tablespace = '';
-SET default_table_access_method = heap;
</pre>
<p dir="auto">Please remove this change, which is not related to this PR and is an artefact of your postgres version.</p>
<hr>
<p>In <a href="https://github.com/openstreetmap/openstreetmap-website/pull/3535#discussion_r857605740">app/views/browse/_common_details.html.erb</a>:</p>
<pre style='color:#555'>> @@ -31,4 +31,4 @@
</div>
<% end %>
-<%= render :partial => "tag_details", :object => common_details.tags %>
+<%= render :partial => "tag_details", :object => (local_assigns[:tag_history] or common_details.tags), :locals => { :is_history => local_assigns[:is_history] } %>
</pre>
<p dir="auto">Is there a reason for using <code>local_assigns</code> in all these templates? A local value passed to <code>render</code> should be available as a normal variable I think, so just <code>is_history</code> would work as well as <code>local_assigns[:is_history]</code> here?</p>
<hr>
<p>In <a href="https://github.com/openstreetmap/openstreetmap-website/pull/3535#discussion_r857609269">app/helpers/browse_helper.rb</a>:</p>
<pre style='color:#555'>> @@ -75,4 +75,21 @@ def icon_tags(object)
def name_locales(object)
object.tags.keys.map { |k| Regexp.last_match(1) if k =~ /^name:(.*)$/ }.flatten
end
+
+ def tags_with_version_info(current_tags, old_objects)
+ version_history = {}
+
+ current_tags.each do |t|
+ version_history[t.k] = { :value => nil, :version => -1 }
+ end
+ old_objects.each do |old|
+ old.old_tags.each do |t|
+ if version_history.include?(t.k) && version_history[t.k][:value] != t.v
+ version_history[t.k] = { :value => t.v, :version => old.version,
+ :changeset => old.changeset, :timestamp => old.timestamp }
+ end
</pre>
<p dir="auto">I think if you this needs to reset the version in the history to -1 for any tags which aren't in this version, otherwise I think if a tag is deleted and then reinstated with the same value the last edit will appear to be the version when it was originally added rather than the version where it was reinstated?</p>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />Reply to this email directly, <a href="https://github.com/openstreetmap/openstreetmap-website/pull/3535#pullrequestreview-951820237">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLIBRXDYV743R236JPDVG2KWRANCNFSM5UG6SIIQ">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AAK2OLJKIGSUAYWUXRLSTD3VG2KWRA5CNFSM5UG6SII2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOHC5Z7TI.gif" height="1" width="1" alt="" /><span style="color: transparent; font-size: 0; display: none; visibility: hidden; overflow: hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0; mso-hide: all">Message ID: <span><openstreetmap/openstreetmap-website/pull/3535/review/951820237</span><span>@</span><span>github</span><span>.</span><span>com></span></span></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/openstreetmap-website/pull/3535#pullrequestreview-951820237",
"url": "https://github.com/openstreetmap/openstreetmap-website/pull/3535#pullrequestreview-951820237",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>