Skip to content

Commit

Permalink
Merge pull request #810 from distributive/main
Browse files Browse the repository at this point in the history
Display pronouns on card pages, when applicable (using v3 api)
  • Loading branch information
distributive authored Mar 10, 2024
2 parents 0265738 + 3cba88b commit b51fba9
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions app/Resources/views/Search/display-zoom.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,19 @@
{% endblock %}

{% block main %}
{% include '/Scripts/api.html.twig' %}
<script type="text/javascript">
async function getPronouns() {
// Attempt to get card's pronouns
const printing = await fetchData(`${v3_api_url}/api/v3/public/printings/{{ card.code }}`);
const card = await fetchData(`${v3_api_url}/api/v3/public/cards/${printing.attributes.card_id}`);
if (card.pronouns) {
$(".card-stats").append(`<br>Pronouns: ${card.pronouns}`)
}
}
getPronouns();
</script>

<div class="row">
<div class="col-sm-4">
<div class="card-image">
Expand Down

0 comments on commit b51fba9

Please sign in to comment.