remotes/origin/PR-39
shishman 10 years ago
commit 6c37c97850
  1. 1
      projects/forms.py
  2. 19
      projects/migrations/0013_auto_20160819_1735.py
  3. 2
      projects/views.py
  4. 1
      ratings/templatetags/specializtions_tags.py
  5. 21
      users/migrations/0011_auto_20160819_1735.py
  6. 4
      users/models.py
  7. 1
      users/templates/contractor_profile.html
  8. 4
      users/templates/portfolio_create_form.html
  9. 2
      users/templatetags/user_tags.py

@ -151,6 +151,7 @@ class RealtyForm(forms.ModelForm):
class PortfolioForm(forms.ModelForm):
duplicate = forms.BooleanField(required=False,label='Some label here')
images_ids = forms.CharField(required=True)
class Meta:
model = Portfolio

@ -0,0 +1,19 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-08-19 14:35
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('projects', '0012_project_rejected_answers_count'),
]
operations = [
migrations.AlterModelOptions(
name='answermessage',
options={'ordering': ['created'], 'verbose_name': 'Отклики на проекты -- переписка', 'verbose_name_plural': 'Отклики на проекты -- переписки'},
),
]

@ -656,7 +656,7 @@ def contractor_portfolio_create(request):
work_sell.contractor = instance.user
work_sell.save()
images_ids = request.POST.get('images-ids').split(';')[:-1]
images_ids = request.POST.get('images_ids').split(';')[:-1]
for pk in images_ids:
picture = Picture.objects.get(pk=pk)
temp_file = ContentFile(picture.file.read())

@ -15,6 +15,7 @@ def specialization_widget(context, user_id, class_name=None):
'user_id': user_id,
}
@register.inclusion_tag('templatetags/specializations_widget.html', takes_context=True)
def specialization_team_widget(context, team_id):
team_id = int(team_id)

@ -0,0 +1,21 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-08-19 14:35
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0010_auto_20160818_2131'),
]
operations = [
migrations.AlterField(
model_name='contractorresume',
name='text',
field=models.TextField(blank=True, default=''),
preserve_default=False,
),
]

@ -81,10 +81,10 @@ class UserFinancialInfo(models.Model):
class ContractorResume(models.Model):
resume_file = models.FileField(upload_to='users/resume/files/', null=True, blank=True)
text = models.TextField(null=True, blank=True)
text = models.TextField(blank=True)
def __str__(self):
return self.text
return str(self.pk)
class Meta:
verbose_name = 'Резюме'

@ -604,6 +604,7 @@
});
location.reload();
} else if (data.status == 'no') {
$.each(data.form_errors, function (k, v) {
$('.error-' + k).html(v).show();
});

@ -98,7 +98,7 @@
</div>
<input type="hidden" name="{{ portfolio_form.user.html_name }}" value="{{ request.user.pk }}"/>
<input type="hidden" name="images-ids" id="upload-files-pk"/>
<input type="hidden" name="{{ portfolio_form.images_ids.html_name }}" id="upload-files-pk"/>
</div>
</div>
@ -106,6 +106,8 @@
<!-- The fileinput-button span is used to style the file input field as button -->
<div class="textAreaBlock2 polsF1 text-nn box-sizing disTab" style="margin-bottom: 12px;">
<span style="color: red; margin-left:8px; font-size: 12px;"
class="error-{{ portfolio_form.images_ids.html_name }}">{{ portfolio_form.images_ids.errors.as_text }}</span>
<span class="btn btn-success fileinput-button add_file_to_port">
<span>Выберите файлы</span>
<input id="fileupload" type="file" name="file" multiple value="">

@ -2,6 +2,8 @@ from django import template
register = template.Library()
@register.filter('has_group')
def has_group(user, group_name):
groups = user.groups.all().values_list('name', flat=True)

Loading…
Cancel
Save