From bcdd5707a6dd48ee119492449ec1753f1d1dd0e8 Mon Sep 17 00:00:00 2001 From: Mukhtar Date: Mon, 30 May 2016 18:40:58 +0300 Subject: [PATCH] add projects test files --- .../migrations/0012_auto_20160530_1355.py | 32 ++ projects/models.py | 1 + .../templates/projects/project_detail.html | 468 ++++++++---------- .../templates/projects/project_detail1.html | 279 +++++++++++ projects/templates/projects/project_form.html | 412 ++++++++------- projects/templates/projects/project_list.html | 4 +- projects/views.py | 7 +- .../specializations/specialization.html | 25 +- specializations/views.py | 1 + templates/base.html | 2 +- templates/registration/login.html | 36 +- templates/registration/registration_form.html | 54 +- 12 files changed, 829 insertions(+), 492 deletions(-) create mode 100644 projects/migrations/0012_auto_20160530_1355.py create mode 100644 projects/templates/projects/project_detail1.html diff --git a/projects/migrations/0012_auto_20160530_1355.py b/projects/migrations/0012_auto_20160530_1355.py new file mode 100644 index 0000000..555079f --- /dev/null +++ b/projects/migrations/0012_auto_20160530_1355.py @@ -0,0 +1,32 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.6 on 2016-05-30 13:55 +from __future__ import unicode_literals + +from django.conf import settings +from django.db import migrations, models +import django.db.models.deletion +import django.utils.timezone + + +class Migration(migrations.Migration): + + dependencies = [ + ('projects', '0011_auto_20160525_1526'), + ] + + operations = [ + migrations.AlterModelOptions( + name='order', + options={'verbose_name': 'Заказ', 'verbose_name_plural': 'Заказы'}, + ), + migrations.AddField( + model_name='project', + name='created', + field=models.DateTimeField(default=django.utils.timezone.now), + ), + migrations.AlterField( + model_name='portfolio', + name='user', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='portfolio', to=settings.AUTH_USER_MODEL), + ), + ] diff --git a/projects/models.py b/projects/models.py index dabf112..6d23272 100644 --- a/projects/models.py +++ b/projects/models.py @@ -45,6 +45,7 @@ class Project(models.Model): term_cost = models.BooleanField(default=False) secure_transaction = models.BooleanField(default=False) realty = models.ForeignKey(Realty, null=True, related_name='projects') + created = models.DateTimeField(default=timezone.now) def __str__(self): return self.name diff --git a/projects/templates/projects/project_detail.html b/projects/templates/projects/project_detail.html index 7aa812f..503381d 100644 --- a/projects/templates/projects/project_detail.html +++ b/projects/templates/projects/project_detail.html @@ -1,115 +1,104 @@ {% extends "base.html" %} -{#{% block content %}#} - -{#{% endblock %}#} {% block content %} -
-
-
-

{{ object }}

-
-
-
-
-
- execitor-image -
-

- {{ object.get_full_name }} -

- - -
-
-
-

- Специализации: -

+
+

{{ object }}

+
+
+
+
+

{{ object.price }}

+
+ +
+ +
+
+
+

+ Специализации: +

+
+ Интерьеры +
+
+ Визуализация/3D +
+
+
+
+
    +
  • + 13.0.2016 +
  • +
  • + Техническое сопровождение +
  • +
+
+
+

Есть допуск СРО

+
+
+
+
+
+
+
    +
  • + Местоположение: Россия, Москва +
  • +
  • + Классификация здания: Коттедж +
  • +
  • + Вид строительства: Новое +
  • +
+
+
+

+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean euismod bibendum laoreet. Proin gravida + dolor sit amet lacus accumsan et viverra justo commodo. Proin sodales pulvinar tempor. Cum sociis natoque + penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam fermentum, nulla luctus pharetra + vulputate, felis tellus mollis orci, sed rhoncus sapien nunc eget odio. +

+
+
+ + Ответить на проект + +
+
+ +
+
+
-
- Интерьеры -
-
- Визуализация/3D -
-
-
-
-
    -
  • - 13.0.2016 -
  • -
  • - Техническое сопровождение -
  • -
-
-
-

Есть допуск СРО

-
-
-
-
-
-
-
    -
  • - Местоположение: Россия, Москва -
  • -
  • - Классификация здания: Коттедж -
  • -
  • - Вид строительства: Новое -
  • -
-
-
-

- {{ object.text }} -

-
- -
-
-
-

Исполнители

-
-
-
- - - -
-
-
-
-
-

Сравнить кандидатов

-
-
{% if perms.projects.add_answer %}

Оставить ответ

@@ -118,162 +107,133 @@ {% csrf_token %} {% for field in form %} -
- {{ field.label }} - {{ field }} +
+

{{ field.label }}

+ {{ field }}
+ + + {% endfor %} {% endif %} -
-

Новые исполнители

-
-
- {% for answer in object.answers.all %} -
-
-
- execitor-image -
-

- Иванов Петр Иванович [ivanov_petr] -

- -
Свободен
-
-
- -
-
-

Есть допуск СРО

-
-
-
-

Цена: - {{ answer.cost }} - -

-

- Срок: {{ answer.term }} {{ answer.term_type }} -

-

Опубликован:{{ answer.created }}

-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-

- Иванов Петр Иванович -

+
+
+
+
+ +
+ execitor-image +
+
+

+ Иванов Петр Иванович [ivanov_petr] +

+ +
+
+ +
+
+

Есть допуск СРО

+
+
+
+

Цена: + 35 000 + +

+

+ Срок: 3 недели +

+

Опубликован: 22.04.2016

+
+ +
+
+
+

+ Иванов Петр Иванович +

13.0.2016 / 21:05 -
- - - - - -
-

- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean euismod bibendum laoreet. Proin gravida dolor sit amet lacus accumsan et viverra justo commodo. Proin sodales pulvinar tempor. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam fermentum, nulla luctus pharetra vulputate, felis tellus mollis orci, sed rhoncus sapien nunc eget odio. -

-
-
-
-
-

- Иванов Петр Иванович -

+
+ + + + + +
+

+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean euismod bibendum laoreet. Proin + gravida dolor sit amet lacus accumsan et viverra justo commodo. Proin sodales pulvinar tempor. + Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam + fermentum, nulla luctus pharetra vulputate, felis tellus mollis orci, sed rhoncus sapien nunc + eget odio. +

+
+
+
+
+

+ Иванов Петр Иванович +

13.0.2016 / 21:05 -

- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean euismod bibendum laoreet. Proin gravida dolor sit amet lacus accumsan et viverra justo commodo. Proin sodales pulvinar tempor. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam fermentum, nulla luctus pharetra vulputate, felis tellus mollis orci, sed rhoncus sapien nunc eget odio. -

- - Ответить - -
-
-
-
- {% endfor %} -
-
- -
- +

+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean euismod bibendum laoreet. Proin + gravida dolor sit amet lacus accumsan et viverra justo commodo. Proin sodales pulvinar tempor. + Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam + fermentum, nulla luctus pharetra vulputate, felis tellus mollis orci, sed rhoncus sapien nunc + eget odio. +

+ + Ответить + +
+
+
+
+
+
+ +
{% endblock %} diff --git a/projects/templates/projects/project_detail1.html b/projects/templates/projects/project_detail1.html new file mode 100644 index 0000000..7aa812f --- /dev/null +++ b/projects/templates/projects/project_detail1.html @@ -0,0 +1,279 @@ +{% extends "base.html" %} +{#{% block content %}#} + + +{#{% endblock %}#} +{% block content %} +
+
+
+

{{ object }}

+
+
+
+
+
+ execitor-image +
+

+ {{ object.get_full_name }} +

+ + +
+
+
+

+ Специализации: +

+ +
+ Интерьеры +
+
+ Визуализация/3D +
+
+
+
+
    +
  • + 13.0.2016 +
  • +
  • + Техническое сопровождение +
  • +
+
+
+

Есть допуск СРО

+
+
+
+
+
+
+
    +
  • + Местоположение: Россия, Москва +
  • +
  • + Классификация здания: Коттедж +
  • +
  • + Вид строительства: Новое +
  • +
+
+
+

+ {{ object.text }} +

+
+ +
+
+
+

Исполнители

+
+
+
+ + + +
+
+
+
+
+

Сравнить кандидатов

+
+
+ {% if perms.projects.add_answer %} + +

Оставить ответ

+
+ {{ form.errors }} + {% csrf_token %} + + {% for field in form %} +
+ {{ field.label }} + {{ field }} +
+ {% endfor %} + +
+ {% endif %} +
+

Новые исполнители

+
+
+ + {% for answer in object.answers.all %} +
+
+
+ execitor-image +
+

+ Иванов Петр Иванович [ivanov_petr] +

+ +
Свободен
+
+
+ +
+
+

Есть допуск СРО

+
+
+
+

Цена: + {{ answer.cost }} + +

+

+ Срок: {{ answer.term }} {{ answer.term_type }} +

+

Опубликован:{{ answer.created }}

+
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

+ Иванов Петр Иванович +

+ + 13.0.2016 / 21:05 + +
+ + + + + +
+

+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean euismod bibendum laoreet. Proin gravida dolor sit amet lacus accumsan et viverra justo commodo. Proin sodales pulvinar tempor. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam fermentum, nulla luctus pharetra vulputate, felis tellus mollis orci, sed rhoncus sapien nunc eget odio. +

+
+
+
+
+

+ Иванов Петр Иванович +

+ + 13.0.2016 / 21:05 + +

+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean euismod bibendum laoreet. Proin gravida dolor sit amet lacus accumsan et viverra justo commodo. Proin sodales pulvinar tempor. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam fermentum, nulla luctus pharetra vulputate, felis tellus mollis orci, sed rhoncus sapien nunc eget odio. +

+ + Ответить + +
+
+
+
+ {% endfor %} +
+
+ +
+ +{% endblock %} diff --git a/projects/templates/projects/project_form.html b/projects/templates/projects/project_form.html index 9e5d3d0..b223de2 100644 --- a/projects/templates/projects/project_form.html +++ b/projects/templates/projects/project_form.html @@ -7,239 +7,271 @@

Новый заказ

-
- {% csrf_token %} + + {% csrf_token %} +
-
- - {{ form.errors }} -
-

Формирование заказа

-
-

Название заказа

- - {{ form.name.errors }} -
-
-

Подробно опишите задание

- -
-
-
-
-

Дополнительно

-
-
-{# #} -{#
#} -{# #} -{#

+ добавить файл (до 100 файлов)

#} -{#
#} -{# #} -{# #} -
    -
  • - Архитерурное 2.jpg - 7мб -
    -
  • -
-
-

Тип работы:

-
-
- -

Проектирование

+ {{ form.errors }} +
+

Формирование заказа

+
+

Название заказа

+ + {{ form.name.errors }}
- -
- -

Техническое сопровождение

+
+

Подробно опишите задание

+
- -
-
-
-
-
-
Специализация проекта:
-
-
-
-
- - -
-
- {{ form.specialization }} -{# #} -
-
-{# #} -
-
-{# #} -
-
-{# #} -
-
-
-
Бюджет
-
-
-
-
- - +
+
+

Дополнительно

-
- +
+ {#
#} + {#
#} + {# #} + {#

+ добавить файл (до 100 файлов)

#} + {#
#} + {# #} + {#
#} +
    +
  • + Архитерурное 2.jpg + 7мб +
    +
  • +
-
- -

или по договоренности

-
-
-
- -

Сделать для исполнителей обязательным для заполнения поля цена и срок

-
-
-
Способ оплаты
-
-
-
- -

- Безопасная сделка (с резервированием бюджета) -

-

- Текст -

-
-
- -

- Прямая оплата Исполнителю на его кошелек/счет -

-

- Текст -

-
-
-
-
-

Расширенный поиск

- +

Тип работы:

+
+
+ +

Проектирование

+
+ +
+ +

Техническое сопровождение

+
- -
+
+
+
-
Выбор объекта:
-
Наименование:
-
Классификация здания:
-
Вид строительства:
+
Специализация проекта:
+
+
+
-
+ + +
-
- +
- + {# #}
- + {# #}
-
-
Местоположение:
+
+
Бюджет
+
-
-
- +
-
+
-

Требуется допуск СРО

+

или по договоренности

+
+
+
+ +

Сделать для исполнителей обязательным для заполнения поля цена и срок

+
+
+
Способ оплаты
+
+
+
+ +

+ Безопасная сделка (с резервированием бюджета) +

+

+ Текст +

+
+
+ +

+ Прямая оплата Исполнителю на его кошелек/счет +

+

+ Текст +

+
+
+

Расширенный поиск

+ +
+
+
+
+
+
+
+
Выбор объекта:
+
Наименование:
+
Классификация здания:
+
Вид строительства:
+
+
+
+ +
+
+ +
+
+ +
+
+ +
+
+
+
Местоположение:
+
+
+
+ +
+
+ +
+
+ +

Требуется допуск СРО

+
+
- {# #} + {# #} +
-
-
+
- + +{% endblock %} +{% block js_block %} + {% endblock %} diff --git a/projects/templates/projects/project_list.html b/projects/templates/projects/project_list.html index cbe47fe..52c77a2 100644 --- a/projects/templates/projects/project_list.html +++ b/projects/templates/projects/project_list.html @@ -154,7 +154,7 @@

  • - Объект "Карточный домик" + Объект "{{ proj.realty.name }}"
  • 2 ответ от имени группы @@ -165,7 +165,7 @@

    • - 13.02.2016 + {{ proj.created }}
    • 523 diff --git a/projects/views.py b/projects/views.py index bc4ddd2..75c1d9a 100644 --- a/projects/views.py +++ b/projects/views.py @@ -1,7 +1,7 @@ from django.http import HttpResponseForbidden from django.core.urlresolvers import reverse from django.contrib.auth.mixins import PermissionRequiredMixin -from django.views.generic import ListView, DetailView, CreateView, View +from django.views.generic import ListView, DetailView, CreateView, View, TemplateView from django.views.generic.edit import FormMixin from .models import Project, Portfolio @@ -94,13 +94,14 @@ class TestView(View): return render(request, self.template_name, {'form': form, 'second_form': second_form}) def form_valid(self, request, form, second_form): - realty = second_form.save(commit=False) + realty = form.save(commit=False) realty.user = request.user realty.save() - project = form.save(commit=False) + project = second_form.save(commit=False) project.user = request.user project.realty = realty project.save() + return HttpResponseRedirect('/projects/') def form_invalid(self, form, second_form): pass diff --git a/specializations/templates/specializations/specialization.html b/specializations/templates/specializations/specialization.html index 225a1ce..8ae917f 100644 --- a/specializations/templates/specializations/specialization.html +++ b/specializations/templates/specializations/specialization.html @@ -1,13 +1,14 @@ -{% load staticfiles %} - - - - - - - Archilance - - +{% extends '_layout.html' %} +{% block content %} - - +

      Angular setup + +
      +
      + + +
      +
      +{% endblock %} diff --git a/specializations/views.py b/specializations/views.py index adb9039..a8a9f37 100644 --- a/specializations/views.py +++ b/specializations/views.py @@ -7,6 +7,7 @@ from .models import Specialization class SpecListView(ListView): model = Specialization + template_name = 'specializations/specialization.html' def get_context_data(self, **kwargs): context = super(SpecListView, self).get_context_data(**kwargs) diff --git a/templates/base.html b/templates/base.html index 418b85d..8bf0bcc 100644 --- a/templates/base.html +++ b/templates/base.html @@ -27,7 +27,7 @@