Browse Source

Modification de compatibilite pelican-comments-system et Elegant

pull/4/head
LecygneNoir 3 years ago
parent
commit
4fbc59253d
4 changed files with 11 additions and 10 deletions
  1. +1
    -1
      pelicanconf.py
  2. +1
    -1
      theme/static/js/comments.js
  3. +6
    -1
      theme/templates/_includes/comments.html
  4. +3
    -7
      theme/templates/pcs/comments.html

+ 1
- 1
pelicanconf.py View File

@ -25,7 +25,7 @@ DEFAULT_PAGINATION = 4
### Plugins ###
PLUGIN_PATHS = ['../pelican-plugins']
PLUGINS = ['extract_toc', 'sitemap', 'tipue_search']
PLUGINS = ['pelican_comment_system', 'extract_toc', 'sitemap', 'tipue_search']
#sitemap
SITEMAP = {

+ 1
- 1
theme/static/js/comments.js View File

@ -5,7 +5,7 @@ var CommentSystem = {
display_replyto_html: function(comment_content, article_slug, author) {return ''},
cancelReply: function() {
$('#commentForm_replyto').val("");
$('#pcs-comment-form-input-replyto').val("");
$('#pcs-comment-form-display-replyto').hide();
},

+ 6
- 1
theme/templates/_includes/comments.html View File

@ -1,5 +1,8 @@
{% macro comments_section(article) %}
{% import 'pcs/comments.html' as pcs with context %}
{% set use_pcs = True %}
{% from '_includes/_defaults.html' import DISQUS_FILTER, UTTERANCES_FILTER, COMMENTBOX_FILTER with context %}
{% set use_disqus = (not DISQUS_FILTER or article.disqus_filter == "off") and DISQUS_SITENAME and article.disqus_filter != "on" %}
@ -22,7 +25,7 @@
{% set intro = article.comments_intro %}
{% endif %}
{% if article.status != 'draft' and article.comments != 'False' and (use_disqus or use_utterances or use_commentbox) %}
{% if article.status != 'draft' and article.comments != 'False' and (use_disqus or use_utterances or use_commentbox or use_pcs) %}
<section>
<h6 style="display:none;">Comments</h6>
@ -61,6 +64,8 @@
{% from '_includes/commentbox_scripts.html' import comments_script_commentbox with context %}
{{ comments_script_commentbox(COMMENTBOX_PROJECT, identifier) }}
{% endif %}
{{ pcs.comments_quickstart("blog.victorhery", "victor-hery.com") }}
</div>
</div>
</div>

+ 3
- 7
theme/templates/pcs/comments.html View File

@ -74,10 +74,6 @@
{% macro comments_with_form() %}
{% if PELICAN_COMMENT_SYSTEM %}
<section id="pcs-comments">
<header>
<h2>Commentaires / Comments</h2>
<hr/>
</header>
{% if article.comments %}
<ul>
{% for comment in article.comments recursive %}
@ -85,8 +81,8 @@
<div class="comment-left">
<img src="{{ SITEURL }}/{{ comment.avatar }}"
alt="Avatar"
height="{{ PELICAN_COMMENT_SYSTEM_IDENTICON_SIZE }}px"
width="{{ PELICAN_COMMENT_SYSTEM_IDENTICON_SIZE }}px">
height="{{ PELICAN_COMMENT_SYSTEM_IDENTICON_SIZE }}"
width="{{ PELICAN_COMMENT_SYSTEM_IDENTICON_SIZE }}">
</div>
<div class="comment-body">
<div style="float:right;">
@ -136,7 +132,7 @@
$(document).ready(function() {
CommentSystem.email_user = "{{ user }}";
CommentSystem.email_domain = "{{ domain }}";
CommentSystem.display_replyto_html = function(comment_content, article_slug, author) {
CommentSystem.display_replyto_html = function(comment_content, article_slug, author) {
return ''
+ '<button style="float:right;" onclick="CommentSystem.cancelReply(); return false;" title="Cancel the reply">'
+ '×'

Loading…
Cancel
Save