From c25343f8a6b0639652071874f932447bec69c59a Mon Sep 17 00:00:00 2001 From: ArturBaybulatov Date: Tue, 14 Jun 2016 10:40:22 +0300 Subject: [PATCH] #ARC-11 --- assets/css/dev-colors.css | 16 ++++ projects/models.py | 4 +- templates/partials/base.html | 1 + .../customer_profile_current_projects.html | 74 ++----------------- .../customer_profile_open_projects.html | 73 +----------------- users/templates/customer_profile_reviews.html | 15 ++++ ...=> customer_profile_trashed_projects.html} | 63 +--------------- .../partials/customer_profile_info_block.html | 69 +++++++++++++++++ users/templates/tmp.html | 15 ++++ users/templatetags/user_tags.py | 6 +- users/urls.py | 4 +- users/views.py | 4 +- 12 files changed, 140 insertions(+), 204 deletions(-) create mode 100755 assets/css/dev-colors.css create mode 100644 users/templates/customer_profile_reviews.html rename users/templates/{customer_profile_deleted_projects.html => customer_profile_trashed_projects.html} (79%) create mode 100644 users/templates/partials/customer_profile_info_block.html create mode 100644 users/templates/tmp.html diff --git a/assets/css/dev-colors.css b/assets/css/dev-colors.css new file mode 100755 index 0000000..4b9b371 --- /dev/null +++ b/assets/css/dev-colors.css @@ -0,0 +1,16 @@ +.a {background-color: #ffbfbf !important} .b {background-color: #ffe1bf !important} +.c {background-color: #fbffbf !important} .d {background-color: #bfffc8 !important} +.e {background-color: #bff2ff !important} .f {background-color: #bfd0ff !important} +.g {background-color: #d0bfff !important} .h {background-color: #ffbfea !important} +.i {background-color: #ff8080 !important} .j {background-color: #ffc480 !important} +.k {background-color: #f6ff80 !important} .l {background-color: #b2ff80 !important} +.m {background-color: #80a2ff !important} .n {background-color: #a280ff !important} +.o {background-color: #ff80d5 !important} .p {background-color: #ff4040 !important} +.q {background-color: #40ff59 !important} .r {background-color: #40ffbf !important} +.s {background-color: #40d9ff !important} .t {background-color: #7340ff !important} +.u {background-color: #d940ff !important} .v {background-color: #ff8800 !important} +.w {background-color: #eeff00 !important} .x {background-color: #ff00aa !important} +.y {background-color: #999999 !important} .z {background-color: #997373 !important} + +.-borders {border: 1px solid red} +.-underline {text-decoration: underline} diff --git a/projects/models.py b/projects/models.py index 9327e66..2f24027 100644 --- a/projects/models.py +++ b/projects/models.py @@ -92,8 +92,8 @@ class Project(models.Model): STATES = ( ('active', 'Активный'), - ('trash', 'В корзине'), - ('delete', 'Удален'), + ('trashed', 'В корзине'), + ('deleted', 'Удален'), ) budget = models.DecimalField(max_digits=10, decimal_places=0) diff --git a/templates/partials/base.html b/templates/partials/base.html index 145a00b..3e629f1 100644 --- a/templates/partials/base.html +++ b/templates/partials/base.html @@ -18,6 +18,7 @@ + diff --git a/users/templates/customer_profile_current_projects.html b/users/templates/customer_profile_current_projects.html index 977f259..0fe6fb8 100644 --- a/users/templates/customer_profile_current_projects.html +++ b/users/templates/customer_profile_current_projects.html @@ -1,77 +1,17 @@ {% extends 'partials/base.html' %} +{% load user_tags %} + {% block content %} {% include 'partials/header.html' %}
-
-
-
-
- profile-image -
-
-
-
-
-

- {{ object.get_full_name }} [ivanov_petr] -

- -

Россия, Москва

- -
- - - - -
-
-
- -
-
-
+ {% include 'partials/customer_profile_info_block.html' %} + +

Current projects will be here

+ + {% include 'partials/footer.html' %}
{% endblock %} diff --git a/users/templates/customer_profile_open_projects.html b/users/templates/customer_profile_open_projects.html index 3e47141..b3ba965 100644 --- a/users/templates/customer_profile_open_projects.html +++ b/users/templates/customer_profile_open_projects.html @@ -5,75 +5,8 @@
-
-
-
-
- profile-image -
-
-
- -
-
-

- {{ object.get_full_name }} [ivanov_petr] -

- -

Россия, Москва

