fix typo
This commit is contained in:
parent
6e72c08ef4
commit
a447cdfcf1
5 changed files with 9 additions and 19 deletions
|
@ -40,7 +40,6 @@ class BookMark(models.Model):
|
|||
except ObjectDoesNotExist:
|
||||
return None
|
||||
|
||||
|
||||
class Meta:
|
||||
verbose_name = _("bookmark")
|
||||
verbose_name_plural = _("bookmarks")
|
||||
|
|
|
@ -65,16 +65,13 @@ def undobookmark_page(request):
|
|||
|
||||
|
||||
class BookMarkDetailView(TemplateResponseMixin, SingleObjectMixin, View):
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
context = super(BookMarkDetailView, self).get_context_data(**kwargs)
|
||||
queryset = BookMark.objects.filter(page=self.get_comment_page())
|
||||
if queryset.exists() == False:
|
||||
bookmark = BookMark(page=self.get_comment_page(),)
|
||||
bookmark.save()
|
||||
context["bookmark"] = queryset.first()
|
||||
queryset = BookMark.objects.get_or_create(page=self.get_comment_page())
|
||||
context["bookmark"] = queryset[0]
|
||||
return context
|
||||
|
||||
|
||||
class BookMarkListView(ListView):
|
||||
def add_bookmark_context_data(self, context, obj_list="object_list"):
|
||||
for item in context[obj_list]:
|
||||
|
|
|
@ -101,11 +101,8 @@ class PageVoteDetailView(TemplateResponseMixin, SingleObjectMixin, View):
|
|||
|
||||
def get_context_data(self, **kwargs):
|
||||
context = super(PageVoteDetailView, self).get_context_data(**kwargs)
|
||||
queryset = PageVote.objects.filter(page=self.get_comment_page())
|
||||
if queryset.exists() == False:
|
||||
pagevote = PageVote(page=self.get_comment_page(), score=0)
|
||||
pagevote.save()
|
||||
context["pagevote"] = queryset.first()
|
||||
queryset = PageVote.objects.get_or_create(page=self.get_comment_page())
|
||||
context["pagevote"] = queryset[0]
|
||||
return context
|
||||
|
||||
|
||||
|
|
|
@ -366,9 +366,6 @@ class UserBookMarkPage(UserPage):
|
|||
context["problemlist"] = problemlist
|
||||
context["contestlist"] = contestlist
|
||||
|
||||
context["haspost"] = pagelist.exists()
|
||||
context["hasproblem"] = problemlist.exists()
|
||||
context["hascontest"] = contestlist.exists()
|
||||
return context
|
||||
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
{% endblock %}
|
||||
|
||||
{% block user_content %}
|
||||
{% if haspost %}
|
||||
{% if postlist %}
|
||||
<div class="bookmark-group">
|
||||
<h3 class="unselectable toggle closed">
|
||||
<span class="fa fa-chevron-right fa-fw"></span>{{ _('Bookmarked Posts') }} ({{ postlist|length }})
|
||||
|
@ -34,7 +34,7 @@
|
|||
<i>{{ _('You have not yet bookmarked any post.') }}</i>
|
||||
{% endif %}
|
||||
<hr>
|
||||
{% if hasproblem %}
|
||||
{% if problemlist %}
|
||||
<div class="bookmark-group">
|
||||
<h3 class="unselectable toggle closed">
|
||||
<span class="fa fa-chevron-right fa-fw"></span>{{ _('Bookmarked Problems') }} ({{ problemlist|length }})
|
||||
|
@ -60,7 +60,7 @@
|
|||
<i>{{ _('You have not yet bookmarked any problem.') }}</i>
|
||||
{% endif %}
|
||||
<hr>
|
||||
{% if hascontest %}
|
||||
{% if contestlist %}
|
||||
<div class="bookmark-group">
|
||||
<h3 class="unselectable toggle closed">
|
||||
<span class="fa fa-chevron-right fa-fw"></span>{{ _('Bookmarked Contests') }} ({{ contestlist|length }})
|
||||
|
|
Loading…
Reference in a new issue