From e3e1499d631bb3d6f90a5fc46dd615aae896e694 Mon Sep 17 00:00:00 2001 From: didier amyot Date: Sun, 7 Feb 2016 14:32:28 -0500 Subject: [PATCH] added default pages --- .gitignore | 1 + script/main.js | 6 +++- script/views/confidentialPage.js | 20 ++++++++++++++ script/views/contactPage.js | 20 ++++++++++++++ script/views/mainPage.js | 2 +- script/views/photosPage.js | 20 ++++++++++++++ script/views/rulesPage.js | 47 ++++++++++++++++++++++++++++++++ script/views/topNavBar.js | 6 ++-- 8 files changed, 117 insertions(+), 5 deletions(-) create mode 100644 script/views/confidentialPage.js create mode 100644 script/views/contactPage.js create mode 100644 script/views/photosPage.js create mode 100644 script/views/rulesPage.js diff --git a/.gitignore b/.gitignore index eabf113..dca5b39 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ lib/* css/* /api/resultats.json /index.html +/main-built.js diff --git a/script/main.js b/script/main.js index 8b8dedd..2fcede9 100644 --- a/script/main.js +++ b/script/main.js @@ -7,10 +7,14 @@ requirejs.config({ }); -requirejs(['m', 'views/mainPage', 'views/calendarPage'], function(m, mainPage, calendarPage){ +requirejs(['m', 'views/mainPage', 'views/calendarPage', 'views/rulesPage', 'views/photosPage', 'views/confidentialPage', 'views/contactPage'], function(m, mainPage, calendarPage, rulesPage, photosPage, confidentialPage, contactPage){ m.route.mode = "hash"; m.route(document.body, "/", { "/": mainPage, "/calendrier": calendarPage, + "/reglement": rulesPage, + "/photos": photosPage, + "/membre": confidentialPage, + "/contact": contactPage }); }); diff --git a/script/views/confidentialPage.js b/script/views/confidentialPage.js new file mode 100644 index 0000000..f421559 --- /dev/null +++ b/script/views/confidentialPage.js @@ -0,0 +1,20 @@ +define(['m', '_', 'util', 'resultParser', 'views/topNavBar', 'views/footer'], function (m, _ , util, resultParser, topNavBar, footer) { + + var rulesPageBody = {}; + + rulesPageBody.view = function(){ + return m('h1', 'En construction'); + }; + + var confidentialPage = {}; + + confidentialPage.view = function(){ + return [ + m.component(topNavBar), + m.component(rulesPageBody), + m.component(footer) + ]; + }; + + return confidentialPage; +}); diff --git a/script/views/contactPage.js b/script/views/contactPage.js new file mode 100644 index 0000000..3c0cdf6 --- /dev/null +++ b/script/views/contactPage.js @@ -0,0 +1,20 @@ +define(['m', '_', 'util', 'resultParser', 'views/topNavBar', 'views/footer'], function (m, _ , util, resultParser, topNavBar, footer) { + + var rulesPageBody = {}; + + rulesPageBody.view = function(){ + return m('h1', 'En construction'); + }; + + var contactPage = {}; + + contactPage.view = function(){ + return [ + m.component(topNavBar), + m.component(rulesPageBody), + m.component(footer) + ]; + }; + + return contactPage; +}); diff --git a/script/views/mainPage.js b/script/views/mainPage.js index d9e9615..7ff09a5 100644 --- a/script/views/mainPage.js +++ b/script/views/mainPage.js @@ -76,7 +76,7 @@ define(['m', '_', 'util', 'resultParser', 'views/topNavBar', 'views/footer'], fu var mainMap = {}; mainMap.getMap = function(){ - var iframeUrl = "http://www.openstreetmap.org/export/embed.html?bbox=-73.55889558792114%2C45.53089890181621%2C-73.55181455612183%2C45.53426212742867&layer=mapnik"; + 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'}, diff --git a/script/views/photosPage.js b/script/views/photosPage.js new file mode 100644 index 0000000..21c34d3 --- /dev/null +++ b/script/views/photosPage.js @@ -0,0 +1,20 @@ +define(['m', '_', 'util', 'resultParser', 'views/topNavBar', 'views/footer'], function (m, _ , util, resultParser, topNavBar, footer) { + + var rulesPageBody = {}; + + rulesPageBody.view = function(){ + return m('h1', 'En construction'); + }; + + var photosPage = {}; + + photosPage.view = function(){ + return [ + m.component(topNavBar), + m.component(rulesPageBody), + m.component(footer) + ]; + }; + + return photosPage; +}); diff --git a/script/views/rulesPage.js b/script/views/rulesPage.js new file mode 100644 index 0000000..295cd70 --- /dev/null +++ b/script/views/rulesPage.js @@ -0,0 +1,47 @@ +define(['m', '_', 'util', 'resultParser', 'views/topNavBar', 'views/footer'], function (m, _ , util, resultParser, topNavBar, footer) { + + var rulesPage = {}; + + rulesPage.missionTest = function(){ + return "La ligue de balle Les Phénix a été fondée en 2004 afin "+ + "d'offrir aux membres de la communauté gaie et lesbienne et à "+ + "leurs amis hétéros l'opportunité de s'amuser et de pratiquer "+ + "un sport dans une ambiance amicale et décontractée. "+ + "L'ouverture d'esprit, la camaraderie et le plaisir de "+ + "pratiquer un sport à l'extérieur caractérisent cette ligue." + }; + + rulesPage.mission = function(){ + return m('div.uk-panel.uk-panel-box.uk-panel-box-secondary', [ + m('h2', 'Mission'), + m('p', rulesPage.missionTest()) + ]); + + }; + + rulesPage.rules = function(){ + return m('div.uk-panel.uk-panel-box.uk-panel-box-secondary', [ + m('h2', 'Règlements 2015'), + m('ul',[ + m('li', m('h3', 'Règlements généraux')), + m('li', m('h3','Règles et procédures')), + m('li', m('h3','Règlements de terrain')), + ]) + ]); + }; + + rulesPage.view = function(){ + return [ + m.component(topNavBar), + + m('div.uk-margin-top.uk-margin-bottom.uk-grid', + m('div.uk-width-large-3-5.uk-container-center', [ + rulesPage.mission(), + rulesPage.rules() + ])), + m.component(footer) + ]; + }; + + return rulesPage; +}); diff --git a/script/views/topNavBar.js b/script/views/topNavBar.js index c29b8d0..0e1fde1 100644 --- a/script/views/topNavBar.js +++ b/script/views/topNavBar.js @@ -2,7 +2,7 @@ define(['m', '_', 'util'], function (m, _, util) { var topNavBar = {}; topNavBar._urlMapping = { - acceuil: 'Acceuil', + '': 'Acceuil', calendrier: 'Calendrier', reglement: 'Règlement', photos: 'Photos', @@ -19,7 +19,7 @@ define(['m', '_', 'util'], function (m, _, util) { }; topNavBar._isActive = function(id_){ - return id_ == m.route.param("page"); + return topNavBar._getUrlForId(id_) == window.location.hash; }; topNavBar._getItem = function(name, id){ @@ -31,7 +31,7 @@ define(['m', '_', 'util'], function (m, _, util) { topNavBar.view = function(controller){ return m("nav.uk-navbar.uk-navbar-attached",[ m("ul.uk-navbar-nav.uk-navbar-center.uk-visible-large", - m('li.uk-parent', util.facebookLink()), + 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()),