Post Badges

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.

5개의 좋아요

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

1개의 좋아요

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
3개의 좋아요

Ahh that’s my issue thanks man :smiley:

3개의 좋아요

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.

3개의 좋아요

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

4개의 좋아요

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개의 좋아요

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)

8개의 좋아요

Yep. Older version. Thanks.

4개의 좋아요

Thank you for your support. Now everything is perfect.

:smiling_face_with_three_hearts::smiling_face_with_three_hearts:

3개의 좋아요

Topic List Preview 플러그인의 새 포트폴리오 기능을 사용 중이며, 포트폴리오 아이콘이 배지 페이지 대신 사용자 프로필로 연결되도록 Topic Badge 코드를 수정했습니다:

        if(badge.url) {
            // Bart 오버라이드
            if(badge.name == 'portfolio' ) {
                username = badge.url.substring(badge.url.lastIndexOf('=') + 1);
                user_portfolio_url = '/u/' + username + '/activity/portfolio';
                iconBody = dec.h("a", { attributes: { href: user_portfolio_url } }, iconBody);
            } else {
              iconBody = dec.h("a", { attributes: { href: badge.url } }, iconBody);
            }
            // Bart 오버라이드 종료
        }

이 코드는 컴포넌트가 업데이트되면 사라질 것임을 알고 있습니다. 따라서 이보다 더 나은 방법이 있는지 궁금합니다. 예를 들어, buildBadge 함수를 어떻게든 오버라이드할 수 있을까요?

배경 정보: 우리는 실제로 포트폴리오가 있는 사용자, 즉 Artwork 카테고리에 최소 한 개의 토픽을 생성한 사용자에게만 이 아이콘을 표시하기를 원합니다. 이는 배지 쿼리를 통해 쉽게 수행할 수 있으며, 이미 사이트에 Post Badges 컴포넌트를 사용 중이므로 합리적인 접근 방식이라고 생각했습니다.

4개의 좋아요

제목/이름이 여전히 작동하도록 별도의 영역을 추가할 수 있을까요?

현재 정확히 어떤 부분이 작동하지 않나요?

제 데스크톱과 휴대폰에서는 여전히 사용자 이름, 이름, 직함 및 배지를 확인할 수 있습니다.

2개의 좋아요

아니, 다행이네. 방금 테마 제작자 사이트를 확인해봤는데, 그렇지 않은 것 같더라고.

수고하고, 좋은 크리스마스 보내!

1개의 좋아요

음, 제가 좀 어리석게 행동하고 있는 것 같습니다. 몇 가지를 시도해 보았는데, 생성 버튼을 눌러야 했고, 검색 시에는 나타나지 않았습니다.

그 후 리더(Leader)는 표시되지만, 로코모티브 브레스(locomotive breath)는 표시되지 않습니다.

image

제가 '충분히 읽지 않는 증후군’에 시달리고 있는 건가요?

또한, 표시를 원하지 않는 개인에게서 이를 제거할 수 있나요?

그리고,

이것은 URL을 표시합니다.

다른 하나는 제목을 표시합니다.

image

배지 검색이 안 되는 특정 문제의 경우, 그렇습니다. 그것은 제가 몇 포스트 전에 언급한 UI의 알려진 문제입니다.

2개의 좋아요

그걸 위한 배지가 필요해요 :pensive:

2개의 좋아요

신뢰 수준 배지가 URL을 표시하는 것을 확인했습니다. 이것이 원인일 수 있습니다.

설명만 있는 배지는 정상적으로 표시됩니다.

2개의 좋아요

@bartv, 가까운 시일 내에 이 컴포넌트에 대한 개선/리팩토링을 진행하는 것이 좋겠습니다. 오버라이드를 별도의 테마 컴포넌트로 처리할 수 있도록 구조를 재편성하는 방법에 대해 살펴보겠습니다. 언제 진행할지는 아직 정확히 알 수 없지만, 소식이 있을 때 이 토픽을 반드시 업데이트하겠습니다.


현재는 불가능하지만, 다음에 이 컴포넌트를 작업할 때 이 부분을 염두에 두겠습니다.


맞습니다. 아래를 참고하세요:

이 컴포넌트를 업데이트하는 작업을 진행할 때, 이 문제에 대해 더 우아한 해결책을 찾아보겠습니다.

7개의 좋아요