Skip to content

Commit

Permalink
Merge branch 'linked-to-from-#1428' of https://github.com/carlinmack/…
Browse files Browse the repository at this point in the history
…scholia into carlinmack-linked-to-from-#1428
  • Loading branch information
fnielsen committed Aug 9, 2021
2 parents 8a2ae85 + d04d515 commit a070a58
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion scholia/app/templates/base.html
Expand Up @@ -94,7 +94,19 @@
$.getJSON(url, function (data) {
var item = data.entities["{{ q }}"];
if ('en' in item.labels) {
$("#h1").text(item.labels.en.value);
var title = item.labels.en.value
$("#h1").text(title);

{% if request.path.endswith("curation") or request.path.endswith("curation/") %}

var linkedToFrom = "<p><a href='https://www.wikidata.org/w/index.php?hidecategorization=1&target={{ q }}&showlinkedto=1&limit=500&days=7&enhanced=1&title=Special:RecentChangesLinked&urlversion=2' >";
linkedToFrom += "Recent changes to items that link <em>to</em> " + title + "</a> and ";
linkedToFrom += "<a href='https://www.wikidata.org/w/index.php?hidecategorization=1&target={{ q }}&showlinkedto=0&limit=500&days=7&enhanced=1&title=Special:RecentChangesLinked&urlversion=2' >";
linkedToFrom += "recent changes to items that link <em>from</em> " + title + "</a>.</p>";

$(linkedToFrom).insertAfter('h1:first');

{% endif %}
}
$("#h1").append(' (<a href="https://www.wikidata.org/wiki/{{ q }}">{{ q }}</a>)');

Expand Down

0 comments on commit a070a58

Please sign in to comment.