diff --git a/projects/models.py b/projects/models.py index 25b26d7..dd83ce5 100644 --- a/projects/models.py +++ b/projects/models.py @@ -133,7 +133,7 @@ class Answer(models.Model): author = GenericForeignKey('content_type', 'object_id') def __str__(self): - return self.text + return "{author}'s answer ({id})".format(author=type(self.author).__name__, id=self.pk) class Meta: verbose_name = 'Отклик на проект' diff --git a/projects/templates/project_detail.html b/projects/templates/project_detail.html index 2ab204b..7651f06 100644 --- a/projects/templates/project_detail.html +++ b/projects/templates/project_detail.html @@ -157,22 +157,16 @@ - - - - - - - - {% if False and request.user.is_contractor and request.user.contractor_answers.exists and request.user.contractor_answers.first in project.answers.all %} + {% if request.user.is_contractor %} + - {% with answer=request.user.contractor_answers.first %} + {% if answer %}
- {{ answer.author.get_full_name }} [{{ answer.author.username }}] + {% if answer.author|class_name == 'User' %} + {{ answer.author.get_full_name }} [{{ answer.author.username }}] + {% elif answer.author|class_name == 'Team' %} + {{ answer.author.name }} + {% endif %}
+ {% if answer.author|class_name == 'User' %} @@ -208,12 +208,19 @@ {% if answer.author|class_name == 'User' %} -Есть допуск СРО
-Есть допуск СРО
+Есть допуск СРО
+Опубликован: {{ answer.created }}
@@ -306,112 +302,107 @@