Giving some improved aspect and deleting unnecessary moving parts. · pythonDrive/bootcamp@88b3802 · GitHub
Skip to content

Commit 88b3802

Browse files
Giving some improved aspect and deleting unnecessary moving parts.
1 parent adc9334 commit 88b3802

4 files changed

Lines changed: 12 additions & 19 deletions

File tree

bootcamp/qa/urls.py

Lines changed: 0 additions & 2 deletions

bootcamp/qa/views.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,26 +17,13 @@ class QuestionListView(LoginRequiredMixin, ListView):
1717
context_object_name = "questions"
1818

1919

20-
class AnswerListView(LoginRequiredMixin, ListView):
21-
model = Answer
22-
paginate_by = 5
23-
context_object_name = "answers"
24-
25-
2620
class QuestionDetailView(LoginRequiredMixin, DetailView):
2721
"""View to call a given Question object and to render all the details about
2822
that Question."""
2923
model = Question
3024
context_object_name = 'question'
3125

3226

33-
class AnswerDetailView(LoginRequiredMixin, DetailView):
34-
"""View to call a given Answer object and to render all the details about
35-
that Answer."""
36-
model = Answer
37-
context_object_name = 'answer'
38-
39-
4027
class CreateQuestionView(LoginRequiredMixin, CreateView):
4128
"""
4229
View to handle the creation of a new question

bootcamp/templates/qa/answer_sample.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
<div class="row answer" answer-id="{{ answer.id }}">
44
{% csrf_token %}
55
<div class="col-md-2 options">
6-
<i class="fa fa-chevron-up vote up-vote answer-vote {% if user in answer.get_up_voters %}voted{% endif %}" aria-hidden="true" title="{% trans 'Click to up vote; click again to toggle' %}"></i>
6+
<i class="fa fa-chevron-up vote up-vote answer-vote {% if request.user in answer.get_up_voters %}voted{% endif %}" aria-hidden="true" title="{% trans 'Click to up vote; click again to toggle' %}"></i>
77
<span class="votes">{{ answer.count_votes }}</span>
8-
<i class="fa fa-chevron-down vote down-vote answer-vote {% if user in answer.get_down_voters %}voted{% endif %}" aria-hidden="true" title="{% trans 'Click to down vote; click again to toggle' %}"></i>
8+
<i class="fa fa-chevron-down vote down-vote answer-vote {% if request.user in answer.get_down_voters %}voted{% endif %}" aria-hidden="true" title="{% trans 'Click to down vote; click again to toggle' %}"></i>
99
{% if answer.is_answer and user == question.user %}
1010
<i class="fa fa-check accept accepted" aria-hidden="true" title="{% trans 'Click to unaccept the answer' %}"></i>
1111
{% elif answer.is_answer %}

bootcamp/templates/qa/question_detail.html

Lines changed: 10 additions & 2 deletions

0 commit comments

Comments
 (0)