Изменение model WorkSell Форма создания готовых проектов законченаremotes/origin/PR-49
parent
0b8c803dad
commit
96745cc2fa
31 changed files with 3020 additions and 254 deletions
|
After Width: | Height: | Size: 2.9 KiB |
|
After Width: | Height: | Size: 23 KiB |
@ -0,0 +1,212 @@ |
||||
/******/ (function(modules) { // webpackBootstrap
|
||||
/******/ // The module cache
|
||||
/******/ var installedModules = {}; |
||||
|
||||
/******/ // The require function
|
||||
/******/ function __webpack_require__(moduleId) { |
||||
|
||||
/******/ // Check if module is in cache
|
||||
/******/ if(installedModules[moduleId]) |
||||
/******/ return installedModules[moduleId].exports; |
||||
|
||||
/******/ // Create a new module (and put it into the cache)
|
||||
/******/ var module = installedModules[moduleId] = { |
||||
/******/ exports: {}, |
||||
/******/ id: moduleId, |
||||
/******/ loaded: false |
||||
/******/ }; |
||||
|
||||
/******/ // Execute the module function
|
||||
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); |
||||
|
||||
/******/ // Flag the module as loaded
|
||||
/******/ module.loaded = true; |
||||
|
||||
/******/ // Return the exports of the module
|
||||
/******/ return module.exports; |
||||
/******/ } |
||||
|
||||
|
||||
/******/ // expose the modules object (__webpack_modules__)
|
||||
/******/ __webpack_require__.m = modules; |
||||
|
||||
/******/ // expose the module cache
|
||||
/******/ __webpack_require__.c = installedModules; |
||||
|
||||
/******/ // __webpack_public_path__
|
||||
/******/ __webpack_require__.p = ""; |
||||
|
||||
/******/ // Load entry module and return exports
|
||||
/******/ return __webpack_require__(0); |
||||
/******/ }) |
||||
/************************************************************************/ |
||||
/******/ ([ |
||||
/* 0 */ |
||||
/***/ function(module, exports, __webpack_require__) { |
||||
|
||||
'use strict'; |
||||
|
||||
var _file_upload = __webpack_require__(1); |
||||
|
||||
var _image_upload = __webpack_require__(8); |
||||
|
||||
$(function () { |
||||
// fileUploadInit();
|
||||
(0, _image_upload.imageUploadInit)(); |
||||
}); |
||||
|
||||
/***/ }, |
||||
/* 1 */ |
||||
/***/ function(module, exports, __webpack_require__) { |
||||
|
||||
'use strict'; |
||||
|
||||
Object.defineProperty(exports, "__esModule", { |
||||
value: true |
||||
}); |
||||
exports.fileUploadInit = undefined; |
||||
|
||||
var _utils = __webpack_require__(2); |
||||
|
||||
function fileUploadInit() { |
||||
var $fileUploadContainer = $('#fileUploadContainer'); |
||||
|
||||
$('#fileUploadAddBtn').on('click', function ($evt) { |
||||
$fileUploadContainer.find('.file-upload-widget').last().find('.file-upload-input').click(); |
||||
}); |
||||
|
||||
$fileUploadContainer.on('change', '.file-upload-input', function ($evt) { |
||||
var $fileInput = $(this); |
||||
var $fileUploadWidget = $fileInput.closest('.file-upload-widget'); |
||||
var filePath = $fileInput.val().replace(/\\/g, '/'); |
||||
var fileName = path.basename(filePath); |
||||
//var fileExt = path.extname(filePath)
|
||||
var fileSize = $fileInput.get(0).files && (0, _utils.humanFileSize)($fileInput.get(0).files[0].size); |
||||
|
||||
if (fileName) { |
||||
$fileUploadWidget.find('.file-upload-label').text(fileName + ' ' + fileSize); |
||||
|
||||
var $newFileUploadWidget = $fileUploadWidget.clone(); |
||||
$newFileUploadWidget.find('.file-upload-label').text(''); |
||||
|
||||
$fileUploadContainer.find('ul').first().append($newFileUploadWidget); |
||||
|
||||
$fileUploadWidget.css('display', 'block'); |
||||
} |
||||
}); |
||||
|
||||
$fileUploadContainer.on('click', '.file-upload-remove-btn', function ($evt) { |
||||
var $btn = $(this); |
||||
$btn.closest('.file-upload-widget').remove(); |
||||
}); |
||||
} |
||||
|
||||
exports.fileUploadInit = fileUploadInit; |
||||
|
||||
/***/ }, |
||||
/* 2 */ |
||||
/***/ function(module, exports) { |
||||
|
||||
'use strict'; |
||||
|
||||
Object.defineProperty(exports, "__esModule", { |
||||
value: true |
||||
}); |
||||
function getCookie(name) { |
||||
var cookieValue = null; |
||||
if (document.cookie && document.cookie != '') { |
||||
var cookies = document.cookie.split(';'); |
||||
for (var i = 0; i < cookies.length; i++) { |
||||
var cookie = jQuery.trim(cookies[i]); |
||||
if (cookie.substring(0, name.length + 1) == name + '=') { |
||||
cookieValue = decodeURIComponent(cookie.substring(name.length + 1)); |
||||
break; |
||||
} |
||||
} |
||||
} |
||||
return cookieValue; |
||||
} |
||||
|
||||
function humanFileSize(bytes, si) { |
||||
var thresh = si ? 1000 : 1024; |
||||
|
||||
if (Math.abs(bytes) < thresh) return bytes + ' B'; |
||||
|
||||
var units = si ? ['kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'] : ['KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB', 'ZiB', 'YiB']; |
||||
|
||||
var u = -1; |
||||
|
||||
do { |
||||
bytes /= thresh; |
||||
++u; |
||||
} while (Math.abs(bytes) >= thresh && u < units.length - 1); |
||||
|
||||
return bytes.toFixed(1) + ' ' + units[u]; |
||||
} |
||||
|
||||
exports.humanFileSize = humanFileSize; |
||||
exports.getCookie = getCookie; |
||||
|
||||
/***/ }, |
||||
/* 3 */, |
||||
/* 4 */, |
||||
/* 5 */, |
||||
/* 6 */, |
||||
/* 7 */, |
||||
/* 8 */ |
||||
/***/ function(module, exports, __webpack_require__) { |
||||
|
||||
'use strict'; |
||||
|
||||
Object.defineProperty(exports, "__esModule", { |
||||
value: true |
||||
}); |
||||
exports.imageUploadInit = undefined; |
||||
|
||||
var _utils = __webpack_require__(2); |
||||
|
||||
function imageUploadInit() { |
||||
var $fileUploadContainer = $('#fileUploadContainer'); |
||||
|
||||
$('#fileUploadAddBtn').on('click', function ($evt) { |
||||
$fileUploadContainer.find('.file-upload-widget').last().find('.file-upload-input').click(); |
||||
}); |
||||
|
||||
$fileUploadContainer.on('change', '.file-upload-input', function ($evt) { |
||||
var $fileInput = $(this); |
||||
var $fileUploadWidget = $fileInput.closest('.file-upload-widget'); |
||||
var $fileImg = $fileUploadWidget.find('img'); |
||||
var filePath = $fileInput.val().replace(/\\/g, '/'); |
||||
var fileName = path.basename(filePath); |
||||
var fileSize = $fileInput.get(0).files && (0, _utils.humanFileSize)($fileInput.get(0).files[0].size); |
||||
|
||||
if (fileName) { |
||||
$fileUploadWidget.find('.file-upload-label').text(fileName + ' ' + fileSize); |
||||
|
||||
var $newFileUploadWidget = $fileUploadWidget.clone(); |
||||
$newFileUploadWidget.find('.file-upload-label').text(''); |
||||
|
||||
$fileUploadContainer.find('.list-new-new').append($newFileUploadWidget); |
||||
|
||||
$fileUploadWidget.css('display', 'block'); |
||||
|
||||
if ($fileImg) { |
||||
var reader = new FileReader(); |
||||
reader.onload = function (e) { |
||||
$fileImg.attr('src', e.target.result); |
||||
}; |
||||
|
||||
reader.readAsDataURL($fileInput[0].files[0]); |
||||
} |
||||
} |
||||
}); |
||||
|
||||
$fileUploadContainer.on('click', '.file-upload-remove-img-btn', function ($evt) { |
||||
var $btn = $(this); |
||||
$btn.closest('.file-upload-widget').remove(); |
||||
}); |
||||
} //TODO: оформить Upload'еры в виде классов
|
||||
exports.imageUploadInit = imageUploadInit; |
||||
|
||||
/***/ } |
||||
/******/ ]); |
||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,7 @@ |
||||
import {fileUploadInit} from './seeds/file_upload' |
||||
import {imageUploadInit} from './seeds/image_upload' |
||||
|
||||
$(function () { |
||||
// fileUploadInit();
|
||||
imageUploadInit(); |
||||
}); |
||||
@ -0,0 +1,104 @@ |
||||
import SelectedContainer from 'components/SelectedContainer'; |
||||
import SelectedContainerCreate from 'components/SelectedContainerCreate'; |
||||
import NoTreeSelect from 'components/NoTreeSelect'; |
||||
import TreeSelect from 'components/TreeSelect'; |
||||
import SingleTreeSelect from 'components/SingleTreeSelect' |
||||
import SelectOrCreate from 'components/SelectOrCreate' |
||||
|
||||
$(function () { |
||||
function createSpecs(url) { |
||||
// SPECIALIZATIONS
|
||||
let sb_main = new TreeSelect($('#select-box-1'), {url, visible: true, required: true}); |
||||
sb_main.setHeader("Тип готовой работы"); |
||||
let select_container = new SelectedContainer($('#selected-spec'), |
||||
{ |
||||
obj: sb_main, |
||||
}); |
||||
sb_main.connectSelectedContainer(select_container); |
||||
let sb_1 = new TreeSelect($('#select-box-2'), {obj: sb_main}); |
||||
let sb_2 = new TreeSelect($('#select-box-3'), {obj: sb_main}); |
||||
let sb_3 = new TreeSelect($('#select-box-4'), {obj: sb_main}); |
||||
let sb_4 = new TreeSelect($('#select-box-5'), {obj: sb_main}); |
||||
|
||||
// select_container.on("add", () => {
|
||||
// let $container = $('#spec-value');
|
||||
// $container.html($('#selected-spec').find(".selected-element").find(".name").html());
|
||||
// });
|
||||
|
||||
sb_main.setNearbySelectBox(sb_1); |
||||
sb_1.setNearbySelectBox(sb_2, sb_main); |
||||
sb_2.setNearbySelectBox(sb_3, sb_1); |
||||
sb_3.setNearbySelectBox(sb_4, sb_2); |
||||
sb_4.setNearbySelectBox("", sb_3); |
||||
|
||||
} |
||||
|
||||
function createBuildingClass(url) { |
||||
// BUILDING-CLASSIFICATION
|
||||
sb_build_main = new TreeSelect($('#sb-building-classification'), {url, visible: true}); |
||||
sb_build_main.setHeader("Классификация здания"); |
||||
|
||||
let sb_build_1 = new TreeSelect($('#sb-building-sub-classification'), {obj: sb_build_main}); |
||||
|
||||
let select_build_container = new SelectedContainer($('#selected-building-classification'), |
||||
{ |
||||
obj: sb_build_main, |
||||
onlyOne: true |
||||
}); |
||||
sb_build_main.connectSelectedContainer(select_build_container); |
||||
|
||||
sb_build_main.setNearbySelectBox(sb_build_1); |
||||
sb_build_1.setNearbySelectBox("", sb_build_main); |
||||
} |
||||
|
||||
function createConstructionType(url) { |
||||
sb_constr_main = new NoTreeSelect($('#sb-construction-type'), {url, visible: true}); |
||||
sb_constr_main.setHeader("Вид строительства"); |
||||
let select_constr_type = new SelectedContainer($('#selected-construction-type'), { |
||||
obj: sb_constr_main, |
||||
noTree: true, |
||||
onlyOne: true |
||||
}); |
||||
sb_constr_main.connectSelectedContainer(select_constr_type); |
||||
} |
||||
|
||||
function createLocations(url) { |
||||
sb_loc_main = new TreeSelect($('#sb-location-1'), {url, visible: true}); |
||||
sb_loc_main.setHeader("Проектное местоположение"); |
||||
let select_loc = new SelectedContainer($('#selected-location'), |
||||
{ |
||||
obj: sb_loc_main, |
||||
onlyOne: true |
||||
}); |
||||
sb_loc_main.connectSelectedContainer(select_loc); |
||||
let sb_loc_1 = new TreeSelect($('#sb-location-2'), {obj: sb_loc_main}); |
||||
let sb_loc_2 = new TreeSelect($('#sb-location-3'), {obj: sb_loc_main}); |
||||
|
||||
sb_loc_main.setNearbySelectBox(sb_loc_1); |
||||
sb_loc_1.setNearbySelectBox(sb_loc_2, sb_loc_main); |
||||
sb_loc_2.setNearbySelectBox("", sb_loc_1); |
||||
} |
||||
|
||||
function createFormat(url) { |
||||
let sb_format_main = new NoTreeSelect($('#sb-format'), {url, visible: true}); |
||||
sb_format_main.setHeader("Формат электронной версии"); |
||||
let select_format = new SelectedContainer($('#selected-format'), { |
||||
obj: sb_format_main, |
||||
noTree: true, |
||||
// onlyOne: true
|
||||
}); |
||||
sb_format_main.connectSelectedContainer(select_format); |
||||
} |
||||
|
||||
let sb_loc_main, sb_constr_main, sb_build_main; |
||||
|
||||
createSpecs('/api/specializations_flat'); |
||||
|
||||
createBuildingClass('/api/building_classifications'); |
||||
createConstructionType('/api/construction_type'); |
||||
createLocations('/api/locations_flat'); |
||||
createFormat('/api/el_format'); |
||||
|
||||
// createRealty('/api/realties/current_user')
|
||||
|
||||
}); |
||||
@ -0,0 +1,47 @@ |
||||
//TODO: оформить Upload'еры в виде классов
|
||||
import {humanFileSize} from '../utils' |
||||
|
||||
function imageUploadInit() { |
||||
var $fileUploadContainer = $('#fileUploadContainer'); |
||||
|
||||
$('#fileUploadAddBtn').on('click', function ($evt) { |
||||
$fileUploadContainer.find('.file-upload-widget').last().find('.file-upload-input').click() |
||||
}); |
||||
|
||||
$fileUploadContainer.on('change', '.file-upload-input', function ($evt) { |
||||
var $fileInput = $(this); |
||||
var $fileUploadWidget = $fileInput.closest('.file-upload-widget'); |
||||
let $fileImg = $fileUploadWidget.find('img'); |
||||
var filePath = $fileInput.val().replace(/\\/g, '/'); |
||||
var fileName = path.basename(filePath); |
||||
var fileSize = $fileInput.get(0).files && humanFileSize($fileInput.get(0).files[0].size); |
||||
|
||||
if (fileName) { |
||||
$fileUploadWidget.find('.file-upload-label').text(fileName + ' ' + fileSize); |
||||
|
||||
var $newFileUploadWidget = $fileUploadWidget.clone(); |
||||
$newFileUploadWidget.find('.file-upload-label').text(''); |
||||
|
||||
$fileUploadContainer.find('.list-new-new').append($newFileUploadWidget); |
||||
|
||||
$fileUploadWidget.css('display', 'block'); |
||||
|
||||
if ($fileImg) { |
||||
let reader = new FileReader(); |
||||
reader.onload = function (e) { |
||||
$fileImg.attr('src', e.target.result); |
||||
}; |
||||
|
||||
reader.readAsDataURL($fileInput[0].files[0]); |
||||
} |
||||
} |
||||
}); |
||||
|
||||
$fileUploadContainer.on('click', '.file-upload-remove-img-btn', function ($evt) { |
||||
var $btn = $(this); |
||||
$btn.closest('.file-upload-widget').remove() |
||||
}); |
||||
|
||||
} |
||||
|
||||
export {imageUploadInit} |
||||
@ -0,0 +1,16 @@ |
||||
function textareasMaxRowsInit() { |
||||
$('textarea[data-limit-rows=true]') |
||||
.on('keypress', function (event) { |
||||
console.log("work"); |
||||
var textarea = $(this), |
||||
text = textarea.val(), |
||||
numberOfLines = (text.match(/\n/g) || []).length + 1, |
||||
maxRows = parseInt(textarea.attr('rows')); |
||||
|
||||
if (event.which === 13 && numberOfLines === maxRows) { |
||||
return false; |
||||
} |
||||
}); |
||||
} |
||||
|
||||
export {textareasMaxRowsInit} |
||||
@ -0,0 +1,36 @@ |
||||
function getCookie(name) { |
||||
var cookieValue = null; |
||||
if (document.cookie && document.cookie != '') { |
||||
var cookies = document.cookie.split(';'); |
||||
for (var i = 0; i < cookies.length; i++) { |
||||
var cookie = jQuery.trim(cookies[i]); |
||||
if (cookie.substring(0, name.length + 1) == (name + '=')) { |
||||
cookieValue = decodeURIComponent(cookie.substring(name.length + 1)); |
||||
break; |
||||
} |
||||
} |
||||
} |
||||
return cookieValue; |
||||
} |
||||
|
||||
function humanFileSize(bytes, si) { |
||||
var thresh = si ? 1000 : 1024; |
||||
|
||||
if (Math.abs(bytes) < thresh) |
||||
return bytes + ' B'; |
||||
|
||||
var units = si |
||||
? ['kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'] |
||||
: ['KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB', 'ZiB', 'YiB']; |
||||
|
||||
var u = -1; |
||||
|
||||
do { |
||||
bytes /= thresh; |
||||
++u |
||||
} while (Math.abs(bytes) >= thresh && u < units.length - 1); |
||||
|
||||
return bytes.toFixed(1) + ' ' + units[u] |
||||
} |
||||
|
||||
export {humanFileSize, getCookie} |
||||
@ -1,7 +1,8 @@ |
||||
from django.contrib import admin |
||||
|
||||
from .models import WorkSell, WorkSellPhoto, Picture |
||||
from .models import WorkSell, WorkSellPhoto, Picture, ElFormat |
||||
|
||||
admin.site.register(WorkSell) |
||||
admin.site.register(ElFormat) |
||||
admin.site.register(Picture) |
||||
admin.site.register(WorkSellPhoto) |
||||
|
||||
@ -0,0 +1,30 @@ |
||||
# -*- coding: utf-8 -*- |
||||
# Generated by Django 1.9.7 on 2016-12-06 21:34 |
||||
from __future__ import unicode_literals |
||||
|
||||
from django.db import migrations, models |
||||
|
||||
|
||||
class Migration(migrations.Migration): |
||||
|
||||
dependencies = [ |
||||
('work_sell', '0019_auto_20161201_2003'), |
||||
] |
||||
|
||||
operations = [ |
||||
migrations.CreateModel( |
||||
name='ElFormat', |
||||
fields=[ |
||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), |
||||
('name', models.CharField(max_length=32)), |
||||
], |
||||
options={ |
||||
'verbose_name': 'Формат электронной версии', |
||||
}, |
||||
), |
||||
migrations.AddField( |
||||
model_name='worksell', |
||||
name='el_format', |
||||
field=models.ManyToManyField(blank=True, related_name='work_sell', to='work_sell.ElFormat'), |
||||
), |
||||
] |
||||
@ -0,0 +1,27 @@ |
||||
# -*- coding: utf-8 -*- |
||||
# Generated by Django 1.9.7 on 2016-12-07 09:10 |
||||
from __future__ import unicode_literals |
||||
|
||||
from django.db import migrations, models |
||||
import mptt.fields |
||||
|
||||
|
||||
class Migration(migrations.Migration): |
||||
|
||||
dependencies = [ |
||||
('specializations', '0004_auto_20161014_2344'), |
||||
('work_sell', '0020_auto_20161207_0034'), |
||||
] |
||||
|
||||
operations = [ |
||||
migrations.AddField( |
||||
model_name='worksell', |
||||
name='specializations', |
||||
field=mptt.fields.TreeManyToManyField(blank=True, to='specializations.Specialization'), |
||||
), |
||||
migrations.AlterField( |
||||
model_name='worksell', |
||||
name='work_type', |
||||
field=models.IntegerField(blank=True, choices=[(403, 'Проектирование777'), (87, 'Техническое сопровождение666')], default=1), |
||||
), |
||||
] |
||||
@ -0,0 +1,37 @@ |
||||
# -*- coding: utf-8 -*- |
||||
# Generated by Django 1.9.7 on 2016-12-07 09:13 |
||||
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', '0021_auto_20161207_1210'), |
||||
] |
||||
|
||||
operations = [ |
||||
migrations.AlterField( |
||||
model_name='worksell', |
||||
name='building_classification', |
||||
field=mptt.fields.TreeForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='work_sells', 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='work_sells', to='projects.ConstructionType'), |
||||
), |
||||
migrations.AlterField( |
||||
model_name='worksell', |
||||
name='location', |
||||
field=mptt.fields.TreeForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='work_sells', to='common.Location'), |
||||
), |
||||
migrations.AlterField( |
||||
model_name='worksell', |
||||
name='specialization', |
||||
field=mptt.fields.TreeForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='work_sells', to='specializations.Specialization'), |
||||
), |
||||
] |
||||
@ -1,55 +1,224 @@ |
||||
{% 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> |
||||
{% load staticfiles %} |
||||
{% load sass_tags %} |
||||
{% load thumbnail %} |
||||
{% block old_css %}{% endblock %} |
||||
{% block head_css %} |
||||
<link rel='stylesheet' href='{% static "css/font-awesome.min.css" %}'> |
||||
<link rel='stylesheet' href='{% sass_src "sass/main.sass" %}'> |
||||
<link rel='stylesheet' href='{% sass_src "sass/components/custom-components.sass" %}'> |
||||
<link rel='stylesheet' href='{% sass_src "lib/proekton-components/sass/components.sass" %}'> |
||||
{# <style>#} |
||||
{# .-live-image-upload-container .-position-relative-parent {#} |
||||
{# position: relative#} |
||||
{# }#} |
||||
{##} |
||||
{# .-live-image-upload-container .-image-delete,#} |
||||
{# .-live-image-upload-container .-live-image-delete {#} |
||||
{# position: absolute;#} |
||||
{# top: 0;#} |
||||
{# right: 0;#} |
||||
{# background-color: white;#} |
||||
{# }#} |
||||
{# </style>#} |
||||
{% endblock %} |
||||
|
||||
{% block js_block %} |
||||
|
||||
<script type="text/javascript"> |
||||
{% block content %} |
||||
{% include 'partials/modals/project_work_type_suggestion.html' %} |
||||
{% include 'partials/header.html' %} |
||||
<div class="container main-scope"> |
||||
<div class="row title-scope"> |
||||
<div class="col-lg-12"> |
||||
{# <div class="title-scope">#} |
||||
<h1>Добавить готовую работу</h1> |
||||
{# </div>#} |
||||
</div> |
||||
</div> |
||||
<div class="row main-content"> |
||||
<div class="col-lg-12"> |
||||
<form action="{% url 'work_sell:create' %}" method="POST" |
||||
enctype="multipart/form-data" novalidate> |
||||
{% csrf_token %} |
||||
<div class="row"> |
||||
<div class="col-lg-9"> |
||||
<div class="simple-field"> |
||||
<div class="header">Название проекта</div> |
||||
<i class="fa fa-question-circle-o" aria-hidden="true"></i> |
||||
<span class="required">Обязательно</span> |
||||
<input value="{{ form.name.value }}" name="{{ form.name.html_name }}" |
||||
class="simple-input italic" |
||||
placeholder="Пример: Дизайн проект квартиры, Армирование фундамента, Конструкции перекрытия и т.д." |
||||
autocomplete="off" |
||||
required> |
||||
</div> |
||||
</div> |
||||
<div class="col-lg-3"> |
||||
<div class="header ">Стоимость готового проекта |
||||
<i class="fa fa-question-circle-o" aria-hidden="true" title=""></i> |
||||
</div> |
||||
<input name="{{ form.budget.html_name }}" class="simple-input icon-rub js-number-format" |
||||
placeholder="Введите сумму" |
||||
value="{{ form.budget.value }}" |
||||
autocomplete="off"> |
||||
</div> |
||||
</div> |
||||
<div class="row vertical-child mod-align-bottom"> |
||||
<div class="col-lg-9"> |
||||
<div class="" id="select-box-1"></div> |
||||
</div> |
||||
<div class="col-lg-3"> |
||||
<div href="#" onclick="return false" data-toggle="modal" |
||||
data-target="#projectWorkTypeSuggestionModal" |
||||
class="btn btn-simple btn-plus">Нет нужной специальности хочу добавить |
||||
</div> |
||||
</div> |
||||
</div> |
||||
<div class="row"> |
||||
<div class="col-lg-3"> |
||||
<div class="vertical-child" id="select-box-2"> |
||||
</div> |
||||
</div> |
||||
<div class="col-lg-3"> |
||||
<div class="vertical-child" id="select-box-3"> |
||||
</div> |
||||
</div> |
||||
<div class="col-lg-3"> |
||||
<div class="vertical-child" id="select-box-4"> |
||||
</div> |
||||
</div> |
||||
<div class="col-lg-3"> |
||||
<div class="vertical-child" id="select-box-5"> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
<div class="row"> |
||||
<div class="col-lg-12 vertical-child"> |
||||
<div class="selected-container horizontal" id="selected-spec"> |
||||
<input type="hidden" name="{{ form.specializations.html_name }}" |
||||
value="{{ form.specializations.value }}"> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
<div style="margin-top: 45px" class="row"> |
||||
<div class="col-lg-12"> |
||||
<div class="simple-field"> |
||||
<div class="header">Подробно опишите проект |
||||
<span class="select-text" id="spec-value"></span> |
||||
</div> |
||||
<i class="fa fa-question-circle-o" aria-hidden="true" title=""></i> |
||||
<span class="required">Обязательно</span> |
||||
<textarea name="{{ form.description.html_name }}" class="description" rows="8">{{ form.description.value }}</textarea> |
||||
|
||||
$(function(){ |
||||
$.ajax({ |
||||
url : '/work_sell/test/', |
||||
</div> |
||||
<div class="documentsChat mod" id="fileUploadContainer"> |
||||
<div style="display: inline-block;vertical-align: middle;"> |
||||
<div style="display: inline-block;vertical-align: inherit;" |
||||
class="upload-new paper-clip"> |
||||
<p id="fileUploadAddBtn" style="margin: 0">прикрепить файл</p> |
||||
</div> |
||||
<span style="display: inline-block;vertical-align: inherit;">ДО 100 ФАЙЛОВ</span> |
||||
</div> |
||||
|
||||
success:function(data){ |
||||
alert(data); |
||||
console.log(data); |
||||
} |
||||
}); |
||||
}); |
||||
<div class="row list-new-new" style="margin-top: 10px"> |
||||
<div class="col-lg-3 file-upload-widget" style="display: none"> |
||||
<input type="file" name="new_files" class="file-upload-input" |
||||
style="position: absolute; top: -1000px; left: -1000px"> |
||||
<div class="preview-container"> |
||||
<div class="file-upload-remove-img-btn"></div> |
||||
<img class="preview" src="#" alt="your image"/> |
||||
<textarea rows="2" data-limit-rows="true" class="description"> |
||||
|
||||
{# $(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;#} |
||||
{# }#} |
||||
{##} |
||||
{# });#} |
||||
</textarea> |
||||
</div> |
||||
<span style="display:none" class="file-upload-label"></span> |
||||
|
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
<div class="row"> |
||||
<div class="col-lg-3"> |
||||
<div class="vertical-child" id="sb-building-classification"> |
||||
</div> |
||||
<div class="vertical-child" id="sb-building-sub-classification"> |
||||
</div> |
||||
<div class="selected-container" id="selected-building-classification"> |
||||
<input type="hidden" |
||||
name="{{ form.building_classification.html_name }}" |
||||
value="{{ form.building_classification.value }}"> |
||||
</div> |
||||
</div> |
||||
<div class="col-lg-3"> |
||||
<div class="vertical-child" id="sb-construction-type"> |
||||
</div> |
||||
<div class="selected-container" id="selected-construction-type"> |
||||
<input type="hidden" |
||||
name="{{ form.construction_type.html_name }}" |
||||
value="{{ form.construction_type.value }}"> |
||||
</div> |
||||
</div> |
||||
<div class="col-lg-3"> |
||||
<div class="vertical-child" id="sb-location-1"></div> |
||||
<div class="vertical-child" id="sb-location-2"></div> |
||||
<div class="vertical-child" id="sb-location-3"></div> |
||||
<div class="selected-container" id="selected-location"> |
||||
<input type="hidden" |
||||
name="{{ form.location.html_name }}" |
||||
value="{{ form.location.value }}"> |
||||
</div> |
||||
</div> |
||||
<div class="col-lg-3"> |
||||
<div class="vertical-child" id="sb-format"></div> |
||||
<div class="selected-container" id="selected-format"> |
||||
<input type="hidden" |
||||
name="{{ form.el_format.html_name }}" |
||||
value="{{ form.el_format.value }}"> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
<div class="row"> |
||||
<div class="col-lg-12"> |
||||
<div class="separator"> |
||||
<div class="border"></div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
<div class="row top-line"> |
||||
<div class="col-lg-3" style="text-align: center"> |
||||
<div class="header"> </div> |
||||
<input style="width: 100%" type="submit" class="btn btn-simple" |
||||
value="РАЗМЕСТИТЬ ЗАКАЗ"> |
||||
</div> |
||||
<div class="col-lg-3 col-lg-offset-6" style="text-align: center"> |
||||
<div class="header"> </div> |
||||
<input style="width: 100%" type="button" class="btn btn-simple" |
||||
value="ПРЕДВАРИТЕЛЬНЫЙ ПРОСМОТР"> |
||||
</div> |
||||
</div> |
||||
</form> |
||||
</div> |
||||
</div> |
||||
{% include 'partials/footer.html' %} |
||||
</div> |
||||
{% endblock %} |
||||
{% block old_js %} |
||||
<script src='{% static "lib/jquery.fileupload/js/vendor/jquery.ui.widget.js" %}'></script> |
||||
<script src='{% static "lib/jquery.fileupload/js/jquery.iframe-transport.js" %}'></script> |
||||
<script src='{% static "lib/jquery.fileupload/js/jquery.fileupload.js" %}'></script> |
||||
<script src='{% static "lib/jquery.fileupload/js/jquery.fileupload-process.js" %}'></script> |
||||
<script src='{% static "lib/lodash/lodash.js" %}'></script> |
||||
<script src='{% static "my-libs.js" %}'></script> |
||||
{% endblock %} |
||||
{% block js_block %} |
||||
<script src='{% static "js/bootstrap.min.js" %}'></script> |
||||
<script src='{% static "js/build/init_create_worksell.js" %}'></script> |
||||
<script src='{% static "js/build/create_worksell.js" %}'></script> |
||||
<script src='{% static "js/jquery.mask.min.js" %}'></script> |
||||
<script> |
||||
$(function () { |
||||
$('.js-number-format').mask('0000000000'); |
||||
}) |
||||
</script> |
||||
{% endblock %} |
||||
Loading…
Reference in new issue