Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
51b9631708 |
No files matched your search
@@ -4,4 +4,3 @@ css/*
|
||||
/api/resultats.json
|
||||
/index.html
|
||||
/main-built.js
|
||||
/api
|
||||
+2
-9
@@ -1,4 +1,4 @@
|
||||
image: "node:4.4.3"
|
||||
image: node
|
||||
|
||||
before_script:
|
||||
# install ssh-agent
|
||||
@@ -6,14 +6,7 @@ before_script:
|
||||
|
||||
pages:
|
||||
stage: deploy
|
||||
cache:
|
||||
paths:
|
||||
- node_modules/
|
||||
- lib/
|
||||
script:
|
||||
- export SALT="salt_and_pepper"
|
||||
- export KEY="qwerty"
|
||||
- export PLAYER_LIST_LOCATION="//ballephenix.gitlab.io/private/players.spritz.js"
|
||||
- npm install
|
||||
- node_modules/.bin/gulp prod
|
||||
- node_modules/.bin/r.js -o build.js
|
||||
@@ -25,4 +18,4 @@ pages:
|
||||
paths:
|
||||
- public
|
||||
only:
|
||||
- master
|
||||
- private
|
||||
@@ -1,12 +1,11 @@
|
||||
# Site Web de Balle Phénix
|
||||

|
||||

|
||||
|
||||
|
||||
## introduction
|
||||
|
||||
Vous trouverez le code source du site web pour les Phénix ici. Le site web
|
||||
en lui-même est accessible au http://ballephenix.com ou au
|
||||
https://ballephenix.gitlab.io/website/.
|
||||
en lui-même est accessible au https://didiercrunch.gitlab.io/phenix-website/.
|
||||
|
||||
### Structure du site web.
|
||||
|
||||
|
||||
+8
-1
@@ -16,5 +16,12 @@
|
||||
"lib",
|
||||
"test",
|
||||
"tests"
|
||||
]
|
||||
],
|
||||
"dependencies": {
|
||||
"uikit": "~2.24.3",
|
||||
"mithril": "~0.2.1",
|
||||
"lodash": "~4.2.1",
|
||||
"almond": "~0.3.1",
|
||||
"requirejs": "~2.1.22"
|
||||
}
|
||||
}
|
||||
@@ -1,12 +1,11 @@
|
||||
({
|
||||
baseUrl: "script",
|
||||
paths: {
|
||||
m: '../node_modules/mithril/mithril.min',
|
||||
_: '../node_modules/lodash/lodash.min',
|
||||
spritz: '../node_modules/spritzjs/dist/spritz',
|
||||
requireLib: '../node_modules/requirejs/require'
|
||||
m: '../lib/mithril/mithril.min',
|
||||
_: '../lib/lodash/dist/lodash.min',
|
||||
requireLib: '../lib/requirejs/require'
|
||||
},
|
||||
include: 'main',
|
||||
name: "../node_modules/almond/almond",
|
||||
name: "../lib/almond/almond",
|
||||
out: "main-built.js"
|
||||
})
|
||||
@@ -1,24 +0,0 @@
|
||||
[title]
|
||||
innerMarkdown = """
|
||||
## Parc Beaubien
|
||||
"""
|
||||
|
||||
[meta]
|
||||
innerMarkdown = """
|
||||
Vendredi 19 aout 2016
|
||||
"""
|
||||
|
||||
[body]
|
||||
innerMarkdown = """
|
||||
|
||||
Bonjour à tous les phénixiens phénixiennes.
|
||||
|
||||
Dès la semaine prochaine, **nous nous relocaliserons au parc Beaubien**, dans
|
||||
Rosemont. [Google map](http://bit.ly/2bPWCY8) vous aidera a trouver votre
|
||||
chemin.
|
||||
|
||||
|
||||
Votre comité de balle les phénix.
|
||||
|
||||
|
||||
"""
|
||||
@@ -38,8 +38,6 @@ Nous avons très hâte de vous y voir et de fêter avec vous!!!
|
||||
|
||||
Votre comité de balle les phénix.
|
||||
|
||||
[<i class="fa fa-paperclip"></i> Formulaire d'inscription](/files/inscription2016.pdf)
|
||||
|
||||
"""
|
||||
|
||||
[smallBody]
|
||||
|
||||
@@ -1,60 +0,0 @@
|
||||
[title]
|
||||
innerMarkdown = """
|
||||
## Inscription 2017!
|
||||
"""
|
||||
|
||||
[meta]
|
||||
innerMarkdown = """
|
||||
Samedi 18 mars 2017
|
||||
"""
|
||||
|
||||
[body]
|
||||
innerMarkdown = """
|
||||
Bonjour à tous les phénixiens phénixiennes.
|
||||
|
||||
Bien que subtilement, l'hiver tire à sa fin et et la saison de la balle-molle
|
||||
arrive a grand pas. Comble du bonheur, nous retrouvons notre parc, Walter-Stewart,
|
||||
et gardons notre plage horaire, les jeudi soirs.
|
||||
|
||||
**L'inscription aura lieu le vendredi 24 mars 2017 de 18h30 à 21h30 à la [taverne
|
||||
le normandie](http://bit.ly/1pmNWu8)**; situé au [1295 rue amherst,
|
||||
Montréal](http://bit.ly/1QUC6Ou). Il s'agit de l'endroit ou nous avons fêté la
|
||||
fin de la dernière saison.
|
||||
|
||||
Le prix de l'inscription est de **110$** incluant la location du chandail au coût de
|
||||
10$. La valeur de la location du chandail vous sera rendue en fin de saison
|
||||
lorsque vous le rendrez.
|
||||
|
||||
Pour ceux et celles qui ne pourront être présent à l'inscription, vous pouvez
|
||||
vous inscrire par courrier. Imprimez, remplissez et envoyez le formulaire
|
||||
avec le chèque.
|
||||
|
||||
Nous allons jouer une **partie hors concours le 4 mai** et la **saison
|
||||
commencera le jeudi 11 mai**.
|
||||
|
||||
Nous avons très hâte de vous y voir et de fêter avec vous!!!
|
||||
|
||||
|
||||
Votre comité de balle les phénix.
|
||||
|
||||
[<i class="fa fa-paperclip"></i> Formulaire d'inscription](/files/inscription2017.pdf)
|
||||
|
||||
"""
|
||||
|
||||
[smallBody]
|
||||
innerMarkdown = """
|
||||
Bonjour à tous les phénixiens phénixiennes.
|
||||
|
||||
Bien que subtilement, l'hiver tire à sa fin et et la saison de la balle-molle
|
||||
arrive a grand pas. Comble du bonheur, nous retrouvons notre parc, Walter-Stewart,
|
||||
et gardons notre plage horaire, les jeudi soirs.
|
||||
|
||||
**L'inscription aura lieu le vendredi 24 mars 2017 de 18h30 à 21h30 à la [taverne
|
||||
le normandie](http://bit.ly/1pmNWu8)**; situé au [1295 rue amherst,
|
||||
Montréal](http://bit.ly/1QUC6Ou). Il s'agit de l'endroit ou nous avons fêté la
|
||||
fin de la dernière saison.
|
||||
|
||||
|
||||
**[lire la suite ...](#/nouvelles)**
|
||||
|
||||
"""
|
||||
@@ -1,50 +0,0 @@
|
||||
[title]
|
||||
innerMarkdown="""
|
||||
## Inscription 2016 et Dates!
|
||||
"""
|
||||
|
||||
[meta]
|
||||
innerMarkdown = """
|
||||
Jeudi 31 mars 2016
|
||||
"""
|
||||
|
||||
|
||||
[body]
|
||||
innerMarkdown = """
|
||||
Bonjour a tous,
|
||||
|
||||
Permièrement, il est encore temps de s'inscrire. Par ordre de l'Association de
|
||||
Sport de Ball de Montréal, **l'inscription doit être fini le 15 avril**. Donc
|
||||
imprimez et envovez votre inscription le plus vite possible!
|
||||
|
||||
Deuxièmement, nous avons des nouvelles sur les dates. La **saison commencera
|
||||
le jeudi 12 mai**. Nous allons jouer une **partie hors concours le 5 mai**.
|
||||
Comme aux saisons précédentes, nous jouerons les jeudi soir au parc
|
||||
Walter-Stewart et y organiserons une pratique les dimanches matins.
|
||||
|
||||
Pour les nouveaux, les **évaluations se feront dans les alentours du 30 avril**.
|
||||
Il s'agit d'une journee ou les capitaines vous observerons pour savoir votre
|
||||
niveau dans l'optique de creer des équipes les plus égales que possible.
|
||||
|
||||
|
||||
Votre commite ballephenix adoré!
|
||||
|
||||
[<i class="fa fa-paperclip"></i> Formulaire d'inscription](/files/inscription2016.pdf)
|
||||
|
||||
|
||||
"""
|
||||
|
||||
|
||||
|
||||
[smallBody]
|
||||
innerMarkdown = """
|
||||
|
||||
Bonjour a tous,
|
||||
|
||||
Permièrement, il est encore temps de s'inscrire. Par ordre de l'Association de
|
||||
Sport de Ball de Montréal, **l'inscription doit être fini le 15 avril**. Donc
|
||||
imprimez et envovez votre inscription le plus vite possible!
|
||||
|
||||
**[lire la suite ...](#/nouvelles)**
|
||||
|
||||
"""
|
||||
@@ -1,50 +0,0 @@
|
||||
[title]
|
||||
innerMarkdown = """
|
||||
## Saison 2017!
|
||||
"""
|
||||
|
||||
[meta]
|
||||
innerMarkdown = """
|
||||
Samedi 6 mai 2017
|
||||
"""
|
||||
|
||||
[body]
|
||||
innerMarkdown = """
|
||||
|
||||
Bonjour a toutes et a tous!
|
||||
|
||||
Nous avons quelques problèmes avec le parc Walter-Stewart. La ville
|
||||
re-tourbera bientôt le terrain et nous n'allons pouvoir l'utiliser avant la
|
||||
semaine du 19 juin. D'ici la, nous allons etre hébergé au parc [Georges-Vernot](http://bit.ly/2qMdsdm)
|
||||
dans St-Michel.
|
||||
|
||||
Avec tout ces délais, nous sommes obligé de commencer la saison un peu plus
|
||||
tard que prévue. La saison commencera donc le **jeudi 18 mai 2017**. Il n'y
|
||||
aura donc aucun match pré-saison.
|
||||
|
||||
Nous sommes toujours a la **recherche de capitaines**. La case "je veux devenir
|
||||
capitaine" ne fut pas des plus populaire. Nous cherchons donc intensément
|
||||
quatre capitaines au sang neuf pour diriger cinq équipes au sang chaud.
|
||||
|
||||
|
||||
En résumé.
|
||||
|
||||
* La saison debute le **jeudi 18 mai 2017** au parc **[Georges-Vernot](http://bit.ly/2qMdsdm)**
|
||||
* Nous retrouverons le parc [Walter-Stewart](http://bit.ly/2qDlnMW) la semaine du 19 juin
|
||||
* Il nous manque 4 capitaines
|
||||
|
||||
"""
|
||||
|
||||
[smallBody]
|
||||
innerMarkdown = """
|
||||
Bonjour a toutes et a tous!
|
||||
|
||||
Nous avons quelques problèmes avec le parc Walter-Stewart. La ville
|
||||
re-tourbera bientôt le terrain et nous n'allons pouvoir l'utiliser avant la
|
||||
semaine du 19 juin. D'ici la, nous allons etre hébergé au parc [Georges-Vernot](http://bit.ly/2qMdsdm)
|
||||
dans St-Michel.
|
||||
|
||||
|
||||
**[lire la suite ...](#/nouvelles)**
|
||||
|
||||
"""
|
||||
@@ -1,20 +0,0 @@
|
||||
[title]
|
||||
innerMarkdown = """
|
||||
## Début saison 2017 retardée
|
||||
"""
|
||||
|
||||
[meta]
|
||||
innerMarkdown = """
|
||||
Samedi 23 avril 2017
|
||||
"""
|
||||
|
||||
[body]
|
||||
innerMarkdown = """
|
||||
Suite à la situation au parc Walter-Stewart, nous n'avons toujours pas de date définie
|
||||
pour le début de la saison. La situation devrait se régler incessamment. Nous vous
|
||||
donnerons des nouvelles dès que nous en aurons.
|
||||
|
||||
Merci beaucoup,
|
||||
|
||||
Comité ballephenix!
|
||||
"""
|
||||
@@ -1,33 +0,0 @@
|
||||
[title]
|
||||
innerMarkdown = """
|
||||
# Report de la saison 2016
|
||||
"""
|
||||
|
||||
[meta]
|
||||
innerMarkdown = """
|
||||
Mercredi 11 mai 2016
|
||||
"""
|
||||
|
||||
[body]
|
||||
innerMarkdown = """
|
||||
Le parc walter-stewart est présentement en réaménagement. Conséquemment, nous
|
||||
devons reporter la saison jusqu'à la fin juin, date à laquelle le parc devrait
|
||||
être prêt.
|
||||
|
||||
|
||||
Plusieurs hypothèses sont envisagées pour ne pas perdre de matchs. Nous pensons
|
||||
à jouer les mercredis et jeudis ou rallonger la saison durant le mois de
|
||||
septembre. Malheuresement, nous ne pouvons prendre une désision officielle
|
||||
avant de prendre connaissance de la date exacte de réouverture du parc.
|
||||
|
||||
Votre comité de balle les phénix.
|
||||
"""
|
||||
|
||||
[smallBody]
|
||||
innerMarkdown = """
|
||||
Le parc walter-stewart est présentement en réaménagement. Conséquemment, nous
|
||||
devons reporter la saison jusqu'à la fin juin, date à laquelle le parc devrait
|
||||
être prêt.
|
||||
|
||||
**[lire la suite ...](#/nouvelles)**
|
||||
"""
|
||||
@@ -287,21 +287,3 @@
|
||||
score: 3
|
||||
team: rouge
|
||||
tel: 224-921-0391x3813
|
||||
-
|
||||
email: brossard@chat.miaou
|
||||
name: "brossard"
|
||||
score: 3
|
||||
team: vert
|
||||
tel: (432)161-1237
|
||||
-
|
||||
email: hobo@chat.miaou
|
||||
name: "hobo"
|
||||
score: 1
|
||||
team: vert
|
||||
tel: (432)161-1237
|
||||
-
|
||||
email: western@chat.miaou
|
||||
name: "western"
|
||||
score: 2
|
||||
team: vert
|
||||
tel: (432)161-1237
|
||||
+9
-413
@@ -1,421 +1,17 @@
|
||||
---
|
||||
|
||||
# generated by https://scheduler.leaguelobster.com/edit/236693/new-league/new-season/#
|
||||
-
|
||||
date: 2017/5/18 # year/month/day
|
||||
time: "18:30"
|
||||
home: jaune # t6
|
||||
away: bleu # t5
|
||||
date: ~
|
||||
time: ~
|
||||
home: gris
|
||||
away: jaune
|
||||
home_points: ~
|
||||
away_points: ~
|
||||
rain: false
|
||||
away_points: !
|
||||
|
||||
-
|
||||
date: 2017/5/18 # year/month/day
|
||||
time: "20:00"
|
||||
home: orange # t3
|
||||
away: gris # t1
|
||||
date: ~
|
||||
time: ~
|
||||
home: bleu
|
||||
away: rouge
|
||||
home_points: ~
|
||||
away_points: ~
|
||||
rain: false
|
||||
|
||||
-
|
||||
date: 2017/5/18 # year/month/day
|
||||
time: "21:30"
|
||||
home: vert # t2
|
||||
away: rouge # t4
|
||||
home_points: ~
|
||||
away_points: ~
|
||||
rain: false
|
||||
|
||||
# WEEK 2
|
||||
-
|
||||
date: 2017/5/25 # year/month/day
|
||||
time: "18:30"
|
||||
home: gris # t1
|
||||
away: bleu # t5
|
||||
home_points: ~
|
||||
away_points: ~
|
||||
rain: false
|
||||
|
||||
-
|
||||
date: 2017/5/25 # year/month/day
|
||||
time: "20:00"
|
||||
home: rouge # t4
|
||||
away: jaune # t6
|
||||
home_points: ~
|
||||
away_points: ~
|
||||
rain: false
|
||||
|
||||
-
|
||||
date: 2017/5/25 # year/month/day
|
||||
time: "21:30"
|
||||
home: vert # t2
|
||||
away: orange # t3
|
||||
home_points: ~
|
||||
away_points: ~
|
||||
rain: false
|
||||
|
||||
# WEEK 3
|
||||
-
|
||||
date: 2017/6/1 # year/month/day
|
||||
time: "18:30"
|
||||
home: jaune # t6
|
||||
away: gris # t1
|
||||
home_points: ~
|
||||
away_points: ~
|
||||
rain: false
|
||||
|
||||
-
|
||||
date: 2017/6/1 # year/month/day
|
||||
time: "20:00"
|
||||
home: bleu # t5
|
||||
away: vert # t2
|
||||
home_points: ~
|
||||
away_points: ~
|
||||
rain: false
|
||||
|
||||
-
|
||||
date: 2017/6/1 # year/month/day
|
||||
time: "21:30"
|
||||
home: orange # t3
|
||||
away: rouge # t4
|
||||
home_points: ~
|
||||
away_points: ~
|
||||
rain: false
|
||||
|
||||
# WEEK 4
|
||||
-
|
||||
date: 2017/6/8 # year/month/day
|
||||
time: "18:30"
|
||||
home: vert # t2
|
||||
away: gris # t1
|
||||
home_points: ~
|
||||
away_points: ~
|
||||
rain: false
|
||||
|
||||
-
|
||||
date: 2017/6/8 # year/month/day
|
||||
time: "20:00"
|
||||
home: rouge # t4
|
||||
away: bleu # t5
|
||||
home_points: ~
|
||||
away_points: ~
|
||||
rain: false
|
||||
|
||||
-
|
||||
date: 2017/6/8 # year/month/day
|
||||
time: "21:30"
|
||||
home: orange # t3
|
||||
away: jaune # t6
|
||||
home_points: ~
|
||||
away_points: ~
|
||||
rain: false
|
||||
|
||||
# WEEK 5
|
||||
-
|
||||
date: 2017/6/15 # year/month/day
|
||||
time: "18:30"
|
||||
home: jaune # t6
|
||||
away: vert # t2
|
||||
home_points: ~
|
||||
away_points: ~
|
||||
rain: false
|
||||
|
||||
-
|
||||
date: 2017/6/15 # year/month/day
|
||||
time: "20:00"
|
||||
home: gris # t1
|
||||
away: rouge # t4
|
||||
home_points: ~
|
||||
away_points: ~
|
||||
rain: false
|
||||
|
||||
-
|
||||
date: 2017/6/15 # year/month/day
|
||||
time: "21:30"
|
||||
home: bleu # t5
|
||||
away: orange # t3
|
||||
home_points: ~
|
||||
away_points: ~
|
||||
rain: false
|
||||
|
||||
# WEEK 6
|
||||
-
|
||||
date: 2017/6/22 # year/month/day
|
||||
time: "18:30"
|
||||
home: bleu # t5
|
||||
away: jaune # t6
|
||||
home_points: ~
|
||||
away_points: ~
|
||||
rain: false
|
||||
|
||||
-
|
||||
date: 2017/6/22 # year/month/day
|
||||
time: "20:00"
|
||||
home: orange # t3
|
||||
away: gris # t1
|
||||
home_points: ~
|
||||
away_points: ~
|
||||
rain: false
|
||||
|
||||
-
|
||||
date: 2017/6/22 # year/month/day
|
||||
time: "21:30"
|
||||
home: rouge # t4
|
||||
away: vert # t2
|
||||
home_points: ~
|
||||
away_points: ~
|
||||
rain: false
|
||||
|
||||
# WEEK 7
|
||||
-
|
||||
date: 2017/6/29 # year/month/day
|
||||
time: "18:30"
|
||||
home: jaune # t6
|
||||
away: rouge # t4
|
||||
home_points: ~
|
||||
away_points: ~
|
||||
rain: false
|
||||
|
||||
-
|
||||
date: 2017/6/29 # year/month/day
|
||||
time: "20:00"
|
||||
home: gris # t1
|
||||
away: bleu # t5
|
||||
home_points: ~
|
||||
away_points: ~
|
||||
rain: false
|
||||
|
||||
-
|
||||
date: 2017/6/29 # year/month/day
|
||||
time: "21:30"
|
||||
home: vert # t2
|
||||
away: orange # t3
|
||||
home_points: ~
|
||||
away_points: ~
|
||||
rain: false
|
||||
|
||||
# WEEK 8
|
||||
-
|
||||
date: 2017/7/6 # year/month/day
|
||||
time: "18:30"
|
||||
home: bleu # t5
|
||||
away: vert # t2
|
||||
home_points: ~
|
||||
away_points: ~
|
||||
rain: false
|
||||
|
||||
-
|
||||
date: 2017/7/6 # year/month/day
|
||||
time: "20:00"
|
||||
home: gris # t1
|
||||
away: jaune # t6
|
||||
home_points: ~
|
||||
away_points: ~
|
||||
rain: false
|
||||
|
||||
-
|
||||
date: 2017/7/6 # year/month/day
|
||||
time: "21:30"
|
||||
home: orange # t3
|
||||
away: rouge # t4
|
||||
home_points: ~
|
||||
away_points: ~
|
||||
rain: false
|
||||
|
||||
# WEEK 9
|
||||
-
|
||||
date: 2017/7/13 # year/month/day
|
||||
time: "18:30"
|
||||
home: jaune # t6
|
||||
away: orange # t3
|
||||
home_points: ~
|
||||
away_points: ~
|
||||
rain: false
|
||||
|
||||
-
|
||||
date: 2017/7/13 # year/month/day
|
||||
time: "20:00"
|
||||
home: rouge # t4
|
||||
away: bleu # t5
|
||||
home_points: ~
|
||||
away_points: ~
|
||||
rain: false
|
||||
|
||||
-
|
||||
date: 2017/7/13 # year/month/day
|
||||
time: "21:30"
|
||||
home: vert # t2
|
||||
away: gris # t1
|
||||
home_points: ~
|
||||
away_points: ~
|
||||
rain: false
|
||||
|
||||
# WEEK 10
|
||||
-
|
||||
date: 2017/7/20 # year/month/day
|
||||
time: "18:30"
|
||||
home: gris # t1
|
||||
away: rouge # t4
|
||||
home_points: ~
|
||||
away_points: ~
|
||||
rain: false
|
||||
|
||||
-
|
||||
date: 2017/7/20 # year/month/day
|
||||
time: "20:00"
|
||||
home: bleu # t5
|
||||
away: orange # t3
|
||||
home_points: ~
|
||||
away_points: ~
|
||||
rain: false
|
||||
|
||||
-
|
||||
date: 2017/7/20 # year/month/day
|
||||
time: "21:30"
|
||||
home: vert # t2
|
||||
away: jaune # t6
|
||||
home_points: ~
|
||||
away_points: ~
|
||||
rain: false
|
||||
|
||||
# WEEK 11
|
||||
-
|
||||
date: 2017/7/27 # year/month/day
|
||||
time: "18:30"
|
||||
home: rouge # t4
|
||||
away: vert # t2
|
||||
home_points: ~
|
||||
away_points: ~
|
||||
rain: false
|
||||
|
||||
-
|
||||
date: 2017/7/27 # year/month/day
|
||||
time: "20:00"
|
||||
home: jaune # t6
|
||||
away: bleu # t5
|
||||
home_points: ~
|
||||
away_points: ~
|
||||
rain: false
|
||||
|
||||
-
|
||||
date: 2017/7/27 # year/month/day
|
||||
time: "21:30"
|
||||
home: orange # t3
|
||||
away: gris # t1
|
||||
home_points: ~
|
||||
away_points: ~
|
||||
rain: false
|
||||
|
||||
# WEEK 12
|
||||
-
|
||||
date: 2017/8/3 # year/month/day
|
||||
time: "18:30"
|
||||
home: gris # t1
|
||||
away: bleu # t5
|
||||
home_points: ~
|
||||
away_points: ~
|
||||
rain: false
|
||||
|
||||
-
|
||||
date: 2017/8/3 # year/month/day
|
||||
time: "20:00"
|
||||
home: rouge # t4
|
||||
away: jaune # t6
|
||||
home_points: ~
|
||||
away_points: ~
|
||||
rain: false
|
||||
|
||||
-
|
||||
date: 2017/8/3 # year/month/day
|
||||
time: "21:30"
|
||||
home: vert # t2
|
||||
away: orange # t3
|
||||
home_points: ~
|
||||
away_points: ~
|
||||
rain: false
|
||||
|
||||
# WEEK 13
|
||||
-
|
||||
date: 2017/8/10 # year/month/day
|
||||
time: "18:30"
|
||||
home: jaune # t6
|
||||
away: gris # t1
|
||||
home_points: ~
|
||||
away_points: ~
|
||||
rain: false
|
||||
|
||||
-
|
||||
date: 2017/8/10 # year/month/day
|
||||
time: "20:00"
|
||||
home: bleu # t5
|
||||
away: vert # t2
|
||||
home_points: ~
|
||||
away_points: ~
|
||||
rain: false
|
||||
|
||||
-
|
||||
date: 2017/8/10 # year/month/day
|
||||
time: "21:30"
|
||||
home: orange # t3
|
||||
away: rouge # t4
|
||||
home_points: ~
|
||||
away_points: ~
|
||||
rain: false
|
||||
|
||||
# WEEK 14
|
||||
-
|
||||
date: 2017/8/17 # year/month/day
|
||||
time: "18:30"
|
||||
home: rouge # t4
|
||||
away: bleu # t5
|
||||
home_points: ~
|
||||
away_points: ~
|
||||
rain: false
|
||||
|
||||
-
|
||||
date: 2017/8/17 # year/month/day
|
||||
time: "20:00"
|
||||
home: vert # t2
|
||||
away: gris # t1
|
||||
home_points: ~
|
||||
away_points: ~
|
||||
rain: false
|
||||
|
||||
-
|
||||
date: 2017/8/17 # year/month/day
|
||||
time: "21:30"
|
||||
home: orange # t3
|
||||
away: jaune # t6
|
||||
home_points: ~
|
||||
away_points: ~
|
||||
rain: false
|
||||
|
||||
# WEEK 15
|
||||
-
|
||||
date: 2017/8/24 # year/month/day
|
||||
time: "18:30"
|
||||
home: gris # t1
|
||||
away: rouge # t4
|
||||
home_points: ~
|
||||
away_points: ~
|
||||
rain: false
|
||||
|
||||
-
|
||||
date: 2017/8/24 # year/month/day
|
||||
time: "20:00"
|
||||
home: bleu # t5
|
||||
away: orange # t3
|
||||
home_points: ~
|
||||
away_points: ~
|
||||
rain: false
|
||||
|
||||
-
|
||||
date: 2017/8/24 # year/month/day
|
||||
time: "21:30"
|
||||
home: jaune # t6
|
||||
away: vert # t2
|
||||
home_points: ~
|
||||
away_points: ~
|
||||
rain: false
|
||||
@@ -1,281 +0,0 @@
|
||||
---
|
||||
-
|
||||
date: 2017/5/04 # year/month/day
|
||||
time: "18:45"
|
||||
away: jaune
|
||||
home: rouge
|
||||
home_points: ~
|
||||
away_points: ~
|
||||
rain: false
|
||||
|
||||
-
|
||||
date: 2017/5/04 # year/month/day
|
||||
time: "20:20"
|
||||
away: gris
|
||||
home: bleu
|
||||
home_points: ~
|
||||
away_points: ~
|
||||
rain: false
|
||||
|
||||
-
|
||||
date: 2017/5/11 # year/month/day
|
||||
time: "18:45"
|
||||
away: rouge
|
||||
home: gris
|
||||
home_points: ~
|
||||
away_points: ~
|
||||
rain: false
|
||||
|
||||
-
|
||||
date: 2017/5/11 # year/month/day
|
||||
time: "20:20"
|
||||
away: bleu
|
||||
home: jaune
|
||||
home_points: ~
|
||||
away_points: ~
|
||||
rain: false
|
||||
|
||||
-
|
||||
date: 2017/5/18 # year/month/day
|
||||
time: "18:45"
|
||||
away: gris
|
||||
home: jaune
|
||||
home_points: ~
|
||||
away_points: ~
|
||||
rain: false
|
||||
|
||||
-
|
||||
date: 2017/5/18 # year/month/day
|
||||
time: "20:20"
|
||||
away: rouge
|
||||
home: bleu
|
||||
home_points: ~
|
||||
away_points: ~
|
||||
rain: false
|
||||
|
||||
-
|
||||
date: 2017/5/25 # year/month/day
|
||||
time: "18:45"
|
||||
away: bleu
|
||||
home: gris
|
||||
home_points: ~
|
||||
away_points: ~
|
||||
|
||||
-
|
||||
date: 2017/5/25 # year/month/day
|
||||
time: "20:20"
|
||||
away: rouge
|
||||
home: jaune
|
||||
home_points: ~
|
||||
away_points: ~
|
||||
|
||||
-
|
||||
date: 2017/6/1 # year/month/day
|
||||
time: "18:45"
|
||||
away: jaune
|
||||
home: bleu
|
||||
home_points: ~
|
||||
away_points: ~
|
||||
|
||||
-
|
||||
date: 2017/6/1 # year/month/day
|
||||
time: "20:20"
|
||||
away: gris
|
||||
home: rouge
|
||||
home_points: ~
|
||||
away_points: ~
|
||||
|
||||
-
|
||||
date: 2017/6/8 # year/month/day
|
||||
time: "18:45"
|
||||
away: bleu
|
||||
home: rouge
|
||||
home_points: ~
|
||||
away_points: ~
|
||||
rain: false
|
||||
|
||||
-
|
||||
date: 2017/6/8 # year/month/day
|
||||
time: "20:20"
|
||||
away: jaune
|
||||
home: gris
|
||||
home_points: ~
|
||||
away_points: ~
|
||||
rain: false
|
||||
|
||||
-
|
||||
date: 2017/6/15 # year/month/day
|
||||
time: "18:45"
|
||||
away: jaune
|
||||
home: rouge
|
||||
home_points: ~
|
||||
away_points: ~
|
||||
|
||||
-
|
||||
date: 2017/6/15 # year/month/day
|
||||
time: "20:20"
|
||||
away: gris
|
||||
home: bleu
|
||||
home_points: ~
|
||||
away_points: ~
|
||||
|
||||
-
|
||||
date: 2017/6/22 # year/month/day
|
||||
time: "18:45"
|
||||
away: rouge
|
||||
home: gris
|
||||
home_points: ~
|
||||
away_points: ~
|
||||
|
||||
-
|
||||
date: 2017/6/22 # year/month/day
|
||||
time: "20:20"
|
||||
away: bleu
|
||||
home: jaune
|
||||
home_points: ~
|
||||
away_points: ~
|
||||
|
||||
-
|
||||
date: 2017/6/29 # year/month/day
|
||||
time: "18:45"
|
||||
away: gris
|
||||
home: jaune
|
||||
home_points: ~
|
||||
away_points: ~
|
||||
|
||||
-
|
||||
date: 2017/6/29 # year/month/day
|
||||
time: "20:20"
|
||||
away: rouge
|
||||
home: bleu
|
||||
home_points: ~
|
||||
away_points: ~
|
||||
|
||||
-
|
||||
date: 2017/7/6 # year/month/day
|
||||
time: "18:45"
|
||||
away: bleu
|
||||
home: gris
|
||||
home_points: ~
|
||||
away_points: ~
|
||||
|
||||
-
|
||||
date: 2017/7/6 # year/month/day
|
||||
time: "20:20"
|
||||
away: rouge
|
||||
home: jaune
|
||||
home_points: ~
|
||||
away_points: ~
|
||||
|
||||
-
|
||||
date: 2017/7/13 # year/month/day
|
||||
time: "18:45"
|
||||
away: jaune
|
||||
home: bleu
|
||||
home_points: ~
|
||||
away_points: ~
|
||||
|
||||
-
|
||||
date: 2017/7/13 # year/month/day
|
||||
time: "20:20"
|
||||
away: gris
|
||||
home: rouge
|
||||
home_points: ~
|
||||
away_points: ~
|
||||
|
||||
-
|
||||
date: 2017/7/20 # year/month/day
|
||||
time: "18:45"
|
||||
away: bleu
|
||||
home: rouge
|
||||
home_points: ~
|
||||
away_points: ~
|
||||
|
||||
-
|
||||
date: 2017/7/20 # year/month/day
|
||||
time: "20:20"
|
||||
away: jaune
|
||||
home: gris
|
||||
home_points: ~
|
||||
away_points: ~
|
||||
|
||||
-
|
||||
date: 2017/7/27 # year/month/day
|
||||
time: "18:45"
|
||||
away: jaune
|
||||
home: rouge
|
||||
home_points: ~
|
||||
away_points: ~
|
||||
|
||||
-
|
||||
date: 2017/7/27 # year/month/day
|
||||
time: "20:20"
|
||||
away: gris
|
||||
home: bleu
|
||||
home_points: ~
|
||||
away_points: ~
|
||||
|
||||
-
|
||||
date: 2017/8/3 # year/month/day
|
||||
time: "18:45"
|
||||
away: rouge
|
||||
home: gris
|
||||
home_points: ~
|
||||
away_points: ~
|
||||
|
||||
-
|
||||
date: 2017/8/3 # year/month/day
|
||||
time: "20:20"
|
||||
away: bleu
|
||||
home: jaune
|
||||
home_points: ~
|
||||
away_points: ~
|
||||
|
||||
-
|
||||
date: 2017/8/10 # year/month/day
|
||||
time: "18:45"
|
||||
away: jaune
|
||||
home: rouge
|
||||
home_points: ~
|
||||
away_points: ~
|
||||
|
||||
-
|
||||
date: 2017/8/10 # year/month/day
|
||||
time: "20:20"
|
||||
away: gris
|
||||
home: bleu
|
||||
home_points: ~
|
||||
away_points: ~
|
||||
-
|
||||
date: 2017/8/17 # year/month/day
|
||||
time: "18:45"
|
||||
away: gris
|
||||
home: jaune
|
||||
home_points: ~
|
||||
away_points: ~
|
||||
|
||||
-
|
||||
date: 2017/8/17 # year/month/day
|
||||
time: "20:20"
|
||||
away: rouge
|
||||
home: bleu
|
||||
home_points: ~
|
||||
away_points: ~
|
||||
|
||||
-
|
||||
date: 2017/8/25 # year/month/day
|
||||
time: "18:45"
|
||||
away: bleu
|
||||
home: rouge
|
||||
home_points: ~
|
||||
away_points: ~
|
||||
temporary: false
|
||||
|
||||
-
|
||||
date: 2017/8/25 # year/month/day
|
||||
time: "20:20"
|
||||
away: jaune
|
||||
home: gris
|
||||
home_points: ~
|
||||
away_points: ~
|
||||
temporary: false
|
||||
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.
+16
-39
@@ -1,4 +1,5 @@
|
||||
var gulp = require('gulp');
|
||||
var bower = require('gulp-bower');
|
||||
var help = require('gulp-task-listing');
|
||||
var clean = require('gulp-clean');
|
||||
var toml = require('gulp-toml');
|
||||
@@ -7,17 +8,21 @@ var rename = require("gulp-rename");
|
||||
var yaml = require('gulp-yaml');
|
||||
var template = require('gulp-template');
|
||||
var wrapper = require('gulp-wrapper');
|
||||
var rename = require("gulp-rename");
|
||||
var webserver = require('gulp-webserver');
|
||||
var marked = require('marked');
|
||||
var spritz = require('spritzjs');
|
||||
var modify = require('gulp-modify');
|
||||
var _ = require('lodash');
|
||||
|
||||
gulp.task('help', help);
|
||||
|
||||
gulp.task('bower', function(){
|
||||
return bower()
|
||||
.pipe(gulp.dest('lib/'))
|
||||
.on('error', console.log);
|
||||
});
|
||||
|
||||
gulp.task('sass', [], function(){
|
||||
var extraSassPath = ['./node_modules/'];
|
||||
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'));
|
||||
@@ -34,46 +39,17 @@ gulp.task('compile-results', function(){
|
||||
.pipe(gulp.dest('./api'));
|
||||
});
|
||||
|
||||
var encryptFile = function(message){
|
||||
var keyLengthInBytes = 128;
|
||||
var salt = process.env.SALT || 'salt';
|
||||
var stringKey = salt + (process.env.KEY || 'qwerty');
|
||||
var key = spritz.hash(stringKey, keyLengthInBytes);
|
||||
var byteArrMessage = spritz.stringToUtf8ByteArray(message);
|
||||
var cypher = spritz.encrypt(key, byteArrMessage);
|
||||
return JSON.stringify(cypher);
|
||||
};
|
||||
|
||||
var wrapEncryptedData = function(encryptedData){
|
||||
return 'window.encryptedPlayerList = ' + encryptedData + ';';
|
||||
};
|
||||
|
||||
gulp.task('encrypt-results', ['compile-results'], function(){
|
||||
return gulp.src('api/*.clear.json')
|
||||
.pipe(modify({
|
||||
fileModifier: function(file, content) {
|
||||
return wrapEncryptedData(encryptFile(content));
|
||||
}
|
||||
}))
|
||||
.pipe(rename(function(path){
|
||||
path.basename = path.basename.replace(/\.clear$/i, '');
|
||||
path.extname = '.spritz.js';
|
||||
return path;
|
||||
}))
|
||||
.pipe(gulp.dest('./api'));
|
||||
});
|
||||
|
||||
gulp.task('template-prod', function () {
|
||||
return gulp.src('index.tmpl.html')
|
||||
.pipe(rename("index.html"))
|
||||
.pipe(template({production: true, salt: process.env.SALT, playerListLocation: process.env.PLAYER_LIST_LOCATION}))
|
||||
.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, salt: 'salt', playerListLocation: 'api/players.spritz.js'}))
|
||||
.pipe(template({production: false}))
|
||||
.pipe(gulp.dest('.'));
|
||||
});
|
||||
|
||||
@@ -106,7 +82,7 @@ gulp.task('compile-articles', function(){
|
||||
|
||||
});
|
||||
|
||||
gulp.task('default', ['sass', 'encrypt-results', 'compile-results', 'compile-articles']);
|
||||
gulp.task('default', ['bower', 'sass', 'compile-results', 'compile-articles']);
|
||||
|
||||
gulp.task('prod', ['default', 'template-prod']);
|
||||
|
||||
@@ -114,15 +90,16 @@ gulp.task('webserver', function(){
|
||||
return gulp.src('.')
|
||||
.pipe(webserver({
|
||||
host: '0.0.0.0',
|
||||
port: 4321,
|
||||
port: 2222,
|
||||
livereload: false,
|
||||
directoryListing: false,
|
||||
}));
|
||||
});
|
||||
|
||||
gulp.task('dev', ['default', 'webserver', 'template-dev'], function(){
|
||||
|
||||
gulp.task('dev', ['default', 'webserver', 'template-dev', 'bower'], function(){
|
||||
gulp.watch('./scss/*.scss', ['sass']);
|
||||
gulp.watch('*.tmpl.html', ['template-dev']);
|
||||
gulp.watch('./data/articles/**/*', ['compile-articles']);
|
||||
return gulp.watch('./data/*.yaml', ['encrypt-results', 'compile-results']);
|
||||
return gulp.watch('./data/*.yaml', ['compile-results']);
|
||||
});
|
||||
File diff suppressed because it is too large.
Load diff
Binary file not shown.
File diff suppressed because it is too large.
Load diff
|
Before Width: | Height: | Size: 219 KiB |
File diff suppressed because it is too large.
Load diff
|
Before Width: | Height: | Size: 379 KiB |
+2
-6
@@ -7,17 +7,13 @@
|
||||
<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.6.0/css/font-awesome.min.css">
|
||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
window.salt = "<%= salt %>";
|
||||
</script>
|
||||
<script src="<%= playerListLocation %>"></script>
|
||||
<%if(production){ %>
|
||||
<script src="main-built.js"></script>
|
||||
<% }else{ %>
|
||||
<script data-main="script/main" src="node_modules/requirejs/require.js"></script>
|
||||
<script data-main="script/main" src="lib/requirejs/require.js"></script>
|
||||
<% } %>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,18 @@
|
||||
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 ]
|
||||
+2
-7
@@ -5,8 +5,8 @@
|
||||
"main": "index.html",
|
||||
"dependencies": {
|
||||
"gulp": "^3.9.0",
|
||||
"gulp-bower": "0.0.13",
|
||||
"gulp-clean": "^0.3.1",
|
||||
"gulp-modify": "^0.1.1",
|
||||
"gulp-rename": "^1.2.2",
|
||||
"gulp-sass": "^2.1.1",
|
||||
"gulp-task-listing": "^1.0.1",
|
||||
@@ -16,12 +16,7 @@
|
||||
"gulp-wrapper": "^1.0.0",
|
||||
"lodash": "^4.6.1",
|
||||
"marked": "^0.3.5",
|
||||
"requirejs": "^2.1.22",
|
||||
"uikit": "2.27.2",
|
||||
"mithril": "~0.2.1",
|
||||
"almond": "~0.3.1",
|
||||
"requirejs": "~2.1.22",
|
||||
"spritzjs": "https://gitlab.com/didiercrunch/spritzjs.git"
|
||||
"requirejs": "^2.1.22"
|
||||
},
|
||||
"devDependencies": {
|
||||
"gulp-webserver": "^0.9.1",
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
*.js
|
||||
@@ -1,4 +1,5 @@
|
||||
define(['m', 'articles/saison2017', 'articles/saison_retardee', 'articles/inscription_2017', 'articles/inscription', 'articles/inscription_rappel', 'articles/walter_stewart', 'articles/changement_de_parc'], function (m, saison2017, saison_retardee, inscription_2017, inscription, inscription_rappel, walter_stewart, changement_de_parc) {
|
||||
define(['m', 'articles/inscription'], function (m, inscription) {
|
||||
|
||||
var simplifyArticleStructure = function(article){
|
||||
var ret = {};
|
||||
_.each(article, function(section, sectionName){
|
||||
@@ -7,15 +8,9 @@ define(['m', 'articles/saison2017', 'articles/saison_retardee', 'articles/inscri
|
||||
return ret;
|
||||
};
|
||||
|
||||
var articles = [
|
||||
saison2017,
|
||||
saison_retardee,
|
||||
inscription_2017,
|
||||
changement_de_parc,
|
||||
walter_stewart,
|
||||
inscription_rappel,
|
||||
inscription
|
||||
];
|
||||
var articles = [];
|
||||
articles.push(inscription);
|
||||
|
||||
|
||||
return _.map(articles, simplifyArticleStructure);
|
||||
});
|
||||
@@ -1,13 +0,0 @@
|
||||
define(['m', '_'], function (m, _ ) {
|
||||
return {
|
||||
"title": {
|
||||
"innerMarkdown": "<h2 id=\"d-but-saison-2017-retard-e\">Début saison 2017 retardée</h2>\n"
|
||||
},
|
||||
"meta": {
|
||||
"innerMarkdown": "<p>Samedi 23 avril 2017</p>\n"
|
||||
},
|
||||
"body": {
|
||||
"innerMarkdown": "<p>Suite à la situation au parc Walter-Stewart, nous n'avons toujours pas de date définie\npour le début de la saison. La situation devrait se régler incessamment. Nous vous\ndonnerons des nouvelles dès que nous en aurons.</p>\n<p>Merci beaucoup,</p>\n<p>Comité ballephenix!</p>\n"
|
||||
}
|
||||
};
|
||||
});
|
||||
+3
-6
@@ -1,23 +1,20 @@
|
||||
requirejs.config({
|
||||
paths: {
|
||||
'_': '../node_modules/lodash/lodash.min',
|
||||
'm': '../node_modules/mithril/mithril.min',
|
||||
'spritz': '../node_modules/spritzjs/dist/spritz'
|
||||
'_': '../lib/lodash/dist/lodash.min',
|
||||
'm': '../lib/mithril/mithril.min'
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
requirejs(['m', 'views/mainPage', 'views/historicPage', 'views/newsPage', 'views/calendarPage', 'views/rulesPage', 'views/photosPage', 'views/confidentialPage', 'views/contactPage', 'views/inscriptionForm'], function(m, mainPage, historicPage, newsPage, calendarPage, rulesPage, photosPage, confidentialPage, contactPage, inscriptionForm){
|
||||
requirejs(['m', 'views/mainPage', 'views/newsPage', 'views/calendarPage', 'views/rulesPage', 'views/photosPage', 'views/confidentialPage', 'views/contactPage', 'views/loginPage',], function(m, mainPage, newsPage, calendarPage, rulesPage, photosPage, confidentialPage, contactPage, loginPage){
|
||||
m.route.mode = "hash";
|
||||
m.route(document.body, "/", {
|
||||
"/": mainPage,
|
||||
"/nouvelles": newsPage,
|
||||
"/inscription-form": inscriptionForm,
|
||||
"/calendrier": calendarPage,
|
||||
"/reglement": rulesPage,
|
||||
"/photos": photosPage,
|
||||
"/membre": confidentialPage,
|
||||
"/historique": historicPage,
|
||||
"/contact": contactPage
|
||||
});
|
||||
});
|
||||
@@ -101,14 +101,8 @@ define(['_'], function(_) {
|
||||
return ret;
|
||||
};
|
||||
|
||||
resultParser._removeTemporaryResults = function(rawResults){
|
||||
return _.filter(rawResults, function(rawResult){
|
||||
return !rawResult.temporary;
|
||||
});
|
||||
};
|
||||
|
||||
resultParser.getStats = function(rawResults){
|
||||
var allTeams = resultParser._getAllTeams(resultParser._removeTemporaryResults(rawResults));
|
||||
var allTeams = resultParser._getAllTeams(rawResults);
|
||||
var getTeamStats = _.partial(resultParser._getTeamStats, rawResults);
|
||||
return _.map(allTeams, getTeamStats);
|
||||
};
|
||||
|
||||
+13
-18
@@ -1,26 +1,21 @@
|
||||
define(['m', '_'], function (m, _) {
|
||||
var teams = {};
|
||||
|
||||
teams.teams = function(){
|
||||
return [
|
||||
{name: 'jaune', color: '#FF0'},
|
||||
{name:'rouge', color: '#F00'},
|
||||
{name:'bleu', color: '#00F'},
|
||||
{name:'gris', color: '#808080'},
|
||||
{name:'vert', color: '#008000'},
|
||||
{name: 'orange', color: '#FFA500'}
|
||||
];
|
||||
};
|
||||
|
||||
teams.getTeamColor = function(teamName){
|
||||
var color;
|
||||
_.each(teams.teams(), function(team){
|
||||
if(team.name == teamName){
|
||||
color = team.color;
|
||||
return false;
|
||||
if(teamName == 'jaune'){
|
||||
return '#FF0';
|
||||
}
|
||||
});
|
||||
return color;
|
||||
if(teamName == 'rouge'){
|
||||
return '#F00';
|
||||
}
|
||||
if(teamName == 'bleu'){
|
||||
return '#00F';
|
||||
}
|
||||
if(teamName == 'gris'){
|
||||
return '#808080';
|
||||
}
|
||||
|
||||
return undefined;
|
||||
};
|
||||
|
||||
return teams;
|
||||
|
||||
+1
-18
@@ -21,7 +21,7 @@ define(['m'], function(m) {
|
||||
|
||||
util.formatDate = function(date){
|
||||
var monthNames = ['janvier', 'février', 'mars', 'avril', 'mai', 'juin',
|
||||
'juillet', 'août', 'septembre', 'octobre', 'novembre',
|
||||
'juiller', 'août', 'septembre', 'octobre', 'novembre',
|
||||
'decembre'];
|
||||
return [date.getDate(),
|
||||
monthNames[date.getMonth()],
|
||||
@@ -38,28 +38,11 @@ define(['m'], function(m) {
|
||||
date.getFullYear() % 1000].join(' ');
|
||||
};
|
||||
|
||||
util.join = function(arr, sep){
|
||||
if(!_.isArray(arr) || arr.length < 1){
|
||||
return [];
|
||||
}
|
||||
var ret = [arr.pop()];
|
||||
_.each(arr, function(elm){
|
||||
ret.push(sep);
|
||||
ret.push(elm);
|
||||
});
|
||||
return ret;
|
||||
};
|
||||
|
||||
util.facebookLink = function(){
|
||||
return m('a[href="https://www.facebook.com/LigueDeBalleLesPhenix"]',
|
||||
m('i.fa.fa-facebook-square')
|
||||
);
|
||||
};
|
||||
|
||||
util.resultatsURL = function(){
|
||||
var cacheBuster = 2;
|
||||
return "api/resultats.json?_=" + cacheBuster;
|
||||
};
|
||||
|
||||
return util;
|
||||
});
|
||||
@@ -26,7 +26,6 @@ define(['m', '_', 'util', 'resultParser', 'teams', 'views/topNavBar', 'views/foo
|
||||
};
|
||||
|
||||
statsView.mainTable = function(stats){
|
||||
var orderedStats = _.reverse(_.sortBy(stats, ['victories', 'pointsFor']));
|
||||
return m('table.uk-table.uk-table-hover.uk-table-striped',[
|
||||
m('thead', m('tr', [
|
||||
m('th', 'Équipes'),
|
||||
@@ -39,7 +38,7 @@ define(['m', '_', 'util', 'resultParser', 'teams', 'views/topNavBar', 'views/foo
|
||||
m('th', 'DIF'),
|
||||
m('th', 'PTS')
|
||||
])),
|
||||
m('tbody', _.map(orderedStats, statsView.getStatRow))
|
||||
m('tbody', _.map(stats, statsView.getStatRow))
|
||||
]);
|
||||
};
|
||||
|
||||
@@ -57,22 +56,13 @@ define(['m', '_', 'util', 'resultParser', 'teams', 'views/topNavBar', 'views/foo
|
||||
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 2017'),
|
||||
m('h2', 'Classement 2016'),
|
||||
statsView.mainTable(stats()),
|
||||
statsView.legend()
|
||||
]));
|
||||
|
||||
};
|
||||
|
||||
var tabView = {};
|
||||
|
||||
tabView.view = function(){
|
||||
return m('div.uk-margin', m('h2', 'Calendrier 2017'),
|
||||
m('ul.uk-tab', [
|
||||
m('li.uk-active', m('a', 'Saison')),
|
||||
m('li', m('a', 'Éliminatoire'))
|
||||
]));
|
||||
};
|
||||
|
||||
var schedulView = {};
|
||||
|
||||
@@ -128,7 +118,7 @@ define(['m', '_', 'util', 'resultParser', 'teams', 'views/topNavBar', 'views/foo
|
||||
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 2017')], _.map(games(), schedulView._gameView))));
|
||||
_.concat([m('h2', 'Calendrier 2016')], _.map(games(), schedulView._gameView))));
|
||||
};
|
||||
|
||||
calendarPage = {};
|
||||
@@ -138,7 +128,6 @@ define(['m', '_', 'util', 'resultParser', 'teams', 'views/topNavBar', 'views/foo
|
||||
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.component(statsView),
|
||||
m.component(tabView),
|
||||
m.component(schedulView)])),
|
||||
m.component(footer)];
|
||||
};
|
||||
|
||||
@@ -1,13 +1,286 @@
|
||||
define(['m', '_', 'teams', 'views/loginPage', 'views/playersPage', 'views/topNavBar', 'views/footer'], function (m, _ , teams, loginPage, playersPage, topNavBar, footer) {
|
||||
define(['m', '_', 'teams', 'views/topNavBar', 'views/footer'], function (m, _ , teams, topNavBar, footer) {
|
||||
|
||||
|
||||
var confidentialSelection = {};
|
||||
|
||||
confidentialSelection.toggleTeam = function(teamId, activatedTeams){
|
||||
return function(isActive){
|
||||
isActive = isActive != 'true';
|
||||
if(isActive){
|
||||
activatedTeams().push(teamId);
|
||||
return;
|
||||
}
|
||||
activatedTeams(_.difference(activatedTeams(), [teamId]));
|
||||
};
|
||||
};
|
||||
|
||||
confidentialSelection.teamInput = function(teamName, teamId, activatedTeams){
|
||||
var isActive = _.includes(activatedTeams(), teamId);
|
||||
var class_ = isActive ? 'uk-badge-success' : '';
|
||||
var callback = confidentialSelection.toggleTeam(teamId, activatedTeams);
|
||||
return m('div.uk-badge.uk-margin-left.uk-border-rounded',
|
||||
{class: class_, 'data-selected': isActive, onclick: m.withAttr("data-selected", callback)},
|
||||
m('h3', {style: {width: '80px'}}, teamName)
|
||||
);
|
||||
|
||||
};
|
||||
|
||||
confidentialSelection.scoreInput = function(score, activatedScores){
|
||||
var isActive = _.includes(activatedScores(), score);
|
||||
var class_ = isActive ? 'uk-badge-success' : '';
|
||||
var callback = confidentialSelection.toggleTeam(score, activatedScores);
|
||||
return m('div.uk-badge.uk-margin-left.uk-border-rounded',
|
||||
{class: class_, 'data-selected': isActive, onclick: m.withAttr("data-selected", callback)},
|
||||
m('h3', {style: {width: '80px'}}, score)
|
||||
);
|
||||
};
|
||||
|
||||
confidentialSelection.chooseTeams = function(model){
|
||||
return m('form.uk-grid', {style: {'margin-top': '1em'}},
|
||||
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', {style: {'margin-top': '1em'}},
|
||||
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', [
|
||||
confidentialSelection.chooseTeams(model),
|
||||
confidentialSelection.chooseScore(model)
|
||||
]);
|
||||
};
|
||||
|
||||
|
||||
var confidentialTable = {};
|
||||
|
||||
confidentialTable._sortFunction = function(sortingElm){
|
||||
|
||||
};
|
||||
|
||||
confidentialTable._sortPlayers = function(sorting, playerList){
|
||||
var sortingKeys = _.map(sorting(), 'key');
|
||||
var sortingDirections = _.map(sorting(), function(o){
|
||||
return o.direction == 1 ? 'desc' : 'asc';
|
||||
});
|
||||
return _.orderBy(playerList, sortingKeys, sortingDirections);
|
||||
};
|
||||
|
||||
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);
|
||||
ctrl.sortPlayers = function(){
|
||||
ctrl.players(confidentialTable._sortPlayers(ctrl.model.sorting, ctrl.players()));
|
||||
};
|
||||
return ctrl;
|
||||
};
|
||||
|
||||
confidentialTable._getSortDict = function(sorting){
|
||||
var ret = {};
|
||||
_.each(sorting(), function(elm){
|
||||
ret[elm.key] = elm.direction;
|
||||
});
|
||||
return ret;
|
||||
|
||||
};
|
||||
|
||||
confidentialTable._isSortingUp = function(sorting, key){
|
||||
var dict = confidentialTable._getSortDict(sorting);
|
||||
return dict[key] === 1;
|
||||
};
|
||||
|
||||
confidentialTable._isSortingDown = function(sorting, key){
|
||||
var dict = confidentialTable._getSortDict(sorting);
|
||||
return dict[key] === -1;
|
||||
};
|
||||
|
||||
confidentialTable.arrows = function(sorting, key){
|
||||
var sortUp = confidentialTable._isSortingUp(sorting, key);
|
||||
var sortDown = confidentialTable._isSortingDown(sorting, key);
|
||||
var style = {
|
||||
display: 'inline-block',
|
||||
'line-height': '0.5em',
|
||||
'margin-right': '1em',
|
||||
'font-size': '0.7em'
|
||||
};
|
||||
var sortedStyle = {color: '#8cc14c', 'font-weight': 'bold'};
|
||||
return m('span', {style: style},
|
||||
m('i.fa.fa-chevron-up', {style: sortUp ? sortedStyle: {}}),
|
||||
m('br'),
|
||||
m('i.fa.fa-chevron-down', {style: sortDown ? sortedStyle: {}})
|
||||
);
|
||||
};
|
||||
|
||||
confidentialTable._setSorting = function(sorting, key){
|
||||
var newDirection = {key: key, direction: -1 * confidentialTable._getSortDict(sorting)[key]};
|
||||
var directions = _.filter(sorting(), function(o){
|
||||
return o.key != key;
|
||||
});
|
||||
sorting([newDirection].concat(directions));
|
||||
};
|
||||
|
||||
confidentialTable.tableHeader = function(sorting){
|
||||
var setSorting = function(key){
|
||||
return _.partial(confidentialTable._setSorting, sorting, key);
|
||||
};
|
||||
return m('thead',
|
||||
m('tr', [
|
||||
m('th', {onclick: setSorting('team')}, confidentialTable.arrows(sorting, 'team'), 'Équipe'),
|
||||
m('th', {onclick: setSorting('name')}, confidentialTable.arrows(sorting, 'name'), 'Nom'),
|
||||
m('th.uk-hidden-small', 'Courriel'),
|
||||
m('th.uk-hidden-small', 'Téléphone'),
|
||||
m('th', {onclick: setSorting('score')}, confidentialTable.arrows(sorting, 'score'), '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(' '));
|
||||
};
|
||||
|
||||
confidentialTable.playerRow = function(player){
|
||||
return m('tr',[
|
||||
m('td', confidentialTable.getPlayerTeamIcon(player)),
|
||||
m('td', player.name),
|
||||
m('td.uk-hidden-small', player.email),
|
||||
m('td.uk-hidden-small', 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){
|
||||
ctrl.sortPlayers();
|
||||
return m('table.uk-table.uk-table-hover.uk-table-striped',
|
||||
confidentialTable.tableHeader(ctrl.model.sorting),
|
||||
confidentialTable.tableBody(ctrl.players(),
|
||||
ctrl.model.activatedTeams(),
|
||||
ctrl.model.activatedScores()
|
||||
)
|
||||
);
|
||||
};
|
||||
|
||||
var confidentialPageBody = {};
|
||||
|
||||
confidentialPageBody.controller = function(){
|
||||
var model = {};
|
||||
model.activatedTeams = m.prop(['bleu', 'rouge', 'jaune', 'gris']);
|
||||
model.activatedScores = m.prop([1, 2, 3, 4, 5]);
|
||||
model.sorting = m.prop([{key: 'team', direction: 1}, {key: 'score', direction: -1}, {key: 'name', direction: 1}]);
|
||||
return model;
|
||||
};
|
||||
|
||||
confidentialPageBody.view = function(model){
|
||||
return 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(confidentialSelection, model),
|
||||
m.component(confidentialTable, model),
|
||||
]));
|
||||
};
|
||||
|
||||
|
||||
var loginComponent = {};
|
||||
|
||||
loginComponent.controller = function(){
|
||||
return {email: m.prop(), password: m.prop()};
|
||||
};
|
||||
|
||||
loginComponent.logo = function(){
|
||||
var style = 'height: 250px; width: 250px; background-size: 250px; background-image: url(images/logosansfond.JPG);';
|
||||
return m('div.uk-cover-background.uk-container-center', {style: style});
|
||||
};
|
||||
|
||||
loginComponent.logoLine = function(){
|
||||
return m('div.uk-grid.uk-margin',
|
||||
m('div.uk-width-1-1', loginComponent.logo()));
|
||||
};
|
||||
|
||||
loginComponent.login = function(ctrl){
|
||||
return function(){
|
||||
var salt = "9'D)E@E{DSq[|l2bq!v";
|
||||
window.secret = salt + ctrl.email() + ctrl.password();
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
loginComponent.loginForm = function(ctrl){
|
||||
return m('div.uk-panel.uk-panel-box.uk-panel-box-secondary.uk-width-large-1-3.uk-container-center.uk-margin', [
|
||||
m('form.uk-text-center', {onsubmit: m.withAttr("form", loginComponent.login(ctrl))},
|
||||
m('div.uk-form-row',
|
||||
m('label', "Nom d'utilisateur ",
|
||||
m('input[type=text][required].uk-form-width-small', {oninput: m.withAttr("value", ctrl.email)}))),
|
||||
m('div.uk-form-row',
|
||||
m('label', "Mot de passe ",
|
||||
m('input[type=password][required].uk-form-width-small', {oninput: m.withAttr("value", ctrl.password)}))),
|
||||
m('div.uk-form-row', m('button.uk-button', m("i.fa.fa-mars-double"), " Pénétrez"))
|
||||
)
|
||||
]);
|
||||
};
|
||||
|
||||
loginComponent.view = function(ctrl){
|
||||
return m('div', [
|
||||
loginComponent.logoLine(),
|
||||
loginComponent.loginForm(ctrl)
|
||||
]);
|
||||
};
|
||||
|
||||
|
||||
var confidentialPage = {};
|
||||
|
||||
confidentialPage.view = function(){
|
||||
var body;
|
||||
if(_.isEmpty(localStorage.getItem('secret'))){
|
||||
body = loginPage;
|
||||
window.secret = 'o'
|
||||
if(!window.secret){
|
||||
body = loginComponent;
|
||||
}else{
|
||||
body = playersPage;
|
||||
body = confidentialPageBody;
|
||||
}
|
||||
return [
|
||||
m.component(topNavBar),
|
||||
|
||||
@@ -13,21 +13,15 @@ define(['m', '_', 'util', 'resultParser', 'views/topNavBar', 'views/footer'], fu
|
||||
};
|
||||
|
||||
contactBody.email = function(){
|
||||
return m('a[href=mailto:ballephenix@gmail.com]', 'ballephenix@gmail.com');
|
||||
return m('a[href=mailto:info@ballephenix.com]', 'info@ballephenix.com');
|
||||
};
|
||||
|
||||
contactBody.tel = function(){
|
||||
return ' (514) 563-1736';
|
||||
return ' (514) 544-8976';
|
||||
};
|
||||
|
||||
contactBody.address = function(){
|
||||
return m('p', ' 9200 rue hochelage, App 205', m('br'), 'Montréal, Québec H1L 0B2');
|
||||
};
|
||||
|
||||
contactBody.website = function(){
|
||||
var gitlabUrl = 'https://gitlab.com/ballephenix/website';
|
||||
return m('p', ' Le site web est ouvert et accessible sur ',
|
||||
m('a', {href: gitlabUrl}, 'gitlab.'));
|
||||
return m('p', ' 123 rue Dufresne', m('br'), 'Montréal, Québec H6Y 8U7');
|
||||
};
|
||||
|
||||
contactBody.contact = function(){
|
||||
@@ -44,10 +38,6 @@ define(['m', '_', 'util', 'resultParser', 'views/topNavBar', 'views/footer'], fu
|
||||
m('tr',
|
||||
m('td.uk-text-right', m('i.fa.fa-envelope')),
|
||||
m('td', contactBody.address())
|
||||
),
|
||||
m('tr',
|
||||
m('td.uk-text-right', m('i.fa.fa-gitlab')),
|
||||
m('td', contactBody.website())
|
||||
)
|
||||
)
|
||||
]);
|
||||
|
||||
@@ -13,7 +13,7 @@ define(['m', '_', 'util'], function (m, _, util) {
|
||||
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:ballephenix@gmail.com"]', 'ballephenix@gmail.com'))),
|
||||
m('li', m('a[href="mailto:info@ballephenix.com"]', 'info@ballephenix.com'))),
|
||||
m('h1', util.facebookLink())
|
||||
])
|
||||
);
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
define(['m', '_', 'util', 'views/topNavBar', 'views/calendarPage'], function(m, _, util, topNavBar, calendarPage) {
|
||||
|
||||
var yearSelector = {};
|
||||
|
||||
yearSelector.view = function(){
|
||||
return m('div.uk-grid',
|
||||
m('div.uk-width-large-3-5.uk-width-medium-1-1.uk-container-center',
|
||||
yearSelector.tab()));
|
||||
};
|
||||
|
||||
yearSelector.tab = function(){
|
||||
return m('ul.uk-tab.uk-margin-top', [
|
||||
m('li.uk-active', m('a', 'Saison 2016'))
|
||||
]);
|
||||
};
|
||||
|
||||
var historicPage = {};
|
||||
|
||||
historicPage.view = function(){
|
||||
return [
|
||||
m.component(topNavBar),
|
||||
m.component(yearSelector)
|
||||
// m.component(calendarPage)
|
||||
];
|
||||
};
|
||||
|
||||
return historicPage;
|
||||
});
|
||||
@@ -1,53 +0,0 @@
|
||||
define(['m', '_',], function (m, _ ) {
|
||||
|
||||
var inscriptionForm = {};
|
||||
|
||||
inscriptionForm.title = function(){
|
||||
return m('h1.uk-width-1-1.uk-text-center', 'Inscription Balle Phénix');
|
||||
};
|
||||
|
||||
inscriptionForm._field = function(label){
|
||||
return m('label', label, m('input.uk-form-width-large', {type: 'text'}));
|
||||
};
|
||||
|
||||
inscriptionForm.identification = function(){
|
||||
return m('form.uk-form', m('fieldset',
|
||||
m('legend', 'Identification'),
|
||||
m('div.uk-margin-top.uk-margin-bottom.uk-grid',
|
||||
m('div.uk-width-1-2', inscriptionForm._field('Nom')),
|
||||
m('div.uk-width-1-2', inscriptionForm._field('Prénom'))),
|
||||
m('div.uk-margin-top.uk-margin-bottom.uk-grid',
|
||||
m('div.uk-width-1-2', inscriptionForm._field('Adresse')),
|
||||
m('div.uk-width-1-2', inscriptionForm._field('Chanson préférée'))),
|
||||
m('div.uk-margin-top.uk-margin-bottom.uk-grid',
|
||||
m('div.uk-width-1-3', inscriptionForm._field('Ville')),
|
||||
m('div.uk-width-1-3', inscriptionForm._field('Code postal')),
|
||||
m('div.uk-width-1-3', inscriptionForm._field('Tél')))
|
||||
|
||||
));
|
||||
};
|
||||
|
||||
inscriptionForm.inscription = function(){
|
||||
return m('form.uk-form',
|
||||
m('h2.uk-width-1-1.uk-text-center', 'Inscription'),
|
||||
m('div.uk-margin-top.uk-margin-bottom.uk-grid',
|
||||
m('div.uk-width-1-1',
|
||||
inscriptionForm._field('Inscription en duo. Inscrivez le nom du joueur')))
|
||||
|
||||
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
inscriptionForm.view = function(){
|
||||
return [
|
||||
inscriptionForm.title(),
|
||||
inscriptionForm.identification(),
|
||||
inscriptionForm.inscription()
|
||||
|
||||
];
|
||||
// return m('form', m('label', 'Nom', m('input', {type: 'text'})));
|
||||
};
|
||||
|
||||
return inscriptionForm;
|
||||
});
|
||||
+22
-34
@@ -1,55 +1,43 @@
|
||||
define(['m', '_'], function (m, _) {
|
||||
define(['m', '_', 'util', 'views/topNavBar', 'views/footer'], function (m, _ , util, topNavBar, footer) {
|
||||
|
||||
var loginPage = {};
|
||||
loginPage.salt = window.salt;
|
||||
var loginComponent = {};
|
||||
|
||||
loginPage.controller = function(){
|
||||
return {email: m.prop(''), password: m.prop('')};
|
||||
};
|
||||
|
||||
loginPage.logo = function(){
|
||||
loginComponent.logo = function(){
|
||||
var style = 'height: 250px; width: 250px; background-size: 250px; background-image: url(images/logosansfond.JPG);';
|
||||
return m('div.uk-cover-background.uk-container-center', {style: style});
|
||||
};
|
||||
|
||||
loginPage.logoLine = function(){
|
||||
loginComponent.logoLine = function(){
|
||||
return m('div.uk-grid.uk-margin',
|
||||
m('div.uk-width-1-1', loginPage.logo()));
|
||||
m('div.uk-width-1-1', loginComponent.logo()));
|
||||
};
|
||||
|
||||
loginPage.login = function(ctrl){
|
||||
return function(){
|
||||
localStorage.setItem('secret', loginPage.salt + ctrl.email() + ctrl.password());
|
||||
return false;
|
||||
};
|
||||
};
|
||||
|
||||
loginPage.formChange = function(ctrl){
|
||||
return function(evt){
|
||||
ctrl[evt.target.name](evt.target.value);
|
||||
};
|
||||
};
|
||||
|
||||
loginPage.loginForm = function(ctrl){
|
||||
loginComponent.loginForm = function(){
|
||||
return m('div.uk-panel.uk-panel-box.uk-panel-box-secondary.uk-width-large-1-3.uk-container-center.uk-margin', [
|
||||
m('form.uk-text-center[action]', {onsubmit: loginPage.login(ctrl), onchange: loginPage.formChange(ctrl)},
|
||||
m('div.uk-form-row',
|
||||
m('label', "Nom d'utilisateur ",
|
||||
m('input[type=text][name=email][required].uk-form-width-small', {value: ctrl.email()} ))),
|
||||
m('div.uk-form-row',
|
||||
m('label', "Mot de passe ",
|
||||
m('input[type=password][name=password][required].uk-form-width-small', {value: ctrl.password()}))),
|
||||
m('form.uk-text-center',
|
||||
m('div.uk-form-row', m('label', "Nom d'utilisateur ", m('input[type=text].uk-form-width-small'))),
|
||||
m('div.uk-form-row', m('label', "Mot de passe ", m('input[type=password].uk-form-width-small'))),
|
||||
m('div.uk-form-row', m('button.uk-button', m("i.fa.fa-mars-double"), " Pénétrez"))
|
||||
)
|
||||
]);
|
||||
};
|
||||
|
||||
loginPage.view = function(ctrl){
|
||||
loginComponent.view = function(){
|
||||
return m('div', [
|
||||
loginPage.logoLine(),
|
||||
loginPage.loginForm(ctrl)
|
||||
loginComponent.logoLine(),
|
||||
loginComponent.loginForm()
|
||||
]);
|
||||
};
|
||||
|
||||
var loginPage = {};
|
||||
|
||||
loginPage.view = function(){
|
||||
return [
|
||||
m.component(topNavBar),
|
||||
m.component(loginComponent),
|
||||
m.component(footer)
|
||||
];
|
||||
};
|
||||
|
||||
return loginPage;
|
||||
});
|
||||
+22
-69
@@ -1,4 +1,4 @@
|
||||
define(['m', '_', 'util', 'resultParser', 'views/topNavBar', 'views/footer', 'articles/articles', 'images/rain.svg'], function (m, _ , util, resultParser, topNavBar, footer, articles, rainSvg) {
|
||||
define(['m', '_', 'util', 'resultParser', 'views/topNavBar', 'views/footer', 'articles/articles'], function (m, _ , util, resultParser, topNavBar, footer, articles) {
|
||||
var mainPageLogo = {};
|
||||
|
||||
mainPageLogo.view = function(){
|
||||
@@ -15,7 +15,7 @@ define(['m', '_', 'util', 'resultParser', 'views/topNavBar', 'views/footer', 'ar
|
||||
var article = _.get(articles, 0, {});
|
||||
return m('div.uk-panel.uk-panel-box',[
|
||||
m('div.uk-panel-badge.uk-badge', [
|
||||
m('i.fa.fa-newspaper-o', {style: {'font-size': '1.7em'}})
|
||||
m('i.fa.fa-newspaper-o')
|
||||
]),
|
||||
m('h3.uk-panel-title', m('a.uk-link-muted', {href: '#/nouvelles'}, article.title)),
|
||||
m('p', article.smallBody || article.body)
|
||||
@@ -24,28 +24,16 @@ define(['m', '_', 'util', 'resultParser', 'views/topNavBar', 'views/footer', 'ar
|
||||
|
||||
var nextGameDaySchedule = {};
|
||||
|
||||
nextGameDaySchedule._toDay = function(){
|
||||
var now = new Date();
|
||||
return new Date(now.getFullYear(), now.getMonth(), now.getDate());
|
||||
};
|
||||
|
||||
nextGameDaySchedule.controller = function(){
|
||||
var games = m.prop([]);
|
||||
var toDay = new Date();
|
||||
return m.request({method: "GET", url: util.resultatsURL()})
|
||||
return m.request({method: "GET", url: "api/resultats.json"})
|
||||
.then(games)
|
||||
.then(resultParser.getNightGames)
|
||||
.then(function(nightGames){
|
||||
return nextGameDaySchedule._getNextNightGame(nightGames, nextGameDaySchedule._toDay()).games;
|
||||
return nightGames[0].games;
|
||||
});
|
||||
};
|
||||
|
||||
nextGameDaySchedule._getNextNightGame = function(games, date){
|
||||
return _.first(_.filter(games, function(game){
|
||||
return game.jsDate.getTime() >= date.getTime();
|
||||
}));
|
||||
};
|
||||
|
||||
nextGameDaySchedule._getTableHead = function(){
|
||||
return m('thead', m('tr', [
|
||||
m('td', 'Date'),
|
||||
@@ -55,22 +43,15 @@ define(['m', '_', 'util', 'resultParser', 'views/topNavBar', 'views/footer', 'ar
|
||||
]));
|
||||
};
|
||||
|
||||
nextGameDaySchedule._responsoveText = function(largeText, smallText, rain){
|
||||
var ret = [];
|
||||
if(rain){
|
||||
ret.push(rainSvg('1.5em'));
|
||||
ret.push(' ');
|
||||
}
|
||||
ret.push(m('span.uk-visible-large', largeText));
|
||||
ret.push(m('span.uk-hidden-large', smallText));
|
||||
return ret;
|
||||
nextGameDaySchedule._responsoveText = function(largeText, smallText){
|
||||
return [m('span.uk-visible-large', largeText),
|
||||
m('span.uk-hidden-large', smallText)];
|
||||
};
|
||||
|
||||
nextGameDaySchedule._getGamesRow = function(game){
|
||||
return m('tr', [
|
||||
m('td', nextGameDaySchedule._responsoveText(util.formatDate(game.jsDate),
|
||||
util.formatDateSmall(game.jsDate),
|
||||
game.rain)),
|
||||
util.formatDateSmall(game.jsDate))),
|
||||
m('td', game.time),
|
||||
m('td', game.away),
|
||||
m('td', game.home)
|
||||
@@ -89,22 +70,11 @@ define(['m', '_', 'util', 'resultParser', 'views/topNavBar', 'views/footer', 'ar
|
||||
)]);
|
||||
};
|
||||
|
||||
var scheduleNotYetSet = {};
|
||||
|
||||
scheduleNotYetSet. view = function(){
|
||||
return m('div',
|
||||
m('h4', 'À venir...'),
|
||||
m('p', "Suite a la situation au parc Walter-Stewart, " +
|
||||
"nous n'avons toujours pas de date définie " +
|
||||
"pour le début de la saison. La situation" +
|
||||
"devrait se regler incessamment"));
|
||||
};
|
||||
|
||||
var mainPageSchedule = {};
|
||||
|
||||
mainPageSchedule.view = function(){
|
||||
return m('div.uk-panel.uk-panel-box',[
|
||||
m('div.uk-panel-badge.uk-badge', m('i.fa.fa-calendar', {style: {'font-size': '1.7em'}})),
|
||||
m('div.uk-panel-badge.uk-badge', m('i.fa.fa-clock-o')),
|
||||
m('h3.uk-panel-title', m('a.uk-link-muted', {href: '#/calendrier'}, 'Horaire')),
|
||||
m.component(nextGameDaySchedule)
|
||||
]);
|
||||
@@ -112,32 +82,13 @@ define(['m', '_', 'util', 'resultParser', 'views/topNavBar', 'views/footer', 'ar
|
||||
|
||||
var mainMap = {};
|
||||
|
||||
mainMap.getWalterStewartMap = function(){
|
||||
var iframeUrl = "//www.openstreetmap.org/export/embed.html?bbox=-73.55936229228975%2C45.53102667048665%2C-73.55230271816255%2C45.53444249585723&layer=mapnik"; // "//www.openstreetmap.org/export/embed.html?bbox=-73.56355190277101%2C45.5294483312637%2C-73.54943275451662%2C45.53627996625677&layer=mapnik"; // "//www.openstreetmap.org/export/embed.html?bbox=-73.56355190277101%2C45.5294483312637%2C-73.54943275451662%2C45.53627996625677&layer=mapnik";
|
||||
var externalLink = "http://www.openstreetmap.org/#map=17/45.53216/-73.55692";
|
||||
var iframeParams = {
|
||||
style: {border: '1px solid black', 'min-height': '300px'},
|
||||
width: '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.getGeorgesVernotMap = function(){
|
||||
// " style="border: 1px solid black"></iframe><br/><small><a href="http://www.openstreetmap.org/#map=16/45.5670/-73.6177">View Larger Map</a></small>
|
||||
|
||||
var iframeUrl = "//www.openstreetmap.org/export/embed.html?bbox=-73.63185167312623%2C45.560217957150535%2C-73.60361337661745%2C45.57387292040785&layer=mapnik";
|
||||
var externalLink = "http://www.openstreetmap.org/#map=17/45.53216/-73.55692";
|
||||
mainMap.getMap = function(){
|
||||
var iframeUrl = "//www.openstreetmap.org/export/embed.html?bbox=-73.55889558792114%2C45.53089890181621%2C-73.55181455612183%2C45.53426212742867&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,
|
||||
@@ -153,10 +104,10 @@ define(['m', '_', 'util', 'resultParser', 'views/topNavBar', 'views/footer', 'ar
|
||||
mainMap.view = function(){
|
||||
return m('div.uk-panel.uk-panel-box',[
|
||||
m('div.uk-panel-badge.uk-badge', [
|
||||
m('i.fa.fa-map-o', {style: {'font-size': '1.7em'}})
|
||||
m('i.fa.fa-map-o')
|
||||
]),
|
||||
m('h3.uk-panel-title', 'Parc Georges-Vernot'),
|
||||
mainMap.getGeorgesVernotMap()
|
||||
m('h3.uk-panel-title', 'Parc Walter-Stewart'),
|
||||
mainMap.getMap()
|
||||
]);
|
||||
};
|
||||
|
||||
@@ -191,6 +142,7 @@ define(['m', '_', 'util', 'resultParser', 'views/topNavBar', 'views/footer', 'ar
|
||||
]);
|
||||
};
|
||||
|
||||
|
||||
mainPageBottom.view = function(){
|
||||
return m('div.uk-margin-top.uk-margin-bottom.uk-grid',
|
||||
m('div.uk-width-large-3-5.uk-width-medium-4-5.uk-width-small-1-1.uk-container-center', [
|
||||
@@ -199,16 +151,17 @@ define(['m', '_', 'util', 'resultParser', 'views/topNavBar', 'views/footer', 'ar
|
||||
mainPageBottom.smallSizeView()
|
||||
])
|
||||
);
|
||||
|
||||
};
|
||||
|
||||
var mainPage = {};
|
||||
|
||||
mainPage.view = function(){
|
||||
return [
|
||||
m.component(topNavBar),
|
||||
m.component(mainPageLogo),
|
||||
m.component(mainPageBottom),
|
||||
m.component(footer)
|
||||
topNavBar.view(),
|
||||
mainPageLogo.view(),
|
||||
mainPageBottom.view(),
|
||||
footer.view()
|
||||
];
|
||||
};
|
||||
|
||||
|
||||
@@ -16,8 +16,8 @@ define(['m', '_', 'util', 'resultParser', 'articles/articles', 'views/topNavBar'
|
||||
};
|
||||
|
||||
newsPageBody.view = function(){
|
||||
var arts = _.reverse(_.map(articles, newsPageBody.getArticle));
|
||||
return m('div', util.join(arts, m('hr')));
|
||||
return m('div', _.map(articles, newsPageBody.getArticle));
|
||||
|
||||
};
|
||||
|
||||
var newsPage = {};
|
||||
|
||||
@@ -1,318 +0,0 @@
|
||||
define(['m', '_', 'spritz', 'teams'], function (m, _ , spritz, teams) {
|
||||
|
||||
var playersSelectionBar = {};
|
||||
|
||||
playersSelectionBar.toggleTeam = function(teamId, activatedTeams){
|
||||
return function(isActive){
|
||||
isActive = isActive != 'true';
|
||||
if(isActive){
|
||||
activatedTeams().push(teamId);
|
||||
return;
|
||||
}
|
||||
activatedTeams(_.difference(activatedTeams(), [teamId]));
|
||||
};
|
||||
};
|
||||
|
||||
playersSelectionBar.teamInput = function(teamName, teamId, activatedTeams){
|
||||
var isActive = _.includes(activatedTeams(), teamId);
|
||||
var class_ = isActive ? 'uk-badge-success' : '';
|
||||
var callback = playersSelectionBar.toggleTeam(teamId, activatedTeams);
|
||||
return m('div.uk-badge.uk-margin-left.uk-border-rounded',
|
||||
{class: class_, 'data-selected': isActive, onclick: m.withAttr("data-selected", callback)},
|
||||
m('span', {style: {'min-width': '40px', display: 'inline-block'}}, teamName)
|
||||
);
|
||||
|
||||
};
|
||||
|
||||
playersSelectionBar.scoreInput = function(score, activatedScores){
|
||||
var isActive = _.includes(activatedScores(), score);
|
||||
var class_ = isActive ? 'uk-badge-success' : '';
|
||||
var callback = playersSelectionBar.toggleTeam(score, activatedScores);
|
||||
return m('div.uk-badge.uk-margin-left.uk-border-rounded',
|
||||
{class: class_, 'data-selected': isActive, onclick: m.withAttr("data-selected", callback)},
|
||||
m('span', {style: {'min-width': '30px', display: 'inline-block'}}, score)
|
||||
);
|
||||
};
|
||||
|
||||
playersSelectionBar.getTeamInput = function(model, team){
|
||||
var label = team.name;
|
||||
return playersSelectionBar.teamInput(label, team.name, model.activatedTeams);
|
||||
};
|
||||
|
||||
playersSelectionBar.chooseTeams = function(model){
|
||||
return m('form.uk-grid', {style: {'margin-top': '1em'}},
|
||||
m('div.uk-width-1-6', m('label', m('b', 'Équipes'))),
|
||||
m('div.uk-width-5-6',
|
||||
m('div.uk-grid',
|
||||
_.map(teams.teams(), _.partial(playersSelectionBar.getTeamInput, model))
|
||||
))
|
||||
);
|
||||
};
|
||||
|
||||
playersSelectionBar.chooseScore = function(model){
|
||||
return m('form.uk-grid', {style: {'margin-top': '1em'}},
|
||||
m('div.uk-width-1-6', m('label', m('b', 'Cote'))),
|
||||
m('div.uk-width-5-6',
|
||||
m('div.uk-grid', [
|
||||
playersSelectionBar.scoreInput(1, model.activatedScores),
|
||||
playersSelectionBar.scoreInput(2, model.activatedScores),
|
||||
playersSelectionBar.scoreInput(3, model.activatedScores),
|
||||
playersSelectionBar.scoreInput(4, model.activatedScores),
|
||||
playersSelectionBar.scoreInput(5, model.activatedScores)
|
||||
])));
|
||||
};
|
||||
|
||||
playersSelectionBar.searchFactory = function(model){
|
||||
return function(){
|
||||
model.searchTerm(this.value);
|
||||
};
|
||||
};
|
||||
|
||||
playersSelectionBar.searchBar = function(model){
|
||||
var icon = m('i.fa.fa-search', {'aria-hidden': true}, '');
|
||||
return m('form.uk-grid', {style: {'margin-top': '1em'}},
|
||||
m('div.uk-width-1-1.', {style: 'text-align: right;'},
|
||||
m('label', m('b', icon, " Rechercher ")),
|
||||
m('input', {type: 'text', onkeypress: playersSelectionBar.searchFactory(model)})));
|
||||
};
|
||||
|
||||
playersSelectionBar.controller = function(model){
|
||||
return model;
|
||||
};
|
||||
|
||||
playersSelectionBar.view = function(model){
|
||||
return m('div.uk-grid', [
|
||||
m('div.uk-width-1-2',
|
||||
playersSelectionBar.chooseTeams(model),
|
||||
playersSelectionBar.chooseScore(model)),
|
||||
m('div.uk-width-1-2',
|
||||
playersSelectionBar.searchBar(model))
|
||||
]);
|
||||
};
|
||||
|
||||
|
||||
var playersTable = {};
|
||||
|
||||
playersTable._sortPlayers = function(sorting, playerList){
|
||||
var sortingKeys = _.map(sorting(), 'key');
|
||||
var sortingDirections = _.map(sorting(), function(o){
|
||||
return o.direction == 1 ? 'desc' : 'asc';
|
||||
});
|
||||
return _.orderBy(playerList, sortingKeys, sortingDirections);
|
||||
};
|
||||
|
||||
playersTable.decryptPlayerList = function(encryptedPlayerList){
|
||||
var keyLengthInBytes = 128;
|
||||
var key = spritz.hash(localStorage.getItem('secret') || '', keyLengthInBytes);
|
||||
var decryptedMessage = spritz.decrypt(key, encryptedPlayerList);
|
||||
try{
|
||||
return JSON.parse(spritz.utf8ByteArrayToString(decryptedMessage));
|
||||
}catch(e){
|
||||
localStorage.removeItem('secret');
|
||||
m.route('/membre');
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
playersTable.getEncryptedPlayerList = function(){
|
||||
var deferred = m.deferred();
|
||||
var interval = setInterval(function() {
|
||||
if(!_.isEmpty(window.encryptedPlayerList)){
|
||||
clearInterval(interval);
|
||||
deferred.resolve(window.encryptedPlayerList);
|
||||
m.redraw();
|
||||
}
|
||||
}, 333);
|
||||
return deferred.promise;
|
||||
};
|
||||
|
||||
playersTable.controller = function(model){
|
||||
var ctrl = {};
|
||||
ctrl.model = model;
|
||||
|
||||
ctrl.players = playersTable.getEncryptedPlayerList()
|
||||
.then(playersTable.decryptPlayerList);
|
||||
|
||||
ctrl.sortPlayers = function(){
|
||||
ctrl.players(playersTable._sortPlayers(ctrl.model.sorting, ctrl.players()));
|
||||
};
|
||||
return ctrl;
|
||||
};
|
||||
|
||||
playersTable._getSortDict = function(sorting){
|
||||
var ret = {};
|
||||
_.each(sorting(), function(elm){
|
||||
ret[elm.key] = elm.direction;
|
||||
});
|
||||
return ret;
|
||||
|
||||
};
|
||||
|
||||
playersTable._isSortingUp = function(sorting, key){
|
||||
var dict = playersTable._getSortDict(sorting);
|
||||
return dict[key] === 1;
|
||||
};
|
||||
|
||||
playersTable._isSortingDown = function(sorting, key){
|
||||
var dict = playersTable._getSortDict(sorting);
|
||||
return dict[key] === -1;
|
||||
};
|
||||
|
||||
playersTable.arrows = function(sorting, key){
|
||||
var sortUp = playersTable._isSortingUp(sorting, key);
|
||||
var sortDown = playersTable._isSortingDown(sorting, key);
|
||||
var style = {
|
||||
display: 'inline-block',
|
||||
'line-height': '0.5em',
|
||||
'margin-right': '1em',
|
||||
'font-size': '0.7em'
|
||||
};
|
||||
var sortedStyle = {color: '#8cc14c', 'font-weight': 'bold'};
|
||||
return m('span', {style: style},
|
||||
m('i.fa.fa-chevron-up', {style: sortUp ? sortedStyle: {}}),
|
||||
m('br'),
|
||||
m('i.fa.fa-chevron-down', {style: sortDown ? sortedStyle: {}})
|
||||
);
|
||||
};
|
||||
|
||||
playersTable._setSorting = function(sorting, key){
|
||||
var newDirection = {key: key, direction: -1 * playersTable._getSortDict(sorting)[key]};
|
||||
var directions = _.filter(sorting(), function(o){
|
||||
return o.key != key;
|
||||
});
|
||||
sorting([newDirection].concat(directions));
|
||||
};
|
||||
|
||||
playersTable.tableHeader = function(sorting){
|
||||
var setSorting = function(key){
|
||||
return _.partial(playersTable._setSorting, sorting, key);
|
||||
};
|
||||
return m('thead',
|
||||
m('tr', [
|
||||
m('th', {onclick: setSorting('team')}, playersTable.arrows(sorting, 'team'), 'Équipe'),
|
||||
m('th', {onclick: setSorting('name')}, playersTable.arrows(sorting, 'name'), 'Nom'),
|
||||
m('th.uk-hidden-small', 'Courriel'),
|
||||
m('th.uk-hidden-small', 'Téléphone'),
|
||||
m('th', {onclick: setSorting('score')}, playersTable.arrows(sorting, 'score'), 'Cote')
|
||||
]));
|
||||
};
|
||||
|
||||
playersTable.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(' '));
|
||||
};
|
||||
|
||||
playersTable.showOrHidePlayerDetail = function(player){
|
||||
return function(){
|
||||
player.showDetails = !player.showDetails;
|
||||
};
|
||||
};
|
||||
|
||||
playersTable.playerTelLink = function(player){
|
||||
return m('a[href=tel:' + player.tel + ']', player.tel);
|
||||
};
|
||||
|
||||
playersTable.playerRow = function(player){
|
||||
return m('tr', {onclick: playersTable.showOrHidePlayerDetail(player)}, [
|
||||
m('td', playersTable.getPlayerTeamIcon(player)),
|
||||
m('td', player.name),
|
||||
m('td.uk-hidden-small', player.email),
|
||||
m('td.uk-hidden-small', player.tel),
|
||||
m('td', player.score)
|
||||
]);
|
||||
};
|
||||
|
||||
playersTable.playerInformation = function(player){
|
||||
return m('tr.uk-visible-small', [
|
||||
m('td', ''),
|
||||
m('td[colspan=3]',
|
||||
m('ul', [
|
||||
m('li', [m('b', 'tel: '), playersTable.playerTelLink(player)]),
|
||||
m('li', [m('b', 'email: '), player.email])
|
||||
]))
|
||||
]);
|
||||
};
|
||||
|
||||
playersTable.playerRowAndInformation = function(player){
|
||||
if(player.showDetails){
|
||||
return [playersTable.playerRow(player),
|
||||
m('tr', {style: {height: '0px'}}),
|
||||
playersTable.playerInformation(player)];
|
||||
}
|
||||
return playersTable.playerRow(player);
|
||||
};
|
||||
|
||||
playersTable.onlyPlayerOfTeams = function(visibleTeams){
|
||||
return function(player){
|
||||
return _.includes(visibleTeams, player.team);
|
||||
};
|
||||
};
|
||||
|
||||
playersTable.onlyPlayerOfScore = function(visibleScores){
|
||||
return function(player){
|
||||
return _.includes(visibleScores, player.score);
|
||||
};
|
||||
};
|
||||
|
||||
playersTable.playerHasBeenSearchedFor = function(searchTerm){
|
||||
return function(player){
|
||||
if(_.isEmpty(searchTerm)){
|
||||
return true;
|
||||
}
|
||||
return new RegExp(searchTerm, 'i').test(player.name);
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
playersTable.tableBody = function(players, visibleTeams, activatedScores, searchTerm){
|
||||
return m('tbody',
|
||||
_(players)
|
||||
.filter(playersTable.onlyPlayerOfTeams(visibleTeams))
|
||||
.filter(playersTable.onlyPlayerOfScore(activatedScores))
|
||||
.filter(playersTable.playerHasBeenSearchedFor(searchTerm))
|
||||
.map(playersTable.playerRowAndInformation).flatten().value()
|
||||
);
|
||||
};
|
||||
|
||||
playersTable.view = function(ctrl){
|
||||
ctrl.sortPlayers();
|
||||
return m('table.uk-table.uk-table-hover.uk-table-striped',
|
||||
playersTable.tableHeader(ctrl.model.sorting),
|
||||
playersTable.tableBody(ctrl.players(),
|
||||
ctrl.model.activatedTeams(),
|
||||
ctrl.model.activatedScores(),
|
||||
ctrl.model.searchTerm()
|
||||
|
||||
)
|
||||
);
|
||||
};
|
||||
|
||||
var playersPage = {};
|
||||
|
||||
playersPage.controller = function(){
|
||||
var model = {};
|
||||
model.activatedTeams = m.prop(_.map(teams.teams(), 'name'));
|
||||
model.activatedScores = m.prop([1, 2, 3, 4, 5]);
|
||||
model.sorting = m.prop([{key: 'team', direction: 1}, {key: 'score', direction: -1}, {key: 'name', direction: 1}]);
|
||||
model.searchTerm = m.prop('');
|
||||
return model;
|
||||
};
|
||||
|
||||
playersPage.downloadButton = function(){
|
||||
return m('button.uk-button.uk-button-success.uk-border-rounded',
|
||||
m('i.fa.fa-download', {'aria-hidden': true}),
|
||||
" Télécharger");
|
||||
};
|
||||
|
||||
playersPage.view = function(model){
|
||||
return 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(playersSelectionBar, model),
|
||||
m.component(playersTable, model),
|
||||
playersPage.downloadButton()
|
||||
]));
|
||||
};
|
||||
|
||||
return playersPage;
|
||||
});
|
||||
@@ -16,44 +16,25 @@ define(['m', '_', 'util', 'resultParser', 'views/topNavBar', 'views/footer'], fu
|
||||
return m('div.uk-cover-background.uk-container-center', {style: style});
|
||||
};
|
||||
|
||||
rulesPage.ruleSection = function(){
|
||||
rulesPage.rules = function(){
|
||||
var urlASBM = 'http://montreal.baseballquebec.com/fr/publication/nouvelle/recherche_un_directeur_general_asbm.html';
|
||||
return [
|
||||
m('h2', 'Règlements 2017'),
|
||||
return m('div.uk-width-large-2-3.uk-width-small-1-1',
|
||||
m('div.uk-panel.uk-panel-box.uk-panel-box-secondary', [
|
||||
m('h2', 'Règlements 2016'),
|
||||
m('ul',[
|
||||
m('li', m('h3', m('a', {href: 'files/reglements_generaux.pdf'}, 'Règlements généraux'))),
|
||||
m('li', m('h3', m('a', {href: 'files/regles_procedures2017.pdf'},'Règles et procédures'))),
|
||||
m('li', m('h3', m('a', {href: 'files/reglements_de_terrain2016.pdf'},'Règlements de terrain'))),
|
||||
m('li', m('h3', m('a', {href: 'files/regles_procedures2015.pdf'},'Règles et procédures'))),
|
||||
m('li', m('h3', m('a', {href: 'files/reglements_de_terrain2015.pdf'},'Règlements de terrain'))),
|
||||
m('li', m('h3', m('a', {href: urlASBM}, 'Association des Sports de Balle à Montréal (ASBM)'))),
|
||||
])
|
||||
];
|
||||
};
|
||||
|
||||
rulesPage.rules = function(){
|
||||
return m('div.uk-width-large-2-3.uk-width-small-1-1',
|
||||
m('div.uk-panel.uk-panel-box.uk-panel-box-secondary',
|
||||
rulesPage.ruleSection()
|
||||
)
|
||||
);
|
||||
};
|
||||
|
||||
rulesPage.generalAssemblies = function(){
|
||||
return m('div.uk-width-large-1-1.uk-width-small-1-1.uk-margin',
|
||||
m('div.uk-panel.uk-panel-box.uk-panel-box-secondary', [
|
||||
m('h2', 'Procès verbaux des Assemblées Générales'),
|
||||
m('ul',[
|
||||
m('li', m('h3', m('a', {href: 'files/aga2016.pdf'}, 'Assemblée générale annuelle 2016'))),
|
||||
])
|
||||
])
|
||||
);
|
||||
|
||||
};
|
||||
|
||||
rulesPage.logoAndRules = function(){
|
||||
return m('div.uk-grid',[
|
||||
m('div.uk-width-large-1-3.uk-width-small-1-1', rulesPage.logo()),
|
||||
rulesPage.rules(),
|
||||
rulesPage.generalAssemblies()
|
||||
rulesPage.rules()
|
||||
]
|
||||
);
|
||||
};
|
||||
|
||||
+22
-106
@@ -1,21 +1,18 @@
|
||||
define(['m', '_', 'util'], function (m, _, util) {
|
||||
|
||||
var topNavBar = {};
|
||||
|
||||
topNavBar._urlMapping = [
|
||||
{name: 'Accueil', path: '', fa: 'fa-home'},
|
||||
{name: 'Nouvelles', path: 'nouvelles', fa: 'fa-newspaper-o'},
|
||||
{name: 'Calendrier', path: 'calendrier', fa: 'fa-calendar'},
|
||||
{name: 'Règlement', path: 'reglement', fa: 'fa-legal'},
|
||||
{name: 'Membre', path: 'membre', fa: 'fa-lock'},
|
||||
{name: 'Historique', path: 'historique', fa: 'fa-history'},
|
||||
{name: 'Nous Joindre', path: 'contact', fa: 'fa-phone'}
|
||||
];
|
||||
topNavBar._urlMapping = {
|
||||
'': 'Accueil',
|
||||
nouvelles: 'Nouvelles',
|
||||
calendrier: 'Calendrier',
|
||||
reglement: 'Règlement',
|
||||
// photos: 'Photos',
|
||||
membre: 'Membre',
|
||||
contact: 'Nous Joindre'
|
||||
};
|
||||
|
||||
topNavBar.controller = function(){
|
||||
var model = {};
|
||||
model.openDropdown = false;
|
||||
return model;
|
||||
return {id: m.route.param("page")};
|
||||
};
|
||||
|
||||
topNavBar._getUrlForId = function(id_){
|
||||
@@ -25,102 +22,21 @@ define(['m', '_', 'util'], function (m, _, util) {
|
||||
topNavBar._isActive = function(id_){
|
||||
return topNavBar._getUrlForId(id_) == window.location.hash;
|
||||
};
|
||||
topNavBar._getItemIcon = function(item){
|
||||
return m('i.fa.' + item.fa);
|
||||
|
||||
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._getLargeItem = function(item){
|
||||
var class_ = topNavBar._isActive(item.path) ? 'uk-active' : '';
|
||||
var url = topNavBar._getUrlForId(item.path);
|
||||
return m("li", {class: class_},
|
||||
m("a", {href: url},
|
||||
m('div', topNavBar._getItemIcon(item), ' ', item.name)
|
||||
)
|
||||
);
|
||||
};
|
||||
|
||||
topNavBar._getMediumItem = function(item){
|
||||
var class_ = topNavBar._isActive(item.path) ? 'uk-active' : '';
|
||||
var url = topNavBar._getUrlForId(item.path);
|
||||
return m("li", {class: class_},
|
||||
m("a", {href: url},
|
||||
topNavBar._getItemIcon(item), ' ', item.name
|
||||
)
|
||||
);
|
||||
};
|
||||
|
||||
topNavBar._getSmallItem = function(item){
|
||||
var class_ = topNavBar._isActive(item.path) ? 'uk-active' : '';
|
||||
var url = topNavBar._getUrlForId(item.path);
|
||||
return m("li", {class: class_},
|
||||
m("a", {href: url},
|
||||
topNavBar._getItemIcon(item),
|
||||
' ',
|
||||
item.name
|
||||
)
|
||||
);
|
||||
};
|
||||
|
||||
topNavBar.largeTopNav = function(){
|
||||
return [
|
||||
m('li.uk-parent', m('div.uk-navbar-brand', util.facebookLink())),
|
||||
_.map(topNavBar._urlMapping, topNavBar._getLargeItem)
|
||||
];
|
||||
};
|
||||
|
||||
topNavBar.mediumTopNav = function(){
|
||||
return [
|
||||
m('li.uk-parent', m('div.uk-navbar-brand', util.facebookLink())),
|
||||
_.map(topNavBar._urlMapping, topNavBar._getMediumItem)
|
||||
];
|
||||
};
|
||||
|
||||
topNavBar.dropdown = function(){
|
||||
return m('div.uk-dropdown',
|
||||
m('ul.uk-nav.uk-nav-navbar.uk-dropdown-navbar',
|
||||
_.map(topNavBar._urlMapping, topNavBar._getSmallItem)
|
||||
));
|
||||
};
|
||||
|
||||
topNavBar.toggleDropdown = function(model){
|
||||
return function(){
|
||||
model.openDropdown = !model.openDropdown;
|
||||
};
|
||||
};
|
||||
|
||||
topNavBar.clickElsewhere = function(model){
|
||||
var style = {
|
||||
position: 'fixed',
|
||||
top: '0px',
|
||||
bottom: '0px',
|
||||
left: '0px',
|
||||
right: '0px',
|
||||
background: 'black',
|
||||
opacity: 0.5,
|
||||
'z-index': 2
|
||||
};
|
||||
var attrs = {style: style, onclick: topNavBar.toggleDropdown(model)};
|
||||
return m('div', attrs);
|
||||
};
|
||||
|
||||
topNavBar.smallTopNav = function(model){
|
||||
var class_ = model.openDropdown ? 'uk-open' : '';
|
||||
var attrs = {class: class_, onclick: topNavBar.toggleDropdown(model)};
|
||||
var ret = [
|
||||
m('li.uk-parent', m('div.uk-navbar-brand', util.facebookLink())),
|
||||
m('li.uk-parent[data-uk-dropdown][aria-expanded]', attrs, m('a', m('i.fa.fa-bars'), ' Menu'), topNavBar.dropdown()),
|
||||
];
|
||||
if(model.openDropdown){
|
||||
ret.push(topNavBar.clickElsewhere(model));
|
||||
}
|
||||
return ret;
|
||||
};
|
||||
|
||||
topNavBar.view = function(model){
|
||||
topNavBar.view = function(controller){
|
||||
return m("nav.uk-navbar.uk-navbar-attached",[
|
||||
m("ul.uk-navbar-nav.uk-visible-large.uk-navbar-content.uk-navbar-center", topNavBar.largeTopNav()),
|
||||
m("ul.uk-navbar-nav.uk-visible-medium", topNavBar.mediumTopNav()),
|
||||
m("ul.uk-navbar-nav.uk-visible-small", topNavBar.smallTopNav(model)),
|
||||
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)),
|
||||
]);
|
||||
};
|
||||
|
||||
|
||||
+40
-38
@@ -1,10 +1,11 @@
|
||||
// LESS related
|
||||
@import "uikit/dist/scss/uikit-mixins.scss";
|
||||
@import "uikit/dist/scss/core/variables.scss";
|
||||
@import "uikit/scss/uikit-mixins.scss";
|
||||
@import "uikit/scss/core/variables.scss";
|
||||
|
||||
// Phenix colors
|
||||
|
||||
$navbar-background: #f08d28; //#dabd5e;
|
||||
// $foo: ; // #f8c694;
|
||||
|
||||
$panel-box-background: #fce3ca;
|
||||
$table-striped-background: #fce3ca;
|
||||
@@ -13,53 +14,54 @@ $navbar-nav-hover-background: #fce3ca;
|
||||
$panel-box-secondary-background: #fce3ca;
|
||||
$badge-background: #fce3ca;
|
||||
$badge-color: black;
|
||||
$badge-font-size: 2em;
|
||||
|
||||
// Defaults
|
||||
@import "uikit/dist/scss/core/base.scss";
|
||||
@import "uikit/scss/core/base.scss";
|
||||
|
||||
// Layout
|
||||
@import "uikit/dist/scss/core/grid.scss";
|
||||
@import "uikit/dist/scss/core/panel.scss";
|
||||
@import "uikit/dist/scss/core/block.scss";
|
||||
@import "uikit/dist/scss/core/article.scss";
|
||||
@import "uikit/dist/scss/core/comment.scss";
|
||||
@import "uikit/dist/scss/core/cover.scss";
|
||||
@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/dist/scss/core/nav.scss";
|
||||
@import "uikit/dist/scss/core/navbar.scss";
|
||||
@import "uikit/dist/scss/core/subnav.scss";
|
||||
@import "uikit/dist/scss/core/breadcrumb.scss";
|
||||
@import "uikit/dist/scss/core/pagination.scss";
|
||||
@import "uikit/dist/scss/core/tab.scss";
|
||||
@import "uikit/dist/scss/core/thumbnav.scss";
|
||||
@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/dist/scss/core/list.scss";
|
||||
@import "uikit/dist/scss/core/description-list.scss";
|
||||
@import "uikit/dist/scss/core/table.scss";
|
||||
@import "uikit/dist/scss/core/form.scss";
|
||||
@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/dist/scss/core/button.scss";
|
||||
@import "uikit/dist/scss/core/icon.scss";
|
||||
@import "uikit/dist/scss/core/close.scss";
|
||||
@import "uikit/dist/scss/core/badge.scss";
|
||||
@import "uikit/dist/scss/core/alert.scss";
|
||||
@import "uikit/dist/scss/core/thumbnail.scss";
|
||||
@import "uikit/dist/scss/core/overlay.scss";
|
||||
@import "uikit/dist/scss/core/column.scss";
|
||||
@import "uikit/dist/scss/core/animation.scss";
|
||||
@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/dist/scss/core/dropdown.scss";
|
||||
@import "uikit/dist/scss/core/modal.scss";
|
||||
@import "uikit/dist/scss/core/offcanvas.scss";
|
||||
@import "uikit/dist/scss/core/switcher.scss";
|
||||
@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/dist/scss/core/text.scss";
|
||||
@import "uikit/dist/scss/core/utility.scss";
|
||||
@import "uikit/dist/scss/core/flex.scss";
|
||||
@import "uikit/dist/scss/core/contrast.scss";
|
||||
@import "uikit/dist/scss/core/print.scss";
|
||||
@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";
|
||||
Reference in new issue
Block a user