237 Commits
Author SHA1 Message Date
didier 123481d748 mdldfs 2026-08-08 09:17:05 -04:00
didier 11031eb5a3 added new thing 2026-08-08 09:13:46 -04:00
didier e5850a448b feat: removed gitlab ci 2026-07-18 09:22:22 -04:00
didier 7162be1f49 feat: removed gitlab-ci 2026-07-17 09:23:42 -04:00
didier 3413c4f94a feat: foo 2026-07-13 21:07:08 -04:00
didier 9d741b8516 feat: fixed flake 2026-07-13 20:27:00 -04:00
didier bb13614d1e feat: fixed flake 2026-07-13 20:20:33 -04:00
didier 29ed46aa7f feat: moved to C# thanks to deepseek 2026-07-12 21:01:09 -04:00
didier ab81a1c4be feat: added script to create 2026 schedule 2026-05-04 08:48:28 -04:00
didier 4399d1b434 fix: changed passeord 2026-05-01 15:13:30 -04:00
didier 428842affe added new news 2026-03-09 07:20:41 -04:00
didier 514bb0ac47 Added shome shit to invert who is home and away. 2025-05-28 14:23:38 -04:00
didier 3bc18baa30 pour le respect 2025-05-26 21:11:04 -04:00
didier 3adcdcbd78 pour le respect 2025-05-26 20:57:14 -04:00
didier e6675c0d90 fixed game order 2025-04-27 21:15:27 -04:00
didier fb84c8229c updated deploy script 2025-04-25 10:01:05 -04:00
didier 0858a3f1e7 updated deno.lock 2025-04-25 09:57:04 -04:00
didier ce399ce258 Fixed couple of bugs 2025-04-25 09:53:48 -04:00
didier 5a5cc814c3 Revert "added didider stuff"
This reverts commit 2948e5dabc.
2024-10-18 08:54:17 -04:00
didier 2948e5dabc added didider stuff 2024-10-17 18:39:40 -04:00
didier 1e874b790d boom 2024-07-02 20:03:47 -04:00
didier 8d883b9416 fixed gitlab-ci 2024-07-02 19:55:25 -04:00
didier 74ac5b5ef7 fixed gitlab-ci 2024-07-02 19:53:50 -04:00
didier 7bee9526fc Merge branch 'deno' into 'master'
Deno

See merge request ballephenix/website!2
2024-07-02 23:51:24 +00:00
didier 95a8ed5ffa added the worst kind of security ever 2024-07-02 19:43:24 -04:00
didier cd45813228 fixed type 2024-07-02 19:22:51 -04:00
didier a31390d55a prepared for migration 2024-07-02 19:01:57 -04:00
didier.amyot df26a3fe96 Added new website 2024-07-02 18:36:05 -04:00
didier.amyot 293b7727e2 deleted old website. fuck it. 2024-07-02 18:35:00 -04:00
didier ce4f47b79c added more scores 2024-06-29 19:09:02 -04:00
didier e874c125ea boom 2024-06-19 07:46:42 -04:00
didier amyot ae180fc3c8 added results 2024-05-13 20:49:21 -04:00
didier amyot 65c9da0a1d added new season 2024-05-13 20:32:31 -04:00
didier amyot 32d5666c4e fixed little bug. 2023-08-27 12:48:55 +00:00
Cameron Letourneau f853ccd820 Update resultats2023.yaml 2023-08-25 12:30:24 +00:00
Cameron Letourneau 297aa5c3b0 Update resultats2023.yaml 2023-08-18 14:58:02 +00:00
Cameron Letourneau da556a5d25 Update resultats2023.yaml 2023-08-18 14:33:30 +00:00
didier amyot ac05980fad modified jour-de-la-balle 2023-08-07 18:27:14 -04:00
didier amyot 593ed01669 updated jour-de-la-balle 2023-08-05 10:58:41 -04:00
didier amyot 8393749900 added one game for la fete de la balle 2023-08-01 10:39:50 -04:00
Cameron Letourneau 12676278c1 Update resultats2023.yaml 2023-07-28 13:46:36 +00:00
didier amyot 016d629aed adeed new game 2023-07-25 10:29:18 -04:00
didier amyot 1ebf5dc2d0 Added new scores 2023-07-21 09:28:03 -04:00
Cameron Letourneau ad5f3c0a67 Update resultats2023.yaml 2023-07-14 13:28:00 +00:00
didier amyot 89899d82b8 forgotten to add file 2023-07-12 16:57:13 -04:00
didier amyot 3c505d7d5e fixed small bug 2023-07-12 16:54:49 -04:00
Cameron Letourneau 250fe56322 Update pour article 2023 2023-07-09 16:22:12 +00:00
Cameron Letourneau 958ccaf246 Add new file 2023-07-09 16:16:03 +00:00
Cameron Letourneau c6cba8ef62 Update resultats2023.yaml 2023-07-08 17:09:48 +00:00
Cameron Letourneau 87d6b9667a Update resultats2023.yaml 2023-06-30 13:59:53 +00:00
Cameron Letourneau 19fa311496 Update resultats2023.yaml 2023-06-24 13:15:38 +00:00
Cameron Letourneau e19a7c5c68 Update resultats2023.yaml 2023-06-23 19:53:20 +00:00
Cameron Letourneau a1bec8a62b Update resultats2023.yaml 2023-06-09 09:53:38 +00:00
Cameron Letourneau 795d9d4099 Update resultats2023.yaml 2023-06-02 23:56:25 +00:00
Cameron Letourneau cc1dd3d652 Merge branch 'master' into 'master'
Update file resultats2023.yaml

See merge request ballephenix/website!1
2023-06-02 23:54:56 +00:00
Cameron Letourneau 51eb6d1ebb Update file resultats2023.yaml 2023-06-02 23:09:06 +00:00
didier amyot cf2de58a77 added updated schedule 2023-06-01 13:19:06 -04:00
didier amyot 05897534c8 Updated games 2023-06-01 13:07:17 -04:00
didier amyot c472aac40b fixed time in 2023 result file 2023-05-22 11:41:36 -04:00
didier amyot 257fc4e630 changed results and schedule of 2023 season. 2023-05-22 11:19:35 -04:00
didier amyot 978d4dd6b1 fixed plurialization typo from 'gri' to 'gris' 2023-05-02 14:37:19 -04:00
didier amyot e58239e6b9 Rename yaml file extension from yml to yaml to make it work with build system 2023-05-02 14:32:39 -04:00
didier amyot f68b91602d added 2023 schedule 2023-05-02 13:45:14 -04:00
didier amyot bdb6b24da7 nsdds 2022-07-19 18:19:58 -04:00
didier amyot e42d42189c added more games 2022-07-04 20:32:20 -04:00
didier amyot 4aef8a9e84 no rain tomorrow 2022-06-29 17:43:15 -04:00
didier amyot e5916dcd21 calisse 2022-06-28 20:08:32 -04:00
didier amyot cf23f25af7 ostie d'or 2022-06-28 20:01:41 -04:00
didier amyot 9f8386af74 added more results 2022-06-11 18:45:12 -04:00
didier amyot 10950b4f50 fixed shit 2022-05-28 14:02:19 -04:00
didier amyot 29a7b9c078 added results 2022-05-28 13:56:08 -04:00
didier amyot 6efd4b8afd added y2k22 2022-05-28 13:52:03 -04:00
didier amyot 1e18870715 added basic nix flake file. 2022-05-28 13:18:13 -04:00
didier amyot a65de2a03a Update resultats2021.yaml 2021-07-30 13:35:05 +00:00
didier amyot fb83d95e7e Update resultats2021.yaml 2021-07-23 12:32:32 +00:00
didier amyot b5e1bf6cb0 Update resultats2021.yaml 2021-07-16 01:43:08 +00:00
didier amyot 375c2551fc changed files 2021-06-20 13:06:09 -04:00
didier amyot 0751d3e447 Update resultats2021.yaml 2021-06-16 00:17:41 +00:00
didier amyot 8897e9ac53 Update resultats2021.yaml 2021-06-16 00:14:45 +00:00
didier amyot 1f569b6f3d fixed contacts 2021-06-15 20:04:49 -04:00
didier amyot e18a393c9e fixed facebook link 2021-06-15 18:43:37 -04:00
didier amyot 7d21d5316b more love 2021-06-15 17:25:43 -04:00
didier amyot 548d4c1def added some support for practices 2021-06-15 16:55:21 -04:00
didier amyot 2f7dcdc5d0 added saison 2021 data 2021-06-15 16:18:03 -04:00
didier amyot 80ddf2b010 more love 2021-06-15 12:50:49 -04:00
didier amyot 9cabb7c2cd Given some love to the website 2021-06-15 12:45:21 -04:00
didier amyot 2916077329 Update rulesPage.js 2019-10-28 19:42:22 +00:00
didier amyot 7cfb302634 nkjnfdsk 2019-08-22 08:09:54 -04:00
didier amyot fb4b893e39 jdsk 2019-08-22 08:02:47 -04:00
didier amyot 19b7afa7c5 changed calendar 2019-08-06 15:21:15 -04:00
didier amyot 71e1491683 added more results 2019-08-01 17:14:06 -04:00
didier amyot 093370d199 blah 2019-07-13 09:49:50 -04:00
didier amyot d293b8be06 more points 2019-06-28 16:35:31 -04:00
didier amyot 161e828fe4 balh 2019-06-24 18:28:01 -04:00
didier amyot f84d375785 ajouter les reprises 2019-06-12 17:08:38 -04:00
didier amyot 8074b3679e added new score 2019-06-09 09:41:48 -04:00
didier amyot 75ecc7c346 added new scores 2019-06-03 15:36:00 -04:00
didier amyot 6c81a9aeb1 add rain for todays games 2019-05-16 14:20:21 -04:00
didier amyot 39cde030dd fixed away/home 2019-05-16 09:34:57 -04:00
didier amyot 6da40dfb6e added new game dates 2019-05-13 09:13:08 -04:00
didier amyot e93e54df8e nouvelle nouvelle 2019-04-01 08:09:36 -04:00
didier amyot 63cbf51af8 fixed pdf 2019-03-09 07:30:31 -05:00
didier amyot b634723762 removed unused download button 2019-03-09 07:00:21 -05:00
didier amyot cee0e920c3 Added previous seasons to the web site 2019-03-08 12:15:51 -05:00
didier amyot da7951b1cb fixed inscrition 2019 files 2019-03-05 21:40:54 +00:00
didier amyot 516a9856c1 changed main message 2019-02-20 09:20:32 -05:00
didier amyot 441b617eb1 changed some rules 2019-02-19 12:46:59 -05:00
didier amyot e343cee701 changed rules order 2019-02-17 20:20:14 -05:00
didier amyot fe69c01c10 fixed typo 2019-02-17 20:16:01 -05:00
didier amyot e421930f8b added documents for new commity 2019-02-17 20:10:40 -05:00
didier amyot 17f3103144 typo 2018-08-28 18:56:43 -04:00
didier amyot 3c81297272 added last game 2018-08-28 18:52:57 -04:00
didier amyot 25d2fdb781 Update resultats.yaml 2018-08-24 23:32:46 +00:00
didier amyot 42341dec3e Update resultats.yaml 2018-08-16 00:10:06 +00:00
didier amyot fdfef069cb added new score 2018-08-07 20:50:13 -04:00
didier amyot 8066c990cc new article 2018-07-09 20:19:38 -04:00
didier amyot 6118ae35ee Update resultats.yaml 2018-06-10 13:00:20 +00:00
didier amyot 223932df0a let's encrypt 2018-06-09 09:09:46 -04:00
didier amyot a10d01c8d7 added let's encrypt challenge 2018-06-09 09:02:50 -04:00
didier amyot f04c039e8c Update resultats.yaml 2018-06-05 23:33:44 +00:00
didier amyot 48377dbe9d Update resultats.yaml 2018-06-05 22:56:53 +00:00
didier amyot 8e4eb803d7 more resilient team structure 2018-05-20 17:12:57 -04:00
didier amyot 01bdcbe3b7 je suis saoul 2018-05-19 19:53:04 -04:00
didier amyot 6b2a781378 changed hour of the very first game 2018-05-16 20:41:58 -04:00
didier amyot e5bd620c88 created a 'remplaçants' team 2018-05-13 18:14:19 -04:00
didier amyot 3182c82dba changed team colour 2018-05-13 17:46:12 -04:00
didier amyot 26b09a0941 added evaluation 2018 2018-05-07 20:34:20 -04:00
didier amyot 926c35466d replace team strings 2018-05-04 14:18:34 -04:00
didier amyot 9cec9e101a added 2018 schedule 2018-05-04 14:15:42 -04:00
didier amyot 3d344de012 added enrollement for 2018 2018-03-19 17:40:12 -04:00
didier amyot bb6638ae79 added let's encrypt challenge 2018-03-11 15:39:50 -04:00
didier amyot 2f6b62afef added new article 2017-09-17 11:29:34 -04:00
didier amyot 6015d479fb Update resultats.yaml 2017-08-25 02:50:48 +00:00
didier amyot 9220f4d4a6 new message 2017-08-23 19:13:01 -04:00
didier amyot d8a655bd9b Update resultats.yaml 2017-08-23 01:05:19 +00:00
didier amyot c577d12fc1 oups 2017-08-19 18:48:51 -04:00
didier amyot 42a37856d2 applied richard's comments 2017-08-19 18:42:06 -04:00
didier amyot d085eeb91b Update resultats.yaml 2017-08-19 17:11:23 +00:00
didier amyot f3dcddcbc0 Update resultats.yaml 2017-08-19 17:00:14 +00:00
didier amyot 3dab44623a Update resultats.yaml 2017-08-18 13:43:52 +00:00
didier amyot 44eb09100c added new result 2017-08-09 21:24:48 -04:00
didier amyot deaf5f0fbc boom 2017-08-09 20:59:19 -04:00
didier amyot 9bf4830f7a added basic playoff integration 2017-08-08 22:22:51 -04:00
didier amyot 7be88a2167 Update resultats.yaml 2017-08-01 01:02:14 +00:00
didier amyot 4ef7661371 Update resultats.yaml 2017-07-23 15:25:43 +00:00
didier amyot 8ad11a2a78 trying to fix a prod issue 2017-07-17 22:00:38 -04:00
didier amyot 3d4995e228 Update resultats.yaml 2017-07-18 01:35:27 +00:00
didier amyot a46e4a463e added new scores 2017-07-09 18:00:18 -04:00
didier amyot b9c6612fb1 new results 2017-07-01 08:29:52 -04:00
didier amyot 4af9f56707 walter-stewart!!! 2017-06-20 20:57:25 -04:00
didier amyot 314a816fbd implemented comments and suggestions by marc beaudoin 2017-06-15 20:15:36 -04:00
didier amyot 3caa916d47 Update resultats.yaml 2017-06-05 23:31:10 +00:00
Valerie Andre fff837b103 correction inversion équipe home et away 2017-05-29 20:58:06 -04:00
Valerie Andre f9893f3130 updates dates et ordre des matchs 2017-05-29 20:39:55 -04:00
didier amyot 334c40dead hide unfinished improvments 2017-05-23 22:39:33 -04:00
didier amyot dfefef815b fix rebasing 2017-05-23 22:37:04 -04:00
didier amyot e34b213327 blah blah blah 2017-05-23 22:35:11 -04:00
didier amyot f67080571a stuff 2017-05-23 22:33:30 -04:00
didier amyot 5d630e28f4 added new schedule 2017-05-13 09:58:11 -04:00
didier amyot 337508e72a changed parc to fucking george vernot 2017-05-07 10:07:29 -04:00
didier amyot ae5b3365e2 added season 2017 email 2017-05-06 10:44:36 -04:00
didier amyot 5a0582a37b fixed build.js 2017-04-23 11:28:48 -04:00
didier amyot f711a5876d moved away from bower 2017-04-23 11:19:06 -04:00
didier amyot bb3a616f7c saison retarde 2017-04-23 10:21:57 -04:00
didier amyot 3c9cacd8ea changed dated 2017-03-19 09:28:43 -04:00
didier amyot 378e8ab7cc updated message 2017-03-19 08:56:36 -04:00
didier amyot cc73d82288 oupsi 2017-03-18 16:32:57 -04:00
didier amyot 7fc849842f new season inscrition time! 2017-03-18 09:16:04 -04:00
didier amyot 16d8c290d8 updted game schedule 2017-03-16 20:45:09 -04:00
didier amyot 09a08a3c68 changed parc 2017-03-16 20:05:53 -04:00
didier amyot dd932664e0 updated uikit version 2017-02-19 11:09:55 -05:00
didier amyot d08ffff206 updated last meeting updates 2017-02-19 10:51:47 -05:00
didier amyot da77c69063 Update resultats.yaml 2016-09-13 12:41:01 +00:00
didier amyot a0e5a806ef Update resultats.yaml 2016-09-11 22:48:47 +00:00
didier amyot 2576d75f2f Update resultats.yaml 2016-09-06 13:08:20 +00:00
didier amyot 62a18dbd6d Update resultats.yaml 2016-08-31 13:22:05 +00:00
didier amyot dd089045d2 ended final regular season 2016-08-29 19:40:07 -04:00
didier amyot 450cd26ff0 added new scores 2016-08-19 13:55:32 -04:00
didier amyot 7129c334a6 added new games 2016-08-18 13:48:54 -04:00
didier amyot 06eade5a4d Update resultats.yaml 2016-08-17 02:09:23 +00:00
didier amyot 56d893e6a4 Update resultats.yaml 2016-08-15 20:12:21 +00:00
didier amyot 93776f6b72 Update resultats.yaml 2016-08-11 20:18:57 +00:00
didier amyot a89892e2fb Update resultats.yaml 2016-07-22 20:14:49 +00:00
didier amyot f5d343aca2 Update resultats.yaml 2016-07-15 17:57:15 +00:00
didier amyot 6b0652092c ordered the team results 2016-07-12 13:32:10 -04:00
didier amyot b36c7ebcdc Update resultats.yaml 2016-07-08 15:22:55 +00:00
didier amyot 7181d871c0 Update resultats.yaml 2016-07-06 11:53:47 +00:00
didier amyot 9690b60a6d Update resultats.yaml 2016-07-06 02:17:47 +00:00
didier amyot 76950581b4 added new result 2016-06-26 09:30:40 -04:00
didier amyot 813a4968b0 added rain day for today 2016-06-16 17:58:04 -04:00
didier amyot 7a447278be Update resultats.yaml 2016-06-11 15:21:58 +00:00
didier amyot 418e161cc7 fix result typo 2016-06-10 16:42:51 -04:00
didier amyot fe1ed751e1 added cache to gitlab pages 2016-06-10 15:41:46 -04:00
didier amyot df9d8b9109 changed cache buster 2016-06-10 18:30:37 +00:00
didier amyot 41a563ff34 updated results 2016-06-10 18:04:03 +00:00
didier amyot b3e48ebdfa added cache buster in for all result url 2016-06-02 08:48:55 -04:00
didier amyot 137912eaa4 added cache buster 2016-06-02 08:45:22 -04:00
didier amyot a0ae5e89b7 re-added new schedule 2016-06-01 19:15:21 -04:00
didier amyot de0b35f476 cancel season (or almost) 2016-05-11 19:36:05 -04:00
didier amyot 3eae9143fa added real schedule! 2016-05-06 19:47:44 +00:00
didier amyot 61f32a74da fixed many bugs 2016-04-30 11:06:30 -04:00
didier amyot 7e54032605 pined node version in build pack 2016-04-27 20:10:19 -04:00
didier amyot 18938a77d0 changed way to get encrypted data to make cross server requests possible 2016-04-27 19:40:01 -04:00
didier amyot d1c01b6bf9 pointed player list to private repo 2016-04-23 23:53:26 -04:00
didier amyot 1d0a2d4b22 renamed files 2016-04-23 23:34:03 -04:00
didier amyot 930f3cc799 added spritz in build.js 2016-04-23 23:23:55 -04:00
didier amyot 15120d48fc use https instead of ssh for npm 2016-04-23 23:19:22 -04:00
didier amyot bc5a3ce364 added default params to deployemnt 2016-04-23 23:11:04 -04:00
didier amyot 2a689dd20b added encryption to player list 2016-04-23 23:02:19 -04:00
didier amyot 9f113a8588 fixed article order 2016-03-31 09:49:37 -04:00
didier amyot 1d1b697d46 added a new news 2016-03-31 09:01:35 -04:00
didier amyot 9e794ed81e change website url 2016-03-20 00:49:57 +00:00
didier amyot 325360084b improved dropdown nav for cell phones 2016-03-19 17:42:51 -04:00
didier amyot d7ce36f1bc improved top bar for small devices 2016-03-19 15:31:56 -04:00
didier amyot a158a9e323 re-implemented user details 2016-03-19 13:42:20 -04:00
didier amyot efd279691a refactored out the players page 2016-03-19 13:07:05 -04:00
didier amyot bfd839b4cb refactored login page out 2016-03-19 12:59:56 -04:00
didier amyot 73f4f3b8e0 fixed bugs on member page 2016-03-19 12:45:34 -04:00
Comite Ballephenix d6be795177 updated readme files with the new repo url 2016-03-18 01:27:06 +00:00
didier amyot 999bf1afd5 updated public information 2016-03-17 20:00:58 -04:00
didier amyot b009ad7115 added first news! 2016-03-13 22:22:33 -04:00
didier amyot 639a493dfa empty game list 2016-03-13 22:00:33 -04:00
didier amyot c200acc7bc loaded article in main and news page 2016-03-13 21:57:08 -04:00
didier amyot 80f4a937b6 compiled articles in gulp 2016-03-13 21:48:53 -04:00
didier amyot 3f75921194 update a result a for demo 2016-03-06 23:54:00 +00:00
didier amyot ff993beb55 added sorting of players-teams-score in confidential page. 2016-03-06 10:45:07 -05:00
didier amyot a314f5d804 improved ui on different screen sizes 2016-03-05 11:27:28 -05:00
didier amyot 54e2edad11 removed broken dependencies 2016-02-22 21:45:56 -05:00
didier amyot df37a6c5a4 type 2016-02-22 21:34:24 -05:00
didier amyot b1b657b6f7 working evening 2016-02-22 21:27:59 -05:00
didier amyot 7f0bbbb55b prepared for encryption 2016-02-19 16:20:08 -05:00
didier amyot 83e957965f Merge branch 'master' of gitlab.com:didiercrunch/phenix-website 2016-02-15 21:41:30 -05:00
didier amyot 005b008b26 Merge branch 'member_section' 2016-02-15 21:39:23 -05:00
didier amyot 5569fa14f6 ui ui ui 2016-02-15 21:36:20 -05:00
didier amyot f2ad5aced8 changed css 2016-02-15 20:32:25 -05:00
didier amyot 3dcd306ccc example of change 2016-02-16 00:22:34 +00:00
didier amyot 45622ee2a9 started to implement the member section 2016-02-15 19:18:45 -05:00
107 changed files with 25010 additions and 1669 deletions

