Compare commits
2 commits
721bc1827a
...
2873707e50
Author | SHA1 | Date | |
---|---|---|---|
2873707e50 | |||
cd8df4c826 |
4 changed files with 6 additions and 3 deletions
|
@ -1,6 +1,7 @@
|
||||||
|
import json
|
||||||
import xml.etree.ElementTree as ET
|
import xml.etree.ElementTree as ET
|
||||||
|
|
||||||
import json
|
import ox
|
||||||
|
|
||||||
from django.utils import timezone
|
from django.utils import timezone
|
||||||
from django.utils.timezone import datetime, timedelta
|
from django.utils.timezone import datetime, timedelta
|
||||||
|
@ -158,7 +159,7 @@ def comment(request):
|
||||||
comment.name = data['name']
|
comment.name = data['name']
|
||||||
comment.email = data['email']
|
comment.email = data['email']
|
||||||
comment.session_key = request.session.session_key
|
comment.session_key = request.session.session_key
|
||||||
comment.text = data['text']
|
comment.text = ox.add_links(data['text'])
|
||||||
comment.save()
|
comment.save()
|
||||||
link = request.build_absolute_uri(comment.item.get_absolute_url())
|
link = request.build_absolute_uri(comment.item.get_absolute_url())
|
||||||
tasks.notify_moderators.delay(comment.id, link)
|
tasks.notify_moderators.delay(comment.id, link)
|
||||||
|
|
|
@ -161,7 +161,7 @@ document.querySelector('button#add-comment').addEventListener('click', event =>
|
||||||
`
|
`
|
||||||
comment.querySelector('.name').innerText = response.name
|
comment.querySelector('.name').innerText = response.name
|
||||||
comment.querySelector('.date').innerText = response.date
|
comment.querySelector('.date').innerText = response.date
|
||||||
comment.querySelector('.text').innerText = response.text
|
comment.querySelector('.text').innerHTML = response.text
|
||||||
document.querySelector('.comments .comments-content').append(comment)
|
document.querySelector('.comments .comments-content').append(comment)
|
||||||
document.querySelector('.add-comment textarea').value = ''
|
document.querySelector('.add-comment textarea').value = ''
|
||||||
if (!user.username) {
|
if (!user.username) {
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
{% if week_title %}
|
{% if week_title %}
|
||||||
<h1>{{ week_title }}</h1>
|
<h1>{{ week_title }}</h1>
|
||||||
|
<br>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% for item in items %}
|
{% for item in items %}
|
||||||
<div class="item">
|
<div class="item">
|
||||||
|
|
|
@ -14,3 +14,4 @@ django-celery-beat
|
||||||
redis
|
redis
|
||||||
django-brake
|
django-brake
|
||||||
python-telegram-bot
|
python-telegram-bot
|
||||||
|
ox
|
||||||
|
|
Loading…
Reference in a new issue