Skip to content

Commit

Permalink
misc improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
nilandev committed Jan 8, 2024
1 parent f1216f6 commit 059ff6a
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion bloggy/admin/quiz_admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand Down
4 changes: 4 additions & 0 deletions bloggy/models/quizzes.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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()

Expand Down
8 changes: 5 additions & 3 deletions bloggy/templates/pages/single/quiz.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@
<div class="container">
<div class="row">
<main id="main-content" class="article-details-card p-5 lessons_list col-12 col-md-8">
{% if user.is_authenticated and user.is_superuser %}
<a class="mb-3 btn btn-sm btn-secondary btn-xs"
href="{{ quiz.get_admin_url }}">Edit post</a>
{% endif %}
<div id="vueRoot">
<quizlet :quiz="{{ quiz.get_questions_json }}"></quizlet>
</div>
Expand All @@ -35,12 +39,10 @@
<div class="sidebar-content sticky-top ms-lg-3" style="z-index: 99">
{% include 'widgets/ad-unit-vertical-responsive.html' %}
{% include "partials/home_widget_contribute_cta.html" %}


<div class="card card-rounded card-shadow mb-4 p-3 p-lg-4">
{% related_article_widget count=6 slug=quiz.slug widget_title='Recent posts' widget_style="list" %}
</div>

</div>
</aside>
</div>
Expand Down
2 changes: 1 addition & 1 deletion bloggy_frontend/sass/content/_category_widget.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 059ff6a

Please sign in to comment.