[openstreetmap/openstreetmap-website] Integrate human-readable wikidata browser plugin (PR #6127)

Marwin Hochfelsner notifications at github.com
Thu Jul 17 21:41:28 UTC 2025


@hlfan commented on this pull request.



> +      icon: ["P8972", "P154", "P14"].reduce((out, prop) => out ?? entity.claims[prop]?.[0]?.mainsnak?.datavalue?.value, null),
+      description: localizedProperty("descriptions", langs)?.value,
+      article: localizedProperty("sitelinks", wikis)
+    };
+    return data;
+  }
+
+  function renderWikidataResponse(data, $btn) {
+    const cell = $("<td>")
+      .attr("colspan", 2)
+      .addClass("bg-body-tertiary");
+
+    if (data.icon && OSM.WIKIMEDIA_COMMONS_URL) {
+      $("<a>")
+        .attr("href", OSM.WIKIMEDIA_COMMONS_URL + "File:" + data.icon)
+        .append($("<img>").attr({ src: OSM.WIKIMEDIA_COMMONS_URL + "Special:FilePath/" + data.icon, height: "32" }))

That worked out well, didn't it?

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/6127#discussion_r2214364546
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/pull/6127/review/3031115195 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20250717/31bd1bfb/attachment.htm>


More information about the rails-dev mailing list