- -
- - - - -
- -
-
- -
-
-
+ {% include 'partials/customer_profile_info_block.html' %} +
@@ -81,7 +14,7 @@ 2 / 35 - + Корзина 7 diff --git a/users/templates/customer_profile_reviews.html b/users/templates/customer_profile_reviews.html new file mode 100644 index 0000000..eba585e --- /dev/null +++ b/users/templates/customer_profile_reviews.html @@ -0,0 +1,15 @@ +{% extends 'partials/base.html' %} + +{% block content %} + {% include 'partials/header.html' %} + +
+
+ {% include 'partials/customer_profile_info_block.html' %} + +

Reviews will be here

+ + {% include 'partials/footer.html' %} +
+
+{% endblock %} diff --git a/users/templates/customer_profile_deleted_projects.html b/users/templates/customer_profile_trashed_projects.html similarity index 79% rename from users/templates/customer_profile_deleted_projects.html rename to users/templates/customer_profile_trashed_projects.html index f93ebe4..3595531 100644 --- a/users/templates/customer_profile_deleted_projects.html +++ b/users/templates/customer_profile_trashed_projects.html @@ -5,65 +5,8 @@
-
-
-
-
- profile-image -
-
-
-
-
-

- {{ object.get_full_name }} [ivanov_petr] -

-

Россия, Москва

- -
- - -
-
-
- -
-
-
+ {% include 'partials/customer_profile_info_block.html' %} +
@@ -71,7 +14,7 @@ 2 / 35 - + Корзина 7 diff --git a/users/templates/partials/customer_profile_info_block.html b/users/templates/partials/customer_profile_info_block.html new file mode 100644 index 0000000..05b0e12 --- /dev/null +++ b/users/templates/partials/customer_profile_info_block.html @@ -0,0 +1,69 @@ +
+
+
+
+ profile-image +
+
+
+ +
+
+

+ {{ object.get_full_name }} [ivanov_petr] +

+ +

Россия, Москва

+ +
+ + + + +
+ +
+
+ +
+
+
diff --git a/users/templates/tmp.html b/users/templates/tmp.html new file mode 100644 index 0000000..bb85a66 --- /dev/null +++ b/users/templates/tmp.html @@ -0,0 +1,15 @@ +{% extends 'partials/base.html' %} + +{% block content %} + {% include 'partials/header.html' %} + +
+
+ {% include 'partials/customer_profile_info_block.html' %} + +

Hello there

+ + {% include 'partials/footer.html' %} +
+
+{% endblock %} diff --git a/users/templatetags/user_tags.py b/users/templatetags/user_tags.py index 95a95ad..3bae815 100644 --- a/users/templatetags/user_tags.py +++ b/users/templatetags/user_tags.py @@ -5,4 +5,8 @@ register = template.Library() @register.filter('has_group') def has_group(user, group_name): groups = user.groups.all().values_list('name', flat=True) - return True if group_name in groups else False \ No newline at end of file + return True if group_name in groups else False + +@register.simple_tag +def test(): + return 'Hello there' diff --git a/users/urls.py b/users/urls.py index a39029f..ab74007 100755 --- a/users/urls.py +++ b/users/urls.py @@ -3,7 +3,7 @@ from django.contrib.auth.views import login, logout from .views import ( ContractorListView, ContractorOfficeDetailView, ContractorProfileDetailView, - CustomerProfileCurrentProjectsView, CustomerProfileDeletedProjectsView, CustomerProfileOpenProjectsView, + CustomerProfileCurrentProjectsView, CustomerProfileTrashedProjectsView, CustomerProfileOpenProjectsView, CustomerProfileReviewsView, UserDetailView, UserInfoListView, UserListView, UserView, ) @@ -12,7 +12,7 @@ app_name = 'users' urlpatterns = [ urls.url(r'^customers/(?P\d+)/$', CustomerProfileOpenProjectsView.as_view(), name='customer-profile-open-projects'), - urls.url(r'^customers/(?P\d+)/deleted-projects/$', CustomerProfileDeletedProjectsView.as_view(), name='customer-profile-deleted-projects'), + urls.url(r'^customers/(?P\d+)/trashed-projects/$', CustomerProfileTrashedProjectsView.as_view(), name='customer-profile-trashed-projects'), urls.url(r'^customers/(?P\d+)/current-projects/$', CustomerProfileCurrentProjectsView.as_view(), name='customer-profile-current-projects'), urls.url(r'^customers/(?P\d+)/reviews/$', CustomerProfileReviewsView.as_view(), name='customer-profile-reviews'), diff --git a/users/views.py b/users/views.py index 9270960..7adde0e 100644 --- a/users/views.py +++ b/users/views.py @@ -75,9 +75,9 @@ class CustomerProfileOpenProjectsView(TemplateView): template_name = 'customer_profile_open_projects.html' -class CustomerProfileDeletedProjectsView(TemplateView): +class CustomerProfileTrashedProjectsView(TemplateView): model = User - template_name = 'customer_profile_deleted_projects.html' + template_name = 'customer_profile_trashed_projects.html' class CustomerProfileCurrentProjectsView(TemplateView):