diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b2464ef66..017c6a5f2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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: diff --git a/ore/app/views/home.scala.html b/ore/app/views/home.scala.html index c228cb98b..b1ec7a8b6 100644 --- a/ore/app/views/home.scala.html +++ b/ore/app/views/home.scala.html @@ -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 = { diff --git a/ore/conf/messages b/ore/conf/messages index 9b37f3cfb..dc7d40b93 100644 --- a/ore/conf/messages +++ b/ore/conf/messages @@ -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 diff --git a/ore/conf/ore-default-settings.conf b/ore/conf/ore-default-settings.conf index ffed70b99..046661468 100644 --- a/ore/conf/ore-default-settings.conf +++ b/ore/conf/ore-default-settings.conf @@ -234,30 +234,47 @@ sponge { # Sponsors from high to low donation amounts sponsors = [ + { + "name": "BisectHosting", + "image": "images/sponsors/bisecthosting.svg", + "link": "https://bisecthosting.com/sponge", + "weight": 37 + }, { "name": "Apex Hosting", "image": "images/sponsors/apexhosting.png", - "link": "https://apexminecrafthosting.com/" + "link": "https://apexminecrafthosting.com/", + "weight": 27 + }, + { + "name": "Minecraft Index", + "image": "images/sponsors/minecraftindex.svg", + "link": "https://minecraftindex.net/", + "weight": 17 + }, + { + "name": "Shockbyte", + "image":"images/sponsors/shockbyte.png", + "link": "https://shockbyte.com/", + "weight": 10 }, { "name": "CreeperHost", "image": "images/sponsors/creeperhost.svg", - "link": "https://billing.creeperhost.net/link.php?id=8" + "link": "https://billing.creeperhost.net/link.php?id=8", + "weight": 1 }, { "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 + } ] } diff --git a/ore/public/images/sponsors/bisecthosting.svg b/ore/public/images/sponsors/bisecthosting.svg new file mode 100644 index 000000000..a842a668d --- /dev/null +++ b/ore/public/images/sponsors/bisecthosting.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/ore/public/images/sponsors/shockbyte.png b/ore/public/images/sponsors/shockbyte.png new file mode 100644 index 000000000..d1fbb895b Binary files /dev/null and b/ore/public/images/sponsors/shockbyte.png differ diff --git a/oreClient/src/main/resources/assets/entries/font-awesome.js b/oreClient/src/main/resources/assets/entries/font-awesome.js index bb2eb8772..88a855838 100644 --- a/oreClient/src/main/resources/assets/entries/font-awesome.js +++ b/oreClient/src/main/resources/assets/entries/font-awesome.js @@ -14,6 +14,8 @@ import { faSadTear, faCheckCircle as farCheckCircle, faClock } from '@fortawesome/free-regular-svg-icons' +import { faDiscord } from '@fortawesome/free-brands-svg-icons' + config.autoAddCss = false; library.add(fasStar, fasGem, faEye, faDownload, faServer, faComment, faWrench, faMoneyBillAlt, faPuzzlePiece, faGamepad, @@ -23,6 +25,6 @@ library.add(fasStar, fasGem, faEye, faDownload, faServer, faComment, faWrench, f faCheck, faReply, faSave, faTimes, faPencilAlt, faArrowLeft, faCog, faPlayCircle, faEdit, faKey, faCalendar, faFile, faUpload, faPaperPlane, faPlusSquare, faSearch, farStar, faExternalLinkAlt, faMinusSquare, faBug, faFileArchive, faTerminal, faStopCircle, faClipboard, faWindowClose, faSadTear, faUnlockAlt, farGem, faLink, farCheckCircle, faClock, - faInfo, fasCheckCircle, faTimesCircle, faEyeSlash, faUserTag); + faInfo, fasCheckCircle, faTimesCircle, faEyeSlash, faUserTag, faDiscord); dom.watch(); diff --git a/oreClient/yarn.lock b/oreClient/yarn.lock index 1fa10fb59..2bcf766c3 100644 --- a/oreClient/yarn.lock +++ b/oreClient/yarn.lock @@ -1102,38 +1102,38 @@ lodash "^4.17.13" to-fast-properties "^2.0.0" -"@fortawesome/fontawesome-common-types@6.1.1": - version "6.1.1" - resolved "https://registry.yarnpkg.com/@fortawesome/fontawesome-common-types/-/fontawesome-common-types-6.1.1.tgz#7dc996042d21fc1ae850e3173b5c67b0549f9105" - integrity sha512-wVn5WJPirFTnzN6tR95abCx+ocH+3IFLXAgyavnf9hUmN0CfWoDjPT/BAWsUVwSlYYVBeCLJxaqi7ZGe4uSjBA== +"@fortawesome/fontawesome-common-types@6.4.0": + version "6.4.0" + resolved "https://registry.yarnpkg.com/@fortawesome/fontawesome-common-types/-/fontawesome-common-types-6.4.0.tgz#88da2b70d6ca18aaa6ed3687832e11f39e80624b" + integrity sha512-HNii132xfomg5QVZw0HwXXpN22s7VBHQBv9CeOu9tfJnhsWQNd2lmTNi8CSrnw5B+5YOmzu1UoPAyxaXsJ6RgQ== -"@fortawesome/fontawesome-svg-core@6.1.1": - version "6.1.1" - resolved "https://registry.yarnpkg.com/@fortawesome/fontawesome-svg-core/-/fontawesome-svg-core-6.1.1.tgz#3424ec6182515951816be9b11665d67efdce5b5f" - integrity sha512-NCg0w2YIp81f4V6cMGD9iomfsIj7GWrqmsa0ZsPh59G7PKiGN1KymZNxmF00ssuAlo/VZmpK6xazsGOwzKYUMg== +"@fortawesome/fontawesome-svg-core@6.4.0": + version "6.4.0" + resolved "https://registry.yarnpkg.com/@fortawesome/fontawesome-svg-core/-/fontawesome-svg-core-6.4.0.tgz#3727552eff9179506e9203d72feb5b1063c11a21" + integrity sha512-Bertv8xOiVELz5raB2FlXDPKt+m94MQ3JgDfsVbrqNpLU9+UE2E18GKjLKw+d3XbeYPqg1pzyQKGsrzbw+pPaw== dependencies: - "@fortawesome/fontawesome-common-types" "6.1.1" + "@fortawesome/fontawesome-common-types" "6.4.0" -"@fortawesome/free-brands-svg-icons@6.1.1": - version "6.1.1" - resolved "https://registry.yarnpkg.com/@fortawesome/free-brands-svg-icons/-/free-brands-svg-icons-6.1.1.tgz#3580961d4f42bd51dc171842402f23a18a5480b1" - integrity sha512-mFbI/czjBZ+paUtw5NPr2IXjun5KAC8eFqh1hnxowjA4mMZxWz4GCIksq6j9ZSa6Uxj9JhjjDVEd77p2LN2Blg== +"@fortawesome/free-brands-svg-icons@6.4.0": + version "6.4.0" + resolved "https://registry.yarnpkg.com/@fortawesome/free-brands-svg-icons/-/free-brands-svg-icons-6.4.0.tgz#c785cf5563231eadc5ef5f8cd0274e0b8920433f" + integrity sha512-qvxTCo0FQ5k2N+VCXb/PZQ+QMhqRVM4OORiO6MXdG6bKolIojGU/srQ1ptvKk0JTbRgaJOfL2qMqGvBEZG7Z6g== dependencies: - "@fortawesome/fontawesome-common-types" "6.1.1" + "@fortawesome/fontawesome-common-types" "6.4.0" -"@fortawesome/free-regular-svg-icons@6.1.1": - version "6.1.1" - resolved "https://registry.yarnpkg.com/@fortawesome/free-regular-svg-icons/-/free-regular-svg-icons-6.1.1.tgz#3f2f58262a839edf0643cbacee7a8a8230061c98" - integrity sha512-xXiW7hcpgwmWtndKPOzG+43fPH7ZjxOaoeyooptSztGmJxCAflHZxXNK0GcT0uEsR4jTGQAfGklDZE5NHoBhKg== +"@fortawesome/free-regular-svg-icons@6.4.0": + version "6.4.0" + resolved "https://registry.yarnpkg.com/@fortawesome/free-regular-svg-icons/-/free-regular-svg-icons-6.4.0.tgz#cacc53bd8d832d46feead412d9ea9ce80a55e13a" + integrity sha512-ZfycI7D0KWPZtf7wtMFnQxs8qjBXArRzczABuMQqecA/nXohquJ5J/RCR77PmY5qGWkxAZDxpnUFVXKwtY/jPw== dependencies: - "@fortawesome/fontawesome-common-types" "6.1.1" + "@fortawesome/fontawesome-common-types" "6.4.0" -"@fortawesome/free-solid-svg-icons@6.1.1": - version "6.1.1" - resolved "https://registry.yarnpkg.com/@fortawesome/free-solid-svg-icons/-/free-solid-svg-icons-6.1.1.tgz#3369e673f8fe8be2fba30b1ec274d47490a830a6" - integrity sha512-0/5exxavOhI/D4Ovm2r3vxNojGZioPwmFrKg0ZUH69Q68uFhFPs6+dhAToh6VEQBntxPRYPuT5Cg1tpNa9JUPg== +"@fortawesome/free-solid-svg-icons@6.4.0": + version "6.4.0" + resolved "https://registry.yarnpkg.com/@fortawesome/free-solid-svg-icons/-/free-solid-svg-icons-6.4.0.tgz#48c0e790847fa56299e2f26b82b39663b8ad7119" + integrity sha512-kutPeRGWm8V5dltFP1zGjQOEAzaLZj4StdQhWVZnfGFCvAPVvHh8qk5bRrU4KXnRRRNni5tKQI9PBAdI6MP8nQ== dependencies: - "@fortawesome/fontawesome-common-types" "6.1.1" + "@fortawesome/fontawesome-common-types" "6.4.0" "@gar/promisify@^1.0.1": version "1.1.2" diff --git a/orePlayCommon/app/ore/OreConfig.scala b/orePlayCommon/app/ore/OreConfig.scala index e5d72903d..01d091981 100644 --- a/orePlayCommon/app/ore/OreConfig.scala +++ b/orePlayCommon/app/ore/OreConfig.scala @@ -164,7 +164,7 @@ object OreConfig { case class Sponge( logo: String, service: String, - sponsors: Seq[Logo] + sponsors: Seq[Sponsor] ) case class Auth( @@ -223,4 +223,4 @@ object OreConfig { ) } -case class Logo(name: String, image: String, link: String) +case class Sponsor(name: String, image: String, link: String, weight: Int) diff --git a/orePlayCommon/app/views/layout/header.scala.html b/orePlayCommon/app/views/layout/header.scala.html index 66c8edcad..0f96cc6a8 100644 --- a/orePlayCommon/app/views/layout/header.scala.html +++ b/orePlayCommon/app/views/layout/header.scala.html @@ -47,8 +47,8 @@