countries: append alias target in flag mode
[sheet.git] / countries.plp
index 3979501664c9c03c050d6b7b37fd9ecf23ed0611..61a4795a688333b3b872e50153e36c929be43b70 100644 (file)
@@ -2,7 +2,7 @@
 
 Html({
        title => 'country code cheat sheet',
-       version => 'v1.0',
+       version => 'v1.1',
        description =>
                "Table of ISO-3166-1 country codes with the names of reserved territories.",
        keywords => [qw'country code cc tld cctld continent territory land table'],
@@ -33,15 +33,15 @@ my $cc = do 'countries.inc.pl';
                                next;
                        };
                        my ($name, $class, $short, $ref) = @$country;
+                       $name .= " → $ref" if $ref;
                        $ref ||= $code;
                        local $_ = $ref;
                        if (exists $get{show}) {
-                               my $img = "flag/$ref.png";
+                               my $img = "data/flag/$ref.png";
                                $_ = sprintf '<img src="/%s" alt="%s">', $img, $ref if -e $img;
                        }
                        else {
                                $_ = EscapeHTML($short || $name);
-                               $name .= " → $ref" if $ref and $ref ne $code;
                        }
                        printf "\n".'<td class="%s" title="%s">%s',
                                $_ ? 'X '.$class : '', EscapeHTML("$code: $name"), $_;