2018-11-12 12:57:25 +01:00
|
|
|
import { NodesFactoryInterface } from './nodes'
|
|
|
|
|
|
|
|
class Posts extends NodesFactoryInterface {
|
|
|
|
static create$item(post) {
|
|
|
|
let content = [];
|
2018-11-21 20:24:12 +01:00
|
|
|
let $title = $('<a>')
|
|
|
|
.attr('href', '/nodes/' + post._id + '/redir')
|
|
|
|
.addClass('h2 text-uppercase font-weight-bold d-block pb-3')
|
2018-11-12 12:57:25 +01:00
|
|
|
.text(post.name);
|
|
|
|
content.push($title);
|
|
|
|
let $post = $('<div>')
|
|
|
|
.addClass('expand-image-links imgs-fluid')
|
|
|
|
.append(
|
2018-11-21 20:24:12 +01:00
|
|
|
content,
|
2018-11-12 12:57:25 +01:00
|
|
|
$('<div>')
|
2018-11-21 20:24:12 +01:00
|
|
|
.addClass('node-details-description mx-auto')
|
2018-11-22 14:39:25 +01:00
|
|
|
.html(post['properties']['pretty_content'])
|
2018-11-12 12:57:25 +01:00
|
|
|
);
|
2018-11-21 20:24:12 +01:00
|
|
|
|
2018-11-12 12:57:25 +01:00
|
|
|
return $post;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-11-21 20:24:12 +01:00
|
|
|
export { Posts };
|