loaded article in main and news page
This commit is contained in:
1 parent
80f4a937b6
commit
c200acc7bc
2 files changed
+10
-9
No files matched your search
@@ -1,4 +1,4 @@
|
||||
define(['m', '_', 'util', 'resultParser', 'views/topNavBar', 'views/footer'], function (m, _ , util, resultParser, topNavBar, footer) {
|
||||
define(['m', '_', 'util', 'resultParser', 'articles/articles', 'views/topNavBar', 'views/footer'], function (m, _ , util, resultParser, articles, topNavBar, footer) {
|
||||
|
||||
var newsPageBody = {};
|
||||
|
||||
@@ -7,16 +7,16 @@ define(['m', '_', 'util', 'resultParser', 'views/topNavBar', 'views/footer'], fu
|
||||
return m('div.uk-cover-background.uk-container-center', {style: style});
|
||||
};
|
||||
|
||||
newsPageBody.getArticle = function(){
|
||||
newsPageBody.getArticle = function(article){
|
||||
return m('article.uk-article.uk-margin-',
|
||||
m('h1.uk-article-title', util.loremIpsum(5)),
|
||||
m('p.uk-article-meta', util.loremIpsum(8)),
|
||||
util.loremIpsum()
|
||||
m('h1.uk-article-title', article.title),
|
||||
m('p.uk-article-meta', article.meta),
|
||||
article.body
|
||||
);
|
||||
};
|
||||
|
||||
newsPageBody.view = function(){
|
||||
return m('div', [newsPageBody.getArticle(), newsPageBody.getArticle(), newsPageBody.getArticle(), newsPageBody.getArticle()]);
|
||||
return m('div', _.map(articles, newsPageBody.getArticle));
|
||||
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user