From 1932b4840832059bdcbf3028558c205c5c5e4d48 Mon Sep 17 00:00:00 2001 From: ArturBaybulatov Date: Mon, 29 Aug 2016 22:31:03 +0300 Subject: [PATCH] Fixes --- common/migrations/0010_tooltip_position.py | 20 +++ common/models.py | 8 + common/templatetags/common_tags.py | 7 + .../templates/customer_project_create.html | 26 +-- users/templates/contractor_profile.html | 162 ++++++++++++++---- .../partials/customer_profile_info_block.html | 18 +- 6 files changed, 186 insertions(+), 55 deletions(-) create mode 100644 common/migrations/0010_tooltip_position.py diff --git a/common/migrations/0010_tooltip_position.py b/common/migrations/0010_tooltip_position.py new file mode 100644 index 0000000..fdaf774 --- /dev/null +++ b/common/migrations/0010_tooltip_position.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.7 on 2016-08-29 19:24 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('common', '0009_merge'), + ] + + operations = [ + migrations.AddField( + model_name='tooltip', + name='position', + field=models.CharField(choices=[('left', 'Слева'), ('right', 'Справа'), ('top', 'Сверху'), ('bottom', 'Снизу')], default='top', max_length=255), + ), + ] diff --git a/common/models.py b/common/models.py index 04ecdbd..43b73dc 100644 --- a/common/models.py +++ b/common/models.py @@ -86,9 +86,17 @@ class PrintDocuments(models.Model): class Tooltip(models.Model): + POSITIONS = ( + ('left', 'Слева'), + ('right', 'Справа'), + ('top', 'Сверху'), + ('bottom', 'Снизу'), + ) + name = models.CharField(max_length=255, unique=True) text = models.TextField(blank=True) example = models.TextField(blank=True) + position = models.CharField(max_length=255, choices=POSITIONS, default='top') class Meta: verbose_name = 'Подсказка' diff --git a/common/templatetags/common_tags.py b/common/templatetags/common_tags.py index b418eea..03fd88c 100644 --- a/common/templatetags/common_tags.py +++ b/common/templatetags/common_tags.py @@ -100,4 +100,11 @@ def tooltip(**kwargs): return tooltip.text +@register.simple_tag +def tooltip_placement(**kwargs): + tooltip = util.get_or_none(Tooltip, **kwargs) + + if tooltip: + return tooltip.position + # import code; code.interact(local=dict(globals(), **locals())) diff --git a/projects/templates/customer_project_create.html b/projects/templates/customer_project_create.html index 95e6024..e8d6c62 100644 --- a/projects/templates/customer_project_create.html +++ b/projects/templates/customer_project_create.html @@ -24,12 +24,12 @@
{{ form.non_field_errors }}
{% endif %} -
+

Название заказа {{ form.name.errors.as_text }}

-
+

Подробно опишите задание {{ form.text.errors.as_text }}

@@ -53,7 +53,7 @@

Тип работы {{ form.work_type.errors.as_text }}

-
+
{% for id, text in form.work_type.field.choices %}
-
+
@@ -107,14 +107,14 @@
-
+
{{ form.currency }}
{{ form.term_type }}
-
+
-
+
-
+
Местоположение {{ realty_form.location.errors.as_text }}
-
+
@@ -271,7 +271,7 @@ -
+

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

diff --git a/users/templates/contractor_profile.html b/users/templates/contractor_profile.html index faa9a36..b77f795 100644 --- a/users/templates/contractor_profile.html +++ b/users/templates/contractor_profile.html @@ -165,42 +165,60 @@ {% endif %}
- {% for p in contractor.portfolios.all %} -
-
- {% thumbnail p.get_cover "224x224" crop="center" as im %} -
-
-
- {% endthumbnail %} -
-
- {{ p }} - {% if request.user.pk == contractor.pk %} -
- -
- + {% if False %} + {% for p in contractor.portfolios.all %} +
+ + +
+ {{ p }} + + {% if request.user.pk == contractor.pk %} +
+ +
+ +
+
+
+
+ {% csrf_token %} + + +
- -
-
- {% csrf_token %} - - -
-
- {% endif %} + {% endif %} +
-
- {% empty %} -
-

Работ в портфолио пока нет

-
- {% endfor %} - + {% empty %} +
+

Работ в портфолио пока нет

+
+ {% endfor %} + {% endif %} + + +
@@ -793,4 +811,82 @@ return (/^(GET|HEAD|OPTIONS|TRACE)$/.test(method)); } + + + + + + {% endblock %} diff --git a/users/templates/partials/customer_profile_info_block.html b/users/templates/partials/customer_profile_info_block.html index e2a2769..b563a4b 100644 --- a/users/templates/partials/customer_profile_info_block.html +++ b/users/templates/partials/customer_profile_info_block.html @@ -46,21 +46,21 @@