Add uid data attributes to vote listing templates.

As a stopgap instead of providing proper API access to vote listings,
expose the user ID of a voter as a data attribute in the DOM so
automated consumers can easily scrape user IDs of voters, rather than
having to make additional requests to turn a username into a user ID.
master
Snakes 2022-08-28 12:12:35 -04:00
parent bce616d624
commit 5f09df467a
2 changed files with 3 additions and 3 deletions

View File

@ -29,7 +29,7 @@
<td>
<a style="color:#{{vote.user.name_color}};font-weight:bold" href="/@{{vote.user.username}}">
<img loading="lazy" src="{{vote.user.profile_url}}" class="pp20">
<span {% if vote.user.patron %}class="patron" style="background-color:#{{vote.user.name_color}}"{% endif %}>
<span {% if vote.user.patron %}class="patron" style="background-color:#{{vote.user.name_color}}"{% endif %} data-user-id="{{vote.user.id}}">
{{vote.user.username}}
</span>
</a>

View File

@ -41,7 +41,7 @@
<td>
<a style="color:#{{vote.user.name_color}};font-weight:bold" href="/@{{vote.user.username}}">
<img loading="lazy" src="{{vote.user.profile_url}}" class="pp20">
<span {% if vote.user.patron %}class="patron" style="background-color:#{{vote.user.name_color}}"{% endif %}>
<span {% if vote.user.patron %}class="patron" style="background-color:#{{vote.user.name_color}}"{% endif %} data-user-id="{{vote.user.id}}">
{{vote.user.username}}
</span>
</a>
@ -69,7 +69,7 @@
<td>
<a style="color:#{{vote.user.name_color}};font-weight:bold" href="/@{{vote.user.username}}">
<img loading="lazy" src="{{vote.user.profile_url}}" class="pp20">
<span {% if vote.user.patron %}class="patron" style="background-color:#{{vote.user.name_color}}"{% endif %}>
<span {% if vote.user.patron %}class="patron" style="background-color:#{{vote.user.name_color}}"{% endif %} data-user-id="{{vote.user.id}}">
{{vote.user.username}}
</span>
</a>