No files matched your search

-3
View File
@@ -1,3 +0,0 @@
{
"directory": "lib"
}
+1
View File
@@ -0,0 +1 @@
use flake
+12 -6
View File
@@ -1,6 +1,12 @@
node_modules/* # Nix build result
lib/* result
css/*
/api/resultats.json # .NET
/index.html bin/
/main-built.js obj/
*.user
*.suo
*.db
publish/
.direnv/
-21
View File
@@ -1,21 +0,0 @@
image: node
before_script:
# install ssh-agent
- 'which npm || ( apt-get update -y && apt-get install node -y )'
pages:
stage: deploy
script:
- npm install
- node_modules/.bin/gulp prod
- node_modules/.bin/r.js -o build.js
- rm -rf node_modules .public public
- mkdir .public
- cp -r * .public
- mv .public public
artifacts:
paths:
- public
only:
- master
+74
View File
@@ -0,0 +1,74 @@
using Microsoft.AspNetCore.Mvc;
using Phenix.Models;
using Phenix.Services;
namespace Phenix.Controllers;
public record CreateGameRequest(
string Date, string Time, string Home, string Away,
int? HomeScore = null, int? AwayScore = null,
bool Practice = false, bool Rain = false
);
[Route("/api")]
public class ApiController : Controller
{
private readonly IGameService _games;
public ApiController(IGameService games)
{
_games = games;
}
[HttpGet("results/{year}.json")]
public async Task<IActionResult> ResultsJson(int year)
{
var games = await _games.GetAllGames();
var results = games
.Where(g => g.Year == year)
.Select(g => new Dictionary<string, object?>
{
["id"] = g.Id,
["date"] = g.Date,
["time"] = g.Time,
["home"] = g.Home,
["away"] = g.Away,
["year"] = g.Year,
[g.Home] = g.HomeScore,
[g.Away] = g.AwayScore,
["practice"] = g.Practice,
["rain"] = g.Rain,
});
return Json(results);
}
[HttpGet("available-years.json")]
public async Task<IActionResult> AvailableYearsJson()
{
var games = await _games.GetAllGames();
var years = games.Select(g => g.Year).Distinct().OrderByDescending(y => y);
return Json(years);
}
[HttpPost("games")]
public async Task<IActionResult> CreateGame([FromBody] CreateGameRequest req)
{
var (game, error) = await _games.CreateNewGame(req.Date, req.Time, req.Home, req.Away);
if (game is null)
return error switch
{
"game already exists at this date/time" => Conflict(new { error }),
_ => BadRequest(new { error }),
};
await _games.UpdateGame(game.Id, req.HomeScore, req.AwayScore, req.Rain, req.Practice);
return Created($"/api/games/{game.Id}", game);
}
[HttpDelete("games")]
public async Task<IActionResult> ClearGames()
{
await _games.ClearAllGames();
return NoContent();
}
}
+22
View File
@@ -0,0 +1,22 @@
using Microsoft.AspNetCore.Mvc;
using Phenix.Services;
namespace Phenix.Controllers;
public class HomeController : Controller
{
[HttpGet("/")]
public IActionResult Index() => View();
[HttpGet("/calendrier")]
public IActionResult Calendrier() => View();
[HttpGet("/nouvelles")]
public IActionResult Nouvelles() => View();
[HttpGet("/contact")]
public IActionResult Contact() => View();
[HttpGet("/reglement")]
public IActionResult Reglement() => View();
}
+141
View File
@@ -0,0 +1,141 @@
using Microsoft.AspNetCore.Mvc;
using Phenix.Services;
namespace Phenix.Controllers;
[Route("/membre")]
public class MembreController : Controller
{
private readonly IGameService _games;
private readonly LoginService _login;
private const string SessionCookie = "phenix-session";
private const string SessionSignCookie = "phenix-session-sign";
public MembreController(IGameService games, LoginService login)
{
_games = games;
_login = login;
}
[HttpGet("")]
public IActionResult Index()
{
ViewBag.IsLoggedIn = IsLoggedIn();
return View();
}
[HttpGet("/login")]
public IActionResult Login(string? username, string? password)
{
if (username is null || password is null || !_login.ValidateCredentials(username, password))
return StatusCode(403);
var expiresAt = DateTimeOffset.UtcNow.AddDays(90).ToUnixTimeSeconds();
Response.Cookies.Append(SessionCookie, expiresAt.ToString(), new CookieOptions
{
MaxAge = TimeSpan.FromDays(90),
});
Response.Cookies.Append(SessionSignCookie, _login.SignSession(expiresAt), new CookieOptions
{
MaxAge = TimeSpan.FromDays(90),
});
return Redirect("/membre/games-editor/today");
}
[HttpGet("games-editor/today")]
public async Task<IActionResult> GamesEditorToday()
{
if (!IsLoggedIn()) return Redirect("/membre");
var games = await _games.GetAllGames();
var today = DateOnly.FromDateTime(TimeZoneInfo.ConvertTime(
DateTime.UtcNow, TimeZoneInfo.FindSystemTimeZoneById("America/New_York")));
var lastGameDay = games
.Where(g => DateOnly.Parse(g.Date) <= today)
.Select(g => g.Date)
.OrderByDescending(d => d)
.FirstOrDefault();
ViewBag.SelectedYear = (int?)null;
ViewBag.IsToday = true;
ViewBag.Years = games.Select(g => g.Year).Distinct().OrderByDescending(y => y).ToList();
ViewBag.Games = games.Where(g => g.Date == lastGameDay).ToList();
return PartialView("GamesEditor");
}
[HttpGet("games-editor/{year:int}")]
public async Task<IActionResult> GamesEditorByYear(int year)
{
if (!IsLoggedIn()) return Redirect("/membre");
var games = await _games.GetAllGames();
ViewBag.SelectedYear = year;
ViewBag.IsToday = false;
ViewBag.Years = games.Select(g => g.Year).Distinct().OrderByDescending(y => y).ToList();
ViewBag.Games = games.Where(g => g.Year == year).ToList();
return PartialView("GamesEditor");
}
[HttpGet("new-game-editor")]
public IActionResult NewGameEditor()
{
if (!IsLoggedIn()) return Redirect("/membre");
return PartialView();
}
[HttpPost("new-game")]
public async Task<IActionResult> NewGame(string gameDate, string gameTime, string homeTeam, string awayTeam)
{
if (!IsLoggedIn()) return Redirect("/membre");
var (game, error) = await _games.CreateNewGame(gameDate, gameTime, homeTeam, awayTeam);
if (error != "")
{
ViewBag.Error = error;
return StatusCode(500, PartialView("NewGameError"));
}
Response.Headers["game-id"] = game!.Id;
return PartialView("SingleGameEditor", game);
}
[HttpDelete("games/{gameId}")]
public async Task<IActionResult> DeleteGame(string gameId)
{
if (!IsLoggedIn()) return Redirect("/membre");
var ok = await _games.DeleteGameById(gameId);
return Content(ok ? "true" : "false");
}
[HttpPost("games/{gameId}")]
public async Task<IActionResult> UpdateGame(string gameId, int? awayScore, int? homeScore, string? gameType)
{
if (!IsLoggedIn()) return Redirect("/membre");
var success = await _games.UpdateGame(gameId, homeScore, awayScore,
rain: gameType == "rain", practice: gameType == "practice");
return Content(success
? "<i class=\"fa fa-floppy-o\" aria-hidden=\"true\"></i>"
: "<i class=\"fa fa-exclamation-triangle\" aria-hidden=\"true\"></i>");
}
[HttpPost("games/{gameId}/switch")]
public async Task<IActionResult> SwitchVisitors(string gameId)
{
if (!IsLoggedIn()) return Redirect("/membre");
var success = await _games.SwitchVisitors(gameId);
if (!success)
return Content("<i class=\"fa fa-exclamation-triangle\" aria-hidden=\"true\"></i>");
var game = await _games.GetGameById(gameId);
Response.Headers["game-id"] = gameId;
return PartialView("SingleGameEditor", game);
}
private bool IsLoggedIn()
{
Request.Cookies.TryGetValue(SessionCookie, out var expires);
Request.Cookies.TryGetValue(SessionSignCookie, out var sig);
return _login.VerifySession(expires, sig);
}
}
+15
View File
@@ -0,0 +1,15 @@
namespace Phenix.Models;
public class Game
{
public string Id { get; set; } = "";
public string Date { get; set; } = "";
public string Time { get; set; } = "";
public string Home { get; set; } = "";
public string Away { get; set; } = "";
public int Year { get; set; }
public int? HomeScore { get; set; }
public int? AwayScore { get; set; }
public bool Practice { get; set; }
public bool Rain { get; set; }
}
+8
View File
@@ -0,0 +1,8 @@
namespace Phenix.Models;
public class TeamSelectorModel
{
public string Name { get; set; } = "";
public string SelectedTeam { get; set; } = "";
public bool IsDisabled { get; set; }
}
+15
View File
@@ -0,0 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<RootNamespace>Phenix</RootNamespace>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Data.Sqlite" Version="9.0.0" />
<PackageReference Include="Npgsql" Version="8.0.0" />
</ItemGroup>
</Project>
+47
View File
@@ -0,0 +1,47 @@
using Phenix.Services;
var builder = WebApplication.CreateBuilder(new WebApplicationOptions
{
Args = args,
WebRootPath = "static",
});
builder.Services
.AddControllersWithViews()
.AddRazorOptions(o =>
{
o.ViewLocationFormats.Clear();
o.ViewLocationFormats.Add("/Views/{1}/{0}.cshtml");
o.ViewLocationFormats.Add("/Views/Shared/{0}.cshtml");
o.ViewLocationFormats.Add("/Views/{0}.cshtml");
});
builder.Services.AddSingleton<IGameService>(sp =>
{
var config = sp.GetRequiredService<IConfiguration>();
var connStr = config.GetConnectionString("Default")
?? "Data Source=phenix.db";
var provider = config["DatabaseProvider"] ?? "Sqlite";
IGameService svc = provider.ToLowerInvariant() switch
{
"postgres" or "postgresql" => new PostgresGameService(connStr),
_ => new SqliteGameService(connStr),
};
svc.Init().GetAwaiter().GetResult();
return svc;
});
builder.Services.AddSingleton(sp =>
{
var key = sp.GetRequiredService<IConfiguration>()["SessionKey"] ?? "dev-only";
return new LoginService(key);
});
var app = builder.Build();
app.UseStaticFiles();
app.MapControllers();
app.Run();
+27 -29
View File
@@ -1,41 +1,39 @@
# Site Web de Balle Phénix # Site Web de [Balle Phénix](http://ballephenix.com)
![Image Alt](https://gitlab.com/didiercrunch/phenix-website/raw/master/images/phenix_logo.png)
## Stack
## introduction - **ASP.NET Core 9** — Razor Views (`Views/*.cshtml`), contrôleurs dans `Controllers/`
- **SQLite** par défaut (`phenix.db`), Postgres au choix via `DatabaseProvider`
- **Nix** — build et déploiement via `flake.nix` (service NixOS, domaine `ballephenix.com`)
- Les assets statiques vivent dans `static/` et sont servis par `app.config.WebRootPath = "static"`
Vous trouverez le code source du site web pour les Phénix ici. Le site web ## Développement
en lui-même est accessible au https://didiercrunch.gitlab.io/phenix-website/.
### Structure du site web. ```shell
dotnet run
```
Premièrement, mille excuses pour mes choix hétéroclites. J'ai décidé d'explorer Base de données SQLite par défaut (`phenix.db`). La config se règle dans `appsettings.json`
de nouvels technologies avec ce projet. En conséquence, le code est un peu (ou par variables d'environnement en prod, voir le module NixOS dans `flake.nix`).
difficile à comprendre à première vue mais il est __tellement__ plus cool!
Pour peupler une instance locale depuis la prod:
#### Choix ```shell
python dev/populate-db/populate.py --source https://ballephenix.com --target http://localhost:5000 --force
```
* mithril.js comme framework dans le fureteur ## Déploiement
* require.js pour les dépendances
* uikit avec sass comme framework css
* gulp pour la compilation
* gitlab pour le deployment
--- Le build et le service NixOS sont décrits dans `flake.nix` (`packages.website` et
`nixosModules.x86_64-linux`). Le module déploie le binaire `Phenix` avec `static/`
et une base de données dans `/var/lib/phenix`.
# English Version ## Outils d'administration
All the source code is in english. The source code is for a static web - `debut_saison.ts` — script Deno qui crée le calendrier de la saison: se connecte
side for The softball league 'Balle Phénix'. via `GET /login` puis POST chaque partie à `/membre/new-game`. Mettre à jour les
identifiants en haut du fichier et les dates avant de le lancer.
## How to build ```shell
deno run -A debut_saison.ts
$ npm install ```
$ node_modules/.bin/gulp help
# How it is made
* mithril.js as client side framework
* uikit as css framework
* coffee and love
+15
View File
@@ -0,0 +1,15 @@
using Phenix.Models;
namespace Phenix.Services;
public interface IGameService
{
Task Init();
Task<List<Game>> GetAllGames();
Task<Game?> GetGameById(string id);
Task<(Game? Game, string Error)> CreateNewGame(string date, string time, string home, string away);
Task<bool> UpdateGame(string id, int? homeScore, int? awayScore, bool? rain, bool? practice);
Task<bool> DeleteGameById(string id);
Task<bool> SwitchVisitors(string id);
Task ClearAllGames();
}
+67
View File
@@ -0,0 +1,67 @@
using System.Security.Cryptography;
using System.Text;
namespace Phenix.Services;
public class LoginService
{
private readonly Dictionary<string, string> _users;
private readonly string _sessionKey;
private static readonly (string User, string Hash)[] OfficialUsers =
[
("marqueur", "34373780cc542a1eddb6a08488ec149323b94d66025421acd98ffc20eb5055a0:6f2fa05777d45a2da9db79b7fd11e3bc69eb1807642ccb53d41a0b9eb71a3311"),
("comite", "8649feff48a50f53448e59ce480db97b5549eef1d92c886c49b5a14ee22648e5:a0017b879c8834d2f34938e7a4fa3f4c7be8f70545b9bb22a28cf56ab2eb26d9"),
];
public LoginService(string sessionKey)
{
_users = OfficialUsers.ToDictionary(x => x.User, x => x.Hash);
_sessionKey = sessionKey;
}
public bool ValidateCredentials(string username, string password)
{
if (!_users.TryGetValue(username, out var hashWithSalt))
return false;
return VerifyPassword(password, hashWithSalt);
}
public string SignSession(long expiresAt)
{
return ShittyHmac(expiresAt.ToString(), _sessionKey);
}
public bool VerifySession(string? expiresAt, string? signature)
{
if (expiresAt is null || signature is null)
return false;
if (!long.TryParse(expiresAt, out var ts))
return false;
if (signature != ShittyHmac(ts.ToString(), _sessionKey))
return false;
return DateTimeOffset.UtcNow.ToUnixTimeSeconds() < ts;
}
private static bool VerifyPassword(string password, string hashWithSalt)
{
var parts = hashWithSalt.Split(':');
if (parts.Length != 2) return false;
var salt = parts[0];
var expected = parts[1];
return ShittyHmac(password, salt) == expected;
}
private static string HashMessage(string message)
{
var bytes = SHA256.HashData(Encoding.UTF8.GetBytes(message));
return Convert.ToHexStringLower(bytes);
}
private static string ShittyHmac(string message, string salt)
{
var h1 = HashMessage(message + salt);
var h2 = HashMessage(salt + message);
return HashMessage(h1 + h2);
}
}
+209
View File
@@ -0,0 +1,209 @@
using System.Data.Common;
using Npgsql;
using Phenix.Models;
namespace Phenix.Services;
public class PostgresGameService : IGameService
{
private readonly string _connectionString;
public PostgresGameService(string connectionString)
{
_connectionString = connectionString;
}
public async Task Init()
{
await using var conn = new NpgsqlConnection(_connectionString);
await conn.OpenAsync();
var cmd = conn.CreateCommand();
cmd.CommandText = """
CREATE TABLE IF NOT EXISTS games (
id TEXT PRIMARY KEY,
date TEXT NOT NULL,
time TEXT NOT NULL,
home TEXT NOT NULL,
away TEXT NOT NULL,
year INTEGER NOT NULL,
home_score INTEGER,
away_score INTEGER,
practice BOOLEAN NOT NULL DEFAULT FALSE,
rain BOOLEAN NOT NULL DEFAULT FALSE,
UNIQUE(date, time)
)
""";
await cmd.ExecuteNonQueryAsync();
}
public async Task<List<Game>> GetAllGames()
{
var games = new List<Game>();
await using var conn = new NpgsqlConnection(_connectionString);
await conn.OpenAsync();
var cmd = conn.CreateCommand();
cmd.CommandText = "SELECT * FROM games ORDER BY date, time";
await using var reader = await cmd.ExecuteReaderAsync();
while (await reader.ReadAsync())
games.Add(ReadGame(reader));
return games;
}
public async Task<Game?> GetGameById(string id)
{
await using var conn = new NpgsqlConnection(_connectionString);
await conn.OpenAsync();
var cmd = conn.CreateCommand();
cmd.CommandText = "SELECT * FROM games WHERE id = @id";
cmd.Parameters.AddWithValue("@id", id);
await using var reader = await cmd.ExecuteReaderAsync();
if (await reader.ReadAsync())
return ReadGame(reader);
return null;
}
public async Task<(Game? Game, string Error)> CreateNewGame(string date, string time, string home, string away)
{
date = CleanDate(date);
time = CleanTime(time);
if (!DateOnly.TryParse(date, out _))
return (null, $"Invalide date format {date}");
if (!TimeOnly.TryParse(time, out _))
return (null, $"Invalide time format {time}");
if (!ValidTeams.Contains(away))
return (null, $"Invalide away format {away}");
if (!ValidTeams.Contains(home))
return (null, $"Invalide home format {home}");
if (home == away)
return (null, $"Home and away teams must be different (received {home} for both)");
var year = DateOnly.Parse(date).Year;
var game = new Game
{
Id = Guid.NewGuid().ToString(),
Date = date,
Time = time,
Home = home,
Away = away,
Year = year,
};
try
{
await using var conn = new NpgsqlConnection(_connectionString);
await conn.OpenAsync();
var cmd = conn.CreateCommand();
cmd.CommandText = """
INSERT INTO games (id, date, time, home, away, year)
VALUES (@id, @date, @time, @home, @away, @year)
""";
cmd.Parameters.AddWithValue("@id", game.Id);
cmd.Parameters.AddWithValue("@date", game.Date);
cmd.Parameters.AddWithValue("@time", game.Time);
cmd.Parameters.AddWithValue("@home", game.Home);
cmd.Parameters.AddWithValue("@away", game.Away);
cmd.Parameters.AddWithValue("@year", game.Year);
await cmd.ExecuteNonQueryAsync();
}
catch (PostgresException ex) when (ex.SqlState == "23505")
{
return (null, "game already exists at this date/time");
}
return (game, "");
}
public async Task<bool> UpdateGame(string id, int? homeScore, int? awayScore, bool? rain, bool? practice)
{
await using var conn = new NpgsqlConnection(_connectionString);
await conn.OpenAsync();
var cmd = conn.CreateCommand();
cmd.CommandText = """
UPDATE games SET
home_score = COALESCE(@homeScore, home_score),
away_score = COALESCE(@awayScore, away_score),
rain = COALESCE(@rain, rain),
practice = COALESCE(@practice, practice)
WHERE id = @id
""";
cmd.Parameters.AddWithValue("@id", id);
cmd.Parameters.AddWithValue("@homeScore", (object?)homeScore ?? DBNull.Value);
cmd.Parameters.AddWithValue("@awayScore", (object?)awayScore ?? DBNull.Value);
cmd.Parameters.AddWithValue("@rain", rain ?? (object?)DBNull.Value);
cmd.Parameters.AddWithValue("@practice", practice ?? (object?)DBNull.Value);
return await cmd.ExecuteNonQueryAsync() > 0;
}
public async Task<bool> DeleteGameById(string id)
{
await using var conn = new NpgsqlConnection(_connectionString);
await conn.OpenAsync();
var cmd = conn.CreateCommand();
cmd.CommandText = "DELETE FROM games WHERE id = @id";
cmd.Parameters.AddWithValue("@id", id);
return await cmd.ExecuteNonQueryAsync() > 0;
}
public async Task ClearAllGames()
{
await using var conn = new NpgsqlConnection(_connectionString);
await conn.OpenAsync();
var cmd = conn.CreateCommand();
cmd.CommandText = "DELETE FROM games";
await cmd.ExecuteNonQueryAsync();
}
public async Task<bool> SwitchVisitors(string id)
{
var game = await GetGameById(id);
if (game is null) return false;
await using var conn = new NpgsqlConnection(_connectionString);
await conn.OpenAsync();
var cmd = conn.CreateCommand();
cmd.CommandText = """
UPDATE games SET home = @home, away = @away,
home_score = @homeScore, away_score = @awayScore
WHERE id = @id
""";
cmd.Parameters.AddWithValue("@id", id);
cmd.Parameters.AddWithValue("@home", game.Away);
cmd.Parameters.AddWithValue("@away", game.Home);
cmd.Parameters.AddWithValue("@homeScore", (object?)game.AwayScore ?? DBNull.Value);
cmd.Parameters.AddWithValue("@awayScore", (object?)game.HomeScore ?? DBNull.Value);
return await cmd.ExecuteNonQueryAsync() > 0;
}
private static Game ReadGame(DbDataReader r) => new()
{
Id = r.GetString(r.GetOrdinal("id")),
Date = r.GetString(r.GetOrdinal("date")),
Time = r.GetString(r.GetOrdinal("time")),
Home = r.GetString(r.GetOrdinal("home")),
Away = r.GetString(r.GetOrdinal("away")),
Year = r.GetInt32(r.GetOrdinal("year")),
HomeScore = r.IsDBNull(r.GetOrdinal("home_score")) ? null : r.GetInt32(r.GetOrdinal("home_score")),
AwayScore = r.IsDBNull(r.GetOrdinal("away_score")) ? null : r.GetInt32(r.GetOrdinal("away_score")),
Practice = r.GetBoolean(r.GetOrdinal("practice")),
Rain = r.GetBoolean(r.GetOrdinal("rain")),
};
private static readonly string[] ValidTeams =
["jaune", "rouge", "bleu", "gris", "vert", "noir", "orange", "mauve"];
private static string CleanDate(string raw)
{
var parts = raw.Split('-');
if (parts.Length != 3) return raw;
return $"{parts[0]}-{parts[1].PadLeft(2, '0')}-{parts[2].PadLeft(2, '0')}";
}
private static string CleanTime(string raw)
{
var sep = raw.Contains('h') ? 'h' : ':';
var parts = raw.Split(sep);
if (parts.Length != 2) return raw;
return $"{parts[0].PadLeft(2, '0')}:{parts[1].PadLeft(2, '0')}";
}
}
+209
View File
@@ -0,0 +1,209 @@
using System.Data.Common;
using Microsoft.Data.Sqlite;
using Phenix.Models;
namespace Phenix.Services;
public class SqliteGameService : IGameService
{
private readonly string _connectionString;
public SqliteGameService(string connectionString)
{
_connectionString = connectionString;
}
public async Task Init()
{
await using var conn = new SqliteConnection(_connectionString);
await conn.OpenAsync();
var cmd = conn.CreateCommand();
cmd.CommandText = """
CREATE TABLE IF NOT EXISTS games (
id TEXT PRIMARY KEY,
date TEXT NOT NULL,
time TEXT NOT NULL,
home TEXT NOT NULL,
away TEXT NOT NULL,
year INTEGER NOT NULL,
home_score INTEGER,
away_score INTEGER,
practice INTEGER NOT NULL DEFAULT 0,
rain INTEGER NOT NULL DEFAULT 0,
UNIQUE(date, time)
)
""";
await cmd.ExecuteNonQueryAsync();
}
public async Task<List<Game>> GetAllGames()
{
var games = new List<Game>();
await using var conn = new SqliteConnection(_connectionString);
await conn.OpenAsync();
var cmd = conn.CreateCommand();
cmd.CommandText = "SELECT * FROM games ORDER BY date, time";
await using var reader = await cmd.ExecuteReaderAsync();
while (await reader.ReadAsync())
games.Add(ReadGame(reader));
return games;
}
public async Task<Game?> GetGameById(string id)
{
await using var conn = new SqliteConnection(_connectionString);
await conn.OpenAsync();
var cmd = conn.CreateCommand();
cmd.CommandText = "SELECT * FROM games WHERE id = @id";
cmd.Parameters.AddWithValue("@id", id);
await using var reader = await cmd.ExecuteReaderAsync();
if (await reader.ReadAsync())
return ReadGame(reader);
return null;
}
public async Task<(Game? Game, string Error)> CreateNewGame(string date, string time, string home, string away)
{
date = CleanDate(date);
time = CleanTime(time);
if (!DateOnly.TryParse(date, out _))
return (null, $"Invalide date format {date}");
if (!TimeOnly.TryParse(time, out _))
return (null, $"Invalide time format {time}");
if (!ValidTeams.Contains(away))
return (null, $"Invalide away format {away}");
if (!ValidTeams.Contains(home))
return (null, $"Invalide home format {home}");
if (home == away)
return (null, $"Home and away teams must be different (received {home} for both)");
var year = DateOnly.Parse(date).Year;
var game = new Game
{
Id = Guid.NewGuid().ToString(),
Date = date,
Time = time,
Home = home,
Away = away,
Year = year,
};
try
{
await using var conn = new SqliteConnection(_connectionString);
await conn.OpenAsync();
var cmd = conn.CreateCommand();
cmd.CommandText = """
INSERT INTO games (id, date, time, home, away, year)
VALUES (@id, @date, @time, @home, @away, @year)
""";
cmd.Parameters.AddWithValue("@id", game.Id);
cmd.Parameters.AddWithValue("@date", game.Date);
cmd.Parameters.AddWithValue("@time", game.Time);
cmd.Parameters.AddWithValue("@home", game.Home);
cmd.Parameters.AddWithValue("@away", game.Away);
cmd.Parameters.AddWithValue("@year", game.Year);
await cmd.ExecuteNonQueryAsync();
}
catch (SqliteException ex) when (ex.SqliteErrorCode == 19)
{
return (null, "game already exists at this date/time");
}
return (game, "");
}
public async Task<bool> UpdateGame(string id, int? homeScore, int? awayScore, bool? rain, bool? practice)
{
await using var conn = new SqliteConnection(_connectionString);
await conn.OpenAsync();
var cmd = conn.CreateCommand();
cmd.CommandText = """
UPDATE games SET
home_score = COALESCE(@homeScore, home_score),
away_score = COALESCE(@awayScore, away_score),
rain = COALESCE(@rain, rain),
practice = COALESCE(@practice, practice)
WHERE id = @id
""";
cmd.Parameters.AddWithValue("@id", id);
cmd.Parameters.AddWithValue("@homeScore", (object?)homeScore ?? DBNull.Value);
cmd.Parameters.AddWithValue("@awayScore", (object?)awayScore ?? DBNull.Value);
cmd.Parameters.AddWithValue("@rain", rain ?? (object?)DBNull.Value);
cmd.Parameters.AddWithValue("@practice", practice ?? (object?)DBNull.Value);
return await cmd.ExecuteNonQueryAsync() > 0;
}
public async Task<bool> DeleteGameById(string id)
{
await using var conn = new SqliteConnection(_connectionString);
await conn.OpenAsync();
var cmd = conn.CreateCommand();
cmd.CommandText = "DELETE FROM games WHERE id = @id";
cmd.Parameters.AddWithValue("@id", id);
return await cmd.ExecuteNonQueryAsync() > 0;
}
public async Task ClearAllGames()
{
await using var conn = new SqliteConnection(_connectionString);
await conn.OpenAsync();
var cmd = conn.CreateCommand();
cmd.CommandText = "DELETE FROM games";
await cmd.ExecuteNonQueryAsync();
}
public async Task<bool> SwitchVisitors(string id)
{
var game = await GetGameById(id);
if (game is null) return false;
await using var conn = new SqliteConnection(_connectionString);
await conn.OpenAsync();
var cmd = conn.CreateCommand();
cmd.CommandText = """
UPDATE games SET home = @home, away = @away,
home_score = @homeScore, away_score = @awayScore
WHERE id = @id
""";
cmd.Parameters.AddWithValue("@id", id);
cmd.Parameters.AddWithValue("@home", game.Away);
cmd.Parameters.AddWithValue("@away", game.Home);
cmd.Parameters.AddWithValue("@homeScore", (object?)game.AwayScore ?? DBNull.Value);
cmd.Parameters.AddWithValue("@awayScore", (object?)game.HomeScore ?? DBNull.Value);
return await cmd.ExecuteNonQueryAsync() > 0;
}
private static Game ReadGame(DbDataReader r) => new()
{
Id = r.GetString(r.GetOrdinal("id")),
Date = r.GetString(r.GetOrdinal("date")),
Time = r.GetString(r.GetOrdinal("time")),
Home = r.GetString(r.GetOrdinal("home")),
Away = r.GetString(r.GetOrdinal("away")),
Year = r.GetInt32(r.GetOrdinal("year")),
HomeScore = r.IsDBNull(r.GetOrdinal("home_score")) ? null : r.GetInt32(r.GetOrdinal("home_score")),
AwayScore = r.IsDBNull(r.GetOrdinal("away_score")) ? null : r.GetInt32(r.GetOrdinal("away_score")),
Practice = r.GetBoolean(r.GetOrdinal("practice")),
Rain = r.GetBoolean(r.GetOrdinal("rain")),
};
private static readonly string[] ValidTeams =
["jaune", "rouge", "bleu", "gris", "vert", "noir", "orange", "mauve"];
private static string CleanDate(string raw)
{
var parts = raw.Split('-');
if (parts.Length != 3) return raw;
return $"{parts[0]}-{parts[1].PadLeft(2, '0')}-{parts[2].PadLeft(2, '0')}";
}
private static string CleanTime(string raw)
{
var sep = raw.Contains('h') ? 'h' : ':';
var parts = raw.Split(sep);
if (parts.Length != 2) return raw;
return $"{parts[0].PadLeft(2, '0')}:{parts[1].PadLeft(2, '0')}";
}
}
+7
View File
@@ -0,0 +1,7 @@
@{
Layout = "_Layout";
ViewData["Tab"] = "calendrier";
}
<div id="mithril-content"></div>
<script type=module src="scripts/calendar.js"></script>
+36
View File
@@ -0,0 +1,36 @@
@{
Layout = "_Layout";
ViewData["Tab"] = "contact";
}
<div class="uk-width-large-2-5 uk-width-medium-4-5 uk-width-small-1-1 uk-container-center">
<div class="uk-grid uk-margin">
<div class="uk-width-1-1">
<div style="height: 300px; width: 300px; background-size: 300px; background-image: url(images/logosansfond.JPG);" class="uk-cover-background uk-container-center"></div>
</div>
</div>
<div class="div uk-panel uk-panel-box uk-panel-box-secondary uk-container-center uk-margin">
<table class="uk-table">
<tr>
<td class="uk-text-right"><i class="fa fa-desktop"></i></td>
<td><a href="mailto:sportsphenixmtl@gmail.com">sportsphenixmtl@gmail.com</a></td>
</tr>
<tr>
<td class="uk-text-right"><i class="fa fa-phone"></i></td>
<td> (514) 838-8950</td>
</tr>
<tr>
<td class="uk-text-right"><i class="fa fa-envelope"></i></td>
<td>
<p> 10454 Sylvain-Garneau<br>Montréal, Québec H1C 0A2</p>
</td>
</tr>
<tr>
<td class="uk-text-right"><i class="fa fa-gitlab"></i></td>
<td>
<p> Le site web est ouvert et accessible sur <a href="https://gitlab.com/ballephenix/website">gitlab.</a></p>
</td>
</tr>
</table>
</div>
</div>
+103
View File
@@ -0,0 +1,103 @@
@{
Layout = "_Layout";
ViewData["Tab"] = "home";
}
<script type="module" src="scripts/little-calendar.js"></script>
<div class="uk-grid">
<div class="uk-large-1-3 uk-medium-2-3 uk-container-center">
<div style="height:300px; width: 300px; background-size: 300px; background-image: url(images/logosansfond.JPG);" class="uk-cover-background uk-container-center uk-margin-left uk-margin-top"></div>
</div>
</div>
<div class="uk-margin-top uk-margin-bottom uk-grid">
<div class="uk-width-large-3-5 uk-width-medium-4-5 uk-width-small-1-1 uk-container-center">
<div class="uk-grid uk-visible-large uk-grid-match">
<div class="uk-width-large-1-3 uk-width-medium-1-3">
<div class="uk-panel uk-panel-box">
<div class="uk-panel-badge uk-badge">
<i class="fa fa-newspaper-o" style="font-size: 1.7em;"></i>
</div>
<div>
<partial name="HomeNews" />
</div>
</div>
</div>
<div class="uk-width-large-1-3 uk-width-medium-1-3">
<div class="uk-panel uk-panel-box">
<div class="uk-panel-badge uk-badge"><i class="fa fa-calendar" style="font-size: 1.7em;"></i></div>
<h3 class="uk-panel-title"><a href="#/calendrier" class="uk-link-muted">Calendrier</a></h3>
<div id="large-mithril-container"></div>
</div>
</div>
<div class="uk-width-large-1-3 uk-width-medium-1-3">
<div class="uk-panel uk-panel-box">
<div class="uk-panel-badge uk-badge"><i class="fa fa-map-o" style="font-size: 1.7em;"></i></div>
<h3 class="uk-panel-title">Parc Walter-Stewart</h3>
<partial name="WalterStewartMap" />
</div>
</div>
</div>
<div class="uk-visible-medium">
<div class="uk-grid uk-grid-match">
<div class="uk-width-medium-1-2">
<div class="uk-panel uk-panel-box">
<div class="uk-panel-badge uk-badge"><i class="fa fa-newspaper-o" style="font-size: 1.7em;"></i></div>
<div>
<partial name="HomeNews" />
</div>
</div>
</div>
<div class="uk-width-medium-1-2">
<div class="uk-panel uk-panel-box">
<div class="uk-panel-badge uk-badge"><i class="fa fa-calendar" style="font-size: 1.7em;"></i></div>
<h3 class="uk-panel-title"><a href="#/calendrier" class="uk-link-muted">Calendrier</a></h3>
<div id="medium-mithril-container"></div>
</div>
</div>
</div>
<div class="uk-grid">
<div class="uk-width-medium-1-1">
<div class="uk-panel uk-panel-box">
<div class="uk-panel-badge uk-badge"><i class="fa fa-map-o" style="font-size: 1.7em;"></i></div>
<h3 class="uk-panel-title">Parc Walter-Stewart</h3>
<partial name="WalterStewartMap" />
</div>
</div>
</div>
</div>
<div class="uk-visible-small">
<div class="uk-grid">
<div class="uk-width-small-1-1">
<div class="uk-panel uk-panel-box">
<div class="uk-panel-badge uk-badge"><i class="fa fa-newspaper-o" style="font-size: 1.7em;"></i></div>
<div>
<partial name="HomeNews" />
</div>
</div>
</div>
</div>
<div class="uk-grid">
<div class="uk-width-small-1-1">
<div class="uk-panel uk-panel-box">
<div class="uk-panel-badge uk-badge"><i class="fa fa-calendar" style="font-size: 1.7em;"></i></div>
<h3 class="uk-panel-title"><a href="#/calendrier" class="uk-link-muted">Calendrier</a></h3>
<div id="small-mithril-container"></div>
</div>
</div>
</div>
<div class="uk-grid">
<div class="uk-width-small-1-1">
<div class="uk-panel uk-panel-box">
<div class="uk-panel-badge uk-badge"><i class="fa fa-map-o" style="font-size: 1.7em;"></i></div>
<h3 class="uk-panel-title">Parc Walter-Stewart</h3>
<partial name="WalterStewartMap" />
</div>
</div>
</div>
</div>
</div>
</div>
+64
View File
@@ -0,0 +1,64 @@
@{
Layout = "_Layout";
ViewData["Tab"] = "nouvelles";
}
<div class="uk-width-large-2-5 uk-width-medium-3-5 uk-width-small-1-1 uk-container-center">
<div>
<article class="uk-article uk-margin-">
<h1 class="uk-article-title">
<h2 id="pre-inscription">Pré-inscription</h2>
</h1>
<p class="uk-article-meta">
<p>Samedi 8 Août 2026</p>
</p>
<p>
La pré-inscription pour la balle-molle Phénix est maintenant ouverte. Ça ne coûte rien et c'est sans prix!
</p>
<p>
<a href="https://forms.gle/Mv2wCVdbP83uiMdC7">https://forms.gle/Mv2wCVdbP83uiMdC7</a>
</p>
</article>
</div>
</div>
<div class="uk-width-large-2-5 uk-width-medium-3-5 uk-width-small-1-1 uk-container-center">
<div>
<article class="uk-article uk-margin-">
<h1 class="uk-article-title">
<h2 id="saison-2025">Saison 2026</h2>
</h1>
<p class="uk-article-meta">
<p>Lundi 9 Mars 2026</p>
</p>
<p>
La saison de la balle annonce à grand pas et les inscriptions débuteront lundi prochain (16 mars 2026). Le coût de la saison sera le même que l'an passé: 155$ pour la saison + 20$ de dépôt remboursable pour le prêt du chandail.
</p>
<p>
Comme à l'habitude, nous jouerons au parc walter-stewart les jeudis soir. La ligue comptera quatre équipes pour un grand total de 44 joueurs.
</p>
<p>
Les inscriptions en présentiel auront lieu le vendredi 20 mars au bar fullum entre 18h00 et 21h00. Pour ceux qui veulle venir prendre une petite bière avec nous ou payer en argent compten.
</p>
<p>
On vous tiens au courrant!
</p>
</article>
</div>
</div>
<div class="uk-width-large-2-5 uk-width-medium-3-5 uk-width-small-1-1 uk-container-center">
<div>
<article class="uk-article uk-margin-">
<h1 class="uk-article-title">
<h2 id="saison-2025">Saison 2025</h2>
</h1>
<p class="uk-article-meta">
<p>Vendredi 25 Avril 2025</p>
</p>
<p>Bonne saison à tous et toutes!</p>
<p>N'oubliez pas de consulter la page facebook: <a href="https://www.facebook.com/SportsPhenixMtl/">https://www.facebook.com/SportsPhenixMtl/</a> pour toutes mises à jour, y compris les annulations due à la météo.</p>
<p>Votre Comité 2023</p>
</article>
</div>
</div>
+43
View File
@@ -0,0 +1,43 @@
@{
Layout = "_Layout";
ViewData["Tab"] = "reglement";
}
<div class="uk-margin-top uk-margin-bottom uk-grid">
<div class="uk-width-large-3-5 uk-width-medium-4-5 uk-width-large-1-1 uk-container-center">
<div class="uk-grid">
<div class="uk-width-large-1-3 uk-width-small-1-1">
<div style="height: 250px; width: 250px; background-size: 250px; background-image: url(images/logosansfond.JPG);" class="uk-cover-background uk-container-center"></div>
</div>
<div class="uk-width-large-2-3 uk-width-small-1-1">
<div class="uk-panel uk-panel-box uk-panel-box-secondary">
<h2>Règlements 2021</h2>
<ul>
<li>
<h3><a href="files/regle_de_jeux_2021.pdf">Règles de jeu</a></h3>
</li>
<li>
<h3><a href="files/regles_et_procedures_2021.pdf">Règles et procédures</a></h3>
</li>
<li>
<h3><a href="files/charte_organisationnelle_2021.pdf">Charte Organisationnelle</a></h3>
</li>
<li>
<h3><a href="files/formulaire_inscription_2021.pdf">Formulaire d'inscription</a></h3>
</li>
<li>
<h3><a href="files/code_ethique_2021.pdf">Code d'éthique</a></h3>
</li>
<li>
<h3><a href="http://www.asbm.ca/">Association des Sports de Balle à Montréal (ASBN)</a></h3>
</li>
</ul>
</div>
</div>
</div>
<div class="uk-panel uk-panel-box uk-panel-box-secondary">
<h2>Mission</h2>
<p>La ligue de balle Les Phénix a été fondée en 2004 afin d'offrir aux membres de la communauté gaie et lesbienne et à leurs amis hétéros l'opportunité de s'amuser et de pratiquer un sport dans une ambiance amicale et décontractée. L'ouverture d'esprit, la camaraderie et le plaisir de pratiquer un sport à l'extérieur caractérisent cette ligue.</p>
</div>
</div>
</div>
+36
View File
@@ -0,0 +1,36 @@
@{
var isToday = ViewBag.IsToday == true;
var years = (List<int>)ViewBag.Years;
var games = (List<Phenix.Models.Game>)ViewBag.Games;
var selectedYear = (int?)ViewBag.SelectedYear;
}
<div class="uk-width-large-2-3 uk-container-center uk-margin">
<div class="uk-margin" style="margin-top: 1em">
<ul class="uk-tab">
<li class="@(isToday ? "uk-active" : "")">
<a hx-get="/membre/games-editor/today" hx-target="#content">Aujourd'hui</a>
</li>
@foreach (var year in years)
{
<li class="@(year == selectedYear ? "uk-active" : "")">
<a hx-get="/membre/games-editor/@year" hx-target="#content">Saison @year</a>
</li>
}
</ul>
</div>
@foreach (var game in games)
{
<div class="uk-panel uk-panel-box uk-panel-box-secondary uk-margin">
<partial name="GameEditor" model="game" />
</div>
}
<hr>
<button class="uk-button"
hx-get="/membre/new-game-editor"
hx-target="#content">
Nouvelle Partie
</button>
</div>
+28
View File
@@ -0,0 +1,28 @@
@{
Layout = "_Layout";
ViewData["Tab"] = "membre";
}
<div id="content"
@if (ViewBag.IsLoggedIn == true)
{
@:hx-get="/membre/games-editor/today"
@:hx-trigger="load"
@:hx-target="#content"
}>
<div class="uk-grid uk-margin">
<div class="uk-width-1-1">
<div style="height: 250px; width: 250px; background-size: 250px; background-image: url(images/logosansfond.JPG);" class="uk-cover-background uk-container-center"></div>
</div>
</div>
<div class="uk-panel uk-panel-box uk-panel-box-secondary uk-width-large-1-3 uk-container-center uk-margin">
<form action=""
class="uk-text-center"
hx-get="/login"
hx-target="#content">
<div class="uk-form-row"><label>Nom d'utilisateur <input type="text" name="username" class="uk-form-width-small"></label></div>
<div class="uk-form-row"><label>Mot de passe <input type="password" name="password" class="uk-form-width-small"></label></div>
<div class="uk-form-row"><button class="uk-button"><i class="fa fa-mars-double"></i> Pénétrez</button></div>
</form>
</div>
</div>
+35
View File
@@ -0,0 +1,35 @@
@{
Layout = null;
}
<div class="uk-width-large-2-3 uk-container-center uk-margin">
<div class="uk-margin"></div>
<div class="uk-panel uk-panel-box uk-panel-box-secondary uk-margin">
<form hx-post="/membre/new-game"
hx-target="#created-game"
hx-swap="afterbegin">
<div class="uk-form-row" style="text-align: center; font-size: 2em;">
<partial name="TeamSelector" model='new Phenix.Models.TeamSelectorModel { Name = "awayTeam" }' />
<label>Vs.</label>
<partial name="TeamSelector" model='new Phenix.Models.TeamSelectorModel { Name = "homeTeam" }' />
</div>
<div class="uk-form-row">
<label>Date: <input type=date name="gameDate" required></label>
</div>
<div class="uk-form-row">
<label>Heure: <input type="time" name="gameTime"></label>
</div>
<br>
<div style="text-align: right;">
<button class="uk-button">Creer</button>
</div>
</form>
</div>
<div id="created-game"></div>
</div>
+9
View File
@@ -0,0 +1,9 @@
@{
Layout = null;
}
<div class="uk-width-large-2-3 uk-container-center uk-margin">
<div class="uk-panel uk-panel-box uk-panel-box-secondary uk-margin">
<pre>@ViewBag.Error</pre>
</div>
</div>
+7
View File
@@ -0,0 +1,7 @@
@model Phenix.Models.Game
<div class="uk-width-large-2-3 uk-container-center uk-margin">
<div class="uk-panel uk-panel-box uk-panel-box-secondary uk-margin">
<partial name="GameEditor" model="Model" />
</div>
</div>
+53
View File
@@ -0,0 +1,53 @@
@model Phenix.Models.Game
@{
var prettyDate = DateOnly.Parse(Model.Date).ToString("d MMMM yyyy", new System.Globalization.CultureInfo("fr-CA"));
}
<div id="game-@Model.Id">
<h3>@Model.Away vs @Model.Home | @prettyDate | @Model.Time</h3>
<form style="font-size: 1.1em;"
hx-trigger="input delay:250ms"
hx-post="/membre/games/@Model.Id"
hx-target="#saving-result">
<div class="uk-form-row">
<label>
Points @Model.Away : <input type=number min=0 name="awayScore"
value="@(Model.AwayScore ?? 0)"
disabled="@(Model.Rain || Model.Practice ? true : null)">
</label>
</div>
<div class="uk-form-row">
<label>
Points @Model.Home : <input type=number min=0 name="homeScore"
value="@(Model.HomeScore ?? 0)"
disabled="@(Model.Rain || Model.Practice ? true : null)">
</label>
</div>
<div class="uk-form-row">
<label>
Partie reguliere <input type=radio name="gameType" value="regular-game"
checked="@(!Model.Practice && !Model.Rain ? true : null)">
</label>
<label>
Pluie <input type=radio name="gameType" value="rain"
checked="@(Model.Rain ? true : null)">
</label>
<label>
Pratique <input type=radio name="gameType" value="practice"
checked="@(Model.Practice && !Model.Rain ? true : null)">
</label>
</div>
<div id="saving-result"></div>
</form>
<div style="text-align: right">
<button class="uk-button"
hx-post="/membre/games/@Model.Id/switch"
hx-target="#game-@Model.Id">Inverser visiteur/receveur</button>
<button class="uk-button-danger"
hx-delete="/membre/games/@Model.Id"
hx-confirm="Certain de voulez supprimer la partie?"
hx-target="#game-@Model.Id"
hx-swap="delete">Supprimer</button>
</div>
</div>
+9
View File
@@ -0,0 +1,9 @@
<h3 class="uk-panel-title">
<a href="/nouvelles" class="uk-link-muted">
<h2 id="pre-inscription">Pré-inscription</h2>
</a>
</h3>
<p>
Pré-inscription pour la balle-molle Phénix, ça ne coûte rien et c'est sans prix! <a href="https://forms.gle/Mv2wCVdbP83uiMdC7">https://forms.gle/Mv2wCVdbP83uiMdC7</a>
</p>
<p><strong><a href="/nouvelles">lire la suite ...</a></strong></p>
+11
View File
@@ -0,0 +1,11 @@
@model Phenix.Models.TeamSelectorModel
@{
var teams = new[] { "jaune", "rouge", "bleu", "gris", "vert", "noir", "orange", "mauve" };
}
<select name="@Model.Name" class="uk-select" disabled="@(Model.IsDisabled)">
@foreach (var team in teams)
{
<option value="@team" selected="@(Model.SelectedTeam == team)">@team</option>
}
</select>
+14
View File
@@ -0,0 +1,14 @@
<div>
<iframe
style="border: 1px solid black; min-height: 300px;"
width="100%"
frameborder="0"
scrolling="no"
marginheight="0"
src="//www.openstreetmap.org/export/embed.html?bbox=-73.55936229228975%2C45.53102667048665%2C-73.55230271816255%2C45.53444249585723&amp;layer=mapnik">
</iframe>
<br>
<small>
<a href="http://www.openstreetmap.org/#map=17/45.53216/-73.55692">Voir la carte</a>
</small>
</div>
+86
View File
@@ -0,0 +1,86 @@
@{
Layout = null;
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Balle Phenix</title>
<link rel="shortcut icon" href="/images/favicon.ico">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="/scripts/jquery-3.7.1.min.js"></script>
<script src="/scripts/uikit.min.js"></script>
<script src="https://unpkg.com/htmx.org@2.0.0"></script>
<link rel="stylesheet" href="/css/style.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
</head>
<body>
<nav class="uk-navbar uk-navbar-attached">
<ul class="uk-navbar-nav uk-visible-large uk-navbar-content uk-navbar-center">
<li class="uk-parent">
<div class="uk-navbar-brand"><a href="https://www.facebook.com/SportsPhenixMtl"><i class="fa fa-facebook-square"></i></a></div>
</li>
<li class="@((ViewData["Tab"] as string) == "home" ? "uk-active" : "")">
<a href="/"><div><i class="fa fa-home"></i> Accueil</div></a>
</li>
<li class="@((ViewData["Tab"] as string) == "nouvelles" ? "uk-active" : "")">
<a href="/nouvelles"><div><i class="fa fa-newspaper-o"></i> Nouvelles</div></a>
</li>
<li class="@((ViewData["Tab"] as string) == "calendrier" ? "uk-active" : "")">
<a href="/calendrier"><div><i class="fa fa-calendar"></i> Calendrier</div></a>
</li>
<li class="@((ViewData["Tab"] as string) == "reglement" ? "uk-active" : "")">
<a href="/reglement"><div><i class="fa fa-legal"></i> Règlement</div></a>
</li>
<li class="@((ViewData["Tab"] as string) == "membre" ? "uk-active" : "")">
<a href="/membre"><div><i class="fa fa-lock"></i> Membre</div></a>
</li>
<li class="@((ViewData["Tab"] as string) == "contact" ? "uk-active" : "")">
<a href="/contact"><div><i class="fa fa-phone"></i> Nous Joindre</div></a>
</li>
</ul>
<ul class="uk-navbar-nav uk-visible-medium">
<li class="uk-parent">
<div class="uk-navbar-brand"><a href="https://www.facebook.com/SportsPhenixMtl"><i class="fa fa-facebook-square"></i></a></div>
</li>
<li class="@((ViewData["Tab"] as string) == "home" ? "uk-active" : "")"><a href="/"><i class="fa fa-home"></i> Accueil </a></li>
<li class="@((ViewData["Tab"] as string) == "nouvelles" ? "uk-active" : "")"><a href="/nouvelles"><i class="fa fa-newspaper-o"></i> Nouvelles</a></li>
<li class="@((ViewData["Tab"] as string) == "calendrier" ? "uk-active" : "")"><a href="/calendrier"><i class="fa fa-calendar"></i> Calendrier</a></li>
<li class="@((ViewData["Tab"] as string) == "reglement" ? "uk-active" : "")"><a href="/reglement"><i class="fa fa-legal"></i> Règlement</a></li>
<li class="@((ViewData["Tab"] as string) == "membre" ? "uk-active" : "")"><a href="/membre"><i class="fa fa-lock"></i> Membre</a></li>
<li class="@((ViewData["Tab"] as string) == "contact" ? "uk-active" : "")"><a href="/contact"><i class="fa fa-phone"></i> Nous Joindre</a></li>
</ul>
<ul class="uk-navbar-nav uk-visible-small">
<li class="uk-parent">
<div class="uk-navbar-brand"><a href="https://www.facebook.com/SportsPhenixMtl"><i class="fa fa-facebook-square"></i></a></div>
</li>
<li data-uk-dropdown="" aria-expanded="" class="uk-parent"><a><i class="fa fa-bars"></i> Menu</a>
<div class="uk-dropdown">
<ul class="uk-nav uk-nav-navbar uk-dropdown-navbar">
<li class="uk-active"><a href="/"><i class="fa fa-home"></i> Accueil</a></li>
<li class=""><a href="/nouvelles"><i class="fa fa-newspaper-o"></i> Nouvelles</a></li>
<li class=""><a href="/calendrier"><i class="fa fa-calendar"></i> Calendrier</a></li>
<li class=""><a href="/reglement"><i class="fa fa-legal"></i> Règlement</a></li>
<li class=""><a href="/membre"><i class="fa fa-lock"></i> Membre</a></li>
<li class=""><a href="/contact"><i class="fa fa-phone"></i> Nous Joindre</a></li>
</ul>
</div>
</li>
</ul>
</nav>
@RenderBody()
<footer class="uk-grid ph-footer" style="padding: 40px;">
<div class="uk-container uk-container-center uk-text-center">
<div class="uk-panel"><span class="uk-hidden-small">Ligue de balle les Phénix... pour le plaisir de jouer!</span>
<h4 class="uk-visible-small">Ligue de balle les Phénix</h4>
</div>
<ul class="uk-subnav uk-subnav-line uk-flex-center">
<li><a href="mailto:sportsphenixmtl@gmail.com">sportsphenixmtl@gmail.com</a></li>
</ul>
<h1><a href="https://www.facebook.com/SportsPhenixMtl"><i class="fa fa-facebook-square"></i></a></h1>
</div>
</footer>
</body>
</html>
+1
View File
@@ -0,0 +1 @@
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
+3
View File
@@ -0,0 +1,3 @@
@{
Layout = "_Layout";
}
+7
View File
@@ -0,0 +1,7 @@
{
"DatabaseProvider": "Sqlite",
"ConnectionStrings": {
"Default": "Data Source=phenix.db"
},
"SessionKey": "dev-only"
}
-26
View File
@@ -1,26 +0,0 @@
{
"name": "phenix-website",
"description": "Main web site of Balle Phénix.",
"main": "index.html",
"authors": [
"didier amyot <didier.amyot@gmail.com>"
],
"license": "MIT",
"moduleType": [],
"homepage": "",
"private": true,
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"lib",
"test",
"tests"
],
"dependencies": {
"uikit": "~2.24.3",
"mithril": "~0.2.1",
"lodash": "~4.2.1",
"almond": "~0.3.1"
}
}
-11
View File
@@ -1,11 +0,0 @@
({
baseUrl: "script",
paths: {
m: '../lib/mithril/mithril.min',
_: '../lib/lodash/dist/lodash.min',
requireLib: '../lib/requirejs/require'
},
include: 'main',
name: "../lib/almond/almond",
out: "main-built.js"
})
-190
View File
@@ -1,190 +0,0 @@
<!doctype html>
<html>
<head>
<title>Balle Phenix</title>
<link rel="stylesheet" href="css/style.css" />
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
<script src="lib/mithril/mithril.min.js"></script>
</head>
<body>
<nav class="uk-navbar">
<div class="uk-navbar-content uk-navbar-center">
<ul class="uk-navbar-nav">
<li class="uk-parent">
<a href="https://www.facebook.com/LigueDeBalleLesPhenix">
<i class="fa fa-facebook-square"></i>
</a>
</li>
<li class="uk-parent"><a href="/">Acceuil</a></li>
<li class="uk-active"><a href="">Calendrier</a></li>
<li class="uk-parent"><a>Règlements</a></li>
<li class="uk-parent"><a>Photos</a></li>
<li class="uk-parent"><a>Membre</a></li>
<li class="uk-parent"><a>Nous Joindre</a></li>
</ul>
</div>
</nav>
<div class="uk-grid">
<div class="uk-width-1-5"></div>
<div class="uk-width-3-5">
<div class="uk-grid">
<div class="uk-width-5-5">
<h2>Classement 2015</h2>
<table class="uk-table uk-table-hover uk-table-striped">
<thead>
<tr>
<th>Équipes</th>
<th>PJ</th>
<th>V</th>
<th>D</th>
<th>N</th>
<th>PP</th>
<th>PC</th>
<th>DIF</th>
<th>PTS</th>
</tr>
</thead>
<tbody>
<tr>
<td>Verts</td>
<td>14</td>
<td>11</td>
<td>3</td>
<td>0</td>
<td>161</td>
<td>108</td>
<td>+53</td>
<td>22</td>
</tr>
<tr>
<td>Verts</td>
<td>14</td>
<td>11</td>
<td>3</td>
<td>0</td>
<td>161</td>
<td>108</td>
<td>+53</td>
<td>22</td>
</tr>
<tr>
<td>Verts</td>
<td>14</td>
<td>11</td>
<td>3</td>
<td>0</td>
<td>161</td>
<td>108</td>
<td>+53</td>
<td>22</td>
</tr>
<tr>
<td>Verts</td>
<td>14</td>
<td>11</td>
<td>3</td>
<td>0</td>
<td>161</td>
<td>108</td>
<td>+53</td>
<td>22</td>
</tr>
</tbody>
</table>
<ul class="uk-subnav uk-subnav-line uk-flex-center">
<li>PJ : Parties joués </li><li> V : Victoire </li><li> D : Défaite </li><li> N : Nul </li><li> PP : Points pour </li><li> PC : Points contre </li><li> DIF : Diférenciel </li><li> PTS : Points </li>
</ul>
</div>
</div>
<div class="uk-grid">
<div class="uk-width-3-5">
<h2>Calendrier 2015</h2>
<h3 style="text-align: left;">5 mai 2016</h3>
<table class="uk-table uk-table-hover uk-table-condensed uk-table-striped">
<tr>
<td>18h30</td>
<td><i class="fa fa-flag" style="color: purple;"></i> Mauve</td>
<td>8</td>
<td>vs</td>
<td><i class="fa fa-flag" style="color: red;"></i> Rouge</td>
<td>7</td>
</tr>
<tr>
<td>18h30</td>
<td><i class="fa fa-flag" style="color: yellow;"></i> Jaune</td>
<td>00</td>
<td>vs</td>
<td><i class="fa fa-flag" style="color: gray;"></i> Gris</td>
<td>00</td>
</tr>
</table>
</div>
</div>
</div>
<div class="uk-width-1-5"></div>
</div>
<footer class="uk-grid ph-footer" style="padding: 80px;">
<div class="uk-container uk-container-center uk-text-center">
<div class="uk-panel">
Ligue de balle les Phénix &hellip; pour le plaisir de jouer!
</div>
<ul class="uk-subnav uk-subnav-line uk-flex-center">
<li><a href="mailto:info@ballephenix.com">info@ballephenix.com</a></li>
</ul>
<h1>
<a href="https://www.facebook.com/LigueDeBalleLesPhenix">
<i class="fa fa-facebook-square"></i>
</a>
</h1>
</div>
</footer>
</body>
</html>
-289
View File
@@ -1,289 +0,0 @@
---
-
email: fleet80@hickle.org
name: "Delle Emmerich"
score: 2
team: rouge
tel: 613-805-2793x858
-
email: qschamberger@yahoo.com
name: "Susie Quitzon MD"
score: 3
team: rouge
tel: 1-332-714-0777x97469
-
email: kianna90@yahoo.com
name: "Johnathan Leuschke"
score: 5
team: jaune
tel: 974-275-2040
-
email: susannah.grant@hotmail.com
name: "Dr. Wendell Sporer"
score: 3
team: rouge
tel: 04691879363
-
email: millicent46@adams.info
name: "Emile Powlowski II"
score: 1
team: bleu
tel: 1-449-950-7363x2633
-
email: cormier.codi@hotmail.com
name: "Gardner Willms"
score: 2
team: bleu
tel: 625-516-1325
-
email: kamryn.kovacek@gmail.com
name: "Aliya Vandervort"
score: 4
team: rouge
tel: "250.915.3706"
-
email: marian97@beahan.org
name: "Gaige Kautzer"
score: 2
team: gris
tel: "298.694.0319"
-
email: patsy.kerluke@satterfieldberge.com
name: "Orilla Brakus"
score: 5
team: rouge
tel: (506)015-3098x8355
-
email: alpha30@connelly.com
name: "Dr. Thurman O'Hara"
score: 5
team: bleu
tel: 07469452414
-
email: thompson.willene@gmail.com
name: "Rachael Medhurst DDS"
score: 2
team: rouge
tel: 1-602-031-0376
-
email: inader@kunze.info
name: "Mr. Ingram Thompson"
score: 2
team: rouge
tel: (109)873-9483x211
-
email: desiree.harris@gmail.com
name: "Dr. Saul Streich Jr."
score: 5
team: gris
tel: 1-249-486-6759x84328
-
email: samir83@hills.com
name: "Kimberley Kihn"
score: 5
team: jaune
tel: 304.586.6687x3262
-
email: egrady@emmerichpadberg.com
name: "Arra Boyer"
score: 3
team: gris
tel: "485.730.8331"
-
email: bgoodwin@gmail.com
name: "Miss Kaylan Robel DVM"
score: 4
team: gris
tel: "321.945.7155"
-
email: angelic86@homenick.com
name: "Kyson Ruecker"
score: 4
team: bleu
tel: 1-017-690-5278
-
email: val.sawayn@gmail.com
name: "Shaun Goodwin"
score: 3
team: jaune
tel: (271)085-2639x251
-
email: kya.wunsch@gmail.com
name: "Mr. Denzell Casper"
score: 2
team: bleu
tel: 948-754-1786x17035
-
email: delmus18@stoltenberg.org
name: "Bluford Marvin Jr."
score: 2
team: jaune
tel: (268)984-3065x3634
-
email: kihn.zackery@gmail.com
name: "Lucio Kub"
score: 2
team: jaune
tel: 185-942-2355x8756
-
email: jade24@aufderharkuhic.com
name: "Mr. Justice Pollich DVM"
score: 1
team: bleu
tel: 1-918-319-1713
-
email: vgoyette@hotmail.com
name: "Bose Ankunding"
score: 4
team: gris
tel: "265.582.6145"
-
email: raltenwerth@lueilwitz.com
name: "Harlen Harber"
score: 1
team: jaune
tel: (081)424-2803
-
email: thiel.bode@reynolds.info
name: "Linnie Abshire"
score: 1
team: rouge
tel: 1-809-325-8148x5271
-
email: istracke@lueilwitz.com
name: "Mr. Juwan Zemlak"
score: 5
team: jaune
tel: 982.535.6849x5299
-
email: boysie44@hartmanngraham.com
name: "Mr. Tahj Bernhard"
score: 1
team: rouge
tel: +57(9)5038029147
-
email: harm91@dare.net
name: "Dr. Lyle Lakin PhD"
score: 4
team: bleu
tel: 079-078-9724
-
email: prosacco.dolphus@dickens.com
name: "Bertram Schuster"
score: 4
team: gris
tel: (917)409-8168x00826
-
email: elian04@stroman.com
name: "Viviana Howell"
score: 5
team: rouge
tel: 1-414-103-3954x02444
-
email: hakim08@hotmail.com
name: "Marques Goodwin"
score: 1
team: rouge
tel: (649)195-3556x81548
-
email: nigel.kilback@gmail.com
name: "Rayfield Lubowitz"
score: 2
team: bleu
tel: (231)457-7181
-
email: rogahn.tollie@lehnerwillms.com
name: "Miss Luz Altenwerth"
score: 3
team: gris
tel: 00248382520
-
email: reilly.velia@hansenhegmann.com
name: "Lilly Brekke"
score: 1
team: rouge
tel: 006.284.1261x54374
-
email: batz.dessa@rippin.org
name: "Jay Aufderhar"
score: 3
team: rouge
tel: 960-144-7624x406
-
email: garth.barton@kerluke.com
name: "Ms. Contina Pfeffer DDS"
score: 5
team: jaune
tel: (352)043-9218x9064
-
email: mmcglynn@gusikowski.com
name: "Robyn Lakin"
score: 1
team: bleu
tel: 667-492-9674x3911
-
email: breinger@yahoo.com
name: "Latonia Kuhlman"
score: 2
team: bleu
tel: 404.860.5529x107
-
email: jamarion.sipes@gmail.com
name: "Dr. Camryn Goyette"
score: 4
team: bleu
tel: 648-481-0991x380
-
email: consuelo37@gmail.com
name: "Khloe Altenwerth"
score: 4
team: gris
tel: 1-480-994-8256x873
-
email: icie.kohler@murphyrohan.com
name: "Pearl Dicki"
score: 1
team: rouge
tel: +04(3)0376370559
-
email: miya43@yahoo.com
name: "Christoper Botsford"
score: 2
team: gris
tel: (731)031-5128x77337
-
email: xschmidt@yahoo.com
name: "Lauren Bins"
score: 1
team: gris
tel: (503)215-2332x77244
-
email: rempel.earley@waelchi.net
name: "Sigmund Stroman"
score: 4
team: rouge
tel: (719)103-8927x0887
-
email: gustav.graham@kihn.com
name: "Brook Nolan"
score: 2
team: gris
tel: "642.931.3403"
-
email: hettinger.emit@cartwright.com
name: "Mr. Gaston Bartell"
score: 5
team: jaune
tel: "00536147705"
-
email: tlittle@marquardtfunk.info
name: "Ansel Schimmel"
score: 3
team: bleu
tel: (432)161-1237
-
email: blangosh@hotmail.com
name: "Kiefer Funk"
score: 3
team: rouge
tel: 224-921-0391x3813
-63
View File
@@ -1,63 +0,0 @@
---
-
date: 2016/06/02 # year/month/day
time: "18:00"
home: gris
away: jaune
home_points: 6
away_points: 7
-
date: 2016/06/02 # year/month/day
time: "20:30"
home: bleu
away: rouge
home_points: 9
away_points: 2
-
date: 2016/06/09 # year/month/day
time: "18:00"
home: bleu
away: jaune
home_points: 7
away_points: 6
-
date: 2016/06/09 # year/month/day
time: "20:30"
home: gris
away: rouge
home_points: 4
away_points: 8
-
date: 2016/06/16 # year/month/day
time: "18:00"
home: bleu
away: jaune
home_points: 4
away_points: 7
-
date: 2016/06/16 # year/month/day
time: "20:30"
home: gris
away: rouge
home_points: ~
away_points: ~
-
date: 2016/06/23 # year/month/day
time: "18:00"
home: bleu
away: jaune
home_points: ~
away_points: ~
-
date: 2016/06/23 # year/month/day
time: "20:30"
home: gris
away: rouge
home_points: ~
away_points: ~
+171
View File
@@ -0,0 +1,171 @@
const URL = "https://ballephenix.com";
const USERNAME = "XXXXXX";
const PASSWORD = "XXXXXX";
type PreGame = {
date: string;
time: string;
home: string;
away: string;
};
class WeekDay {
readonly year: number;
readonly month: number;
readonly day: number;
constructor(iso: string) {
const [y, m, d] = iso.split("-").map(Number);
this.year = y;
this.month = m;
this.day = d;
}
next(): WeekDay {
const d = new Date(this.year, this.month - 1, this.day + 7);
return new WeekDay(
`${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, "0")}-${String(d.getDate()).padStart(2, "0")}`,
);
}
saturday(): WeekDay {
const d = new Date(this.year, this.month - 1, this.day + 2);
return new WeekDay(
`${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, "0")}-${String(d.getDate()).padStart(2, "0")}`,
);
}
toString(): string {
return `${this.year}-${String(this.month).padStart(2, "0")}-${String(this.day).padStart(2, "0")}`;
}
}
const w1 = new WeekDay("2026-05-14");
const w2 = w1.next();
const w3 = w2.next();
const w4 = w3.next();
// skip Saint-Jean
const w5 = w4.next().next();
const w6 = w5.next();
const w7 = w6.next();
const w8 = w7.next();
const w9 = w8.next();
const w10 = w9.next();
const w11 = w10.next();
const w12 = w11.next();
// const tournament = w12.saturday();
const w13 = w12.next();
const w14 = w13.next();
const games: PreGame[] = [
{ date: `${w1}`, time: "18:45", home: "gris", away: "bleu" },
{ date: `${w1}`, time: "20:15", home: "mauve", away: "jaune" },
{ date: `${w2}`, time: "18:45", home: "jaune", away: "gris" },
{ date: `${w2}`, time: "20:15", home: "bleu", away: "mauve" },
{ date: `${w3}`, time: "18:45", home: "gris", away: "mauve" },
{ date: `${w3}`, time: "20:15", home: "jaune", away: "bleu" },
{ date: `${w4}`, time: "18:45", home: "mauve", away: "bleu" },
{ date: `${w4}`, time: "20:15", home: "gris", away: "jaune" },
{ date: `${w5}`, time: "18:45", home: "bleu", away: "jaune" },
{ date: `${w5}`, time: "20:15", home: "mauve", away: "gris" },
{ date: `${w6}`, time: "18:45", home: "jaune", away: "mauve" },
{ date: `${w6}`, time: "20:15", home: "bleu", away: "gris" },
{ date: `${w7}`, time: "18:45", home: "gris", away: "bleu" },
{ date: `${w7}`, time: "20:15", home: "mauve", away: "jaune" },
{ date: `${w8}`, time: "18:45", home: "jaune", away: "gris" },
{ date: `${w8}`, time: "20:15", home: "bleu", away: "mauve" },
{ date: `${w9}`, time: "18:45", home: "gris", away: "mauve" },
{ date: `${w9}`, time: "20:15", home: "jaune", away: "bleu" },
{ date: `${w10}`, time: "18:45", home: "mauve", away: "bleu" },
{ date: `${w10}`, time: "20:15", home: "gris", away: "jaune" },
{ date: `${w10}`, time: "21:35", home: "jaune", away: "gris" },
{ date: `${w11}`, time: "18:45", home: "bleu", away: "jaune" },
{ date: `${w11}`, time: "20:15", home: "mauve", away: "gris" },
{ date: `${w12}`, time: "18:45", home: "jaune", away: "mauve" },
{ date: `${w12}`, time: "20:15", home: "bleu", away: "gris" },
// { date: `${tournament}`, time: "09:00", home: "gris", away: "bleu" },
// { date: `${tournament}`, time: "10:30", home: "mauve", away: "jaune" },
// { date: `${tournament}`, time: "15:30", home: "bleu", away: "mauve" },
{ date: `${w13}`, time: "18:45", home: "gris", away: "mauve" },
{ date: `${w13}`, time: "20:15", home: "jaune", away: "bleu" },
{ date: `${w14}`, time: "18:45", home: "gris", away: "bleu" },
{ date: `${w14}`, time: "20:15", home: "mauve", away: "jaune" },
];
function extractCookies(headers: Headers): string {
const cookies: string[] = [];
for (const value of headers.getSetCookie()) {
cookies.push(value.split(";")[0]);
}
return cookies.join("; ");
}
async function login(): Promise<string> {
const res = await fetch(
`${URL}/login?username=${encodeURIComponent(USERNAME)}&password=${encodeURIComponent(PASSWORD)}`,
{ redirect: "manual" },
);
if (res.status !== 302) {
throw new Error(`Login failed with status ${res.status}`);
}
return extractCookies(res.headers);
}
async function createGame(cookie: string, game: PreGame): Promise<void> {
const body = new URLSearchParams({
"game-date": game.date,
"game-time": game.time,
"home-team": game.home,
"away-team": game.away,
});
const res = await fetch(`${URL}/membre/new-game`, {
method: "POST",
headers: {
"Content-Type": "application/x-www-form-urlencoded",
Cookie: cookie,
},
body: body.toString(),
redirect: "manual",
});
if (res.status >= 400) {
const text = await res.text();
throw new Error(
`Failed to create ${game.date} ${game.time} ${game.home} vs ${game.away}: ${text}`,
);
}
await res.body?.cancel();
}
async function main() {
console.log("Logging in...");
const cookie = await login();
console.log("Logged in.\n");
for (const game of games) {
console.log(
`Creating: ${game.date} ${game.time} ${game.home} vs ${game.away}`,
);
await createGame(cookie, game);
}
console.log(`\nDone. ${games.length} games created.`);
}
main();
+12
View File
@@ -0,0 +1,12 @@
{ fetchNuGet }: [
(fetchNuGet { pname = "Microsoft.Data.Sqlite"; version = "9.0.0"; sha256 = "0m58j9cdrkk8m0yl24z8jy3iafxfbwmf3v01cwhwnqs0cbq1ara8"; })
(fetchNuGet { pname = "Microsoft.Data.Sqlite.Core"; version = "9.0.0"; sha256 = "11s3pf12x4ghi1xn2dv6dsj3ckxq062m82dcinn2l42z590ny5fg"; })
(fetchNuGet { pname = "Microsoft.Extensions.DependencyInjection.Abstractions"; version = "8.0.0"; sha256 = "1zw0bpp5742jzx03wvqc8csnvsbgdqi0ls9jfc5i2vd3cl8b74pg"; })
(fetchNuGet { pname = "Microsoft.Extensions.Logging.Abstractions"; version = "8.0.0"; sha256 = "1klcqhg3hk55hb6vmjiq2wgqidsl81aldw0li2z98lrwx26msrr6"; })
(fetchNuGet { pname = "Npgsql"; version = "8.0.0"; sha256 = "1x3jlin44frkhd7d50q0vmy0gapxqhmd4jv1nvsnkndp3xjsaynd"; })
(fetchNuGet { pname = "SQLitePCLRaw.bundle_e_sqlite3"; version = "2.1.10"; sha256 = "1irrg46sv2w12nh6jc810clbi06fgclnbky14b8kamfkgy61d4li"; })
(fetchNuGet { pname = "SQLitePCLRaw.core"; version = "2.1.10"; sha256 = "03q02p1cajqzcbk9112mgw3qq733l4gd2vi21dq2am4911imr5l2"; })
(fetchNuGet { pname = "SQLitePCLRaw.lib.e_sqlite3"; version = "2.1.10"; sha256 = "0xqa3l4p68vm3p5n4h3d2gs97vrpnvhwfv366i6fv5x80m2zcswv"; })
(fetchNuGet { pname = "SQLitePCLRaw.provider.e_sqlite3"; version = "2.1.10"; sha256 = "0n7cdwix5h9k578a07g00sw9c03sv4liy91qzpj9wb8k4673gfrh"; })
(fetchNuGet { pname = "System.Memory"; version = "4.5.3"; sha256 = "0naqahm3wljxb5a911d37mwjqjdxv9l0b49p5dmfyijvni2ppy8a"; })
]
+90
View File
@@ -0,0 +1,90 @@
#!/usr/bin/env python3
import argparse
import os
import sys
import requests
def fetch_json(api_root, path):
url = f"{api_root}{path}"
resp = requests.get(url, timeout=30)
resp.raise_for_status()
return resp.json()
def main():
parser = argparse.ArgumentParser(
description="Populate a local instance from production data via REST"
)
parser.add_argument(
"--source",
default=os.environ.get("PHENIX_SOURCE_URL", "https://ballephenix.com"),
help="Source API root (default: https://ballephenix.com)",
)
parser.add_argument(
"--target",
default=os.environ.get("PHENIX_TARGET_URL", "http://localhost:5000"),
help="Target API root (default: http://localhost:5000)",
)
parser.add_argument(
"--force",
action="store_true",
help="Clear existing games before inserting",
)
args = parser.parse_args()
source_root = args.source.rstrip("/")
target_root = args.target.rstrip("/")
years = fetch_json(source_root, "/api/available-years.json")
print(f"Years on source: {len(years)} ({min(years)}–{max(years)})")
all_games = []
for year in years:
games = fetch_json(source_root, f"/api/results/{year}.json")
all_games.extend(games)
print(f"Total games fetched: {len(all_games)}")
if args.force:
resp = requests.delete(f"{target_root}/api/games", timeout=30)
if resp.status_code not in (204, 200):
print(f"Failed to clear games: {resp.status_code} {resp.text}", file=sys.stderr)
sys.exit(1)
print("Cleared existing games")
inserted = 0
skipped = 0
errors = 0
for g in all_games:
payload = {
"date": g.get("date", ""),
"time": g.get("time", ""),
"home": g.get("home", ""),
"away": g.get("away", ""),
"homeScore": g.get("homeScore"),
"awayScore": g.get("awayScore"),
"practice": bool(g.get("practice")),
"rain": bool(g.get("rain")),
}
try:
resp = requests.post(f"{target_root}/api/games", json=payload, timeout=30)
if resp.status_code == 201:
inserted += 1
elif resp.status_code == 409:
skipped += 1
else:
print(f"Error on {g.get('date')} {g.get('time')}: {resp.status_code} {resp.text}", file=sys.stderr)
errors += 1
except requests.RequestException as e:
print(f"Request error on {g.get('date')} {g.get('time')}: {e}", file=sys.stderr)
errors += 1
print(f"Inserted: {inserted}, skipped: {skipped}, errors: {errors}")
print(f"Target: {target_root}")
if __name__ == "__main__":
main()
Generated
+60
View File
@@ -0,0 +1,60 @@
{
"nodes": {
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1710146030,
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1719848872,
"narHash": "sha256-H3+EC5cYuq+gQW8y0lSrrDZfH71LB4DAf+TDFyvwCNA=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "00d80d13810dbfea8ab4ed1009b09100cca86ba8",
"type": "github"
},
"original": {
"id": "nixpkgs",
"ref": "nixos-unstable",
"type": "indirect"
}
},
"root": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
}
},
"root": "root",
"version": 7
}
+127
View File
@@ -0,0 +1,127 @@
{
description = "Balle Phenix website — ASP.NET + SQLite";
inputs = {
nixpkgs.url = "nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils, ... }:
let
nixosModule = { config, lib, pkgs, ... }:
let
cfg = config.services.all-dressed-programming.phenix-website;
phenix = self.packages.${pkgs.system}.website;
in {
options.services.all-dressed-programming.phenix-website = {
enable = lib.mkEnableOption "Balle Phenix website";
domain = lib.mkOption {
type = lib.types.str;
default = "ballephenix.com";
};
port = lib.mkOption {
type = lib.types.port;
default = 8000;
};
dataDir = lib.mkOption {
type = lib.types.path;
default = "/var/lib/phenix";
};
databaseUrl = lib.mkOption {
type = lib.types.str;
default = "";
};
sessionKey = lib.mkOption {
type = lib.types.str;
default = "";
};
};
config = lib.mkIf cfg.enable {
systemd.services.phenix-website = {
description = "Balle Phenix website";
wantedBy = [ "multi-user.target" ];
after = [ "network.target" ];
serviceConfig = {
Type = "simple";
ExecStart = "${phenix}/lib/Phenix";
WorkingDirectory = "${phenix}/lib/";
Restart = "always";
RestartSec = 5;
User = "phenix";
Group = "phenix";
};
environment =
{
ASPNETCORE_URLS = "http://0.0.0.0:${toString cfg.port}";
ASPNETCORE_ENVIRONMENT = "Production";
}
// lib.optionalAttrs (cfg.databaseUrl == "") {
ConnectionStrings__Default = "Data Source=${cfg.dataDir}/phenix.db";
}
// lib.optionalAttrs (cfg.databaseUrl != "") {
DatabaseProvider = "Postgres";
ConnectionStrings__Default = cfg.databaseUrl;
}
// lib.optionalAttrs (cfg.sessionKey != "") {
SessionKey = cfg.sessionKey;
};
postStart = ''
mkdir -p ${cfg.dataDir}
'';
};
users.users.phenix = {
isSystemUser = true;
group = "phenix";
home = cfg.dataDir;
createHome = true;
};
users.groups.phenix = {};
};
};
in
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
dotnet = pkgs.dotnetCorePackages.sdk_9_0;
pythonEnv = pkgs.python3.withPackages (ps: [ ps.requests ]);
phenix-website = pkgs.buildDotnetModule {
name = "phenix-website";
src = ./.;
projectFile = "Phenix.csproj";
selfContainedBuild = true;
dotnet-sdk = dotnet;
dotnet-runtime = pkgs.dotnetCorePackages.runtime_9_0;
runtimeIdentifiers = "linux-x64";
nugetDeps = ./deps.nix;
postInstall = ''
cp -r static $out/lib/static/
cp appsettings.json $out/lib/
'';
meta.mainProgram = "Phenix";
};
in {
packages = {
default = phenix-website;
website = phenix-website;
};
devShell = pkgs.mkShell {
name = "Phenix-Website";
buildInputs = [ dotnet pkgs.nuget-to-nix pythonEnv ];
shellHook = ''
export PATH="$PWD/dev/populate-db:$PATH"
'';
};
}) // {
nixosModules.x86_64-linux = nixosModule;
};
}
-68
View File
@@ -1,68 +0,0 @@
var gulp = require('gulp');
var bower = require('gulp-bower');
var help = require('gulp-task-listing');
var clean = require('gulp-clean');
var sass = require('gulp-sass');
var rename = require("gulp-rename");
var yaml = require('gulp-yaml');
var template = require('gulp-template');
var webserver = require('gulp-webserver');
gulp.task('help', help);
gulp.task('bower', function(){
return bower()
.pipe(gulp.dest('lib/'))
.on('error', console.log);
});
gulp.task('sass', ['bower'], function(){
var extraSassPath = ['./lib/'];
return gulp.src('./scss/*.scss')
.pipe(sass({includePaths: extraSassPath}).on('error', console.log))
.pipe(gulp.dest('./css'));
});
gulp.task('clean', function(){
return gulp.src(["lib/", "css/"], {read: false})
.pipe(clean());
});
gulp.task('compile-results', function(){
return gulp.src('data/*.yaml')
.pipe(yaml({safe: true}))
.pipe(gulp.dest('./api'));
});
gulp.task('template-prod', function () {
return gulp.src('index.tmpl.html')
.pipe(rename("index.html"))
.pipe(template({production: true}))
.pipe(gulp.dest('.'));
});
gulp.task('template-dev', function () {
return gulp.src('index.tmpl.html')
.pipe(rename("index.html"))
.pipe(template({production: false}))
.pipe(gulp.dest('.'));
});
gulp.task('default', ['bower', 'sass', 'compile-results']);
gulp.task('prod', ['default', 'template-prod']);
gulp.task('webserver', function(){
return gulp.src('.')
.pipe(webserver({
livereload: false,
directoryListing: false,
}));
});
gulp.task('dev', ['default', 'webserver', 'template-dev'], function(){
gulp.watch('./scss/*.scss', ['sass']);
gulp.watch('*.tmpl.html', ['template-dev']);
return gulp.watch('./data/*.yaml', ['compile-results']);
});
-17
View File
@@ -1,17 +0,0 @@
<!doctype html>
<html>
<head>
<title>Balle Phenix</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="css/style.css" />
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
</head>
<body>
<%if(production){ %>
<script src="main-built.js"></script>
<% }else{ %>
<script data-main="script/main" src="lib/requirejs/require.js"></script>
<% } %>
</body>
</html>
-18
View File
@@ -1,18 +0,0 @@
0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'install' ]
2 info using npm@1.4.28
3 info using node@v0.10.37
4 verbose node symlink /usr/bin/node
5 error install Couldn't read dependencies
6 error package.json ENOENT, open '/home/didier/dev/go/src/gitlab.com/didiercrunch/phenix-website/static/package.json'
6 error package.json This is most likely not a problem with npm itself.
6 error package.json npm can't find a package.json file in your current directory.
7 error System Linux 4.2.0-23-generic
8 error command "/usr/bin/node" "/usr/bin/npm" "install"
9 error cwd /home/didier/dev/go/src/gitlab.com/didiercrunch/phenix-website/static
10 error node -v v0.10.37
11 error npm -v 1.4.28
12 error path /home/didier/dev/go/src/gitlab.com/didiercrunch/phenix-website/static/package.json
13 error code ENOPACKAGEJSON
14 error errno 34
15 verbose exit [ 34, true ]
-29
View File
@@ -1,29 +0,0 @@
{
"name": "phenix-website",
"version": "1.0.0",
"description": "Main web site of Balle Phénix.",
"main": "index.html",
"dependencies": {
"gulp": "^3.9.0",
"gulp-bower": "0.0.13",
"gulp-clean": "^0.3.1",
"gulp-rename": "^1.2.2",
"gulp-sass": "^2.1.1",
"gulp-task-listing": "^1.0.1",
"gulp-template": "^3.1.0",
"requirejs": "^2.1.22"
},
"devDependencies": {
"gulp-webserver": "^0.9.1",
"gulp-yaml": "^1.0.1"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "https://gitlab.com/didiercrunch/phenix-website"
},
"author": "didier amyot <didier.amyot@gmail.com>",
"license": "MIT"
}
-20
View File
@@ -1,20 +0,0 @@
requirejs.config({
// baseUrl: 'lib',
paths: {
'_': '../lib/lodash/dist/lodash.min',
'm': '../lib/mithril/mithril.min'
}
});
requirejs(['m', 'views/mainPage', 'views/calendarPage', 'views/rulesPage', 'views/photosPage', 'views/confidentialPage', 'views/contactPage'], function(m, mainPage, calendarPage, rulesPage, photosPage, confidentialPage, contactPage){
m.route.mode = "hash";
m.route(document.body, "/", {
"/": mainPage,
"/calendrier": calendarPage,
"/reglement": rulesPage,
"/photos": photosPage,
"/membre": confidentialPage,
"/contact": contactPage
});
});
-111
View File
@@ -1,111 +0,0 @@
define(['_'], function(_) {
var resultParser = {};
resultParser._addJSDateToResult = function(res){
var date = res.date.split('/');
var time = _.isString(res.time) ? res.time.split(':'): [0, 0];
res.jsDate = new Date(
Number(date[0]),
Number(date[1]) - 1,
Number(date[2]),
Number(time[0]),
Number(time[1])
);
return res;
};
resultParser.parseResults = function(rawResults){
rawResults = _.map(rawResults, resultParser._addJSDateToResult);
rawResults = _.map(rawResults, resultParser._addCustomStyle);
return rawResults;
};
resultParser.getNightGames = function(rawResults){
var ret = {};
_.each(resultParser.parseResults(rawResults), function(res){
if(_.has(ret, res.date)){
ret[res.date].push(res);
}else{
ret[res.date] = [res];
}
});
return _.map(ret, function(games, date){
return resultParser._addJSDateToResult({date: date, games: games});
});
};
resultParser._getAllTeams = function(rawResults){
var homeTeams = _.map(rawResults, 'home');
var awayTeams = _.map(rawResults, 'away');
return _.uniq(_.concat(homeTeams, awayTeams));
};
resultParser._getWinner = function(res){
if(res.home_points > res.away_points){
return res.home;
}
if(res.home_points < res.away_points){
return res.away;
}
};
resultParser._hasWon = function(res, team){
return resultParser._getWinner(res) == team;
};
resultParser._hasLost = function(res, team){
return !resultParser._isDraw(res) && resultParser._getWinner(res) != team;
};
resultParser._isDraw = function(res){
return res.home_points == res.away_points;
};
resultParser._getPointsFor = function(res, team){
if(res.home == team){
return res.home_points;
}
return res.away_points;
};
resultParser._getPointsForOpponent = function(res, team){
if(res.home == team){
return res.away_points;
}
return res.home_points;
};
resultParser._getPointsForGame = function(res, team){
if(resultParser._hasWon(res, team)){
return 2;
}
return resultParser._isDraw(res) ? 1: 0;
};
resultParser._getTeamStats = function(rawResults, team){
var ret = {
team: team, gamePlayed: 0, victories: 0, points: 0,
defeats: 0, draws: 0, pointsFor: 0, pointsAgaint: 0};
_.each(rawResults, function(res){
if((team != res.home && team != res.away) || !_.isNumber(res.home_points)){
return;
}
ret.gamePlayed += 1;
ret.victories += resultParser._hasWon(res, team) ? 1: 0;
ret.defeats += resultParser._hasLost(res, team) ? 1: 0;
ret.draws += resultParser._isDraw(res) ? 1: 0;
ret.pointsFor += resultParser._getPointsFor(res, team);
ret.pointsAgaint += resultParser._getPointsForOpponent(res, team);
ret.points += resultParser._getPointsForGame(res, team);
});
return ret;
};
resultParser.getStats = function(rawResults){
var allTeams = resultParser._getAllTeams(rawResults);
var getTeamStats = _.partial(resultParser._getTeamStats, rawResults);
return _.map(allTeams, getTeamStats);
};
return resultParser;
});
-22
View File
@@ -1,22 +0,0 @@
define(['m', '_'], function (m, _) {
var teams = {};
teams.getTeamColor = function(teamName){
if(teamName == 'jaune'){
return '#FF0';
}
if(teamName == 'rouge'){
return '#F00';
}
if(teamName == 'bleu'){
return '#00F';
}
if(teamName == 'gris'){
return '#808080';
}
return undefined;
};
return teams;
});
-35
View File
@@ -1,35 +0,0 @@
define(['m'], function(m) {
var util = {};
util.loremIpsum = function(){
return "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec a"+
" diam lectus. Sed sit amet ipsum mauris. Maecenas congue ligula "+
"ac quam viverra nec consectetur ante hendrerit. Donec et mollis"+
" dolor. Praesent et diam eget libero egestas mattis sit amet"+
" vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia "+
"consectetur. Donec ut libero sed arcu vehicula ultricies a non"+
" tortor. Lorem ipsum dolor sit amet, consectetur adipiscing "+
"elit. Aenean ut gravida lorem. Ut turpis felis, pulvinar a "+
"semper sed, adipiscing id dolor. Pellentesque auctor nisi id "+
"magna consequat sagittis. Curabitur dapibus enim sit amet elit "+
"pharetra tincidunt feugiat nisl imperdiet. Ut convallis libero "+
"in urna ultrices accumsan. Donec sed od";
};
util.formatDate = function(date){
var monthNames = ['janvier', 'février', 'mars', 'avril', 'mai', 'juin',
'juiller', 'août', 'septembre', 'octobre', 'novembre',
'decembre'];
return [date.getDate(),
monthNames[date.getMonth()],
date.getFullYear()].join(' ');
};
util.facebookLink = function(){
return m('a[href="https://www.facebook.com/LigueDeBalleLesPhenix"]',
m('i.fa.fa-facebook-square')
);
};
return util;
});
-128
View File
@@ -1,128 +0,0 @@
define(['m', '_', 'util', 'resultParser', 'teams', 'views/topNavBar', 'views/footer'], function(m, _, util, resultParser, teams, topNavBar, footer) {
var statsView = {};
statsView.controller = function(){
var games = m.prop([]);
return m.request({method: "GET", url: "api/resultats.json"})
.then(games)
.then(resultParser.getStats);
};
statsView.getStatRow = function(teamStats){
var formatStat = function(n){
return teamStats.gamePlayed === 0 ? '-' : n;
};
return m('tr', [
m('td', teamStats.team),
m('td', teamStats.gamePlayed),
m('td', formatStat(teamStats.victories)),
m('td', formatStat(teamStats.defeats)),
m('td', formatStat(teamStats.draws)),
m('td', formatStat(teamStats.pointsFor)),
m('td', formatStat(teamStats.pointsAgaint)),
m('td', formatStat(teamStats.pointsFor - teamStats.pointsAgaint)),
m('td', formatStat(teamStats.points))
]);
};
statsView.mainTable = function(stats){
return m('table.uk-table.uk-table-hover.uk-table-striped',[
m('thead', m('tr', [
m('th', 'Équipes'),
m('th', 'PJ'),
m('th', 'V'),
m('th', 'D'),
m('th', 'N'),
m('th', 'PP'),
m('th', 'PC'),
m('th', 'DIF'),
m('th', 'PTS')
])),
m('tbody', _.map(stats, statsView.getStatRow))
]);
};
statsView.legend = function(){
var items = ["PJ : Parties joués", "V : Victoire", "D : Défaite",
"N : Nul", "PP : Points pour", "PC : Points contre",
"DIF : Diférenciel","PTS : Points"];
return m('ul.uk-subnav.uk-subnav-line.uk-flex-center',[
_.map(items, function(itm){
return m('li', itm);
})
]);
};
statsView.view = function(stats){
return m('div.uk-grid',
m('div.uk-width-medium-1-1.uk-width-large-1-1.uk-container-center',[
m('h2', 'Classement 2016'),
statsView.mainTable(stats()),
statsView.legend()
]));
};
var schedulView = {};
schedulView.controller = function(){
var games = m.prop([]);
return m.request({method: "GET", url: "api/resultats.json"})
.then(games)
.then(resultParser.getNightGames);
};
schedulView._getTeamTag = function(teamName){
var teamColor = teams.getTeamColor(teamName);
return [
m('i.fa.fa-flag', {style: {color: teamColor}}),
m('span', ' ' + teamName)
];
};
schedulView._asGamePoints = function(points){
return !_.isNumber(points) ? '-' : points + '';
};
schedulView._gameRow = function(game){
return m('tr',[
m('td', game.time),
m('td', schedulView._getTeamTag(game.home)),
m('td', schedulView._asGamePoints(game.home_points)),
m('td', 'vs'),
m('td', schedulView._getTeamTag(game.away)),
m('td', schedulView._asGamePoints(game.away_points))
]);
};
schedulView._gameView = function(gameNight){
return m('div', [m('h3', util.formatDate(gameNight.jsDate)),
m('table.uk-table.uk-table-hover.uk-table-condensed.uk-table-striped',
m('tbody',[
_.map(gameNight.games, schedulView._gameRow),
])
)
]);
};
schedulView.view = function(games){
return m('div.uk-grid',
m('div.uk-width-large-3-5.uk-width-medium-1-1',
_.concat([m('h2', 'Calendrier 2016')], _.map(games(), schedulView._gameView))));
};
calendarPage = {};
calendarPage.view = function(){
return [m.component(topNavBar),
m('div.uk-grid.uk-margin-top.uk-margin-bottom',
m('div.uk-width-large-3-5.uk-width-small-1-1.uk-container-center',[
m.component(statsView),
m.component(schedulView)])),
m.component(footer)];
};
return calendarPage;
});
-220
View File
@@ -1,220 +0,0 @@
define(['m', '_', 'event', 'teams', 'views/topNavBar', 'views/footer'], function (m, _ , Events, teams, topNavBar, footer) {
var confidentialSelection = {};
confidentialSelection.toggleTeam = function(teamId, activatedTeams){
return function(isActive){
if(isActive){
activatedTeams().push(teamId);
return;
}
activatedTeams(_.difference(activatedTeams(), [teamId]));
};
};
confidentialSelection.teamInput = function(teamName, teamId, activatedTeams){
var checked = _.includes(activatedTeams(), teamId) ? '[checked=]' : '';
var callback = confidentialSelection.toggleTeam(teamId, activatedTeams);
return m('label.uk-width-1-5',
m('input[type=checkbox]' + checked, {onchange: m.withAttr("checked", callback)}), teamName);
};
confidentialSelection.scoreInput = function(score, activatedScores){
var checked = _.includes(activatedScores(), score) ? '[checked=]' : '';
var callback = confidentialSelection.toggleTeam(score, activatedScores);
return m('label.uk-width-1-5',
m('input[type=checkbox]' + checked, {onchange: m.withAttr("checked", callback)}), score);
};
confidentialSelection.chooseTeams = function(model){
return m('form.uk-grid',
m('div.uk-width-1-6', m('label', m('b', 'Équipes'))),
m('div.uk-width-5-6',
m('div.uk-grid', [
confidentialSelection.teamInput('Bleu', 'bleu', model.activatedTeams),
confidentialSelection.teamInput('Rouge', 'rouge', model.activatedTeams),
confidentialSelection.teamInput('Jaune', 'jaune', model.activatedTeams),
confidentialSelection.teamInput('Gris', 'gris', model.activatedTeams),
]))
);
};
confidentialSelection.chooseScore = function(model){
return m('form.uk-grid',
m('div.uk-width-1-6', m('label', m('b', 'Score'))),
m('div.uk-width-5-6',
m('div.uk-grid', [
confidentialSelection.scoreInput(1, model.activatedScores),
confidentialSelection.scoreInput(2, model.activatedScores),
confidentialSelection.scoreInput(3, model.activatedScores),
confidentialSelection.scoreInput(4, model.activatedScores),
confidentialSelection.scoreInput(5, model.activatedScores)
]))
);
};
confidentialSelection.controller = function(model){
return model;
};
confidentialSelection.view = function(model){
return m('div.uk-grid', [
m('div.uk-width-1-2', confidentialSelection.chooseTeams(model)),
m('div.uk-width-1-2', confidentialSelection.chooseScore(model))
]);
};
var confidentialTable = {};
confidentialTable.controller = function(model){
var players = m.prop([]);
var ctrl = {};
ctrl.model = model;
ctrl.players = m.request({method: "GET", url: "api/players.json"}).then(players);
return ctrl;
};
confidentialTable.arrows = function(){
var style = {
display: 'inline-block',
'line-height': '0.5em',
'margin-right': '1em',
'font-size': '0.7em'
};
return m('span', {style: style},
m('i.fa.fa-chevron-up'),
m('br'),
m('i.fa.fa-chevron-down')
);
};
confidentialTable.tableHeader = function(){
return m('thead',
m('tr', [
m('th', confidentialTable.arrows(), 'Équipe'),
m('th', confidentialTable.arrows(), 'Nom'),
m('th', 'Courriel'),
m('th', 'Téléphone'),
m('th', confidentialTable.arrows(), 'Cote')
]));
};
confidentialTable.getPlayerTeamIcon = function(player){
var background = teams.getTeamColor(player.team);
var style = {width: '20px', height: '20px', 'background-color': background};
return m('div', {style: style}, m.trust('&nbsp;'));
};
confidentialTable.playerRow = function(player){
return m('tr',[
m('td', confidentialTable.getPlayerTeamIcon(player)),
m('td', player.name),
m('td', player.email),
m('td', player.tel),
m('td', player.score)
]);
};
confidentialTable.onlyPlayerOfTeam = function(visibleTeam){
return function(player){
return _.includes(visibleTeam, player.team);
};
};
confidentialTable.onlyPlayerOfScore = function(visibleScores){
return function(player){
return _.includes(visibleScores, player.score);
};
};
confidentialTable.tableBody = function(players, visibleTeam, activatedScores){
return m('tbody',
_(players)
.filter(confidentialTable.onlyPlayerOfTeam(visibleTeam))
.filter(confidentialTable.onlyPlayerOfScore(activatedScores))
.map(confidentialTable.playerRow).value()
);
};
confidentialTable.view = function(ctrl){
return m('table.uk-table.uk-table-hover.uk-table-striped',
confidentialTable.tableHeader(),
confidentialTable.tableBody(ctrl.players(),
ctrl.model.activatedTeams(),
ctrl.model.activatedScores()
)
);
};
var testComponent2 = {};
testComponent2.controller = function(){
var counter = m.prop(0);
return {counter: counter, plusplus: function(){
counter(counter() + 1);
}};
};
testComponent2.view = function(ctrl){
return m('button', {onclick: ctrl.plusplus}, "test component 2 " + ctrl.counter());
};
var testComponent = {};
testComponent.controller = function(){
var counter = m.prop(0);
return {counter: counter, plusplus: function(){
counter(counter() + 1);
}};
};
testComponent.view = function(ctrl){
return m('div', [
m('button', {onclick: ctrl.plusplus}, "test component " + ctrl.counter()),
m.component(testComponent2)]);
};
var confidentialPageBody = {};
confidentialPageBody.controller = function(model){
model.activatedTeams = m.prop(['bleu', 'rouge', 'jaune', 'gris']);
model.activatedScores = m.prop([1, 2, 3, 4, 5]);
return model;
};
confidentialPageBody.view = function(model){
return m('div', [
m.component(confidentialSelection, model),
m.component(confidentialTable, model),
m.component(testComponent)
]);
};
var confidentialPage = {};
confidentialPage.view = function(){
return [
m.component(topNavBar),
m('div.uk-grid.uk-margin-top.uk-margin-bottom',
m('div.uk-width-large-3-5.uk-width-small-1-1.uk-container-center',[
m.component(confidentialPageBody, {})
])),
m.component(footer)
];
};
return confidentialPage;
});
-20
View File
@@ -1,20 +0,0 @@
define(['m', '_', 'util', 'resultParser', 'views/topNavBar', 'views/footer'], function (m, _ , util, resultParser, topNavBar, footer) {
var rulesPageBody = {};
rulesPageBody.view = function(){
return m('h1', 'En construction');
};
var contactPage = {};
contactPage.view = function(){
return [
m.component(topNavBar),
m.component(rulesPageBody),
m.component(footer)
];
};
return contactPage;
});
-23
View File
@@ -1,23 +0,0 @@
define(['m', '_', 'util'], function (m, _, util) {
var footer = {};
footer.wording = function(){
return [
m('span.uk-hidden-small', 'Ligue de balle les Phénix... pour le plaisir de jouer!'),
m('h4.uk-visible-small', 'Ligue de balle les Phénix')
];
};
footer.view = function(){
return m('footer.uk-grid.ph-footer', {style: {padding: '40px'}},
m('div.uk-container.uk-container-center.uk-text-center', [
m('div.uk-panel', footer.wording()),
m('ul.uk-subnav.uk-subnav-line.uk-flex-center',
m('li', m('a[href="mailto:info@ballephenix.com"]', 'info@ballephenix.com'))),
m('h1', util.facebookLink())
])
);
};
return footer;
});
-148
View File
@@ -1,148 +0,0 @@
define(['m', '_', 'util', 'resultParser', 'views/topNavBar', 'views/footer'], function (m, _ , util, resultParser, topNavBar, footer) {
var mainPageLogo = {};
mainPageLogo.view = function(){
return m('div.uk-grid.uk-hidden-small', [
m('div.uk-large-1-3.uk-medium-2-3.uk-container-center', [
m('div.uk-cover-background', {style: 'height: 500px; width: 500px; background-size: 500px; background-image: url(images/phenix_logo.png);'})
])
]);
};
var mainPageNews = {};
mainPageNews.view = function(){
return m('div.uk-panel.uk-panel-box',[
m('div.uk-panel-badge.uk-badge', [
m('i.fa.fa-newspaper-o')
]),
m('h3.uk-panel-title', 'Nouvelles'),
m('p', util.loremIpsum())
]);
};
var nextGameDaySchedule = {};
nextGameDaySchedule.controller = function(){
var games = m.prop([]);
return m.request({method: "GET", url: "api/resultats.json"})
.then(games)
.then(resultParser.getNightGames)
.then(function(nightGames){
return nightGames[0].games;
});
};
nextGameDaySchedule._getTableHead = function(){
return m('thead', m('tr', [
m('td', 'Date'),
m('td', 'Heure'),
m('td', 'Visiteur'),
m('td', 'Receveur')
]));
};
nextGameDaySchedule._getGamesRow = function(game){
return m('tr', [
m('td', util.formatDate(game.jsDate)),
m('td', game.time),
m('td', game.away),
m('td', game.home)
]);
};
nextGameDaySchedule._getGamesRows = function(games){
return _.map(games(), nextGameDaySchedule._getGamesRow);
};
nextGameDaySchedule.view = function(games){
return m('table.uk-table.uk-table-hover.uk-table-striped.uk-table-condensed',[
nextGameDaySchedule._getTableHead(),
m('tbody',
nextGameDaySchedule._getGamesRows(games)
)]);
};
var mainPageSchedule = {};
mainPageSchedule.view = function(){
return m('div.uk-panel.uk-panel-box',[
m('div.uk-panel-badge.uk-badge', m('i.fa.fa-clock-o')),
m('h3.uk-panel-title', 'Horaire'),
m.component(nextGameDaySchedule)
]);
};
var mainMap = {};
mainMap.getMap = function(){
var iframeUrl = "//www.openstreetmap.org/export/embed.html?bbox=-73.55889558792114%2C45.53089890181621%2C-73.55181455612183%2C45.53426212742867&amp;layer=mapnik";
var externalLink = "http://www.openstreetmap.org/#map=18/45.53258/-73.55536";
var iframeParams = {
style: {border: '1px solid black', 'min-height': '300px'},
width: '100%',
height: '100%',
frameborder: 0,
scrolling: 'no',
marginheight: 0,
src: iframeUrl
};
return [
m('iframe', iframeParams),
m('br'),
m('small', m('a', {href: externalLink}, 'Voir la carte'))
];
};
mainMap.view = function(){
return m('div.uk-panel.uk-panel-box',[
m('div.uk-panel-badge.uk-badge', [
m('i.fa.fa-map-o')
]),
m('h3.uk-panel-title', 'Parc Walter-Stewart'),
mainMap.getMap()
]);
};
var mainPageBottom = {};
mainPageBottom.regularSizeView = function(){
return m('div.uk-grid.uk-hidden-small.uk-grid-match', [
m('div.uk-width-large-1-5.uk-hidden-medium'),
m('div.uk-width-large-1-5.uk-width-medium-1-3', m.component(mainPageNews)),
m('div.uk-width-large-1-5.uk-width-medium-1-3', m.component(mainPageSchedule)),
m('div.uk-width-large-1-5.uk-width-medium-1-3', m.component(mainMap))
]);
};
mainPageBottom.smallSizeView = function(){
return m('div.uk-visible-small',
[
m('div.uk-grid', m('div.uk-width-small-1-1', m.component(mainPageNews))),
m('div.uk-grid', m('div.uk-width-small-1-1', m.component(mainPageSchedule))),
m('div.uk-grid', m('div.uk-width-small-1-1', m.component(mainMap)))
]);
};
mainPageBottom.view = function(){
return m('div.uk-margin-top.uk-margin-bottom', [
mainPageBottom.regularSizeView(),
mainPageBottom.smallSizeView()
]);
};
var mainPage = {};
mainPage.view = function(){
return [
topNavBar.view(),
mainPageLogo.view(),
mainPageBottom.view(),
footer.view()
];
};
return mainPage;
});
-20
View File
@@ -1,20 +0,0 @@
define(['m', '_', 'util', 'resultParser', 'views/topNavBar', 'views/footer'], function (m, _ , util, resultParser, topNavBar, footer) {
var rulesPageBody = {};
rulesPageBody.view = function(){
return m('h1', 'En construction');
};
var photosPage = {};
photosPage.view = function(){
return [
m.component(topNavBar),
m.component(rulesPageBody),
m.component(footer)
];
};
return photosPage;
});
-47
View File
@@ -1,47 +0,0 @@
define(['m', '_', 'util', 'resultParser', 'views/topNavBar', 'views/footer'], function (m, _ , util, resultParser, topNavBar, footer) {
var rulesPage = {};
rulesPage.missionTest = function(){
return "La ligue de balle Les Phénix a été fondée en 2004 afin "+
"d'offrir aux membres de la communauté gaie et lesbienne et à "+
"leurs amis hétéros l'opportunité de s'amuser et de pratiquer "+
"un sport dans une ambiance amicale et décontractée. "+
"L'ouverture d'esprit, la camaraderie et le plaisir de "+
"pratiquer un sport à l'extérieur caractérisent cette ligue."
};
rulesPage.mission = function(){
return m('div.uk-panel.uk-panel-box.uk-panel-box-secondary', [
m('h2', 'Mission'),
m('p', rulesPage.missionTest())
]);
};
rulesPage.rules = function(){
return m('div.uk-panel.uk-panel-box.uk-panel-box-secondary', [
m('h2', 'Règlements 2015'),
m('ul',[
m('li', m('h3', 'Règlements généraux')),
m('li', m('h3','Règles et procédures')),
m('li', m('h3','Règlements de terrain')),
])
]);
};
rulesPage.view = function(){
return [
m.component(topNavBar),
m('div.uk-margin-top.uk-margin-bottom.uk-grid',
m('div.uk-width-large-3-5.uk-container-center', [
rulesPage.mission(),
rulesPage.rules()
])),
m.component(footer)
];
};
return rulesPage;
});
-43
View File
@@ -1,43 +0,0 @@
define(['m', '_', 'util'], function (m, _, util) {
var topNavBar = {};
topNavBar._urlMapping = {
'': 'Acceuil',
calendrier: 'Calendrier',
reglement: 'Règlement',
photos: 'Photos',
membre: 'Membre',
contact: 'Nous Joindre'
};
topNavBar.controller = function(){
return {id: m.route.param("page")};
};
topNavBar._getUrlForId = function(id_){
return '#/' + id_;
};
topNavBar._isActive = function(id_){
return topNavBar._getUrlForId(id_) == window.location.hash;
};
topNavBar._getItem = function(name, id){
var class_ = topNavBar._isActive(id) ? 'uk-active' : 'uk-parent';
var url = topNavBar._getUrlForId(id);
return m("li", {class: class_}, [m("a",{href: url}, name)]);
};
topNavBar.view = function(controller){
return m("nav.uk-navbar.uk-navbar-attached",[
m("ul.uk-navbar-nav.uk-navbar-center.uk-visible-large",
m('li.uk-parent', m('div.uk-navbar-brand', util.facebookLink())),
_.map(topNavBar._urlMapping, topNavBar._getItem)),
m("ul.uk-navbar-nav.uk-hidden-large",
m('li.uk-parent', util.facebookLink()),
_.map(topNavBar._urlMapping, topNavBar._getItem)),
]);
};
return topNavBar;
});
-53
View File
@@ -1,53 +0,0 @@
// LESS related
@import "uikit/scss/uikit-mixins.scss";
@import "uikit/scss/core/variables.scss";
// Defaults
@import "uikit/scss/core/base.scss";
// Layout
@import "uikit/scss/core/grid.scss";
@import "uikit/scss/core/panel.scss";
@import "uikit/scss/core/block.scss";
@import "uikit/scss/core/article.scss";
@import "uikit/scss/core/comment.scss";
@import "uikit/scss/core/cover.scss";
// Navs
@import "uikit/scss/core/nav.scss";
@import "uikit/scss/core/navbar.scss";
@import "uikit/scss/core/subnav.scss";
@import "uikit/scss/core/breadcrumb.scss";
@import "uikit/scss/core/pagination.scss";
@import "uikit/scss/core/tab.scss";
@import "uikit/scss/core/thumbnav.scss";
// Elements
@import "uikit/scss/core/list.scss";
@import "uikit/scss/core/description-list.scss";
@import "uikit/scss/core/table.scss";
@import "uikit/scss/core/form.scss";
// Common
@import "uikit/scss/core/button.scss";
@import "uikit/scss/core/icon.scss";
@import "uikit/scss/core/close.scss";
@import "uikit/scss/core/badge.scss";
@import "uikit/scss/core/alert.scss";
@import "uikit/scss/core/thumbnail.scss";
@import "uikit/scss/core/overlay.scss";
@import "uikit/scss/core/column.scss";
@import "uikit/scss/core/animation.scss";
// JavaScript
@import "uikit/scss/core/dropdown.scss";
@import "uikit/scss/core/modal.scss";
@import "uikit/scss/core/offcanvas.scss";
@import "uikit/scss/core/switcher.scss";
// Need to be loaded last
@import "uikit/scss/core/text.scss";
@import "uikit/scss/core/utility.scss";
@import "uikit/scss/core/flex.scss";
@import "uikit/scss/core/contrast.scss";
@import "uikit/scss/core/print.scss";
-9
View File
@@ -1,9 +0,0 @@
@import "custom_uikit";
.foo{
border: solid;
}
.ph-footer{
background-color: $navbar-background;
// height: 200px;
}
+8413
View File
File diff suppressed because it is too large. Load diff
+5
View File
@@ -0,0 +1,5 @@
[Dolphin]
SortRole=modificationtime
Timestamp=2018,3,19,17,32,48
Version=4
ViewMode=1
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 MiB

File diff suppressed because it is too large. Load diff
Binary file not shown.
File diff suppressed because it is too large. Load diff

After

Width:  |  Height:  |  Size: 219 KiB

File diff suppressed because it is too large. Load diff

After

Width:  |  Height:  |  Size: 379 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

File renamed without changes.
File renamed without changes.
+26
View File
@@ -0,0 +1,26 @@
import * as util from "./util.js";
import m from "https://esm.sh/mithril@2.2.2"
import _ from "https://esm.sh/lodash-es@4.17.21"
import {statsView, tabView, schedulView } from './schedule.js'
const calendarPage = {
view: function(){
const availableYears = util.getAvailableYears();
const year = _.get(m.route.param(), 'year', util.getDefaultYear());
return m('div.uk-grid.uk-margin-top.uk-margin-bottom',
m('div.uk-width-large-3-5.uk-width-medium-4-5.uk-width-small-1-1.uk-container-center',
[
m(statsView, {year}),
m(tabView, {year, availableYears}),
m(schedulView, {year}),
]),
)
}
}
m.route.mode = "hash";
m.route(document.getElementById('mithril-content'), "/", {
"/": calendarPage,
"/:year": calendarPage,
});
+19
View File
@@ -0,0 +1,19 @@
import m from "https://esm.sh/mithril@2.2.2"
export function rainSvg (size){
return m("svg[viewBox='0 0 107.95 87.723']",{width: size, height: size}, [
m("defs[id='defs16']"),
m("g[id='layer1'][transform='translate(-310.1 -167.39)']", [
m("g[id='g13542'][transform='translate(-2.4761 19.309)']", [
m("path[d='m378.31 207.24c15.43-1.4 26.66-5.66 26.66-10.69 0-0.41-0.27-0.8-0.42-1.2 0.91 0.23 1.83 0.46 2.83 0.46 5.57 0 10.07-3.78 10.07-8.44 0-4.65-4.5-8.41-10.07-8.41-0.68 0-1.29 0.22-1.93 0.33 0.56-1.86 0.95-3.77 0.95-5.79 0-12.33-11.17-22.34-24.95-22.34-9.77 0-18.13 5.09-22.23 12.4-1.64-0.92-3.47-1.48-5.4-1.48-5.83 0-10.68 4.69-12.18 11.06-2.56-1.01-5.52-1.64-8.7-1.64-9.54 0-17.29 5.23-17.29 11.67 0 5.81 6.35 10.59 14.6 11.47-0.37 0.63-0.66 1.25-0.66 1.91 0 4.25 8.01 7.94 19.79 9.83'][id='path8749']", {style: {"stroke-linejoin": "round", "stroke": "#6798e9", "stroke-linecap": "round", "stroke-miterlimit": ".5", "stroke-width": "12.154", "fill": "none"}}),
m("path[d='m338.14 223.91c-8.25 7.27 1.43 13.47 5.12 3.49l2.83-9.26-7.95 5.77z'][id='path8734']", {style: {"stroke": "#6798e9", "stroke-miterlimit": "3.2", "stroke-width": "8", "fill": "#6798e9"}}),
m("path[d='m367.18 225.11c-8.25 7.27 1.44 13.47 5.13 3.49l2.83-9.26-7.96 5.77z'][id='path8736']", {style: {"stroke": "#6798e9", "stroke-miterlimit": "3.2", "stroke-width": "8", "fill": "#6798e9"}}),
m("path[d='m360.42 209.77c-8.25 7.27 1.44 13.47 5.12 3.49l2.83-9.26-7.95 5.77z'][id='path8738']", {style: {"stroke": "#6798e9", "stroke-miterlimit": "3.2", "stroke-width": "8", "fill": "#6798e9"}}),
m("path[d='m378.31 207.24c15.43-1.4 26.66-5.66 26.66-10.69 0-0.41-0.27-0.8-0.42-1.2 0.91 0.23 1.83 0.46 2.83 0.46 5.57 0 10.07-3.78 10.07-8.44 0-4.65-4.5-8.41-10.07-8.41-0.68 0-1.29 0.22-1.93 0.33 0.56-1.86 0.95-3.77 0.95-5.79 0-12.33-11.17-22.34-24.95-22.34-9.77 0-18.13 5.09-22.23 12.4-1.64-0.92-3.47-1.48-5.4-1.48-5.83 0-10.68 4.69-12.18 11.06-2.56-1.01-5.52-1.64-8.7-1.64-9.54 0-17.29 5.23-17.29 11.67 0 5.81 6.35 10.59 14.6 11.47-0.37 0.63-0.66 1.25-0.66 1.91 0 4.25 8.01 7.94 19.79 9.83'][id='path10281']", {style: {"stroke-linejoin": "round", "stroke": "#6798e9", "stroke-linecap": "round", "stroke-miterlimit": ".5", "stroke-width": "12.154", "fill": "none"}}),
m("path[d='m338.14 223.91c-8.25 7.27 1.43 13.47 5.12 3.49l2.83-9.26-7.95 5.77z'][id='path10283']", {style: {"stroke": "#6798e9", "stroke-miterlimit": "3.2", "stroke-width": "8", "fill": "#6798e9"}}),
m("path[d='m367.18 225.11c-8.25 7.27 1.44 13.47 5.13 3.49l2.83-9.26-7.96 5.77z'][id='path10285']", {style: {"stroke": "#6798e9", "stroke-miterlimit": "3.2", "stroke-width": "8", "fill": "#6798e9"}}),
m("path[d='m360.42 209.77c-8.25 7.27 1.44 13.47 5.12 3.49l2.83-9.26-7.95 5.77z'][id='path10287']", {style: {"stroke": "#6798e9", "stroke-miterlimit": "3.2", "stroke-width": "8", "fill": "#6798e9"}})
])
])
]);
}
Loaded 100 of 107 files, more files were not shown because too many files have changed in this diff. Show more