Timeline: Remove header and lead from posts.

Headers don't really match with the rest of the listing.
This commit is contained in:
2018-11-21 20:24:12 +01:00
parent 801cda88bf
commit 119291f817

View File

@@ -1,47 +1,19 @@
import { NodesFactoryInterface } from './nodes' import { NodesFactoryInterface } from './nodes'
import { thenLoadImage } from './utils';
class Posts extends NodesFactoryInterface { class Posts extends NodesFactoryInterface {
static create$item(post) { static create$item(post) {
let content = []; let content = [];
let $title = $('<div>') let $title = $('<a>')
.addClass('display-4 text-uppercase font-weight-bold') .attr('href', '/nodes/' + post._id + '/redir')
.addClass('h2 text-uppercase font-weight-bold d-block pb-3')
.text(post.name); .text(post.name);
content.push($title); content.push($title);
let $text = $('<div>')
.addClass('lead')
.text(post['pretty_created']);
content.push($text);
let $jumbotron = $('<a>')
.addClass('jumbotron text-white jumbotron-overlay')
.attr('href', '/nodes/' + post._id + '/redir')
.append(
$('<div>')
.addClass('container')
.append(
$('<div>')
.addClass('row')
.append(
$('<div>')
.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 = $('<div>') let $post = $('<div>')
.addClass('expand-image-links imgs-fluid') .addClass('expand-image-links imgs-fluid')
.append( .append(
$jumbotron, content,
$('<div>') $('<div>')
.addClass('node-details-description mx-auto py-5') .addClass('node-details-description mx-auto')
.html(post['properties']['_content_html']) .html(post['properties']['_content_html'])
); );