diff --git a/archilance/settings/prod.py b/archilance/settings/prod.py index 42e5eac..f80dd39 100644 --- a/archilance/settings/prod.py +++ b/archilance/settings/prod.py @@ -1,3 +1,18 @@ from .base import * -DEBUG = False + +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.postgresql_psycopg2', + 'NAME': 'archilance', + 'USER': 'postgres', + 'PASSWORD': 'vfhbyrf', + 'HOST': 'localhost', + 'PORT': '', + } +} + + +DEBUG = True +TEMPLATE_DEBUG = True +SECRET_KEY = 'vb6@b9zj7^f!^+x*e8=e!oundyu1!e*&0i(3gu2xwo4%fx4h&n' \ No newline at end of file diff --git a/assets/css/main.css b/assets/css/main.css index d3f2763..7e2b3f7 100644 --- a/assets/css/main.css +++ b/assets/css/main.css @@ -412,7 +412,7 @@ ul li { width: 100%; background-color: #F2F2F2; position: relative; - margin-bottom: 140px; + /*margin-bottom: 140px;*/ } .scoreButtons > p { @@ -541,6 +541,8 @@ footer { width: 100%; position: relative; background-color: #F7F7F7; + margin-top: 80px; + float: left; } footer:after { @@ -1048,7 +1050,7 @@ footer:after { .pagin { text-align: center; - margin: 30px 0 30px 0; + margin: 30px 0 0px 0; } .pagin nav { @@ -1650,10 +1652,11 @@ input[type="checkbox"]:checked + span { .menuUser ul { float: left; + width: 100%; } .menuUser ul li { - width: 101%; + width: 100%; margin-top: 1px; position: relative; background-color: #F1F1F1; @@ -3262,7 +3265,7 @@ input[type="checkbox"]:checked + span { width: 100%; border-top: 1px solid #DADADA; border-bottom: 1px solid #DADADA; - margin: 18px 0 80px; 0; + margin: 18px 0 0px 0; float: left; } @@ -4346,7 +4349,7 @@ input[type="checkbox"]:checked + span { width: 100%; float: left; margin: 0 0 80px 0; - padding: 67px 0 15px 0; + padding: 67px 0 0 0; background-color: #ddd; text-align: center; } @@ -5703,4 +5706,30 @@ input[type="radio"]:checked + span { #order-stages > div:nth-last-child(2), #order-stages > div:last-child{ border: none; } +.linkSort button{ + font-size: 14px; + font-family: 'Arial-MT-Regular', sans-serif; + float: left; + color: #6b6b6b; + padding: 11px 23px; + border-radius: 40px; + margin-right: 6px; + border: 1px solid #c2c2c2; + background-color: #fff; +} +.linkSort button:after{ + content: "\e252"; + font-family: 'Glyphicons Halflings'; + position: relative; + right: -5px; + top: 3px; + font-style: normal; + font-weight: normal; + line-height: 1; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} +.linkSort button:focus{ + outline: none; +} /*end_new*/ \ No newline at end of file diff --git a/projects/templates/comparison.html b/projects/templates/comparison.html index 1181df2..8e4b07e 100644 --- a/projects/templates/comparison.html +++ b/projects/templates/comparison.html @@ -68,15 +68,18 @@
-
- -
+
+
- -
+
+
+
+ {% csrf_token %} +
+
diff --git a/projects/templates/project_detail.html b/projects/templates/project_detail.html index 4f1072a..bfb462e 100644 --- a/projects/templates/project_detail.html +++ b/projects/templates/project_detail.html @@ -480,22 +480,15 @@
-

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

+

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

- - - - - - - +

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

- - + {% for answer in project.answers.all %}
diff --git a/projects/urls.py b/projects/urls.py index 361a811..9044f0e 100644 --- a/projects/urls.py +++ b/projects/urls.py @@ -20,6 +20,7 @@ from .views import ( ProjectDetailWithAnswerView, ProjectFilterView, sort_candidates, + CandidateDeleteView, ) app_name = 'projects' @@ -44,6 +45,7 @@ urlpatterns = [ urls.url(r'^portfolio/(?P\d+)/edit/$', ContractorPortfolioUpdateView.as_view(), name='contractor-portfolio-edit'), urls.url(r'^candidate/add/(?P(\d+))/(?P(\d+))/$', add_candidate, name='add-candidate'), + urls.url(r'^candidate/delete/(?P(\d+))/$', CandidateDeleteView.as_view(), name='delete-candidate'), urls.url(r'^candidate/comparison/sort/$', sort_candidates, name='comparison-sort'), urls.url(r'^candidate/comparison/(?P\d+)/$', ProjectComparisonView.as_view(), name='comparison'), diff --git a/projects/views.py b/projects/views.py index aec829c..9aa48fb 100644 --- a/projects/views.py +++ b/projects/views.py @@ -592,10 +592,21 @@ class ProjectComparisonView(DetailView): def add_candidate(request, answer_id, project_id): answer = Answer.objects.get(pk=answer_id) project = Project.objects.get(pk=project_id) - candidate = Candidate.objects.create(answer=answer, project=project) + count_answers = Candidate.objects.filter(project=project).count() + count_answers += 1 + candidate = Candidate.objects.create(answer=answer, project=project, position=count_answers) return HttpResponseRedirect(reverse('projects:detail', args=[project_id])) +class CandidateDeleteView(DeleteView): + model = Candidate + + def get_success_url(self): + return reverse('projects:comparison', kwargs={'pk': self.object.project_id}) + + def get(self, *args, **kwargs): + return self.post(*args, **kwargs) + def sort_candidates(request): if request.is_ajax(): items = request.POST.getlist('items[]') diff --git a/update.sh b/update.sh new file mode 100644 index 0000000..dc25eff --- /dev/null +++ b/update.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +source ../env/bin/activate && +git reset --hard && +git pull && +./manage.py migrate --noinput && +./manage.py collectstatic --noinput && +supervisorctl restart arch \ No newline at end of file diff --git a/users/templates/portfolio_create_form.html b/users/templates/portfolio_create_form.html index 540351c..557c16d 100644 --- a/users/templates/portfolio_create_form.html +++ b/users/templates/portfolio_create_form.html @@ -3,115 +3,125 @@
{% csrf_token %}
-

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

+

Название{{ portfolio_form.name.errors.as_text }} +

-

Описание{{ portfolio_form.description.errors.as_text }}

- +

Описание{{ portfolio_form.description.errors.as_text }} +

+

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

-
+
-
- -
+
+ +
-
- -
+
+ +
-
- -
+
+ +
-
- -
-
- + +
+
+ -
+
-

Бюджет{{ portfolio_form.budget.errors.as_text }}

+

Бюджет{{ portfolio_form.budget.errors.as_text }}

- +
- {{ portfolio_form.currency}} + {{ portfolio_form.currency }}
-
+
-

Срок выполнения{{ portfolio_form.budget.errors.as_text }}

+

Срок выполнения{{ portfolio_form.budget.errors.as_text }}

- +
{{ portfolio_form.term_type }}
-
+