parent
1883b0f9da
commit
52bc32bd2a
11 changed files with 331 additions and 28 deletions
@ -0,0 +1,56 @@ |
||||
# -*- coding: utf-8 -*- |
||||
# Generated by Django 1.9.6 on 2016-07-07 10:15 |
||||
from __future__ import unicode_literals |
||||
|
||||
from django.db import migrations, models |
||||
import django.db.models.deletion |
||||
import mptt.fields |
||||
|
||||
|
||||
class Migration(migrations.Migration): |
||||
|
||||
dependencies = [ |
||||
('work_sell', '0008_auto_20160706_1249'), |
||||
] |
||||
|
||||
operations = [ |
||||
migrations.RemoveField( |
||||
model_name='worksell', |
||||
name='budget_by_agreement', |
||||
), |
||||
migrations.AddField( |
||||
model_name='worksell', |
||||
name='currency', |
||||
field=models.CharField(blank=True, choices=[('rur', 'RUR'), ('usd', 'USD'), ('eur', 'EUR')], default='rur', max_length=20, null=True), |
||||
), |
||||
migrations.AlterField( |
||||
model_name='worksell', |
||||
name='budget', |
||||
field=models.DecimalField(blank=True, decimal_places=0, default=0, max_digits=10, null=True), |
||||
), |
||||
migrations.AlterField( |
||||
model_name='worksell', |
||||
name='building_classification', |
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='worksells', to='projects.BuildingClassfication'), |
||||
), |
||||
migrations.AlterField( |
||||
model_name='worksell', |
||||
name='construction_type', |
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='worksells', to='projects.ConstructionType'), |
||||
), |
||||
migrations.AlterField( |
||||
model_name='worksell', |
||||
name='specialization', |
||||
field=mptt.fields.TreeForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='worksells', to='specializations.Specialization'), |
||||
), |
||||
migrations.AlterField( |
||||
model_name='worksell', |
||||
name='term', |
||||
field=models.IntegerField(blank=True, default=0, null=True), |
||||
), |
||||
migrations.AlterField( |
||||
model_name='worksell', |
||||
name='term_type', |
||||
field=models.CharField(blank=True, choices=[('project', 'За проект'), ('hour', 'За час'), ('day', 'За день'), ('month', 'За месяц')], default='hour', max_length=20, null=True), |
||||
), |
||||
] |
||||
@ -0,0 +1,27 @@ |
||||
# -*- coding: utf-8 -*- |
||||
# Generated by Django 1.9.6 on 2016-07-07 11:01 |
||||
from __future__ import unicode_literals |
||||
|
||||
from django.db import migrations, models |
||||
import django.utils.timezone |
||||
import sorl.thumbnail.fields |
||||
|
||||
|
||||
class Migration(migrations.Migration): |
||||
|
||||
dependencies = [ |
||||
('work_sell', '0009_auto_20160707_1315'), |
||||
] |
||||
|
||||
operations = [ |
||||
migrations.AlterField( |
||||
model_name='worksell', |
||||
name='created', |
||||
field=models.DateTimeField(blank=True, default=django.utils.timezone.now, null=True), |
||||
), |
||||
migrations.AlterField( |
||||
model_name='worksell', |
||||
name='img', |
||||
field=sorl.thumbnail.fields.ImageField(blank=True, null=True, upload_to='worksell/worksell'), |
||||
), |
||||
] |
||||
@ -1,4 +1,55 @@ |
||||
<form method="post">{% csrf_token %} |
||||
{{ form.as_p }} |
||||
<input type="submit" value="Save12" /> |
||||
</form> |
||||
{% extends 'partials/base.html' %} |
||||
{% block content %} |
||||
<form method="post" enctype="multipart/form-data">{% csrf_token %} |
||||
|
||||
<div class="col-lg-7"> |
||||
<!-- The fileinput-button span is used to style the file input field as button --> |
||||
<span class="btn btn-success fileinput-button"> |
||||
<i class="glyphicon glyphicon-plus"></i> |
||||
<span>Add files...</span> |
||||
<input type="file" name="files[]" multiple> |
||||
</span> |
||||
</div> |
||||
<input type="submit" value="Save12"/> |
||||
</form> |
||||
{% endblock %} |
||||
|
||||
{% block js_block %} |
||||
|
||||
<script type="text/javascript"> |
||||
|
||||
$(function(){ |
||||
$.ajax({ |
||||
url : '/work_sell/test/', |
||||
|
||||
success:function(data){ |
||||
alert(data); |
||||
console.log(data); |
||||
} |
||||
}); |
||||
}); |
||||
|
||||
{# $(function(){#} |
||||
{# var files;#} |
||||
{# $('input[type=file]').on('change', prepareUpload);#} |
||||
{# $('form').on('submit', uploadFiles);#} |
||||
{##} |
||||
{# function uploadFiles(e){#} |
||||
{# console.log('submit');#} |
||||
{# e.stopPropagation();#} |
||||
{# e.preventDefault();#} |
||||
{# var data = new FormData();#} |
||||
{# $.each(files, function(k,v){#} |
||||
{# console.log(k);#} |
||||
{# console.log(v);#} |
||||
{# data.append(k, v);#} |
||||
{# });#} |
||||
{# console.log(data);#} |
||||
{# }#} |
||||
{# function prepareUpload(e){#} |
||||
{# files = e.target.files;#} |
||||
{# }#} |
||||
{##} |
||||
{# });#} |
||||
</script> |
||||
{% endblock %} |
||||
|
||||
@ -0,0 +1,102 @@ |
||||
{% extends 'partials/base.html' %} |
||||
|
||||
{% load common_tags %} |
||||
|
||||
{% block content %} |
||||
{% include 'partials/header.html' %} |
||||
|
||||
<div class="container mainScore"> |
||||
<div class="row"> |
||||
<div class="col-lg-12 allProjects"> |
||||
<p class="titleScore">Изменение готового проекта</p> |
||||
</div> |
||||
|
||||
<form method="post" id="worksell-add-form">{% csrf_token %} |
||||
<div class="textAreaBlock2 text-nn box-sizing disTab"> |
||||
<p>Название заказа <span style="color: red">{{ form.name.errors.as_text }}</span></p> |
||||
<input type="text" class="box-sizing" name="{{ form.name.html_name }}" |
||||
value="{{ form.name.value }}"> |
||||
</div> |
||||
|
||||
<div class="textAreaBlock2 text-nn box-sizing disTab"> |
||||
<p>Подробно опишите задание <span style="color: red">{{ form.description.errors.as_text }}</span></p> |
||||
<textarea name="{{ form.description.html_name }}" id="text-new">{{ form.description.value }}</textarea> |
||||
</div> |
||||
|
||||
<div class="textAreaBlock2 text-nn box-sizing disTab"> |
||||
<p>Специализации</p> |
||||
</div> |
||||
|
||||
<div class="col-lg-3"> |
||||
<input type='hidden' class="-spec-select -spec-select-level-1" style="width: 100%"> |
||||
</div> |
||||
|
||||
<div class="col-lg-3"> |
||||
<input type='hidden' class="-spec-select -spec-select-level-2" style="width: 100%"> |
||||
</div> |
||||
|
||||
<div class="col-lg-3"> |
||||
<input type='hidden' class="-spec-select -spec-select-level-3" style="width: 100%"> |
||||
</div> |
||||
|
||||
<div class="col-lg-3"> |
||||
<input type='hidden' class="-spec-select -spec-select-level-4" style="width: 100%"> |
||||
</div> |
||||
|
||||
<input type="hidden" id="chosenSpecId" name="{{ form.specialization.html_name }}" |
||||
value="{{ form.specialization.value }}"> |
||||
|
||||
|
||||
<div class="textAreaBlock2 text-nn box-sizing disTab"> |
||||
<p>Бюджет{{ form.budget.errors.as_text }}</p> |
||||
<div class="row"> |
||||
<div class="col-lg-8"> |
||||
<input type="text" class="box-sizing" name="{{ form.budget.html_name }}" value="{{ form.budget.value }}"> |
||||
</div> |
||||
<div class="col-lg-4"> |
||||
{{ form.currency}} |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
<div class="textAreaBlock2 text-nn box-sizing disTab"> |
||||
<p>Срок выполнения{{ form.budget.errors.as_text }}</p> |
||||
<div class="row"> |
||||
<div class="col-lg-8"> |
||||
<input type="text" class="box-sizing" name="{{ form.budget.html_name }}" value="{{ form.budget.value }}"> |
||||
</div> |
||||
<div class="col-lg-4"> |
||||
{{ form.term_type }} |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
<div class="textAreaBlock2 text-nn box-sizing disTab"> |
||||
</div> |
||||
<div class="polsF1 polsF2 disTab"> |
||||
<p>Вид строительства</p> |
||||
{{ form.construction_type}} |
||||
</div> |
||||
|
||||
<div class="polsF1 polsF2 disTab"> |
||||
<p>Классификация здания</p> |
||||
{{ form.building_classification}} |
||||
</div> |
||||
|
||||
<div class="textAreaBlock2 text-nn box-sizing disTab"> |
||||
<input type="text" name="{{ form.contractor.html_name }}" value="{{ form.contractor.value }}" /> |
||||
</div> |
||||
|
||||
<div class="textAreaBlock2 text-nn box-sizing disTab"> |
||||
<input type="file" name="{{ form.img.html_name }}" > |
||||
</div> |
||||
|
||||
<div class="searchF1 polsF1 polsFF links-filter"> |
||||
<input class="btn-submit-link" type="submit" value="Сохранить проект"> |
||||
</div> |
||||
|
||||
</form> |
||||
{% include 'partials/footer.html' %} |
||||
</div> |
||||
</div> |
||||
{% endblock %} |
||||
Loading…
Reference in new issue