11 changed files with 190 additions and 57 deletions
@ -1,3 +1,7 @@
|
||||
from django.contrib import admin |
||||
from .models import Comment |
||||
|
||||
# Register your models here. |
||||
|
||||
@admin.register(Comment) |
||||
class CommentAdmin(admin.ModelAdmin): |
||||
pass |
||||
|
@ -1,18 +0,0 @@
|
||||
# Generated by Django 4.0.3 on 2022-04-09 13:01 |
||||
|
||||
from django.db import migrations, models |
||||
|
||||
|
||||
class Migration(migrations.Migration): |
||||
|
||||
dependencies = [ |
||||
('comments', '0001_initial'), |
||||
] |
||||
|
||||
operations = [ |
||||
migrations.AlterField( |
||||
model_name='comment', |
||||
name='reply', |
||||
field=models.IntegerField(null=True), |
||||
), |
||||
] |
Binary file not shown.
@ -0,0 +1,14 @@
|
||||
.is-red { |
||||
color: #eb2c65; |
||||
} |
||||
|
||||
.is-green { |
||||
color: #3846BA; |
||||
text-color: #3846BA; |
||||
} |
||||
|
||||
.is-auth-user { |
||||
color: #3FBE7B; |
||||
text-color: #3FBE7B; |
||||
|
||||
} |
@ -0,0 +1,29 @@
|
||||
// Получить элемент e
|
||||
function reply(el) { |
||||
|
||||
document.getElementById("reply_to").value = el; |
||||
|
||||
repl_name = document.getElementById(el + "_author_name").innerText |
||||
console.log(repl_name); |
||||
|
||||
document.getElementById("reply_to_name").innerText = repl_name; |
||||
|
||||
document.getElementById("comment_text_form").focus(); |
||||
|
||||
// показываем лейбл для ответа
|
||||
document.getElementById("reply_to_name_field").style.display = "block"; |
||||
// скрываем лейбл для простого комментария
|
||||
document.getElementById("pure_comment_label").style.display = "none"; |
||||
} |
||||
|
||||
function abort_reply() { |
||||
console.log("Галя, отмена!") |
||||
document.getElementById("reply_to").value = ''; |
||||
|
||||
// показываем лейбл для ответа
|
||||
document.getElementById("reply_to_name_field").style.display = "none"; |
||||
// скрываем лейбл для простого комментария
|
||||
document.getElementById("pure_comment_label").style.display = "block"; |
||||
|
||||
|
||||
} |
Loading…
Reference in new issue