Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
petrkucerak committed May 8, 2024
2 parents 5ade751 + 629b75d commit e81b7ea
Show file tree
Hide file tree
Showing 14 changed files with 85 additions and 25 deletions.
4 changes: 4 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# These owners will be the default owners for everything in
# the repo. Unless a later match takes precedence,
* @petrkucerak
_toilets/
22 changes: 14 additions & 8 deletions .github/workflows/rulicka-bot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
required: true
default: ''
title:
description: 'Business name'
description: 'Place name'
required: true
default: ''

Expand All @@ -20,7 +20,14 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout the repo
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: 🔐 Generate a token
id: generate_token
uses: tibdex/github-app-token@v2
with:
app_id: ${{ secrets.RULICKA_ID }}
private_key: ${{ secrets.RULICKA_PRIVATE_KEY }}

- name: Create a json file
run: |
Expand All @@ -29,17 +36,16 @@ jobs:
cat ${{ github.event.inputs.filename }}.json
- name: Create a pull request
uses: peter-evans/create-pull-request@v4
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.PAT }}
commit-message: Add ${{ github.event.inputs.filename }}.json toilet
committer: Rulicka [Bot] <[email protected]>
author: Rulica <[email protected]>
token: ${{steps.generate_token.outputs.token}}
commit-message: Add ${{ github.event.inputs.filename }}.json toilet
signoff: false
branch: new-toilet-${{ github.event.inputs.filename }}
delete-branch: true
title: 'A new toilet request: ${{ github.event.inputs.title }}'
title: '${{ fromJSON(github.event.inputs.content).nickName }} is requesting the addition of a new toilet ${{ github.event.inputs.title }}'
body: |
${{ fromJSON(github.event.inputs.content).nickName }} is requesting the addition of a new toilet ${{ github.event.inputs.title }} with this parameters:
| KEY | VALUE |
| ------ | ---------- |
| placeName | **${{ fromJSON(github.event.inputs.content).placeName }}** |
Expand Down
1 change: 1 addition & 0 deletions _toilets/1714566194547.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"latitude":"50.39716269129624","longtitude":"15.8888706053509","placeName":"Hospital Kuks","wayDescription":"","toiletType":"veřejné toalety, toitoika","isClean":true,"hasPaper":true,"canLock":true,"hasWater":true,"isFree":true,"bonusCategory":[],"comment":"","nickName":"Kajkaj","timeStamp":"2024-05-01T12:23:14.547Z"}
1 change: 1 addition & 0 deletions _toilets/1714569546044.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"latitude":"50.0982262836612","longtitude":"14.365369677543642","placeName":"Bořislavka","wayDescription":"","toiletType":"nákupní středisko","isClean":true,"hasPaper":true,"canLock":true,"hasWater":true,"isFree":true,"bonusCategory":[],"comment":"","nickName":"Pedro","timeStamp":"2024-05-01T13:19:06.044Z"}
1 change: 1 addition & 0 deletions _toilets/1714570151810.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"latitude":"49.10462629179647","longtitude":"17.39416301250458","placeName":"Titique café","wayDescription":"Po schodech dolů. V kavárně si je třeba vyzvednout minci.","toiletType":"hospoda, restaurace, ...","isClean":true,"hasPaper":true,"canLock":true,"hasWater":true,"isFree":false,"bonusCategory":["kavárna"],"comment":"Prý moc dobrá zmrzlina.","nickName":"Pedro","timeStamp":"2024-05-01T13:29:11.810Z"}
1 change: 1 addition & 0 deletions _toilets/1714644582207.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"latitude":"50.08994","longtitude":"17.40913","placeName":"Cafe des Taxis","wayDescription":"Vstup průchodem z ulice Letenská, areál Anglo-americké VŠ. Po vstupu do kavárny projít doleva kolem pultu a doleva. ","toiletType":"hospoda, restaurace, ...","isClean":true,"hasPaper":true,"canLock":true,"hasWater":true,"isFree":true,"bonusCategory":[],"comment":"","nickName":"Žába","timeStamp":"2024-05-02T10:09:42.207Z"}
1 change: 1 addition & 0 deletions _toilets/1714844918687.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"latitude":"50.09338769990597","longtitude":"14.44682626980973","placeName":"Dva kohouti ","wayDescription":"Za barem s pivy rovně ","toiletType":"hospoda, restaurace, ...","isClean":false,"hasPaper":true,"canLock":true,"hasWater":false,"isFree":true,"bonusCategory":[],"comment":"Na dámských se tvoří jednoduše fronta. Pivo celkem fajn, ale vyšší cenová, stejně jako jídlo.","nickName":"Adélka","timeStamp":"2024-05-04T17:48:38.687Z"}
1 change: 1 addition & 0 deletions _toilets/1714845006021.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"latitude":"50.070215080968396","longtitude":"14.367812859764097","placeName":"Kino Kavalírka","wayDescription":"Za barem vlevo","toiletType":"škola, firma, ...","isClean":false,"hasPaper":true,"canLock":true,"hasWater":false,"isFree":true,"bonusCategory":[],"comment":"Low-key nejlepší kino v Praze ","nickName":"Adélka","timeStamp":"2024-05-04T17:50:06.021Z"}
1 change: 1 addition & 0 deletions _toilets/1714998818060.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"latitude":"49.14849604865318","longtitude":"16.921970844268802","placeName":"Orlen","wayDescription":"Klasický Orlen, po vstupu rovně. ","toiletType":"jiné","isClean":true,"hasPaper":true,"canLock":true,"hasWater":true,"isFree":true,"bonusCategory":[],"comment":"","nickName":"Pedro","timeStamp":"2024-05-06T12:33:38.060Z"}
1 change: 1 addition & 0 deletions _toilets/1715192531888.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"latitude":"50.10235326958616","longtitude":"14.424346173333252","placeName":"Pivovar a Café Lajka","wayDescription":"Po schodech dolů ","toiletType":"hospoda, restaurace, ...","isClean":true,"hasPaper":true,"canLock":true,"hasWater":true,"isFree":true,"bonusCategory":[],"comment":"Moc dobré pivo (doporučuji Strelku), jedna z nejmilejších obsluh co jsem zažila a krásný podnik, který by měl navštívit každý ","nickName":"Adélka","timeStamp":"2024-05-08T18:22:11.888Z"}
30 changes: 26 additions & 4 deletions lib/api.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,21 @@
import fs from "fs";

