@ -1,46 +0,0 @@ |
||||
.select2-container-multi .select2-choices .select2-search-field input { |
||||
min-width: 100px; |
||||
} |
||||
|
||||
.selector select[multiple] { |
||||
display: block; |
||||
} |
||||
|
||||
.selector { |
||||
width: auto; |
||||
margin-right: 12px; |
||||
} |
||||
|
||||
.selector-available, .selector-chosen { |
||||
width: auto; |
||||
} |
||||
|
||||
.selector .selector-available input, .selector .selector-chosen input { |
||||
margin: 0; |
||||
} |
||||
|
||||
form select { |
||||
max-width: 266px; |
||||
} |
||||
|
||||
.as-selections.vTextField { |
||||
width: 300px; |
||||
} |
||||
|
||||
.as-results ul.as-list { |
||||
margin-left:9em; |
||||
padding-left:0; |
||||
box-shadow: none !important; |
||||
border: 1px solid #888888 !important; |
||||
} |
||||
.as-results ul.as-list li { |
||||
list-style: none; |
||||
} |
||||
ul.as-selections.vTextField { |
||||
padding-left: 10px; |
||||
margin-left:9em; |
||||
} |
||||
|
||||
ul.as-selections li { |
||||
list-style: none; |
||||
} |
||||
@ -1,43 +0,0 @@ |
||||
.inline-related { |
||||
border: 1px solid #CCC; |
||||
border-radius: 2px; |
||||
box-shadow: 0 1px 2px 1px rgba(0, 0, 0, 0.08); |
||||
} |
||||
|
||||
.inline-related h3 { |
||||
background-color: #FCFCFC; |
||||
padding: 10px 20px 10px 3px; |
||||
margin: 0; |
||||
text-align: center; |
||||
} |
||||
|
||||
.inline-related .inline_label { |
||||
font-weight: 300; |
||||
} |
||||
|
||||
|
||||
.inline-related .collapse-expand { |
||||
display: inline-block; |
||||
text-transform: uppercase; |
||||
padding: 0px 10px 0px 10px; |
||||
width: 44px; |
||||
float: left; |
||||
text-decoration:none!important; |
||||
} |
||||
|
||||
.add-row { |
||||
height: 26px; |
||||
line-height: 26px; |
||||
text-align: center; |
||||
border: 1px dashed #CCC!important; |
||||
border-radius: 2px; |
||||
margin: 0; |
||||
} |
||||
|
||||
.add-row a { |
||||
display: block; |
||||
padding-left: 14px; |
||||
text-indent: -9999px; |
||||
font-size: 11px; |
||||
background-position: 50% 50%!important; |
||||
} |
||||
@ -1,53 +0,0 @@ |
||||
(function($) { |
||||
$(function() { |
||||
var formsubmission_form = $('#formsubmission_form'); |
||||
var form_field = $('select[id="id_form"]', formsubmission_form); |
||||
var headers_field = $('.field-headers', formsubmission_form); |
||||
|
||||
var loadHeaders = function() { |
||||
if (!form_field.val()) { |
||||
headers_field.slideUp('fast'); |
||||
return; |
||||
} |
||||
|
||||
var data = { |
||||
'csrfmiddlewaretoken': $('input[name="csrfmiddlewaretoken"]').val(), |
||||
'form': $('select[name="form"]').val(), |
||||
'file_type': $('select[name="file_type"]').val() |
||||
}; |
||||
|
||||
$.ajax({ |
||||
type: 'POST', |
||||
url: '', |
||||
data: data, |
||||
success: function(response) { |
||||
if (response.reloadBrowser) { |
||||
location.reload(); |
||||
} |
||||
$('select[id="id_headers_to"]').find('option').remove(); |
||||
|
||||
var headers_input_from = $('select[id="id_headers_from"]'); |
||||
headers_input_from.find('option').remove(); |
||||
|
||||
$.each(response.availableHeaders, function(index, value) { |
||||
headers_input_from.append('<option value=' + value + '>' + value + '</option>'); |
||||
}); |
||||
|
||||
SelectBox.init('id_headers_from'); |
||||
SelectBox.init('id_headers_to'); |
||||
headers_field.slideDown(); |
||||
}, |
||||
error: function() { |
||||
alert('We\'re sorry. Something unexpected happened. Please reload the page and try again.'); |
||||
} |
||||
}); |
||||
|
||||
return false; |
||||
}; |
||||
|
||||
if ($('body').hasClass('export-form')) { |
||||
loadHeaders(); |
||||
form_field.change(loadHeaders); |
||||
} |
||||
}); |
||||
})(django.jQuery); |
||||
@ -1,66 +0,0 @@ |
||||
/* |
||||
Makes all inline forms collapsible. |
||||
*/ |
||||
|
||||
jQuery(function($) { |
||||
$.makeCollapsible = function(target, item, collapsible, triggerTarget, setInitStatus, setFirstStatus) |
||||
{ |
||||
var triggerExpand = 'Edit'; |
||||
var triggerCollapse = 'Done'; |
||||
var triggerClass = 'collapse-expand'; |
||||
var triggerLink = '<a class="' + triggerClass + '" href="javascript:void(0);"></a>'; |
||||
|
||||
$(target).find(item).each(function(i) { |
||||
if ($(this).data('isCollapsible')) return; |
||||
$(this).data('isCollapsible', true); |
||||
|
||||
$(this).find(collapsible).hide(); |
||||
|
||||
// trigger already exists if created with "Add another" link
|
||||
var trigger = $(this).find(triggerTarget).find('.'+triggerClass); |
||||
if (!trigger.length) { |
||||
trigger = $(triggerLink); |
||||
$(this).find(triggerTarget).html(trigger); |
||||
} |
||||
|
||||
var item = this; |
||||
var toggleCollapse = function(status, speed) |
||||
{ |
||||
if (status == null) { |
||||
status = !item.collapseStatus; |
||||
} |
||||
if (speed == null) { |
||||
speed = 1; |
||||
} |
||||
item.collapseStatus = status; |
||||
if (status) { |
||||
trigger.html(triggerCollapse); |
||||
$(item).find(collapsible).slideDown('slow'); |
||||
} else { |
||||
trigger.html(triggerExpand); |
||||
$(item).find(collapsible).slideUp('slow'); |
||||
} |
||||
} |
||||
|
||||
trigger.click(function(event) { |
||||
event.preventDefault(); |
||||
toggleCollapse(null, 'normal') |
||||
}) |
||||
|
||||
// Collapse by default unless there are errors
|
||||
initStatus = setInitStatus != null ? setInitStatus : $(this).find('.errors').length != 0; |
||||
firstStatus = setFirstStatus != null ? setFirstStatus : initStatus; |
||||
|
||||
toggleCollapse(i == 0 ? firstStatus : initStatus) |
||||
}); |
||||
}; |
||||
|
||||
var init = function() { |
||||
$.makeCollapsible('div.inline-group', 'div.inline-related', 'fieldset', 'h3 b'); |
||||
}; |
||||
init(); |
||||
// init again when "Add another" link is clicked
|
||||
$('.add-row a').click(function() { |
||||
init(); |
||||
}) |
||||
}); |
||||
@ -1,95 +0,0 @@ |
||||
/* |
||||
Enables repositioning of all inline elements by drag & drop. |
||||
|
||||
The inline model requires is a "position" field that is blank by default. |
||||
This value will be set automatically by this code snippet when dragging elements. |
||||
The model instances can then be ordered by that "position" field. |
||||
*/ |
||||
|
||||
jQuery(function($) { |
||||
|
||||
var positionField = 'position'; |
||||
var target = $('div.inline-group#fields-group'); |
||||
var handle = 'h3'; |
||||
var item = 'div.inline-related'; |
||||
var positionInput = 'input[id$=-'+positionField+']'; |
||||
var hidePositionFieldClosest = '.form-row'; |
||||
|
||||
var renumberAll = function() { |
||||
var pos = 1; |
||||
target.find(item).each(function(i) { |
||||
$(this).removeClass('odd even').addClass(i % 2 ? 'even' : 'odd'); |
||||
if ($(this).find(positionInput).val() != '') { |
||||
$(this).find(positionInput).val(pos); |
||||
pos++; |
||||
} |
||||
}); |
||||
}; |
||||
|
||||
var init = function() { |
||||
target.find(item).each(function(i) { |
||||
if ($(this).data('isSortable')) return; |
||||
$(this).data('isSortable', true); |
||||
$(this).find(handle).css('cursor', 'ns-resize'); |
||||
$(this).find(handle).addClass('draggable'); |
||||
$(this).find(positionInput).each(function() { |
||||
if (hidePositionFieldClosest) { |
||||
var hidden =$('<input type="hidden" id="'+this.id+'" name="'+this.name+'" />'); |
||||
hidden.val($(this).val()); |
||||
$(this).closest(hidePositionFieldClosest).replaceWith(hidden); |
||||
} |
||||
}); |
||||
$(this).find('input, select, textarea').change(function() { |
||||
$(this).closest(item).find('input[id$='+positionField+']').val('X'); // mark for renumberAll() to fill in
|
||||
renumberAll($('div.inline-group')); |
||||
}); |
||||
}); |
||||
}; |
||||
|
||||
var addRow = target.find('.add-row'); |
||||
addRow.remove(); |
||||
var ordered = []; |
||||
var unordered = []; |
||||
// Initially, remove and re-append all inlines ordered by their "position" value
|
||||
target.find(item).each(function(i) { |
||||
var initialPos = $(this).find(positionInput).val(); |
||||
if (initialPos) { |
||||
while (initialPos < ordered.length && ordered[initialPos]) { |
||||
initialPos++; |
||||
} |
||||
ordered[initialPos] = this; |
||||
} else { |
||||
unordered[unordered.length] = this; |
||||
} |
||||
$(this).removeClass('odd even').addClass(i % 2 ? 'even' : 'odd'); |
||||
this.parentElement.removeChild(this); |
||||
}); |
||||
for (var i = 0; i < ordered.length; i++) { |
||||
var el = ordered[i]; |
||||
if (el) { |
||||
target.append(el); |
||||
} |
||||
} |
||||
// Add "position"-less elements in the end
|
||||
for (var i = 0; i < unordered.length; i++) { |
||||
var el = unordered[i]; |
||||
target.append(el); |
||||
} |
||||
target.append(addRow); |
||||
|
||||
target.sortable({ |
||||
containment: 'parent', |
||||
items: item, |
||||
handle: handle, |
||||
update: renumberAll, |
||||
revert: true, |
||||
opacity: 0.9 |
||||
}); |
||||
|
||||
init(); |
||||
// init again when "Add another" link is clicked
|
||||
$('.add-row a').click(function() { |
||||
init(); |
||||
}); |
||||
|
||||
}); |
||||
@ -1,45 +0,0 @@ |
||||
/* |
||||
Replaces the name in an inline element's header while typing it in the input of the "name" field. |
||||
This way, the extra inline element's header will be named instead of numbered #4, #5 etc. |
||||
*/ |
||||
|
||||
jQuery(function($) { |
||||
|
||||
var target = $('div.inline-group'); |
||||
var item = 'div.inline-related'; |
||||
var nameInput = 'input[id*=-label]'; |
||||
var typeInput = 'select[id*=-field_type]'; |
||||
|
||||
|
||||
var init = function() { |
||||
target.find(item).each(function() { |
||||
var nameField = $(this).find(nameInput); |
||||
var typeField = $(this).find(typeInput); |
||||
var label = $('.inline_label', this); |
||||
var rename = function() { |
||||
if (nameField.val()) { |
||||
label.text(nameField.val()); |
||||
} |
||||
else { |
||||
label.text(typeField.find('option:selected').text() + ' Field'); |
||||
} |
||||
}; |
||||
nameField.keyup(function(event) { |
||||
// Update name while typing
|
||||
rename(); |
||||
}); |
||||
|
||||
typeField.change(function(){ |
||||
rename(); |
||||
}); |
||||
rename(); |
||||
}) |
||||
} |
||||
|
||||
init(); |
||||
|
||||
// init again when "Add another" link is clicked
|
||||
$('.add-row a').click(function() { |
||||
init(); |
||||
}) |
||||
}); |
||||
@ -1,35 +0,0 @@ |
||||
jQuery(function($) { |
||||
var target = $('div.inline-group'); |
||||
var item = 'div.inline-related'; |
||||
var typeInput = 'select[id*=-field_type]'; |
||||
|
||||
var init = function() { |
||||
target.find(item).each(function() { |
||||
var that = $(this); |
||||
var inputField = that.find(typeInput); |
||||
var toggleField = function() { |
||||
var selectedFieldType = inputField.val(); |
||||
var choiceFields = ['checkbox_multiple', 'select', 'radio', 'file']; |
||||
var showChoiceField = $.inArray(selectedFieldType, choiceFields) >= 0; |
||||
that.find('.field-choice_values') |
||||
.toggle(showChoiceField) |
||||
.toggleClass('required', showChoiceField); |
||||
|
||||
that.find('.field-placeholder_text, .field-help_text, .field-choice_values:not(:hidden)') |
||||
.toggle(selectedFieldType != 'hidden') |
||||
|
||||
}; |
||||
inputField.change(function() { |
||||
toggleField(); |
||||
}); |
||||
toggleField(); |
||||
}) |
||||
}; |
||||
|
||||
init(); |
||||
|
||||
// init again when "Add another" link is clicked
|
||||
$('.add-row a').click(function() { |
||||
init(); |
||||
}) |
||||
}); |
||||
@ -1,109 +0,0 @@ |
||||
(function ($) { |
||||
$.fn.djangocms_forms = function (options) { |
||||
if (options === undefined) { options = {}; } |
||||
|
||||
var defaults = { |
||||
form_wrapper: '.form-wrapper', |
||||
field_wrapper: '.field-wrapper', |
||||
form_errors: '.form-errors', |
||||
field_errors: '.field-errors', |
||||
form_success: '.form-success', |
||||
errorlist_css_class: 'errorlist', |
||||
error_css_class: 'error', |
||||
server_error: 'We\'re sorry. Something Unexpected Happened. Please Try Again Later.' |
||||
}; |
||||
|
||||
$('input[type=tel]').inputmask("+7 999 999-99-99"); |
||||
|
||||
if(typeof consultation != "undefined") { |
||||
$('input[name=sotrudnik]').val(consultation.name); |
||||
} |
||||
|
||||
this.each(function(options) { |
||||
var options = $.extend( {}, defaults, options) ; |
||||
|
||||
var el = $(this), |
||||
form_wrapper = $(options.form_wrapper, el), |
||||
form_success = $(options.form_success, el), |
||||
form = $('form', form_wrapper); |
||||
|
||||
|
||||
function clearErrors() { |
||||
form.find(options.form_errors).fadeOut().empty(); //clear form errors
|
||||
form.find(options.field_errors).fadeOut().empty(); //clear field errors
|
||||
form.find(options.field_wrapper).removeClass(options.error_css_class); //remove error classes
|
||||
} |
||||
|
||||
// post-submit callback
|
||||
function ajaxSuccess(response) { |
||||
if (response.status == 'success'){ |
||||
formValid(response.redirect_url); |
||||
} |
||||
else if (response.status == 'error'){ |
||||
formInvalid(response.form_errors); |
||||
} |
||||
} |
||||
|
||||
function formValid(success_url) { |
||||
form_success.fadeIn('slow'); |
||||
form_wrapper.slideUp('slow').remove(); |
||||
|
||||
if (success_url){ |
||||
setTimeout(function(){ |
||||
window.location = success_url; |
||||
}, 1000); |
||||
} |
||||
|
||||
} |
||||
|
||||
function formInvalid(form_errors) { |
||||
clearErrors() |
||||
$.each(form_errors, function(key, value) { |
||||
var field = form.find(':input[name=' + key + ']').first(); |
||||
var field_wrapper = field.parents(options.field_wrapper).addClass(options.error_css_class); |
||||
var field_error = $('<ul/>').addClass(options.errorlist_css_class); |
||||
$.each(value, function(key, value) { |
||||
$('<li>', { |
||||
text: value |
||||
}).appendTo(field_error); |
||||
}); |
||||
field_wrapper.find(options.field_errors).append(field_error).fadeIn('slow') |
||||
}); |
||||
if (form_errors.__all__) { |
||||
var form_error = $('<ul/>').addClass(options.errorlist_css_class); |
||||
$.each(form_errors.__all__, function(key, value) { |
||||
$('<li>', { |
||||
text: value |
||||
}).appendTo(form_error); |
||||
}); |
||||
form.find(options.form_errors).append(form_error).fadeIn('slow'); |
||||
} |
||||
} |
||||
|
||||
function ajaxError() { |
||||
clearErrors(); |
||||
var form_error = $('<ul/>').addClass(options.error_class); |
||||
$('<li>', { |
||||
html: options.server_error |
||||
}).appendTo(form_error); |
||||
form.find(options.form_errors).append(form_error).fadeIn('slow'); |
||||
} |
||||
|
||||
// attach handler to form's submit event
|
||||
form.submit(function () { |
||||
var ajaxOptions = { |
||||
type: 'POST', |
||||
success: ajaxSuccess, |
||||
error: ajaxError |
||||
}; |
||||
// submit the form
|
||||
$(this).ajaxSubmit(ajaxOptions); |
||||
|
||||
form.find('button[type="submit"]').attr('disabled','disabled'); |
||||
|
||||
// return false to prevent normal browser submit and page navigation
|
||||
return false; |
||||
}); |
||||
}); |
||||
}; |
||||
})(jQuery); |
||||
|
After Width: | Height: | Size: 83 KiB |
|
After Width: | Height: | Size: 512 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 2.3 MiB |
|
After Width: | Height: | Size: 180 KiB |
|
After Width: | Height: | Size: 5.7 KiB |
|
After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 32 KiB |
|
After Width: | Height: | Size: 165 KiB |
|
After Width: | Height: | Size: 115 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 51 KiB |
|
After Width: | Height: | Size: 84 KiB |
|
After Width: | Height: | Size: 62 KiB |
|
After Width: | Height: | Size: 62 KiB |
|
After Width: | Height: | Size: 155 KiB |
|
After Width: | Height: | Size: 97 KiB |
|
After Width: | Height: | Size: 82 KiB |
|
After Width: | Height: | Size: 26 KiB |
|
After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 6.4 KiB |
|
After Width: | Height: | Size: 56 KiB |
|
After Width: | Height: | Size: 601 KiB |
|
After Width: | Height: | Size: 10 KiB |
|
After Width: | Height: | Size: 760 KiB |
|
After Width: | Height: | Size: 433 KiB |
|
After Width: | Height: | Size: 77 KiB |
|
After Width: | Height: | Size: 47 KiB |
|
After Width: | Height: | Size: 418 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 68 KiB |
|
After Width: | Height: | Size: 276 KiB |
|
After Width: | Height: | Size: 66 KiB |
|
After Width: | Height: | Size: 1.2 MiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 122 KiB |
|
After Width: | Height: | Size: 460 KiB |
|
After Width: | Height: | Size: 86 KiB |
|
After Width: | Height: | Size: 135 KiB |
|
After Width: | Height: | Size: 36 KiB |
|
After Width: | Height: | Size: 36 KiB |
|
After Width: | Height: | Size: 36 KiB |
|
After Width: | Height: | Size: 31 KiB |
|
After Width: | Height: | Size: 59 KiB |
|
After Width: | Height: | Size: 638 KiB |
|
After Width: | Height: | Size: 3.1 KiB |
|
After Width: | Height: | Size: 78 KiB |
|
After Width: | Height: | Size: 34 KiB |
|
After Width: | Height: | Size: 86 KiB |
|
After Width: | Height: | Size: 45 KiB |
|
After Width: | Height: | Size: 50 KiB |
|
After Width: | Height: | Size: 30 KiB |
|
After Width: | Height: | Size: 252 KiB |
|
After Width: | Height: | Size: 35 KiB |
|
After Width: | Height: | Size: 117 KiB |
|
After Width: | Height: | Size: 2.1 MiB |
|
After Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 4.6 KiB |
|
After Width: | Height: | Size: 50 KiB |
|
After Width: | Height: | Size: 90 KiB |
|
After Width: | Height: | Size: 33 KiB |
|
After Width: | Height: | Size: 273 KiB |
|
After Width: | Height: | Size: 26 KiB |
|
After Width: | Height: | Size: 452 KiB |
|
After Width: | Height: | Size: 38 KiB |
|
After Width: | Height: | Size: 4.6 KiB |
|
After Width: | Height: | Size: 40 KiB |
|
After Width: | Height: | Size: 1.2 MiB |
|
After Width: | Height: | Size: 731 KiB |
|
After Width: | Height: | Size: 10 KiB |
|
After Width: | Height: | Size: 237 KiB |
|
After Width: | Height: | Size: 32 KiB |
|
After Width: | Height: | Size: 522 KiB |
|
After Width: | Height: | Size: 37 KiB |
|
After Width: | Height: | Size: 570 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 1.2 MiB |
|
After Width: | Height: | Size: 53 KiB |
|
After Width: | Height: | Size: 47 KiB |
|
After Width: | Height: | Size: 34 KiB |
|
After Width: | Height: | Size: 26 KiB |
|
After Width: | Height: | Size: 24 KiB |
|
After Width: | Height: | Size: 41 KiB |
|
After Width: | Height: | Size: 6.0 KiB |
|
After Width: | Height: | Size: 283 KiB |
|
After Width: | Height: | Size: 1.0 MiB |
|
After Width: | Height: | Size: 735 KiB |