diff --git a/archilance/settings/dev.py b/archilance/settings/dev.py index e4e0860..9488b9b 100644 --- a/archilance/settings/dev.py +++ b/archilance/settings/dev.py @@ -2,6 +2,8 @@ from .base import * AUTH_PASSWORD_VALIDATORS = [] +INSTALLED_APPS += ['debug_toolbar',] + try: from .local import * except ImportError: diff --git a/projects/templates/contractor_project_detail.html b/projects/templates/contractor_project_detail.html index 2a5ba55..29d058e 100644 --- a/projects/templates/contractor_project_detail.html +++ b/projects/templates/contractor_project_detail.html @@ -69,13 +69,13 @@
@@ -91,9 +91,8 @@
@@ -149,6 +148,18 @@
+ +
+
+
+ {% for p in user.portfolio.all %} +

{{ p }}

+ {% endfor %} +
+
+
+
+
diff --git a/projects/views.py b/projects/views.py index cf83e7b..4ee296e 100644 --- a/projects/views.py +++ b/projects/views.py @@ -17,7 +17,6 @@ class ProjectsView(ListView): def get_context_data(self, **kwargs): context = super().get_context_data(**kwargs) - return context @@ -58,6 +57,8 @@ class ProjectCreateView(PermissionRequiredMixin, View): permission_required = ('projects.add_project',) form_realty = RealtyForm form_project = ProjectForm + raise_exception = True + permission_denied_message = 'Вы не можете выполнить это действие' template_name = 'customer_project_create.html' def get(self, request, *args, **kwargs): diff --git a/templates/home.html b/templates/home.html index f6a96a0..1f9074f 100644 --- a/templates/home.html +++ b/templates/home.html @@ -20,10 +20,10 @@
- Я исполнитель + Я исполнитель

- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean euismod bibendum laoreet. Proin gravida dolor sit amet lacus accumsan et viverra justo commodo. -

+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. +

@@ -31,10 +31,10 @@
- Я заказчик + Я заказчик

- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean euismod bibendum laoreet. Proin gravida dolor sit amet lacus accumsan et viverra justo commodo. -

+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. +

diff --git a/templates/registration/login.html b/templates/registration/login.html index f94e158..88aeb7b 100644 --- a/templates/registration/login.html +++ b/templates/registration/login.html @@ -20,3 +20,4 @@
{% endblock %} +a diff --git a/templates/registration/logout.html b/templates/registration/logout.html new file mode 100644 index 0000000..7899492 --- /dev/null +++ b/templates/registration/logout.html @@ -0,0 +1,7 @@ +{% extends 'partials/base.html' %} + +{% block content %} +
+

Выход

+
+{% endblock %} diff --git a/templates/registration/registration_complete.html b/templates/registration/registration_complete.html new file mode 100644 index 0000000..39bfc69 --- /dev/null +++ b/templates/registration/registration_complete.html @@ -0,0 +1,7 @@ +{% extends 'partials/base.html' %} + +{% block content %} +
+

Регистрация прошла успешно

+
+{% endblock %} diff --git a/templates/registration/registration_form.html b/templates/registration/registration_form.html index 109486b..e23d5c0 100644 --- a/templates/registration/registration_form.html +++ b/templates/registration/registration_form.html @@ -1,23 +1,27 @@ {% extends 'partials/base.html' %} - {% block content %}
-

Регистрация

+

Регистрация

{% csrf_token %} + {{ form.errors }}
- + {% if request.GET.type == 'customer' %} + + {% else %} + + {% endif %}
- + +
+ +
+
diff --git a/users/__init__.py b/users/__init__.py index e69de29..208620c 100644 --- a/users/__init__.py +++ b/users/__init__.py @@ -0,0 +1 @@ +default_app_config = 'users.apps.UsersConfig' diff --git a/users/apps.py b/users/apps.py index 4ce1fab..b8d67f1 100644 --- a/users/apps.py +++ b/users/apps.py @@ -3,3 +3,6 @@ from django.apps import AppConfig class UsersConfig(AppConfig): name = 'users' + + def ready(self): + import users.signals diff --git a/users/signals.py b/users/signals.py new file mode 100644 index 0000000..5ff9b35 --- /dev/null +++ b/users/signals.py @@ -0,0 +1,14 @@ +from django.dispatch import receiver +from django.contrib.auth.models import Group +from registration.signals import user_registered + + +@receiver(user_registered) +def user_registered_callback(sender, user, request, **kwargs): + # import code; code.interact(local=dict(globals(), **locals())) + group_name = request.POST['group_id'] or None + g = Group.objects.get(name=group_name) + g.user_set.add(user) + + + diff --git a/users/templates/contractor_profile.html b/users/templates/contractor_profile.html index af379d0..361cfaf 100644 --- a/users/templates/contractor_profile.html +++ b/users/templates/contractor_profile.html @@ -147,6 +147,7 @@
{% endfor %} +
@@ -190,34 +191,7 @@
- -
-
-
-
-
-
-
- 35 000 -
-
-
-
-

- Визуализация - загородного - дома 1500m2 -

-
-
- -
-
- -
-
-
-
+
diff --git a/users/templates/users/login.html b/users/templates/users/login.html deleted file mode 100644 index cf8fe80..0000000 --- a/users/templates/users/login.html +++ /dev/null @@ -1,36 +0,0 @@ -{% extends 'partials/base.html' %} -{% block content %} - -
-
-
- - -
-
-
Вход
- - {% csrf_token %} - -
- -

{{ form.email.errors.as_text }}

-
- -
- -

{{ form.password1.errors.as_text }}

-
- -
- -
- - - -
-
- -{% endblock %} diff --git a/users/templates/users_list.html b/users/templates/users_list.html index b521206..5ac143e 100644 --- a/users/templates/users_list.html +++ b/users/templates/users_list.html @@ -8,52 +8,14 @@ - - - - - - - + {% for user in users %} - + - - - - - - {% endfor %}
КандидатЦенаСрокОписаниеРейтинги/отзывыБезопасные сделкиРешение
1{{ forloop.counter }} {{ user.get_full_name }} 35 000 - 3
недели -
- - -
    -
  • 23 560
  • -
  • - +385 - 0 - - 0 -
  • -
  • - СРО -
  • -
-
- 5
- Готов работать по безопасной сделке -
-
-
-
-
-
-
-