Skip to content

Commit

Permalink
correct plurals of vote and answers
Browse files Browse the repository at this point in the history
  • Loading branch information
brunosmartin committed Oct 10, 2013
1 parent 5fdb452 commit 5c94b5a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions forum/templates/forum.html
Expand Up @@ -61,8 +61,8 @@ <h1 class="top"><i class="icon-double-angle-right"></i>{{ course.name }}</h1>
<article class="question">
<div class="stats">
<div class="arrow-right"></div>
<p><span class="numbers-votes">{{ question.votes.count }}</span>votos</p>
<p><span class="numbers-answers">{{ question.answers.count }}</span>respostas</p>
<p><span class="numbers-votes">{{ question.count_votes }}</span>voto{% if question.count_votes > 1 %}s{% endif %}</p>
<p><span class="numbers-answers">{{ question.answers.count }}</span>resposta{% if question.answers.count > 1 %}s{% endif %}</p>
</div>
<div class="question">
<p><a href="{% url 'forum_question' question.slug %}">{{ question.title }}</a></p>
Expand Down
3 changes: 2 additions & 1 deletion forum/templates/question.html
Expand Up @@ -11,6 +11,7 @@
{% block content %}
<script>
window.question_id = {{ question.pk }};
window.user_id = {{ user.pk }};
</script>

<!-- CONTAINER -->
Expand Down Expand Up @@ -82,7 +83,7 @@ <h1>{{ question.title }}</h1>
<header>
<div class="row">
<div class="col-sm-6 col-lg-6">
<h1>{{ question.answers.count }} Respostas:</h1>
<h1><span ng-init="num_answers={{ question.answers.count }}">{% verbatim angularjs %} {{ num_answers }} {% endverbatim angularjs %}</span> Resposta<span ng-if="num_answers>1">s</span></h1>
</div>
</div>
</header>
Expand Down
2 changes: 1 addition & 1 deletion forum/views.py
Expand Up @@ -74,7 +74,7 @@ def pre_save(self, obj):
class AnswerViewSet(viewsets.ModelViewSet):
model = Answer
serializer_class = AnswerSerializer
filter_fields = ('question',)
filter_fields = ('question', 'user')

def pre_save(self, obj):
obj.user = self.request.user
Expand Down

0 comments on commit 5c94b5a

Please sign in to comment.