Skip to content
Open
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
5 changes: 5 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Set up NodeJS
uses: actions/setup-node@v3
with:
node-version: 16.16.0

- name: Set up JDK
uses: actions/setup-java@v1
with:
Expand Down
11 changes: 8 additions & 3 deletions ore/app/views/home.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,18 @@

@import controllers.sugar.Requests.OreRequest
@import ore.OreConfig
@import ore.Sponsor
@()(implicit messages: Messages, flash: Flash, request: OreRequest[_], config: OreConfig, assetsFinder: AssetsFinder)

@randomSponsor = @{
val logos = config.sponge.sponsors
val sponsors = config.sponge.sponsors

val index = new Random().nextInt(logos.size)
logos(index)
val totalWeight = sponsors.map(_.weight).sum
var randomNumber = Random.nextInt(totalWeight)

sponsors.find { sponsor =>
randomNumber < sponsor.weight || { randomNumber -= sponsor.weight; false }
}.getOrElse(sponsors.last)
}

@scripts = {
Expand Down
2 changes: 1 addition & 1 deletion ore/conf/messages
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ general.docs = Docs
general.javadocs = Javadocs
general.plugins = Plugins
general.getsponge = Downloads
general.irc = Chat
general.discord = Discord
general.edit = Edit
general.cancel = Cancel
general.save = Save
Expand Down
33 changes: 19 additions & 14 deletions ore/conf/ore-default-settings.conf
Original file line number Diff line number Diff line change
Expand Up @@ -235,29 +235,34 @@ sponge {
# Sponsors from high to low donation amounts
sponsors = [
{
"name": "Apex Hosting",
"image": "images/sponsors/apexhosting.png",
"link": "https://apexminecrafthosting.com/"
"name": "ScalaCube",
"image": "images/sponsors/scalacube.svg",
"link": "https://scalacube.com/p/_hosting_server_minecraft/sponsored/spongepowered",
"weight": 30
},
{
"name": "CreeperHost",
"image": "images/sponsors/creeperhost.svg",
"link": "https://billing.creeperhost.net/link.php?id=8"
"name": "BisectHosting",
"image": "images/sponsors/bisecthosting.svg",
"link": "https://bisecthosting.com/sponge",
"weight": 20
},
{
"name": "Shockbyte",
"image":"images/sponsors/shockbyte.png",
"link": "https://shockbyte.com/",
"weight": 10
},
{
"name": "JetBrains",
"image": "images/sponsors/jetbrains.svg",
"link": "https://www.jetbrains.com/"
"link": "https://www.jetbrains.com/",
"weight": 1
},
{
"name": "YourKit",
"image": "images/sponsors/yourkit.png",
"link": "https://www.yourkit.com/"
},
{
"name": "Minecraft Index",
"image": "images/sponsors/minecraftindex.svg",
"link": "https://minecraftindex.net/"
},
"link": "https://www.yourkit.com/",
"weight": 1
}
]
}
Binary file removed ore/public/images/sponsors/apexhosting.png
Binary file not shown.
1 change: 1 addition & 0 deletions ore/public/images/sponsors/bisecthosting.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion ore/public/images/sponsors/creeperhost.svg

This file was deleted.

Loading