# Improved badge granting workflow

**URL:** https://meta.discourse.org/t/improved-badge-granting-workflow/58631
**Category:** Feature
**Tags:** badges, completed
**Created:** [2017年三月8日 12:19 UTC](https://meta.discourse.org/t/improved-badge-granting-workflow/58631 "2017-03-08T12:19:07Z")
**Posts on this page:** 12
**Page:** 2

<div class="post-metadata">

### Author: ![mauditecandela](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mauditecandela/32/120653_2.png) [@mauditecandela](https://meta.discourse.org/u/mauditecandela)
#### Post date: [2017年十月6日 09:43 UTC](https://meta.discourse.org/t/improved-badge-granting-workflow/58631/21 "2017-10-06T09:43:39Z")

</div>

Hi everyone 🙂 I forked the repository and did some commits as I think it could be easier then to comment. I would appreciate some guidance before I get more lost 🙂 You can see my commits here:

[https://github.com/mauditecandela/discourse/commit/c8155861ad33269eb14abb52436bfeef54c25def](https://github.com/mauditecandela/discourse/commit/c8155861ad33269eb14abb52436bfeef54c25def)

- I created a select button in the tanner menu (post-admin-menu) as UX for the feature.
- This button renders a modal that should show the grantable Badges and add the url of the post automatically as a reason. As you can see I was able to pass the object of the selected post, but I don’t know how to read its attributes (this is my first ember project), in order to get the url. Is there any easy solution? Any suggestions?
- Also I would like to be able to read all the grantableBadges for the user. I don’t know if I should directly call them from the grant-badges controller or import them from somewhere else as I did with the selectedPost. What do you think? Any ideas?

Any other feedback is also welcome. Thanks in advance!

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [2017年十一月13日 05:25 UTC](https://meta.discourse.org/t/improved-badge-granting-workflow/58631/23 "2017-11-13T05:25:35Z")

</div>

@mauditecandela I am sorry for the almost infinite delay here, where is this change at now? Are you still going to give it a shot?

---

<div class="post-metadata">

### Author: ![mikechristopher](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mikechristopher/32/89135_2.png) [@mikechristopher](https://meta.discourse.org/u/mikechristopher)
#### Post date: [2017年十二月2日 10:56 UTC](https://meta.discourse.org/t/improved-badge-granting-workflow/58631/25 "2017-12-02T10:56:12Z")

</div>

I was just wondering the same as this would be such an immense time saver for us in granting custom badges 🙂

---

<div class="post-metadata">

### Author: ![xrav3nz](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/xrav3nz/32/76894_2.png) [@xrav3nz](https://meta.discourse.org/u/xrav3nz)
#### Post date: [2018年一月13日 23:31 UTC](https://meta.discourse.org/t/improved-badge-granting-workflow/58631/26 "2018-01-13T23:31:08Z")

</div>

😉

[https://github.com/discourse/discourse/pull/5498](https://github.com/discourse/discourse/pull/5498)

* * *

The changes align with the discussion in this topic

A new Grant Badge option is added to the post admin wrench

 ![post_admin_wrench](https://global.discourse-cdn.com/meta/original/3X/4/2/428f1d9255506f0496391ff4b8d7776f2d394b9c.png)

It opens up a modal for the admin to choose a specific badge to be granted to the user.

The “badge reason” is not shown on purpose and automatically attributed to the post from which the “grant badge” action is triggered. I’ve also considered showing a readonly “badge reason” input box, but the current approach seems cleaner.

 ![grant_badge_modal](https://global.discourse-cdn.com/meta/original/3X/7/a/7a6089413c51176b8ae61c8fab994ea3a46423a0.png)

 ![successfully_granted](https://global.discourse-cdn.com/meta/original/3X/e/f/ef9b51c59f571f36d9a5d8632af09d63852f369a.png)

 ![grant_failed](https://global.discourse-cdn.com/meta/original/3X/3/c/3cb998193898520410631e4178564af9ced51549.png)

* * *

Let me know what you think; open to suggestions!

---

<div class="post-metadata">

### Author: ![ChrisBeach](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/chrisbeach/32/214628_2.png) [@ChrisBeach](https://meta.discourse.org/u/ChrisBeach)
#### Post date: [2018年一月13日 23:36 UTC](https://meta.discourse.org/t/improved-badge-granting-workflow/58631/27 "2018-01-13T23:36:04Z")

</div>

> [@xrav3nz](#):
>
> Let me know what you think; open to suggestions!

Looks great! Thanks so much for coding this up. I hope it makes it into the codebase soon.

One minor point - would it be possible to exclude the badges such as “First Mention,” which are normally granted automatically as opposed to manually?

Also, if possible, order the badge list by the count of manual grants for each badge (most commonly-granted badges at the top of the list)?

---

<div class="post-metadata">

### Author: ![xrav3nz](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/xrav3nz/32/76894_2.png) [@xrav3nz](https://meta.discourse.org/u/xrav3nz)
#### Post date: [2018年一月14日 01:03 UTC](https://meta.discourse.org/t/improved-badge-granting-workflow/58631/29 "2018-01-14T01:03:31Z")

</div>

> would it be possible to exclude the badges such as “First Mention,” which are normally granted automatically as opposed to manually?

I thought of this before, but eventually decided to include all badges (same behavior as the admin page), since having less to choose from may be more problematic.

> if possible, order the badge list by the count of manual grants for each badge

I can totally see this being helpful to granting certain badges manually repeatedly. (On a technical note, I think we will need an additional database column and an index.) In the worst case that this does not happen, the dropdown is completely filterable.

* * *

What do you think @sam?

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [2018年一月14日 21:01 UTC](https://meta.discourse.org/t/improved-badge-granting-workflow/58631/30 "2018-01-14T21:01:24Z")

</div>

> [@xrav3nz](#):
>
> I thought of this before, but eventually decided to include all badges (same behavior as the admin page), since having less to choose from may be more problematic.

I think we got to remove all the “automatically granted badges” from both places. The trouble with including them is that the schedule will kick in and remove the badge later on.

I would not muck with ordering though for now, seems complicated.

---

<div class="post-metadata">

### Author: ![mikechristopher](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mikechristopher/32/89135_2.png) [@mikechristopher](https://meta.discourse.org/u/mikechristopher)
#### Post date: [2018年一月15日 09:39 UTC](https://meta.discourse.org/t/improved-badge-granting-workflow/58631/31 "2018-01-15T09:39:26Z")

</div>

This is one piece of work we have been hoping someone would pick up as will save us so much time - thank you @xrav3nz for putting this together!

---

<div class="post-metadata">

### Author: ![ChrisBeach](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/chrisbeach/32/214628_2.png) [@ChrisBeach](https://meta.discourse.org/u/ChrisBeach)
#### Post date: [2018年一月23日 21:58 UTC](https://meta.discourse.org/t/improved-badge-granting-workflow/58631/32 "2018-01-23T21:58:06Z")

</div>

Works very nicely, thank you @xrav3nz 👍

One request - could this feature be enabled for moderators? It seems only admins can do it at the moment.

---

<div class="post-metadata">

### Author: ![xrav3nz](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/xrav3nz/32/76894_2.png) [@xrav3nz](https://meta.discourse.org/u/xrav3nz)
#### Post date: [2018年一月23日 22:28 UTC](https://meta.discourse.org/t/improved-badge-granting-workflow/58631/33 "2018-01-23T22:28:04Z")

</div>

Good to hear! 🙂

I think you’re right that it should be enabled for moderators too (my bad). I’ll open a PR later to correct it unless someone in the team beats me to it.

* * *

EDIT: here’s the two-line PR

[https://github.com/discourse/discourse/pull/5522](https://github.com/discourse/discourse/pull/5522)

---

<div class="post-metadata">

### Author: ![erlend\_sh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/erlend_sh/32/119475_2.png) [@erlend\_sh](https://meta.discourse.org/u/erlend_sh)
#### Post date: [2018年二月5日 08:11 UTC](https://meta.discourse.org/t/improved-badge-granting-workflow/58631/34 "2018-02-05T08:11:44Z")

</div>

A post was split to a new topic: [Display granted badge underneath post](https://meta.discourse.org/t/display-granted-badge-underneath-post/79799)

---

<div class="post-metadata">

### Author: ![erlend\_sh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/erlend_sh/32/119475_2.png) [@erlend\_sh](https://meta.discourse.org/u/erlend_sh)
#### Post date: [2018年二月5日 08:11 UTC](https://meta.discourse.org/t/improved-badge-granting-workflow/58631/35 "2018-02-05T08:11:54Z")

</div>



[上一頁](https://meta.discourse.org/t/improved-badge-granting-workflow/58631.md?page=1)
