Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add UI to assign tourney winner #353

Merged
merged 1 commit into from
Jul 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion lib/teiserver/account/libs/role_lib.ex
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ defmodule Teiserver.Account.RoleLib do
icon: "fa-solid fa-check",
contains: ~w()
},
%{
name: "Tournament winner",
colour: "#AA8833",
icon: "fa-solid fa-trophy",
contains: ~w()
},

# Community team
%{
Expand Down Expand Up @@ -250,7 +256,7 @@ defmodule Teiserver.Account.RoleLib do

@spec property_roles :: [String.t()]
def property_roles() do
["Trusted", "BAR+", "Verified", "Streamer"]
["Trusted", "BAR+", "Verified", "Streamer", "Tournament winner"]
end

@spec allowed_role_management(String.t()) :: [String.t()]
Expand Down
1 change: 1 addition & 0 deletions lib/teiserver/data/cache_user.ex
Original file line number Diff line number Diff line change
Expand Up @@ -1311,6 +1311,7 @@ defmodule Teiserver.CacheUser do
ingame_hours = rank_time(userid)

cond do
has_any_role?(userid, ["Tournament winner"]) -> 7
has_any_role?(userid, ~w(Core Contributor)) -> 6
ingame_hours > 1000 -> 5
ingame_hours > 250 -> 4
Expand Down
Loading