From 059ff6a4837be63d7ada7c37a81bf3e4fb1139b6 Mon Sep 17 00:00:00 2001 From: Nilanchala Date: Mon, 8 Jan 2024 00:56:16 +0000 Subject: [PATCH] misc improvements --- bloggy/admin/quiz_admin.py | 2 +- bloggy/models/quizzes.py | 4 ++++ bloggy/templates/pages/single/quiz.html | 8 +++++--- bloggy_frontend/sass/content/_category_widget.scss | 2 +- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/bloggy/admin/quiz_admin.py b/bloggy/admin/quiz_admin.py index 17def79..c414a79 100644 --- a/bloggy/admin/quiz_admin.py +++ b/bloggy/admin/quiz_admin.py @@ -35,7 +35,7 @@ class QuizAdmin(BloggyAdmin): }), publication_fieldsets, seo_fieldsets) - summernote_fields = ('description',) + summernote_fields = ('content',) readonly_fields = ['thumbnail_tag'] ordering = ('-display_order',) list_display_links = ['title'] diff --git a/bloggy/models/quizzes.py b/bloggy/models/quizzes.py index 30da1c8..bc0ee7d 100644 --- a/bloggy/models/quizzes.py +++ b/bloggy/models/quizzes.py @@ -1,6 +1,7 @@ from django.contrib.contenttypes.fields import GenericRelation from django.db import models from django.db.models import TextField +from django.urls import reverse from hitcount.models import HitCount from bloggy import settings @@ -58,6 +59,9 @@ class Quiz(Content): def get_questions_json(self): return get_questions_json(self) + def get_admin_url(self): + return reverse(f'admin:{self._meta.app_label}_{self._meta.model_name}_change', args=[self.id]) + def get_questions(self): return self.quizquestion_set.all() diff --git a/bloggy/templates/pages/single/quiz.html b/bloggy/templates/pages/single/quiz.html index 98ce152..933e016 100644 --- a/bloggy/templates/pages/single/quiz.html +++ b/bloggy/templates/pages/single/quiz.html @@ -26,6 +26,10 @@
+ {% if user.is_authenticated and user.is_superuser %} + Edit post + {% endif %}
@@ -35,12 +39,10 @@
diff --git a/bloggy_frontend/sass/content/_category_widget.scss b/bloggy_frontend/sass/content/_category_widget.scss index 96b5ec0..58a0c11 100644 --- a/bloggy_frontend/sass/content/_category_widget.scss +++ b/bloggy_frontend/sass/content/_category_widget.scss @@ -2,7 +2,7 @@ li { box-sizing: border-box; - border: 1px solid var(--tags-list-a-border-color); + //border: 1px solid var(--tags-list-a-border-color); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15); border-radius: 58px; display: inline-flex;