fix(ui): show country code alongside flag emoji in from→to display

This commit is contained in:
2026-07-07 13:34:06 +08:00
parent 1292c6591b
commit 806c9ba8a0
2 changed files with 9 additions and 9 deletions

View File

@@ -37,8 +37,8 @@
<img src="{{ pc.image_front }}" alt="" class="showcase-card-img" loading="lazy"> <img src="{{ pc.image_front }}" alt="" class="showcase-card-img" loading="lazy">
<div class="showcase-card-body"> <div class="showcase-card-body">
<div class="showcase-card-meta"> <div class="showcase-card-meta">
{% if pc.country_from and pc.country %}<span>{{ pc.country_from|flag }}{{ pc.country|flag }}</span> {% if pc.country_from and pc.country %}<span>{{ pc.country_from|flag }} {{ pc.country_from }} → {{ pc.country|flag }} {{ pc.country }}</span>
{% elif pc.country %}<span>{{ pc.country|flag }}</span> {% elif pc.country %}<span>{{ pc.country|flag }} {{ pc.country }}</span>
{% endif %} {% endif %}
</div> </div>
</div> </div>
@@ -78,8 +78,8 @@ function _appendCard(c) {
div.setAttribute('data-front', c.image_front); div.setAttribute('data-front', c.image_front);
div.onclick = function() { openLightbox(div); }; div.onclick = function() { openLightbox(div); };
var countryHtml = ''; var countryHtml = '';
if (c.country_from && c.country) countryHtml = '<span>' + _flag(c.country_from) + '' + _flag(c.country) + '</span>'; if (c.country_from && c.country) countryHtml = '<span>' + _flag(c.country_from) + ' ' + c.country_from + ' → ' + _flag(c.country) + ' ' + c.country + '</span>';
else if (c.country) countryHtml = '<span>' + _flag(c.country) + '</span>'; else if (c.country) countryHtml = '<span>' + _flag(c.country) + ' ' + c.country + '</span>';
div.innerHTML = '<img src="' + c.image_front + '" alt="" class="showcase-card-img" loading="lazy">' + div.innerHTML = '<img src="' + c.image_front + '" alt="" class="showcase-card-img" loading="lazy">' +
'<div class="showcase-card-body"><div class="showcase-card-meta">' + countryHtml + '</div></div>'; '<div class="showcase-card-body"><div class="showcase-card-meta">' + countryHtml + '</div></div>';
grid.appendChild(div); grid.appendChild(div);

View File

@@ -49,7 +49,7 @@
<img src="{{ pc.image_front }}" alt="" class="showcase-card-img" loading="lazy"> <img src="{{ pc.image_front }}" alt="" class="showcase-card-img" loading="lazy">
<div class="showcase-card-body"> <div class="showcase-card-body">
<div class="showcase-card-meta"> <div class="showcase-card-meta">
{% if pc.country_from and pc.country %}<span>{{ pc.country_from|flag }}{{ pc.country|flag }}</span> {% if pc.country_from and pc.country %}<span>{{ pc.country_from|flag }} {{ pc.country_from }} → {{ pc.country|flag }} {{ pc.country }}</span>
{% elif pc.country %}<span>{{ pc.country|flag }}</span> {% elif pc.country %}<span>{{ pc.country|flag }}</span>
{% endif %} {% endif %}
{% if pc.send_time %}<span>{{ pc.send_time.strftime('%Y-%m-%d') }}</span>{% endif %} {% if pc.send_time %}<span>{{ pc.send_time.strftime('%Y-%m-%d') }}</span>{% endif %}
@@ -74,7 +74,7 @@
<img src="{{ pc.image_front }}" alt="" class="showcase-card-img" loading="lazy"> <img src="{{ pc.image_front }}" alt="" class="showcase-card-img" loading="lazy">
<div class="showcase-card-body"> <div class="showcase-card-body">
<div class="showcase-card-meta"> <div class="showcase-card-meta">
{% if pc.country_from and pc.country %}<span>{{ pc.country_from|flag }}{{ pc.country|flag }}</span> {% if pc.country_from and pc.country %}<span>{{ pc.country_from|flag }} {{ pc.country_from }} → {{ pc.country|flag }} {{ pc.country }}</span>
{% elif pc.country %}<span>{{ pc.country|flag }}</span> {% elif pc.country %}<span>{{ pc.country|flag }}</span>
{% endif %} {% endif %}
{% if pc.send_time %}<span>{{ pc.send_time.strftime('%Y-%m-%d') }}</span>{% endif %} {% if pc.send_time %}<span>{{ pc.send_time.strftime('%Y-%m-%d') }}</span>{% endif %}
@@ -98,7 +98,7 @@
<img src="{{ pc.image_front }}" alt="" class="showcase-card-img" loading="lazy"> <img src="{{ pc.image_front }}" alt="" class="showcase-card-img" loading="lazy">
<div class="showcase-card-body"> <div class="showcase-card-body">
<div class="showcase-card-meta"> <div class="showcase-card-meta">
{% if pc.country_from and pc.country %}<span>{{ pc.country_from|flag }}{{ pc.country|flag }}</span> {% if pc.country_from and pc.country %}<span>{{ pc.country_from|flag }} {{ pc.country_from }} → {{ pc.country|flag }} {{ pc.country }}</span>
{% elif pc.country %}<span>{{ pc.country|flag }}</span> {% elif pc.country %}<span>{{ pc.country|flag }}</span>
{% endif %} {% endif %}
{% if pc.receive_time %}<span>{{ pc.receive_time.strftime('%Y-%m-%d') }}</span>{% endif %} {% if pc.receive_time %}<span>{{ pc.receive_time.strftime('%Y-%m-%d') }}</span>{% endif %}
@@ -123,7 +123,7 @@
<img src="{{ pc.image_front }}" alt="" class="showcase-card-img" loading="lazy"> <img src="{{ pc.image_front }}" alt="" class="showcase-card-img" loading="lazy">
<div class="showcase-card-body"> <div class="showcase-card-body">
<div class="showcase-card-meta"> <div class="showcase-card-meta">
{% if pc.country_from and pc.country %}<span>{{ pc.country_from|flag }}{{ pc.country|flag }}</span> {% if pc.country_from and pc.country %}<span>{{ pc.country_from|flag }} {{ pc.country_from }} → {{ pc.country|flag }} {{ pc.country }}</span>
{% elif pc.country %}<span>{{ pc.country|flag }}</span> {% elif pc.country %}<span>{{ pc.country|flag }}</span>
{% endif %} {% endif %}
{% if pc.receive_time %}<span>{{ pc.receive_time.strftime('%Y-%m-%d') }}</span>{% endif %} {% if pc.receive_time %}<span>{{ pc.receive_time.strftime('%Y-%m-%d') }}</span>{% endif %}
@@ -169,7 +169,7 @@ function _appendCard(c, gridId) {
div.setAttribute('data-front', c.image_front); div.setAttribute('data-front', c.image_front);
div.onclick = function() { openLightbox(div); }; div.onclick = function() { openLightbox(div); };
var countryHtml = ''; var countryHtml = '';
if (c.country_from && c.country) countryHtml = '<span>' + _flag(c.country_from) + '' + _flag(c.country) + '</span>'; if (c.country_from && c.country) countryHtml = '<span>' + _flag(c.country_from) + ' ' + c.country_from + ' → ' + _flag(c.country) + ' ' + c.country + '</span>';
else if (c.country) countryHtml = '<span>' + _flag(c.country) + '</span>'; else if (c.country) countryHtml = '<span>' + _flag(c.country) + '</span>';
div.innerHTML = '<img src="' + c.image_front + '" alt="" class="showcase-card-img" loading="lazy">' + div.innerHTML = '<img src="' + c.image_front + '" alt="" class="showcase-card-img" loading="lazy">' +
'<div class="showcase-card-body"><div class="showcase-card-meta">' + countryHtml + '</div></div>'; '<div class="showcase-card-body"><div class="showcase-card-meta">' + countryHtml + '</div></div>';