Skip to content

Commit

Permalink
Remove invitations badge (#10000)
Browse files Browse the repository at this point in the history
* Remove invites badge

* Implement review recommendations

Co-authored-by: Alexandru Emil Lupu <contact@alecslupu.ro>
  • Loading branch information
andreslucena and alecslupu committed Nov 3, 2022
1 parent fadd565 commit 788f402
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ def accept_resource
resource.update!(newsletter_notifications_at: Time.current) if update_resource_params[:newsletter_notifications]
resource.update!(managed: false) if resource.managed?
resource.update!(accepted_tos_version: resource.organization.tos_version)
Decidim::Gamification.increment_score(resource.invited_by, :invitations) if resource.invited_by
end

resource
Expand Down

This file was deleted.

12 changes: 0 additions & 12 deletions decidim-core/config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -869,18 +869,6 @@ en:
how: How can you earn it
page_description: Badges are recognitions to participant actions and progress in the platform. As you start discovering, participating and interacting in the platform, you will earn different badges. Here is the list of badges and some ways you can earn them.
title: Badges
invitations:
conditions:
- Use the “invite friends” link on your user page to invite your friends
- Customize, if you want, the message you are sending
- You’ll level up by sending invitations and getting them registered.
description: This badge is granted when you’ve invited some people and they have spend a little time to register in %{organization_name} and become participants. Thank you for making %{organization_name} known to others and helping to expand the community!
description_another: This participant has invited %{score} people.
description_own: You have invited %{score} people.
name: Invitations
next_level_in: Invite %{score} more people to reach the next level!
unearned_another: This participant has not yet invited anyone.
unearned_own: You haven't invited anyone yet.
description: Badges are recognitions to participant actions and progress in the platform. As you start discovering, participating and interacting in the platform, you will earn different badges.
level: Level %{level}
reached_top: You've reached the top level for this badge.
Expand Down
5 changes: 0 additions & 5 deletions decidim-core/lib/decidim/core/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -549,11 +549,6 @@ class Engine < ::Rails::Engine
end

initializer "decidim.core.add_badges" do
Decidim::Gamification.register_badge(:invitations) do |badge|
badge.levels = [1, 5, 10, 30, 50]
badge.reset = ->(user) { Decidim::User.where(invited_by: user.id).count }
end

Decidim::Gamification.register_badge(:followers) do |badge|
badge.levels = [1, 15, 30, 60, 100]
badge.reset = ->(user) { user.followers.count }
Expand Down

0 comments on commit 788f402

Please sign in to comment.