|
|
|
|
@ -398,7 +398,7 @@ |
|
|
|
|
{{ comment.user.get_full_name }} <time><i class="fa fa-calendar"></i> {{ comment.created }}</time> |
|
|
|
|
</div> |
|
|
|
|
<div class="comment_text">{{ comment.text }}</div> |
|
|
|
|
<a href="#" data-parent="{{ comment.pk }}" class="reply_comment"><i class="fa fa-comment"></i> <span>{% trans "Ответить на комментарий" %}</span></a> |
|
|
|
|
<a href="#" data-parent="{{ comment.pk }}" data-user="{{ comment.user.get_full_name }}" class="reply_comment"><i class="fa fa-comment"></i> <span>{% trans "Ответить на комментарий" %}</span></a> |
|
|
|
|
|
|
|
|
|
{% for answer in comment.childs %} |
|
|
|
|
<div class="comment"> |
|
|
|
|
@ -416,11 +416,13 @@ |
|
|
|
|
<form action="." method="post" id="comment_form"> |
|
|
|
|
{% csrf_token %} |
|
|
|
|
{# {{ commentform.as_p }}#} |
|
|
|
|
<h3>{% trans 'Оставьте свой отзыв:' %}</h3> |
|
|
|
|
<p> |
|
|
|
|
<label for="id_text">Сообщение:</label> |
|
|
|
|
<textarea cols="40" id="id_text" name="text" rows="10"></textarea> |
|
|
|
|
<textarea id="id_text" name="text" placeholder="{% trans 'Введите текст' %}"></textarea> |
|
|
|
|
|
|
|
|
|
<button type="submit" class="button">{% trans 'Оставить отзыв' %}</button> |
|
|
|
|
</p> |
|
|
|
|
<button type="submit">Отправить</button> |
|
|
|
|
</form> |
|
|
|
|
</div> |
|
|
|
|
{% else %} |
|
|
|
|
@ -430,7 +432,6 @@ |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
{% include 'client/includes/booking_block.html' with city=event.city place=event.place event=event %} |
|
|
|
|
<hr /> |
|
|
|
|
|
|
|
|
|
{% if event.get_nearest_events %} |
|
|
|
|
<div class="e-cat"> |
|
|
|
|
@ -582,10 +583,23 @@ |
|
|
|
|
|
|
|
|
|
$('.reply_comment').on('click', function (e) { |
|
|
|
|
e.preventDefault(); |
|
|
|
|
console.log($(this).data('parent')); |
|
|
|
|
|
|
|
|
|
var $parent = $('<input type="hidden" name="parent" value="' + $(this).data('parent') + '">'); |
|
|
|
|
$comment_form.append($parent); |
|
|
|
|
var $parent = $('<input type="hidden" name="parent" id="parent_comment_id" value="' + $(this).data('parent') + '">'), |
|
|
|
|
$delete_parent = $('<a href="#" class="delete_parent"> × <i>' + $(this).data('user') + '</i></a>'); |
|
|
|
|
$comment_form.prepend($parent); |
|
|
|
|
$comment_form.find('button').after($delete_parent); |
|
|
|
|
|
|
|
|
|
$('html, body').animate({ |
|
|
|
|
scrollTop: $comment_form.offset().top - 20 |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
$comment_form.find('textarea').trigger('focus'); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
$comment_form.on('click', '.delete_parent', function (e) { |
|
|
|
|
e.preventDefault(); |
|
|
|
|
$('#parent_comment_id').remove(); |
|
|
|
|
$(this).remove(); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
$comment_form.on('submit', function (e) { |
|
|
|
|
|