Aevann 2024-11-18 15:55:52 +02:00
parent 3356a9c819
commit ff13921177
3 changed files with 11 additions and 4 deletions

View File

@ -158,3 +158,10 @@ document.addEventListener("click", function(e) {
bs_trigger(generated_popover)
}
});
function award_timestamp(t) {
const date = formatDate(new Date(t.dataset.on*1000));
const text = t.getAttribute("data-bs-original-title")
t.setAttribute("data-bs-original-title", `${text} on ${date.toString()}`);
t.removeAttribute("data-onmouseover")
}

View File

@ -119,9 +119,9 @@
{% for a in c.awards %}
<span class="mr-1">
{% if a.kind in ["emoji","emoji-hz"] %}
<img class="emoji-award-icon" alt='{{a.title}} Award given by @{{a.user.username}}: "{{a.note}}"' data-bs-toggle="tooltip" loading="lazy" src="{{SITE_FULL_IMAGES}}/e/{{a.note}}.webp" data-bs-toggle="tooltip" data-bs-placement="bottom" title='{{a.title}} Award given by @{{a.user.username}}: "{{a.note}}"'>
<img class="emoji-award-icon" alt='{{a.title}} Award given by @{{a.user.username}}: "{{a.note}}"' data-bs-toggle="tooltip" loading="lazy" src="{{SITE_FULL_IMAGES}}/e/{{a.note}}.webp" data-bs-toggle="tooltip" data-bs-placement="bottom" title='{{a.title}} Award given by @{{a.user.username}}: "{{a.note}}"' {% if a.awarded_utc %}data-on="{{a.awarded_utc}}" data-nonce="{{g.nonce}}" data-onmouseover="award_timestamp(this)"{% endif %}>
{% else %}
<i class="{{a.class_list}} px-1" data-bs-toggle="tooltip" data-bs-placement="bottom" title='{{a.title}} Award given by @{{a.user.username}}{% if a.kind in ["chud","namelock","flairlock"] %}: "{{a.note}}"{% endif %}'></i>
<i class="{{a.class_list}} px-1" data-bs-toggle="tooltip" data-bs-placement="bottom" title='{{a.title}} Award given by @{{a.user.username}}{% if a.kind in ["chud","namelock","flairlock"] %}: "{{a.note}}"{% endif %}' {% if a.awarded_utc %}data-on="{{a.awarded_utc}}" data-nonce="{{g.nonce}}" data-onmouseover="award_timestamp(this)"{% endif %}></i>
{% endif %}
</span>
{% endfor %}

View File

@ -32,9 +32,9 @@
{% for a in p.awards %}
<span class="mr-1">
{% if a.kind in ["emoji","emoji-hz"] %}
<img class="emoji-award-icon" alt='{{a.title}} Award given by @{{a.user.username}}: "{{a.note}}"' data-bs-toggle="tooltip" loading="lazy" src="{{SITE_FULL_IMAGES}}/e/{{a.note}}.webp" data-bs-toggle="tooltip" data-bs-placement="bottom" title='{{a.title}} Award given by @{{a.user.username}}: "{{a.note}}"'>
<img class="emoji-award-icon" alt='{{a.title}} Award given by @{{a.user.username}}: "{{a.note}}"' data-bs-toggle="tooltip" loading="lazy" src="{{SITE_FULL_IMAGES}}/e/{{a.note}}.webp" data-bs-toggle="tooltip" data-bs-placement="bottom" title='{{a.title}} Award given by @{{a.user.username}}: "{{a.note}}"' {% if a.awarded_utc %}data-on="{{a.awarded_utc}}" data-nonce="{{g.nonce}}" data-onmouseover="award_timestamp(this)"{% endif %}>
{% else %}
<i class="{{a.class_list}} px-1" data-bs-toggle="tooltip" data-bs-placement="bottom" title='{{a.title}} Award given by @{{a.user.username}}{% if a.kind in ["chud","namelock","flairlock"] %}: "{{a.note}}"{% endif %}'></i>
<i class="{{a.class_list}} px-1" data-bs-toggle="tooltip" data-bs-placement="bottom" title='{{a.title}} Award given by @{{a.user.username}}{% if a.kind in ["chud","namelock","flairlock"] %}: "{{a.note}}"{% endif %}' {% if a.awarded_utc %}data-on="{{a.awarded_utc}}" data-nonce="{{g.nonce}}" data-onmouseover="award_timestamp(this)"{% endif %}></i>
{% endif %}
</span>
{% endfor %}