National Flags - Display user nationality in Discourse

Yep, it’s fixed :+1:

Really great to see the improvements made here, everyone.
Really awesome!

Click on mobile? Where is this again?

You’re close! Click Edit CSS/HTML, editing the mobile styling is one of the tabs in there.

4 Likes

Jeff Thanks for updating did you find it Dylan?

Is it possible to use that plugin with other images except flags?

Solution: It is possible to edit flaglist.js.es6 file

{
      "name": "fo",
      "value": "fo.png"
    }

How you can add string variables? What is the user-inputted location?

Solution: I forked plugin repo and customize for my purpose. It seems work.

With that fix, the flag is displayed to the left of the user’s name. How do I move it to the right of the name?

2 Likes

I was added “url” to that component in flaglist.js.es6 file:

{
      "name": "name",
      "value": "name.png",
      "url": "name-link"
    }

How can I print the URL value in show-user-card.hbs?

{{model.custom_fields.nationalflag_iso.url}}

Nice plugin indeed!

I have problem, when i go to user options, and select flag…click SAVE, when i refresh it wont save it it goes back to default.

Any clue why? :slight_smile:

p.s. i did full system and discourse backup this morning, could that be the problem?

Thanks

This was caused by a recent change in Discourse. It will require a small change to the plugin to fix the problem.

@Ebs I have made a pull request on your repository with the change: https://github.com/Ebsy/discourse-nationalflags/pull/3

4 Likes

Thank you i was confused :slight_smile: @david

Merged. Thanks a lot!

3 Likes

Problem solved, i can save national flag now!

Thanks @david and @Ebs

Small issue regarding style/alignment with the mobile view of discourse. The national flag seems to be stretched vertically and is aligned above the username. Would it be possible to move the alignment of the icon to the right of the username/title (to coincide with the respective placement on the desktop view) and fix the distortion?

Desktop:

Mobile:

Please note that the only thing that was done was clicking on the view toggle link in the hamburger menu.

1 Like

I second this. Please help, looks ugly on mobile…

Thought it was about time I fixed it :smiley:
Just updated the plugin. flag is now after the username on mobile (and not stretched anymore) :+1:

3 Likes

Hey Neil @Ebs,

As discussed, have submitted PR to add a few extras for your great plugin!

https://github.com/Ebsy/discourse-nationalflags/pull/4

Sneak peak:

Natural language descriptions and search

replacing codes - these are still used by the code, btw, but hidden:

image :arrow_right: image

Custom Wizard plugin support

If you use both plugins, you will be able include a flag update step in your Wizard, e.g. for new or existing users to complete their profile

Some things to consider

There are a handful of descriptions for the non-standard codes that need to be amended in the .yml file. I’ve left this to you as you know what each one means :).

The structure is now there for Localisation text for additional languages other than English to be added.

Let me know if you have any comments.

Let me know when you have merged as will need to release a new Custom Wizard update shortly afterwards.

@angus

7 Likes

FYI I’ve pushed a small update to improve the code (thanks for suggestions @angus)

https://github.com/Ebsy/discourse-nationalflags/commit/ecfb34d29a9d3d1536a7f60bb3055809968372ac

4 Likes

Thanks for merging @Ebs.

@Vikas_Dangi the drop down uses descriptions now.

3 Likes