remotes/origin/PR-39
ArturBaybulatov 9 years ago
parent 61c05d93e2
commit a62d6c0c95
  1. 20
      projects/migrations/0035_auto_20160916_2003.py
  2. 5
      projects/models.py
  3. 4
      projects/templates/comparison.html
  4. 46
      projects/templates/project_detail.html
  5. 2
      users/templates/customer_profile_open_projects.html
  6. 2
      users/templates/partials/customer_profile_info_block.html

@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-09-16 17:03
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('projects', '0034_auto_20160916_1933'),
]
operations = [
migrations.AlterField(
model_name='stage',
name='term',
field=models.DateField(),
),
]

@ -163,6 +163,11 @@ class Answer(models.Model):
class AnswerMessage(models.Model):
# Get a message's author:
#
# customer: `message.is_sender_customer and message.answer.project.customer`
# contractor/team: `not message2.is_sender_customer and message2.contractor_or_team`
answer = models.ForeignKey(Answer, related_name='messages')
created = models.DateTimeField(default=timezone.now)
is_sender_customer = models.BooleanField(default=False)

@ -36,9 +36,9 @@
<td>
{% if cand.answer.author|class_name == 'User' %}
{{ cand.answer.author.get_full_name }}
{% firstof cand.answer.author.get_full_name.strip cand.answer.author.username %}
{% elif cand.answer.author|class_name == 'Team' %}
{{ cand.answer.author.name }}
{% firstof cand.answer.author.name.strip cand.answer.author.username %}
{% endif %}
</td>

@ -5,6 +5,16 @@
{% load specializtions_tags %}
{% load project_tags %}
{% block head_css %}
<style>
.-highlighted-message {
background-color: #E9FFF8;
}
</style>
{% endblock %}
{% block content %}
{% include 'partials/header.html' %}
@ -332,17 +342,17 @@
<div class="commBlock44 disTab">
{% for message in answer.messages.all %}
<div class="comm44 disTab">
<div class="col-lg-10 col-lg-offset-1">
<div class="col-lg-10 col-lg-offset-1 {% if not message.is_sender_customer %}-highlighted-message{% endif %}">
{% if message.is_sender_customer %}
<p class="nameComm nameCommAct">
{{ project.customer.get_full_name }}
<p class="nameComm">
{% firstof project.customer.get_full_name.strip project.customer.username %}
</p>
{% else %}
<p class="nameComm">
<p class="nameComm nameCommAct">
{% if answer.author|class_name == 'User' %}
{{ answer.author.get_full_name }}
{% firstof answer.author.get_full_name.strip answer.author.username %}
{% elif answer.author|class_name == 'Team' %}
{{ answer.author.name }}
{% firstof answer.author.name.strip answer.author.owner.username %}
{% endif %}
</p>
{% endif %}
@ -705,17 +715,17 @@
<div class="commBlock44 disTab">
{% for message in answer.messages.all %}
<div class="comm44 disTab">
<div class="col-lg-10 col-lg-offset-1">
<div class="col-lg-10 col-lg-offset-1 {% if message.is_sender_customer %}-highlighted-message{% endif %}">
{% if message.is_sender_customer %}
<p class="nameComm nameCommAct">
{{ project.customer.get_full_name }}
{% firstof project.customer.get_full_name.strip project.customer.username %}
</p>
{% else %}
<p class="nameComm">
{% if answer.author|class_name == 'User' %}
{{ answer.author.get_full_name }}
{% firstof answer.author.get_full_name.strip answer.author.username %}
{% elif answer.author|class_name == 'Team' %}
{{ answer.author.name }}
{% firstof answer.author.name.strip answer.author.owner.username %}
{% endif %}
</p>
{% endif %}
@ -899,17 +909,17 @@
<div class="commBlock44 disTab">
{% for message in answer.messages.all %}
<div class="comm44 disTab">
<div class="col-lg-10 col-lg-offset-1">
<div class="col-lg-10 col-lg-offset-1 {% if message.is_sender_customer %}-highlighted-message{% endif %}">
{% if message.is_sender_customer %}
<p class="nameComm nameCommAct">
{{ project.customer.get_full_name }}
{% firstof project.customer.get_full_name.strip project.customer.username %}
</p>
{% else %}
<p class="nameComm">
{% if answer.author|class_name == 'User' %}
{{ answer.author.get_full_name }}
{% firstof answer.author.get_full_name.strip answer.author.username %}
{% elif answer.author|class_name == 'Team' %}
{{ answer.author.name }}
{% firstof answer.author.name.strip answer.author.owner.username %}
{% endif %}
</p>
{% endif %}
@ -1071,17 +1081,17 @@
<div class="commBlock44 disTab">
{% for message in answer.messages.all %}
<div class="comm44 disTab">
<div class="col-lg-10 col-lg-offset-1">
<div class="col-lg-10 col-lg-offset-1 {% if message.is_sender_customer %}-highlighted-message{% endif %}">
{% if message.is_sender_customer %}
<p class="nameComm nameCommAct">
{{ project.customer.get_full_name }}
{% firstof project.customer.get_full_name.strip project.customer.username %}
</p>
{% else %}
<p class="nameComm">
{% if answer.author|class_name == 'User' %}
{{ answer.author.get_full_name }}
{% firstof answer.author.get_full_name.strip answer.author.username %}
{% elif answer.author|class_name == 'Team' %}
{{ answer.author.name }}
{% firstof answer.author.name.strip answer.author.owner.username %}
{% endif %}
</p>
{% endif %}

@ -53,11 +53,13 @@
<li><span>{{ proj.get_team_answers|length }}</span> ответ от имени группы</li>
</ul>
{% if request.user == customer %}
<ul class="color-menu">
<li><a href="{% url 'projects:detail' proj.pk %}#new-answers">Новые: {{ proj|get_new_answers|length }}</a></li>
<li><a href="{% url 'projects:detail' proj.pk %}#candidate-answers">Кандидаты: {{ proj|get_candidate_answers|length }}</a></li>
<li><a href="{% url 'projects:detail' proj.pk %}#rejected-answers">Отказал: {{ proj|get_rejected_answers|length }}</a></li>
</ul>
{% endif %}
<p class="textPro">
{{ proj.text }}

@ -53,6 +53,7 @@
<a href="{{ a }}">Открытые проекты</a>
</li>
{% if request.user == customer %}
<li role="presentation" {% if request.path == b %}class="active"{% endif %}>
<a href="{{ b }}">Текущие проекты</a>
@ -61,6 +62,7 @@
<div class="countG">0</div>
</div>
</li>
{% endif %}
<li role="presentation" {% if request.path == c %}class="active"{% endif %}>
<a href="{{ c }}">Отзывы</a>

Loading…
Cancel
Save