diff --git a/src/scripts/js/es6/common/templates/posts.js b/src/scripts/js/es6/common/templates/posts.js index f9761fa6..9f86babe 100644 --- a/src/scripts/js/es6/common/templates/posts.js +++ b/src/scripts/js/es6/common/templates/posts.js @@ -1,52 +1,24 @@ import { NodesFactoryInterface } from './nodes' -import { thenLoadImage } from './utils'; class Posts extends NodesFactoryInterface { static create$item(post) { let content = []; - let $title = $('
') - .addClass('display-4 text-uppercase font-weight-bold') + let $title = $('') + .attr('href', '/nodes/' + post._id + '/redir') + .addClass('h2 text-uppercase font-weight-bold d-block pb-3') .text(post.name); content.push($title); - let $text = $('
') - .addClass('lead') - .text(post['pretty_created']); - content.push($text); - let $jumbotron = $('') - .addClass('jumbotron text-white jumbotron-overlay') - .attr('href', '/nodes/' + post._id + '/redir') - .append( - $('
') - .addClass('container') - .append( - $('
') - .addClass('row') - .append( - $('
') - .addClass('col-md-9') - .append(content) - ) - ) - ); - thenLoadImage(post.picture, 'l') - .then((img)=>{ - $jumbotron.attr('style', 'background-image: url(' + img.link + ');') - }) - .fail((error)=>{ - let msg = xhrErrorResponseMessage(error); - console.log(msg || error); - }) let $post = $('
') .addClass('expand-image-links imgs-fluid') .append( - $jumbotron, + content, $('
') - .addClass('node-details-description mx-auto py-5') + .addClass('node-details-description mx-auto') .html(post['properties']['_content_html']) ); - + return $post; } } -export { Posts }; \ No newline at end of file +export { Posts };