22 Commits
Author SHA1 Message Date
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
didier amyot d0a163c873 started to implement the member section 2016-02-15 10:29:15 -05:00
didier amyot e49884ccc8 implemented games points 2016-02-07 15:13:57 -05:00
didier amyot 1f0870529b update readme 2016-02-07 19:42:35 +00:00
didier amyot e3e1499d63 added default pages 2016-02-07 14:32:28 -05:00
didier amyot f90d1621f0 added r.js to build 2016-02-07 13:31:34 -05:00
32 changed files with 1114 additions and 91 deletions

No files matched your search

+1
View File
@@ -3,3 +3,4 @@ lib/*
css/* css/*
/api/resultats.json /api/resultats.json
/index.html /index.html
/main-built.js
+1
View File
@@ -9,6 +9,7 @@ pages:
script: script:
- npm install - npm install
- node_modules/.bin/gulp prod - node_modules/.bin/gulp prod
- node_modules/.bin/r.js -o build.js
- rm -rf node_modules .public public - rm -rf node_modules .public public
- mkdir .public - mkdir .public
- cp -r * .public - cp -r * .public
+40
View File
@@ -1 +1,41 @@
# Site Web de Balle Phénix # Site Web de Balle Phénix
![Image Alt](https://gitlab.com/didiercrunch/phenix-website/raw/master/images/phenix_logo.png)
## introduction
Vous trouverez le code source du site web pour les Phénix ici. Le site web
en lui-même est accessible au https://didiercrunch.gitlab.io/phenix-website/.
### Structure du site web.
Premièrement, mille excuses pour mes choix hétéroclites. J'ai décidé d'explorer
de nouvels technologies avec ce projet. En conséquence, le code est un peu
difficile à comprendre à première vue mais il est __tellement__ plus cool!
#### Choix
* mithril.js comme framework dans le fureteur
* require.js pour les dépendances
* uikit avec sass comme framework css
* gulp pour la compilation
* gitlab pour le deployment
---
# English Version
All the source code is in english. The source code is for a static web
side for The softball league 'Balle Phénix'.
## How to build
$ npm install
$ node_modules/.bin/gulp help
# How it is made
* mithril.js as client side framework
* uikit as css framework
* coffee and love
+2 -1
View File
@@ -21,6 +21,7 @@
"uikit": "~2.24.3", "uikit": "~2.24.3",
"mithril": "~0.2.1", "mithril": "~0.2.1",
"lodash": "~4.2.1", "lodash": "~4.2.1",
"almond": "~0.3.1" "almond": "~0.3.1",
"requirejs": "~2.1.22"
} }
} }
+59
View File
@@ -0,0 +1,59 @@
[title]
innerMarkdown = """
## Inscription 2016!
"""
[meta]
innerMarkdown = """
Lundi 14 mars 2016
"""
[body]
innerMarkdown = """
Bonjour à tous les phénixiens phénixiennes.
Eh bien oui l'hiver tire à ça fin et il sera bientôt temps de sortir gants et
batons (en bon français mites et battes) pour jouer à notre sport préféré:
la balle-molle.
**L'inscription aura lieu le vendredi 18 mars 2016 de 19h30 à 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 rendu 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 avons très hâte de vous y voir et de fêter avec vous!!!
Votre comité de balle les phénix.
"""
[smallBody]
innerMarkdown = """
Bonjour à tous les phénixiens phénixiennes.
Eh bien oui l'hiver tire à ça fin et il sera bientôt temps de sortir gants et
batons (en bon français mites et battes) pour jouer à notre sport préféré:
la balle-molle.
**L'inscription aura lieu le vendredi 18 mars 2016 de 19h30 à 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)**
"""
+289
View File
@@ -0,0 +1,289 @@
---
-
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
+6 -52
View File
@@ -1,63 +1,17 @@
--- ---
- -
date: 2016/06/02 # year/month/day date: ~
time: "18:00" time: ~
home: gris home: gris
away: jaune away: jaune
home_points: 6 home_points: ~
away_points: 7 away_points: !
- -
date: 2016/06/02 # year/month/day date: ~
time: "20:30" time: ~
home: bleu home: bleu
away: rouge 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: ~ home_points: ~
away_points: ~ away_points: ~
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+39 -2
View File
@@ -2,11 +2,16 @@ var gulp = require('gulp');
var bower = require('gulp-bower'); var bower = require('gulp-bower');
var help = require('gulp-task-listing'); var help = require('gulp-task-listing');
var clean = require('gulp-clean'); var clean = require('gulp-clean');
var toml = require('gulp-toml');
var sass = require('gulp-sass'); var sass = require('gulp-sass');
var rename = require("gulp-rename"); var rename = require("gulp-rename");
var yaml = require('gulp-yaml'); var yaml = require('gulp-yaml');
var template = require('gulp-template'); var template = require('gulp-template');
var wrapper = require('gulp-wrapper');
var rename = require("gulp-rename");
var webserver = require('gulp-webserver'); var webserver = require('gulp-webserver');
var marked = require('marked');
var _ = require('lodash');
gulp.task('help', help); gulp.task('help', help);
@@ -48,21 +53,53 @@ gulp.task('template-dev', function () {
.pipe(gulp.dest('.')); .pipe(gulp.dest('.'));
}); });
gulp.task('compile-articles', function(){
gulp.task('default', ['bower', 'sass', 'compile-results']); var transformArticle = function(article){
var isMarkdownKey = /markdown/i;
_.each(article, function(section, sectionName){
_.each(section, function(value, key){
if(isMarkdownKey.test(key) && _.isString(value)){
section[key] = marked(value);
}
});
});
return JSON.stringify(article, null, 4);
};
gulp.src('data/articles/**/*.toml.md')
.pipe(toml({to: transformArticle}))
.pipe(wrapper({
header: "define(['m', '_'], function (m, _ ) {\nreturn ",
footer: ';\n});\n'
}))
.pipe(rename(function(path){
path.basename = path.basename.replace(/\.toml$/i, '');
path.extname = '.js';
return path;
}))
.pipe(gulp.dest('./script/articles/'));
});
gulp.task('default', ['bower', 'sass', 'compile-results', 'compile-articles']);
gulp.task('prod', ['default', 'template-prod']); gulp.task('prod', ['default', 'template-prod']);
gulp.task('webserver', function(){ gulp.task('webserver', function(){
return gulp.src('.') return gulp.src('.')
.pipe(webserver({ .pipe(webserver({
host: '0.0.0.0',
port: 2222,
livereload: false, livereload: false,
directoryListing: 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('./scss/*.scss', ['sass']);
gulp.watch('*.tmpl.html', ['template-dev']); gulp.watch('*.tmpl.html', ['template-dev']);
gulp.watch('./data/articles/**/*', ['compile-articles']);
return gulp.watch('./data/*.yaml', ['compile-results']); return gulp.watch('./data/*.yaml', ['compile-results']);
}); });
Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

+3 -1
View File
@@ -1,9 +1,11 @@
<!doctype html> <!doctype html>
<html> <html>
<head> <head>
<meta charset="utf-8" >
<title>Balle Phenix</title> <title>Balle Phenix</title>
<meta charset="utf-8" /> <link rel="shortcut icon" href="/favicon.ico">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="css/style.css" /> <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"> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
</head> </head>
+5
View File
@@ -11,6 +11,11 @@
"gulp-sass": "^2.1.1", "gulp-sass": "^2.1.1",
"gulp-task-listing": "^1.0.1", "gulp-task-listing": "^1.0.1",
"gulp-template": "^3.1.0", "gulp-template": "^3.1.0",
"gulp-toml": "^0.1.1",
"gulp-wrap": "^0.11.0",
"gulp-wrapper": "^1.0.0",
"lodash": "^4.6.1",
"marked": "^0.3.5",
"requirejs": "^2.1.22" "requirejs": "^2.1.22"
}, },
"devDependencies": { "devDependencies": {
+16
View File
@@ -0,0 +1,16 @@
define(['m', 'articles/inscription'], function (m, inscription) {
var simplifyArticleStructure = function(article){
var ret = {};
_.each(article, function(section, sectionName){
ret[sectionName] = m.trust(section.innerMarkdown);
});
return ret;
};
var articles = [];
articles.push(inscription);
return _.map(articles, simplifyArticleStructure);
});
+19
View File
@@ -0,0 +1,19 @@
define(['m'], function(m) {
return function(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"}})
])
])
]);
};
});
+6 -2
View File
@@ -1,5 +1,4 @@
requirejs.config({ requirejs.config({
// baseUrl: 'lib',
paths: { paths: {
'_': '../lib/lodash/dist/lodash.min', '_': '../lib/lodash/dist/lodash.min',
'm': '../lib/mithril/mithril.min' 'm': '../lib/mithril/mithril.min'
@@ -7,10 +6,15 @@ requirejs.config({
}); });
requirejs(['m', 'views/mainPage', 'views/calendarPage'], function(m, mainPage, calendarPage){ 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.mode = "hash";
m.route(document.body, "/", { m.route(document.body, "/", {
"/": mainPage, "/": mainPage,
"/nouvelles": newsPage,
"/calendrier": calendarPage, "/calendrier": calendarPage,
"/reglement": rulesPage,
"/photos": photosPage,
"/membre": confidentialPage,
"/contact": contactPage
}); });
}); });
+9 -1
View File
@@ -75,9 +75,16 @@ define(['_'], function(_) {
return res.home_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){ resultParser._getTeamStats = function(rawResults, team){
var ret = { var ret = {
team: team, gamePlayed: 0, victories: 0, team: team, gamePlayed: 0, victories: 0, points: 0,
defeats: 0, draws: 0, pointsFor: 0, pointsAgaint: 0}; defeats: 0, draws: 0, pointsFor: 0, pointsAgaint: 0};
_.each(rawResults, function(res){ _.each(rawResults, function(res){
if((team != res.home && team != res.away) || !_.isNumber(res.home_points)){ if((team != res.home && team != res.away) || !_.isNumber(res.home_points)){
@@ -89,6 +96,7 @@ define(['_'], function(_) {
ret.draws += resultParser._isDraw(res) ? 1: 0; ret.draws += resultParser._isDraw(res) ? 1: 0;
ret.pointsFor += resultParser._getPointsFor(res, team); ret.pointsFor += resultParser._getPointsFor(res, team);
ret.pointsAgaint += resultParser._getPointsForOpponent(res, team); ret.pointsAgaint += resultParser._getPointsForOpponent(res, team);
ret.points += resultParser._getPointsForGame(res, team);
}); });
return ret; return ret;
}; };
+6 -4
View File
@@ -3,17 +3,19 @@ define(['m', '_'], function (m, _) {
teams.getTeamColor = function(teamName){ teams.getTeamColor = function(teamName){
if(teamName == 'jaune'){ if(teamName == 'jaune'){
return 'yellow'; return '#FF0';
} }
if(teamName == 'rouge'){ if(teamName == 'rouge'){
return 'red'; return '#F00';
} }
if(teamName == 'bleu'){ if(teamName == 'bleu'){
return 'bleu'; return '#00F';
} }
if(teamName == 'gris'){ if(teamName == 'gris'){
return 'grey'; return '#808080';
} }
return undefined;
}; };
return teams; return teams;
+15 -2
View File
@@ -1,7 +1,7 @@
define(['m'], function(m) { define(['m'], function(m) {
var util = {}; var util = {};
util.loremIpsum = function(){ util.loremIpsum = function(n){
return "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec a"+ var loremIpsum = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec a"+
" diam lectus. Sed sit amet ipsum mauris. Maecenas congue ligula "+ " diam lectus. Sed sit amet ipsum mauris. Maecenas congue ligula "+
"ac quam viverra nec consectetur ante hendrerit. Donec et mollis"+ "ac quam viverra nec consectetur ante hendrerit. Donec et mollis"+
" dolor. Praesent et diam eget libero egestas mattis sit amet"+ " dolor. Praesent et diam eget libero egestas mattis sit amet"+
@@ -13,6 +13,10 @@ define(['m'], function(m) {
"magna consequat sagittis. Curabitur dapibus enim sit amet elit "+ "magna consequat sagittis. Curabitur dapibus enim sit amet elit "+
"pharetra tincidunt feugiat nisl imperdiet. Ut convallis libero "+ "pharetra tincidunt feugiat nisl imperdiet. Ut convallis libero "+
"in urna ultrices accumsan. Donec sed od"; "in urna ultrices accumsan. Donec sed od";
loremIpsum = loremIpsum.split(' ');
n = n || loremIpsum.length;
return loremIpsum.splice(0, n).join(" ");
}; };
util.formatDate = function(date){ util.formatDate = function(date){
@@ -25,6 +29,15 @@ define(['m'], function(m) {
}; };
util.formatDateSmall = function(date){
var smallMonthNames = ['janv', 'févr', 'mars', 'avr', 'mai', 'juin',
'juill', 'août', 'sept', 'oct', 'nov',
'dec'];
return [date.getDate(),
smallMonthNames[date.getMonth()],
date.getFullYear() % 1000].join(' ');
};
util.facebookLink = function(){ util.facebookLink = function(){
return m('a[href="https://www.facebook.com/LigueDeBalleLesPhenix"]', return m('a[href="https://www.facebook.com/LigueDeBalleLesPhenix"]',
m('i.fa.fa-facebook-square') m('i.fa.fa-facebook-square')
+12 -4
View File
@@ -1,4 +1,4 @@
define(['m', '_', 'util', 'resultParser', 'teams', 'views/topNavBar', 'views/footer'], function(m, _, util, resultParser, teams, topNavBar, footer) { define(['m', '_', 'util', 'resultParser', 'teams', 'views/topNavBar', 'views/footer', 'images/rain.svg'], function(m, _, util, resultParser, teams, topNavBar, footer, rainSvg) {
var statsView = {}; var statsView = {};
statsView.controller = function(){ statsView.controller = function(){
@@ -21,7 +21,7 @@ define(['m', '_', 'util', 'resultParser', 'teams', 'views/topNavBar', 'views/foo
m('td', formatStat(teamStats.pointsFor)), m('td', formatStat(teamStats.pointsFor)),
m('td', formatStat(teamStats.pointsAgaint)), m('td', formatStat(teamStats.pointsAgaint)),
m('td', formatStat(teamStats.pointsFor - teamStats.pointsAgaint)), m('td', formatStat(teamStats.pointsFor - teamStats.pointsAgaint)),
m('td', "? ") m('td', formatStat(teamStats.points))
]); ]);
}; };
@@ -85,9 +85,17 @@ define(['m', '_', 'util', 'resultParser', 'teams', 'views/topNavBar', 'views/foo
return !_.isNumber(points) ? '-' : points + ''; return !_.isNumber(points) ? '-' : points + '';
}; };
schedulView._gameName = function(game){
if(game.rain){
return [rainSvg('1.5em'), " ", game.time];
}
return [game.time, " ", m('span', {style: {visibility: 'hidden'}}, rainSvg('1.5em'))];
};
schedulView._gameRow = function(game){ schedulView._gameRow = function(game){
return m('tr',[ return m('tr',[
m('td', game.time), m('td', schedulView._gameName(game)),
m('td', schedulView._getTeamTag(game.home)), m('td', schedulView._getTeamTag(game.home)),
m('td', schedulView._asGamePoints(game.home_points)), m('td', schedulView._asGamePoints(game.home_points)),
m('td', 'vs'), m('td', 'vs'),
@@ -118,7 +126,7 @@ define(['m', '_', 'util', 'resultParser', 'teams', 'views/topNavBar', 'views/foo
calendarPage.view = function(){ calendarPage.view = function(){
return [m.component(topNavBar), return [m.component(topNavBar),
m('div.uk-grid.uk-margin-top.uk-margin-bottom', 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('div.uk-width-large-3-5.uk-width-medium-4-5.uk-width-small-1-1.uk-container-center',[
m.component(statsView), m.component(statsView),
m.component(schedulView)])), m.component(schedulView)])),
m.component(footer)]; m.component(footer)];
+293
View File
@@ -0,0 +1,293 @@
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('&nbsp;'));
};
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;
window.secret = 'o'
if(!window.secret){
body = loginComponent;
}else{
body = confidentialPageBody;
}
return [
m.component(topNavBar),
m.component(body),
m.component(footer)
];
};
return confidentialPage;
});
+67
View File
@@ -0,0 +1,67 @@
define(['m', '_', 'util', 'resultParser', 'views/topNavBar', 'views/footer'], function (m, _ , util, resultParser, topNavBar, footer) {
var contactBody = {};
contactBody.logo = function(){
var style = 'height: 300px; width: 300px; background-size: 300px; background-image: url(images/logosansfond.JPG);';
return m('div.uk-cover-background.uk-container-center', {style: style});
};
contactBody.logoLine = function(){
return m('div.uk-grid.uk-margin',
m('div.uk-width-1-1', contactBody.logo()));
};
contactBody.email = function(){
return m('a[href=mailto:info@ballephenix.com]', 'info@ballephenix.com');
};
contactBody.tel = function(){
return ' (514) 544-8976';
};
contactBody.address = function(){
return m('p', ' 123 rue Dufresne', m('br'), 'Montréal, Québec H6Y 8U7');
};
contactBody.contact = function(){
return m('div.div.uk-panel.uk-panel-box.uk-panel-box-secondary.uk-container-center.uk-margin',[
m('table.uk-table',
m('tr',
m('td.uk-text-right', m('i.fa.fa-desktop')),
m('td', contactBody.email())
),
m('tr',
m('td.uk-text-right', m('i.fa.fa-phone')),
m('td', contactBody.tel())
),
m('tr',
m('td.uk-text-right', m('i.fa.fa-envelope')),
m('td', contactBody.address())
)
)
]);
};
contactBody.view = function(){
return m('div.uk-margin-top.uk-margin-bottom.uk-grid',
m('div.uk-width-large-2-5.uk-width-medium-4-5.uk-width-small-1-1.uk-container-center', [
contactBody.logoLine(),
contactBody.contact()
])
);
};
var contactPage = {};
contactPage.view = function(){
return [
m.component(topNavBar),
m.component(contactBody),
m.component(footer)
];
};
return contactPage;
});
+43
View File
@@ -0,0 +1,43 @@
define(['m', '_', 'util', 'views/topNavBar', 'views/footer'], function (m, _ , util, topNavBar, footer) {
var loginComponent = {};
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.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',
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"))
)
]);
};
loginComponent.view = function(){
return m('div', [
loginComponent.logoLine(),
loginComponent.loginForm()
]);
};
var loginPage = {};
loginPage.view = function(){
return [
m.component(topNavBar),
m.component(loginComponent),
m.component(footer)
];
};
return loginPage;
});
+39 -18
View File
@@ -1,10 +1,10 @@
define(['m', '_', 'util', 'resultParser', 'views/topNavBar', 'views/footer'], function (m, _ , util, resultParser, topNavBar, footer) { define(['m', '_', 'util', 'resultParser', 'views/topNavBar', 'views/footer', 'articles/articles'], function (m, _ , util, resultParser, topNavBar, footer, articles) {
var mainPageLogo = {}; var mainPageLogo = {};
mainPageLogo.view = function(){ mainPageLogo.view = function(){
return m('div.uk-grid.uk-hidden-small', [ return m('div.uk-grid', [
m('div.uk-large-1-3.uk-medium-2-3.uk-container-center', [ 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);'}) m('div.uk-cover-background.uk-container-center.uk-margin-left.uk-margin-top',{style: 'height:300px; width: 300px; background-size: 300px; background-image: url(images/logosansfond.JPG);'})
]) ])
]); ]);
}; };
@@ -12,12 +12,13 @@ define(['m', '_', 'util', 'resultParser', 'views/topNavBar', 'views/footer'], fu
var mainPageNews = {}; var mainPageNews = {};
mainPageNews.view = function(){ mainPageNews.view = function(){
var article = _.get(articles, 0, {});
return m('div.uk-panel.uk-panel-box',[ return m('div.uk-panel.uk-panel-box',[
m('div.uk-panel-badge.uk-badge', [ m('div.uk-panel-badge.uk-badge', [
m('i.fa.fa-newspaper-o') m('i.fa.fa-newspaper-o')
]), ]),
m('h3.uk-panel-title', 'Nouvelles'), m('h3.uk-panel-title', m('a.uk-link-muted', {href: '#/nouvelles'}, article.title)),
m('p', util.loremIpsum()) m('p', article.smallBody || article.body)
]); ]);
}; };
@@ -42,9 +43,15 @@ define(['m', '_', 'util', 'resultParser', 'views/topNavBar', 'views/footer'], fu
])); ]));
}; };
nextGameDaySchedule._responsoveText = function(largeText, smallText){
return [m('span.uk-visible-large', largeText),
m('span.uk-hidden-large', smallText)];
};
nextGameDaySchedule._getGamesRow = function(game){ nextGameDaySchedule._getGamesRow = function(game){
return m('tr', [ return m('tr', [
m('td', util.formatDate(game.jsDate)), m('td', nextGameDaySchedule._responsoveText(util.formatDate(game.jsDate),
util.formatDateSmall(game.jsDate))),
m('td', game.time), m('td', game.time),
m('td', game.away), m('td', game.away),
m('td', game.home) m('td', game.home)
@@ -68,7 +75,7 @@ define(['m', '_', 'util', 'resultParser', 'views/topNavBar', 'views/footer'], fu
mainPageSchedule.view = function(){ mainPageSchedule.view = function(){
return m('div.uk-panel.uk-panel-box',[ return m('div.uk-panel.uk-panel-box',[
m('div.uk-panel-badge.uk-badge', m('i.fa.fa-clock-o')), m('div.uk-panel-badge.uk-badge', m('i.fa.fa-clock-o')),
m('h3.uk-panel-title', 'Horaire'), m('h3.uk-panel-title', m('a.uk-link-muted', {href: '#/calendrier'}, 'Horaire')),
m.component(nextGameDaySchedule) m.component(nextGameDaySchedule)
]); ]);
}; };
@@ -76,12 +83,12 @@ define(['m', '_', 'util', 'resultParser', 'views/topNavBar', 'views/footer'], fu
var mainMap = {}; var mainMap = {};
mainMap.getMap = function(){ mainMap.getMap = function(){
var iframeUrl = "http://www.openstreetmap.org/export/embed.html?bbox=-73.55889558792114%2C45.53089890181621%2C-73.55181455612183%2C45.53426212742867&amp;layer=mapnik"; 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 externalLink = "http://www.openstreetmap.org/#map=18/45.53258/-73.55536";
var iframeParams = { var iframeParams = {
style: {border: '1px solid black', 'min-height': '300px'}, style: {border: '1px solid black', 'min-height': '300px'},
width: '100%', width: '100%',
height: '100%', // height: '100%',
frameborder: 0, frameborder: 0,
scrolling: 'no', scrolling: 'no',
marginheight: 0, marginheight: 0,
@@ -107,11 +114,22 @@ define(['m', '_', 'util', 'resultParser', 'views/topNavBar', 'views/footer'], fu
var mainPageBottom = {}; var mainPageBottom = {};
mainPageBottom.regularSizeView = function(){ mainPageBottom.regularSizeView = function(){
return m('div.uk-grid.uk-hidden-small.uk-grid-match', [ return m('div.uk-grid.uk-visible-large.uk-grid-match', [
m('div.uk-width-large-1-5.uk-hidden-medium'), m('div.uk-width-large-1-3.uk-width-medium-1-3', m.component(mainPageNews)),
m('div.uk-width-large-1-5.uk-width-medium-1-3', m.component(mainPageNews)), m('div.uk-width-large-1-3.uk-width-medium-1-3', m.component(mainPageSchedule)),
m('div.uk-width-large-1-5.uk-width-medium-1-3', m.component(mainPageSchedule)), m('div.uk-width-large-1-3.uk-width-medium-1-3', m.component(mainMap))
m('div.uk-width-large-1-5.uk-width-medium-1-3', m.component(mainMap)) ]);
};
mainPageBottom.mediumSizeView = function(){
return m('div.uk-visible-medium', [
m('div.uk-grid.uk-grid-match', [
m('div.uk-width-medium-1-2', [m.component(mainPageNews)]),
m('div.uk-width-medium-1-2', [m.component(mainPageSchedule)]),
]),
m('div.uk-grid',
m('div.uk-width-medium-1-1', m.component(mainMap))
)
]); ]);
}; };
@@ -126,10 +144,13 @@ define(['m', '_', 'util', 'resultParser', 'views/topNavBar', 'views/footer'], fu
mainPageBottom.view = function(){ mainPageBottom.view = function(){
return m('div.uk-margin-top.uk-margin-bottom', [ return m('div.uk-margin-top.uk-margin-bottom.uk-grid',
mainPageBottom.regularSizeView(), m('div.uk-width-large-3-5.uk-width-medium-4-5.uk-width-small-1-1.uk-container-center', [
mainPageBottom.smallSizeView() mainPageBottom.regularSizeView(),
]); mainPageBottom.mediumSizeView(),
mainPageBottom.smallSizeView()
])
);
}; };
+36
View File
@@ -0,0 +1,36 @@
define(['m', '_', 'util', 'resultParser', 'articles/articles', 'views/topNavBar', 'views/footer'], function (m, _ , util, resultParser, articles, topNavBar, footer) {
var newsPageBody = {};
newsPageBody.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});
};
newsPageBody.getArticle = function(article){
return m('article.uk-article.uk-margin-',
m('h1.uk-article-title', article.title),
m('p.uk-article-meta', article.meta),
article.body
);
};
newsPageBody.view = function(){
return m('div', _.map(articles, newsPageBody.getArticle));
};
var newsPage = {};
newsPage.view = function(){
return [
m.component(topNavBar),
m('div.uk-grid.uk-margin-top.uk-margin-bottom',
m('div.uk-width-large-2-5.uk-width-medium-3-5.uk-width-small-1-1.uk-container-center',
m.component(newsPageBody))),
m.component(footer)
];
};
return newsPage;
});
+26
View File
@@ -0,0 +1,26 @@
define(['m', '_', 'util', 'resultParser', 'views/topNavBar', 'views/footer'], function (m, _ , util, resultParser, topNavBar, footer) {
var rulesPageBody = {};
rulesPageBody.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});
};
rulesPageBody.view = function(){
return m('div.uk-grid',
m('div.uk-width-1-1', rulesPageBody.logo()));
};
var photosPage = {};
photosPage.view = function(){
return [
m.component(topNavBar),
m.component(rulesPageBody),
m.component(footer)
];
};
return photosPage;
});
+63
View File
@@ -0,0 +1,63 @@
define(['m', '_', 'util', 'resultParser', 'views/topNavBar', 'views/footer'], function (m, _ , util, resultParser, topNavBar, footer) {
var rulesPage = {};
rulesPage.missionText = 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.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});
};
rulesPage.rules = function(){
var urlASBM = 'http://montreal.baseballquebec.com/fr/publication/nouvelle/recherche_un_directeur_general_asbm.html';
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_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.logoAndRules = function(){
return m('div.uk-grid',[
m('div.uk-width-large-1-3.uk-width-small-1-1', rulesPage.logo()),
rulesPage.rules()
]
);
};
rulesPage.mission = function(){
return m('div.uk-panel.uk-panel-box.uk-panel-box-secondary', [
m('h2', 'Mission'),
m('p', rulesPage.missionText())
]);
};
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-width-medium-4-5.uk-width-large-1-1.uk-container-center', [
rulesPage.logoAndRules(),
rulesPage.mission()
])),
m.component(footer)
];
};
return rulesPage;
});
+5 -4
View File
@@ -2,10 +2,11 @@ define(['m', '_', 'util'], function (m, _, util) {
var topNavBar = {}; var topNavBar = {};
topNavBar._urlMapping = { topNavBar._urlMapping = {
acceuil: 'Acceuil', '': 'Accueil',
nouvelles: 'Nouvelles',
calendrier: 'Calendrier', calendrier: 'Calendrier',
reglement: 'Règlement', reglement: 'Règlement',
photos: 'Photos', // photos: 'Photos',
membre: 'Membre', membre: 'Membre',
contact: 'Nous Joindre' contact: 'Nous Joindre'
}; };
@@ -19,7 +20,7 @@ define(['m', '_', 'util'], function (m, _, util) {
}; };
topNavBar._isActive = function(id_){ topNavBar._isActive = function(id_){
return id_ == m.route.param("page"); return topNavBar._getUrlForId(id_) == window.location.hash;
}; };
topNavBar._getItem = function(name, id){ topNavBar._getItem = function(name, id){
@@ -31,7 +32,7 @@ define(['m', '_', 'util'], function (m, _, util) {
topNavBar.view = function(controller){ topNavBar.view = function(controller){
return m("nav.uk-navbar.uk-navbar-attached",[ return m("nav.uk-navbar.uk-navbar-attached",[
m("ul.uk-navbar-nav.uk-navbar-center.uk-visible-large", m("ul.uk-navbar-nav.uk-navbar-center.uk-visible-large",
m('li.uk-parent', util.facebookLink()), m('li.uk-parent', m('div.uk-navbar-brand', util.facebookLink())),
_.map(topNavBar._urlMapping, topNavBar._getItem)), _.map(topNavBar._urlMapping, topNavBar._getItem)),
m("ul.uk-navbar-nav.uk-hidden-large", m("ul.uk-navbar-nav.uk-hidden-large",
m('li.uk-parent', util.facebookLink()), m('li.uk-parent', util.facebookLink()),
+14
View File
@@ -2,6 +2,20 @@
@import "uikit/scss/uikit-mixins.scss"; @import "uikit/scss/uikit-mixins.scss";
@import "uikit/scss/core/variables.scss"; @import "uikit/scss/core/variables.scss";
// Phenix colors
$navbar-background: #f08d28; //#dabd5e;
// $foo: ; // #f8c694;
$panel-box-background: #fce3ca;
$table-striped-background: #fce3ca;
$navbar-nav-active-background: #fce3ca;
$navbar-nav-hover-background: #fce3ca;
$panel-box-secondary-background: #fce3ca;
$badge-background: #fce3ca;
$badge-color: black;
$badge-font-size: 2em;
// Defaults // Defaults
@import "uikit/scss/core/base.scss"; @import "uikit/scss/core/base.scss";