added a new news

This commit is contained in:
didier amyot committed 2016-03-31 09:01:35 -04:00
1 parent 9e794ed81e
commit 1d1b697d46
6 files changed
+95 -9

No files matched your search

+3 -1
View File
@@ -1,4 +1,4 @@
define(['m', 'articles/inscription'], function (m, inscription) {
define(['m', 'articles/inscription', 'articles/inscription_rappel'], function (m, inscription, inscription_rappel) {
var simplifyArticleStructure = function(article){
var ret = {};
@@ -10,6 +10,8 @@ define(['m', 'articles/inscription'], function (m, inscription) {
var articles = [];
articles.push(inscription);
articles.push(inscription_rappel);
return _.map(articles, simplifyArticleStructure);
+12
View File
@@ -38,6 +38,18 @@ 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')
+2 -2
View File
@@ -16,8 +16,8 @@ define(['m', '_', 'util', 'resultParser', 'articles/articles', 'views/topNavBar'
};
newsPageBody.view = function(){
return m('div', _.map(articles, newsPageBody.getArticle));
var arts = _.map(articles, newsPageBody.getArticle);
return m('div', util.join(arts, m('hr')));
};
var newsPage = {};
+5 -1
View File
@@ -166,6 +166,10 @@ define(['m', '_', 'teams'], function (m, _ , teams) {
};
};
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)),
@@ -181,7 +185,7 @@ define(['m', '_', 'teams'], function (m, _ , teams) {
m('td', ''),
m('td[colspan=3]',
m('ul', [
m('li', [m('b', 'tel: '), player.tel]),
m('li', [m('b', 'tel: '), playersTaguble.playerTelLink(player)]),
m('li', [m('b', 'email: '), player.email])
]))
]);