const titles = ["Sráč zelenáč", "Sráč", "Sráč mazák", "Velesráč"];
const classes = ["srac-zelenac", "srac", "srac-mazak", "velesrac"];
const titles = [
"Sráč zelenáč",
"Sráč",
"Sráč mazák",
"Velesráč",
"Megasráč",
"Gigasráč",
];
const classes = [
"srac-zelenac",
"srac",
"srac-mazak",
"velesrac",
"megasrac",
"gigasrac",
];
const extension = ["trůn", "trůny", "trůny", "trůny", "trůnů"];

export function getData2HallOfShits() {
Expand Down Expand Up @@ -34,14 +48,22 @@ export function getData2HallOfShits() {
if (out[index].score == 3) out[index].extension = extension[2];
if (out[index].score == 4) out[index].extension = extension[3];
if (out[index].score == 5) out[index].extension = extension[4];
if (out[index].score > 20) {
if (out[index].score >= 20) {
out[index].title = titles[2];
out[index].class = classes[2];
}
if (out[index].score > 50) {
if (out[index].score >= 50) {
out[index].title = titles[3];
out[index].class = classes[3];
}
if (out[index].score >= 100) {
out[index].title = titles[4];
out[index].class = classes[4];
}
if (out[index].score >= 200) {
out[index].title = titles[5];
out[index].class = classes[5];
}
}
});
return out;
Expand Down
9 changes: 6 additions & 3 deletions pages/hall.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,12 @@ export default function Hall({ nickNames }) {
<LocalTitle title="Legendy" subtitle="" />
<ul>
{nickNames.sort(compareScore).map((person) => {
if (person.nickName === "KajKaj")
if (person.nickName === "Kajkaj" || person.nickName === "Adélka")
return (
<li key={person.nickName} className={person.class}>
Velesráčka <strong>{person.nickName}</strong>:{" "}
{person.score} {person.extension}
{person.title.replace("sráč", "sračka")}{" "}
<strong>{person.nickName}</strong>: {person.score}{" "}
{person.extension}{" "}
</li>
);
else
Expand All @@ -46,6 +47,8 @@ export default function Hall({ nickNames }) {
<li className="srac">Sráč: 5+ trůnů</li>
<li className="srac-mazak">Sráč mazák: 20+ trůnů</li>
<li className="velesrac">Velesráč: 50+ trůnů</li>
<li className="megasrac">Megasráč: 100+ trůnů</li>
<li className="gigasrac">Gigasráč: 200+ trůnů</li>
</ul>
</SectionBody>
</Section>
Expand Down
7 changes: 7 additions & 0 deletions styles/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,13 @@
.velesrac {
@apply text-[#af8566ff] font-semibold text-xl;
}
.megasrac {
@apply text-[#7d52b6] font-semibold text-xl;
}
.gigasrac {
@apply text-[#ce3dc2] font-bold text-xl;
/* text-shadow: 0px 0px 5px #ce3dc2; */
}
/* End of the tagsinput */

.svg-non-block svg {
Expand Down
30 changes: 20 additions & 10 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1962,9 +1962,9 @@ doctrine@^3.0.0:
esutils "^2.0.2"

ejs@^3.1.6:
version "3.1.8"
resolved "https://registry.yarnpkg.com/ejs/-/ejs-3.1.8.tgz#758d32910c78047585c7ef1f92f9ee041c1c190b"
integrity sha512-/sXZeMlhS0ArkfX2Aw780gJzXSMPnKjtspYZv+f3NiKLlubezAHDU5+9xz6gd3/NhG3txQCo6xlglmTS+oTGEQ==
version "3.1.10"
resolved "https://registry.yarnpkg.com/ejs/-/ejs-3.1.10.tgz#69ab8358b14e896f80cc39e62087b88500c3ac3b"
integrity sha512-UeJmFfOrAQS8OJWPZ4qtgHyWExa088/MtK5UEyoJGFH67cDEXkZSviOiKRCZ4Xij0zxI3JECgYs3oKx+AizQBA==
dependencies:
jake "^10.8.5"

Expand Down Expand Up @@ -3065,11 +3065,16 @@ ms@^2.1.1:
resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2"
integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==

nanoid@^3.1.30, nanoid@^3.3.6:
nanoid@^3.1.30:
version "3.3.6"
resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.6.tgz#443380c856d6e9f9824267d960b4236ad583ea4c"
integrity sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==

nanoid@^3.3.7:
version "3.3.7"
resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.7.tgz#d0c301a691bc8d54efa0a2226ccf3fe2fd656bd8"
integrity sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==

natural-compare@^1.4.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7"
Expand Down Expand Up @@ -3414,13 +3419,13 @@ [email protected]:
source-map-js "^1.0.1"

postcss@^8.1.6, postcss@^8.3.5, postcss@^8.4.31:
version "8.4.31"
resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.31.tgz#92b451050a9f914da6755af352bdc0192508656d"
integrity sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ==
version "8.4.38"
resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.38.tgz#b387d533baf2054288e337066d81c6bee9db9e0e"
integrity sha512-Wglpdk03BSfXkHoQa3b/oulrotAkwrlLDRSOb9D0bN86FdRyE9lppSp33aHNPgBa0JKCoB+drFLZkQoRRYae5A==
dependencies:
nanoid "^3.3.6"
nanoid "^3.3.7"
picocolors "^1.0.0"
source-map-js "^1.0.2"
source-map-js "^1.2.0"

prelude-ls@^1.2.1:
version "1.2.1"
Expand Down Expand Up @@ -3780,11 +3785,16 @@ source-list-map@^2.0.0:
resolved "https://registry.yarnpkg.com/source-list-map/-/source-list-map-2.0.1.tgz#3993bd873bfc48479cca9ea3a547835c7c154b34"
integrity sha512-qnQ7gVMxGNxsiL4lEuJwe/To8UnK7fAnmbGEEH8RpLouuKbeEm0lhbQVFIrNSuB+G7tVrAlVsZgETT5nljf+Iw==

source-map-js@^1.0.1, source-map-js@^1.0.2:
source-map-js@^1.0.1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.0.2.tgz#adbc361d9c62df380125e7f161f71c826f1e490c"
integrity sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==

source-map-js@^1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.2.0.tgz#16b809c162517b5b8c3e7dcd315a2a5c2612b2af"
integrity sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==

source-map-support@~0.5.20:
version "0.5.21"
resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.21.tgz#04fe7c7f9e1ed2d662233c28cb2b35b9f63f6e4f"
Expand Down

0 comments on commit e81b7ea

Please sign in to comment.