diff --git a/projects/migrations/0014_auto_20160823_1912.py b/projects/migrations/0014_auto_20160823_1912.py new file mode 100644 index 0000000..2011dc6 --- /dev/null +++ b/projects/migrations/0014_auto_20160823_1912.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.7 on 2016-08-23 16:12 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('projects', '0013_auto_20160819_1735'), + ] + + operations = [ + migrations.AlterModelOptions( + name='project', + options={'ordering': ('-created',), 'verbose_name': 'Проект', 'verbose_name_plural': 'Проекты'}, + ), + migrations.AddField( + model_name='answer', + name='rejected', + field=models.BooleanField(default=False), + ), + ] diff --git a/projects/models.py b/projects/models.py index 4d7ce77..9f4c9b2 100644 --- a/projects/models.py +++ b/projects/models.py @@ -78,7 +78,7 @@ class Project(models.Model, HitCountMixin): ('trashed', 'В корзине'), ('deleted', 'Удален'), ) - + budget = models.DecimalField(max_digits=10, decimal_places=0) budget_by_agreement = models.BooleanField(default=False) created = models.DateTimeField(default=timezone.now) @@ -89,7 +89,6 @@ class Project(models.Model, HitCountMixin): name = models.CharField(max_length=255) price_and_term_required = models.BooleanField(default=False) realty = models.ForeignKey(Realty, blank=True, null=True, related_name='projects') - rejected_answers_count = models.PositiveIntegerField(default=0) specialization = TreeForeignKey(Specialization, related_name='projects') state = models.CharField(default='active', max_length=20, choices=STATES) term = models.IntegerField(default=0) @@ -134,6 +133,7 @@ class Answer(models.Model): term = models.IntegerField(blank=True, null=True) term_type = models.CharField(max_length=10, choices=TERMS, blank=True, null=True) is_archive = models.BooleanField(default=False) + rejected = models.BooleanField(default=False) content_type = models.ForeignKey(ContentType, limit_choices_to=Q(app_label='users', model='user') | Q(app_label='users', model='team')) object_id = models.IntegerField() diff --git a/projects/templates/project_detail.html b/projects/templates/project_detail.html index e4d6105..aec5b6d 100644 --- a/projects/templates/project_detail.html +++ b/projects/templates/project_detail.html @@ -3,27 +3,28 @@ {% load humanize %} {% load thumbnail %} {% load specializtions_tags %} +{% load project_tags %} {% block content %} {% include 'partials/header.html' %}
{{ project.name }}
-{{ project.name }}
+{{ project.budget|intcomma }}
{% endif %}
- {{ project.customer.get_full_name }} [{{ project.customer.username }}] -
- - - {% if not request.user.is_contractor %} + ++ {{ project.customer.get_full_name }} [{{ project.customer.username }}] +
+ + + {% if not request.user.is_contractor %} {% endif %} -#} -{# Специализации:#} -{#
#} -{#Есть допуск СРО
+ {% endif %} + +
{{ project.text }}
-- {{ message.text }} + {{ message.text|linebreaksbr }}
Исполнители
Новые исполнители
-
+ Новые исполнители
+
+ {% endif %}
+ + {% 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' %} + {% if answer.author.contractor_status == 'free' %} +- {% 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' %} - {% if answer.author.contractor_status == 'free' %} -Есть допуск СРО
+ +Есть допуск СРО
+Есть допуск СРО
+Есть допуск СРО
++ Цена: + {{ answer.budget|intcomma }} + +
++ Срок: {{ answer.term }} {{ answer.get_currency_display }} {{ answer.get_term_type_display|decap }} +
+Опубликован: {{ answer.created|date:'M d, Y' }}
- Цена: - {{ answer.budget|intcomma }} - -
-- Срок: {{ answer.term }} {{ answer.get_currency_display }} {{ answer.get_term_type_display|decap }} -
-Опубликован: {{ answer.created|date:'M d, Y' }}
-+ {{ project.customer.get_full_name }} +
+ {% else %} ++ {% if answer.author|class_name == 'User' %} + {{ answer.author.get_full_name }} + {% elif answer.author|class_name == 'Team' %} + {{ answer.author.name }} + {% endif %} +
+ {% endif %} + + + {{ message.created }} + + ++ {{ message.text|linebreaksbr }} +
+- {{ project.customer.get_full_name }} -
- {% else %} -- {% if answer.author|class_name == 'User' %} - {{ answer.author.get_full_name }} - {% elif answer.author|class_name == 'Team' %} - {{ answer.author.name }} - {% endif %} -
+ {% endfor %} +Кандидаты
+
+ {% endif %}
+ + {% 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' %} + {% if answer.author.contractor_status == 'free' %} +Есть допуск СРО
+- {{ message.text }} -
-Есть допуск СРО
+Отказал
+ {% endif %}
+ + {% 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' %} + {% if answer.author.contractor_status == 'free' %} +Есть допуск СРО
+Есть допуск СРО
++ Цена: + {{ answer.budget|intcomma }} + +
++ Срок: {{ answer.term }} {{ answer.get_currency_display }} {{ answer.get_term_type_display|decap }} +
+Опубликован: {{ answer.created|date:'M d, Y' }}
++ {{ project.customer.get_full_name }} +
+ {% else %} ++ {% if answer.author|class_name == 'User' %} + {{ answer.author.get_full_name }} + {% elif answer.author|class_name == 'Team' %} + {{ answer.author.name }} + {% endif %} +
+ {% endif %} + + + {{ message.created }} + + ++ {{ message.text|linebreaksbr }} +
+