Post Badges component

Ok thanks! This all looks ok so far. A couple more things to confirm:

  • Have you done a “hard refresh” of the page after adding the component?
  • Can you add a screenshot of the theme settings for the Post Badges component? This should rule out any errors in the badge names and such.
3 Likes

Yes I have I even tried a new browser completed Launcher reset and its not showing the default ones

See Editor a Default Badge

1 Like

Ah ok. I see what it is. You need to capitalize the badge name. I did make a note with the setting to enter the badge name as it appears on the badge page, but this is an easy mistake to make and should be easy enough to prevent it from being quite so sensitive. I’ll remember to work on this and the non-English locale support mentioned a few posts up the next time I get an opportunity to work on this component.

2 Likes

Even with the Capital it doesnt show

1 Like

You need to select “Create” and then click the green checkmark that displays to the right of the setting. It doesn’t have a list of badges built-in, you are just creating an entry for a specific badge that you want displayed.

3 Likes

Ahh ok thats my mistake thanks :slight_smile: It Did Work

2 Likes

One more thing One of the Badges isnt showing its showing the popup text and I see in the Badge it Shows
BADGE:
53%20AM

BADGE SETTINGS

On Display
WHERE THAT BLANK SPOT IS SHOULD BE THE BADGE
50%20AM

2 Likes

I can repro that with the css3 font awesome icon. I’ll do some digging and get back to you when I’ve figured out what’s going on.

2 Likes

Thanks Ill try some other ones I added it to my groups for now thanks :smiley:

2 Likes

More I have issues with

fab fa-linode
fas fa-laptop-code
fas fa-pencil-ruler
1 Like

Ok, I just pushed an update that should fix the icons that weren’t working. I specifically checked it against all three of those icons and they work now. I also made the badge names case-insensitive while I was digging into the code.


Locale support will be #1 priority next time I get a chance to look at this.

3 Likes

Hmm still not showing for me I removed and re added I ended up deploying a new instance with bigger specs

How are the icons added to your badges?

You need to prefix any fab and far icons. You can just use the name for the fas icons. The three you listed should be:

fab-linode
laptop-code
pencil-ruler
2 Likes

Ahh that’s my issue thanks man :smiley:

2 Likes

Hi Taylor,

I enjoyed your theme and used it on my forum.

I have a small problem, which is when watching on the phone, the badge is on the left of the username.

I want to transfer the badge to the right of the username. Can you help me do this?

I am very grateful for what you have contributed to the community.

2 Likes

Thanks for reporting that @Phạm_Quốc_Thiện! It should be all fixed up if you update the component.

3 Likes

This was very confusing to me, because it implies it is searching the list of site badges and not finding it. Tried a hard refresh to get it to find my new badges, etc. Glad it works, but maybe the UI can be changed to make it just a plain text box, rather than doing that non-functional search? I think that would make it less confusing to use.

Thanks for the awesome theme component.

2 Likes

Is it normal to get a “These local changes will be erased by the update. Are you sure you want to continue?” message when updating a theme component? I’m 99.9% sure I haven’t made any changes, and the git commit info looks like it is stuff related to the update, not to local changes:

diff --git a/discourse-post-badges/about.json b/discourse-post-badges/about.json
new file mode 100644
index 0000000..eb86c4b
--- /dev/null
+++ b/discourse-post-badges/about.json
@@ -0,0 +1,15 @@
+{
+  "name": "Post Badges",
+  "component": true,
+  "license_url": "https://github.com/tshenry/discourse-post-badges/blob/master/LICENSE",
+  "about_url": "https://meta.discourse.org/t/post-badges-component/114722",
+  "authors": null,
+  "theme_version": null,
+  "minimum_discourse_version": null,
+  "maximum_discourse_version": null,
+  "assets": {
+  },
+  "color_schemes": {
+  },
+  "learn_more": "https://meta.discourse.org/t/beginners-guide-to-using-discourse-themes/91966"
+}
\ No newline at end of file
diff --git a/common/common.scss b/discourse-post-badges/common/common.scss
similarity index 100%
rename from common/common.scss
rename to discourse-post-badges/common/common.scss
diff --git a/common/head_tag.html b/discourse-post-badges/common/head_tag.html
similarity index 100%
rename from common/head_tag.html
rename to discourse-post-badges/common/head_tag.html
diff --git a/discourse-post-badges/settings.yml b/discourse-post-badges/settings.yml
new file mode 100644
index 0000000..7e7e250
--- /dev/null
+++ b/discourse-post-badges/settings.yml
@@ -0,0 +1,21 @@
+badges:
+  type: list
+  default: ""
+  description:
+    en: 'Use the name of the badge as it appears on the
+      <a href="/admin/badges">list of badges</a>.
+      Post badges will appear in the order they are
+      added to this setting.'
+badge_link_destination:
+  type: enum
+  default: "user's badge page"
+  choices:
+    - "badge overview page"
+  description:
+    en: "Where a user will be taken when they click on a post badge."
+only_show_highest_trust_level:
+  type: bool
+  default: false
+  description:
+    en: "When including trust level badges (Basic, Member, Regular, Leader),
+      only show the highest trust level a user has earned."

Edited to add: I ran the update and it works fine. So…

The theme setting UI is common to core Discourse, so I can’t do anything to improve that setting in the component itself. It’s definitely something I’d like to see become a little more intuitive, or perhaps even have the ability to dynamically populate a searchable list at some point.

As for the local changes notice, I don’t think it should be warning you unless you have modified something using the Edit CSS/HTML button. Are you on an older version of Discourse? I believe that behavior should have been fixed in FIX: copy local theme changes to correct temp folder when diffing upd… · discourse/discourse@5cf5e73 · GitHub (cc @pmusaraj)

4 Likes

Yep. Older version. Thanks.

3 Likes