Major revision of comment system.

- Comments are stored in HTML as well as Markdown, so that conversion
  only happens when saving (rather than when viewing).
- Added 'markdown' Jinja filter for easy development. This is quite
  a heavy filter, so it shouldn't be used (much) in production.
- Added CLI command to update schemas on existing node types.
This commit is contained in:
2016-10-19 09:57:43 +02:00
parent eea934a86a
commit ea2be0f13d
14 changed files with 831 additions and 37 deletions

View File

@@ -53,26 +53,8 @@ script(type="text/javascript").
}
}
function loadComments(){
var commentsUrl = "{{ url_for('nodes.comments_index', parent_id=node._id) }}";
$.get(commentsUrl, function(dataHtml) {
})
.done(function(dataHtml){
// Update the DOM injecting the generate HTML into the page
$('#comments-container').replaceWith(dataHtml);
})
.fail(function(e, data){
statusBarSet('error', 'Couldn\'t load comments. Error: ' + data.errorThrown, 'pi-attention', 5000);
$('#comments-container').html('<a id="comments-reload"><i class="pi-refresh"></i> Reload comments</a>');
});
}
loadComments();
$('body').on('click', '#comments-reload', function(){
loadComments();
});
var commentsUrl = "{{ url_for('nodes.comments_for_node', node_id=node._id) }}";
loadComments(commentsUrl);
{% if node.has_method('PUT') %}
$('.project-mode-view').show();
@@ -186,4 +168,3 @@ script(type="text/javascript").
if (typeof $().tooltip != 'undefined'){
$('[data-toggle="tooltip"]').tooltip({'delay' : {'show': 1250, 'hide': 250}});
}