From 851c418a0ed6fb3b272177c57b1bf60a2168a317 Mon Sep 17 00:00:00 2001 From: Philip Helger Date: Wed, 17 Jul 2019 18:29:30 +0200 Subject: [PATCH] Country icon in viewing as well --- .../smp/ui/secure/PageSecureBusinessCard.java | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/phoss-smp-webapp/src/main/java/com/helger/phoss/smp/ui/secure/PageSecureBusinessCard.java b/phoss-smp-webapp/src/main/java/com/helger/phoss/smp/ui/secure/PageSecureBusinessCard.java index 013711108..896215633 100644 --- a/phoss-smp-webapp/src/main/java/com/helger/phoss/smp/ui/secure/PageSecureBusinessCard.java +++ b/phoss-smp-webapp/src/main/java/com/helger/phoss/smp/ui/secure/PageSecureBusinessCard.java @@ -318,13 +318,19 @@ protected void showSelectedObject (@Nonnull final WebPageExecutionContext aWPEC, aForm2.addFormGroup (new BootstrapFormGroup ().setLabel ("Name") .setCtrl (aEntity.names ().getFirst ().getName ())); - aForm2.addFormGroup (new BootstrapFormGroup ().setLabel ("Country code") - .setCtrl (CountryCache.getInstance () - .getCountry (aEntity.getCountryCode ()) - .getDisplayCountry (aDisplayLocale) + - " [" + - aEntity.getCountryCode () + - "]")); + + { + final Locale aCountry = CountryCache.getInstance ().getCountry (aEntity.getCountryCode ()); + final HCNodeList aCtrl = new HCNodeList (); + final EFamFamFlagIcon eIcon = EFamFamFlagIcon.getFromIDOrNull (aCountry.getCountry ()); + if (eIcon != null) + { + aCtrl.addChild (eIcon.getAsNode ()); + aCtrl.addChild (" "); + } + aCtrl.addChild (aCountry.getDisplayCountry (aDisplayLocale) + " [" + aEntity.getCountryCode () + "]"); + aForm2.addFormGroup (new BootstrapFormGroup ().setLabel ("Country code").setCtrl (aCtrl)); + } if (aEntity.hasGeographicalInformation ()) { aForm2.addFormGroup (new BootstrapFormGroup ().setLabel ("Geographical information")