Strip comments
Insert link to comment when it's referenced with #comment_number
This commit is contained in:
0
dynastie/sites/blog.soutade.fr/_all_posts.html
Executable file → Normal file
0
dynastie/sites/blog.soutade.fr/_all_posts.html
Executable file → Normal file
@@ -6,7 +6,7 @@
|
||||
<div class="post_header">
|
||||
<dyn:title link="1"/>
|
||||
<div class="post_sub_header">
|
||||
<dyn:date/> | <div class="author_icon"> Écrit par <dyn:author/> </div>
|
||||
<dyn:date format="%A, %d %B %Y"/> | <div class="author_icon"> Écrit par <dyn:author/> </div>
|
||||
</div>
|
||||
<dyn:tags link="1"/>
|
||||
</div>
|
||||
|
||||
0
dynastie/sites/blog.soutade.fr/_base_post.html
Executable file → Normal file
0
dynastie/sites/blog.soutade.fr/_base_post.html
Executable file → Normal file
@@ -6,7 +6,7 @@
|
||||
<div class="post_header">
|
||||
<dyn:title link="1"/>
|
||||
<div class="post_sub_header">
|
||||
<dyn:date/> | <div class="author_icon"> Écrit par <dyn:author/> </div>
|
||||
<dyn:date format="%A, %d %B %Y"/> | <div class="author_icon"> Écrit par <dyn:author/> </div>
|
||||
</div>
|
||||
<dyn:tags link="1"/>
|
||||
</div>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<div class="post_header">
|
||||
<dyn:title link="1"/>
|
||||
<div class="post_sub_header">
|
||||
<dyn:date/> | <div class="author_icon"> Écrit par <dyn:author/> </div>
|
||||
<dyn:date format="%A, %d %B %Y"/> | <div class="author_icon"> Écrit par <dyn:author/> </div>
|
||||
</div>
|
||||
<dyn:tags link="1"/>
|
||||
</div>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<div class="post_header">
|
||||
<dyn:title link="0"/>
|
||||
<div class="post_sub_header">
|
||||
<dyn:date/> | <div class="author_icon"> Écrit par <dyn:author/> </div>
|
||||
<dyn:date format="%A, %d %B %Y"/> | <div class="author_icon"> Écrit par <dyn:author/> </div>
|
||||
</div>
|
||||
<dyn:tags link="1"/>
|
||||
</div>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<div class="post_header">
|
||||
<dyn:title link="1"/>
|
||||
<div class="post_sub_header">
|
||||
<dyn:date/> | <div class="author_icon"> Écrit par <dyn:author/> </div>
|
||||
<dyn:date format="%A, %d %B %Y"/> | <div class="author_icon"> Écrit par <dyn:author/> </div>
|
||||
</div>
|
||||
<dyn:tags link="1"/>
|
||||
</div>
|
||||
|
||||
2
dynastie/sites/blog.soutade.fr/_tag.html
Executable file → Normal file
2
dynastie/sites/blog.soutade.fr/_tag.html
Executable file → Normal file
@@ -6,7 +6,7 @@
|
||||
<div class="post_header">
|
||||
<dyn:title link="1"/>
|
||||
<div class="post_sub_header">
|
||||
<dyn:date/> | <div class="author_icon"> Écrit par <dyn:author/> </div>
|
||||
<dyn:date format="%A, %d %B %Y"/> | <div class="author_icon"> Écrit par <dyn:author/> </div>
|
||||
</div>
|
||||
<dyn:tags link="1"/>
|
||||
</div>
|
||||
|
||||
@@ -406,7 +406,6 @@ ul li
|
||||
.comment_author, .comment_date
|
||||
{
|
||||
margin-left:5px;
|
||||
margin-right:5px;
|
||||
}
|
||||
|
||||
.comment_author
|
||||
|
||||
0
dynastie/sites/blog.soutade.fr/js/blog.js
Executable file → Normal file
0
dynastie/sites/blog.soutade.fr/js/blog.js
Executable file → Normal file
@@ -22,7 +22,7 @@
|
||||
</head>
|
||||
<body>
|
||||
<div class="logo">
|
||||
<a href="http://indefero.soutade.fr/p/dynastie>"><img src="{{ STATIC_URL }}images/logo.png"/></a>
|
||||
<a href="http://indefero.soutade.fr/p/dynastie"><img src="{{ STATIC_URL }}images/logo.png"/></a>
|
||||
</div>
|
||||
<div class="form">
|
||||
<form method="post" action="/index">
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
along with Dynastie. If not, see <http://www.gnu.org/licenses/>.
|
||||
"""
|
||||
import os
|
||||
import re
|
||||
from datetime import datetime, date, time
|
||||
from django.shortcuts import render
|
||||
from django.contrib.auth import authenticate, login, logout
|
||||
@@ -710,10 +711,11 @@ def add_comment(request, post_id, parent_id):
|
||||
ip = request.META['REMOTE_ADDR']
|
||||
|
||||
# Avoid script injection
|
||||
the_comment = request.POST['the_comment']
|
||||
the_comment = request.POST['the_comment'].strip()
|
||||
the_comment = the_comment.replace('<', '<')
|
||||
the_comment = the_comment.replace('>', '>')
|
||||
the_comment = the_comment.replace('\n', '<br />')
|
||||
the_comment = re.sub('#([0-9]+)', '<a href=\"#comment_\\1\">#\\1</a>', the_comment)
|
||||
|
||||
if 'mel' in request.POST:
|
||||
mel = request.POST['mel'].strip()
|
||||
|
||||
Reference in New Issue
Block a user