Permalink
Browse files

последние изменеия в верстке...

  • Loading branch information...
1 parent 4f97903 commit 2bcd1d4e4ded61980516f78928a84c146572d427 @Guest007 committed Feb 14, 2014
Showing with 62 additions and 20 deletions.
  1. +7 −2 templates/easy-form.html
  2. +9 −2 templates/home.html
  3. +12 −12 theme/css/template.css
  4. +2 −2 theme/css/template.less
  5. +32 −2 theme/js/init.js
View
@@ -3,7 +3,7 @@
{% csrf_token %}
<input type="hidden" id="id" name="id" class="common" value="{{ object.id }}">
<input type="hidden" id="templ" class="common" value="{{ object.templ }}">
- <ul class="first-child">
+ <ul class="visual_first">
<li>
<span id="foil" data-price="
{% for item in modif %}
@@ -73,7 +73,7 @@
<p>Индент печать</p>
</li>
</ul>
- <ul>
+ <ul class="visual_second">
<li>
<span id="print_num" data-price="
{% for item in modif %}
@@ -208,6 +208,11 @@
<input type="hidden" name="count_hidden" value="">
<input type="hidden" name="color" value="">
<input type="hidden" name="materials" value="">
+ <input type="hidden" name="1000" value="0.7" class="ratio">
+ <input type="hidden" name="4000" value="0.6" class="ratio">
+ <input type="hidden" name="7000" value="0.5" class="ratio">
+ <input type="hidden" name="11000" value="0.4" class="ratio">
+ <input type="hidden" name="15000" value="0.3" class="ratio">
</form>
View
@@ -12,7 +12,7 @@
</ul>
<div class="easy_form current">
<form class="jClever filter calc">
- <ul>
+ <ul class="visual_first">
<li>
<span id="foil" data-price="11" class="flag">
<span></span>
@@ -116,7 +116,7 @@
<li>
<label for="color">Цвет:</label>
<div class="select color">
- <select name="all_color" id="all_color">
+ <select name="colors" id="colors">
<option value="1" data-price="10">1+1</option>
<option value="2" data-price="11">2+2</option>
<option value="3" data-price="12" selected>3+3</option>
@@ -172,6 +172,13 @@
<input type="hidden" name="count_hidden" value="">
<input type="hidden" name="colors" value="">
<input type="hidden" name="materials" value="">
+ <input type="hidden" name="1000" value="0.7" class="ratio">
+ <input type="hidden" name="3000" value="0.6" class="ratio">
+ <input type="hidden" name="5000" value="0.5" class="ratio">
+ <input type="hidden" name="8000" value="0.4" class="ratio">
+ <input type="hidden" name="10000" value="0.3" class="ratio">
+ <input type="hidden" name="13000" value="0.2" class="ratio">
+
</form>
</div>
View
@@ -886,8 +886,8 @@ body.under_overlay > div.data_checking.files {
background: url('../images/easy_form_background.png') no-repeat left 100px;
}
.wrap_all > article > section.order > div > div.easy_form > form > ul {
- display: inline-block;
width: 100%;
+ display: inline-block;
margin: 0 0 50px;
}
.wrap_all > article > section.order > div > div.easy_form > form > ul > li {
@@ -1041,36 +1041,36 @@ body.under_overlay > div.data_checking.files {
color: #000;
margin: 20px 0 0;
}
-.wrap_all > article > section.order > div > div.easy_form > form > ul:first-child {
+.wrap_all > article > section.order > div > div.easy_form > form > ul.visual_first {
margin: 0 0 405px;
}
-.wrap_all > article > section.order > div > div.easy_form > form > ul:first-child > li > small > span {
+.wrap_all > article > section.order > div > div.easy_form > form > ul.visual_first > li > small > span {
border-left: 0;
border-bottom: 0;
top: 12px;
}
-.wrap_all > article > section.order > div > div.easy_form > form > ul:first-child > li > small > span > i {
+.wrap_all > article > section.order > div > div.easy_form > form > ul.visual_first > li > small > span > i {
position: absolute;
bottom: -6px;
right: -6px;
font-size: 10px;
}
-.wrap_all > article > section.order > div > div.easy_form > form > ul:first-child > li > small > span.first_flag {
+.wrap_all > article > section.order > div > div.easy_form > form > ul.visual_first > li > small > span.first_flag {
right: -66px;
width: 56px;
height: 195px;
}
-.wrap_all > article > section.order > div > div.easy_form > form > ul:first-child > li > small > span.second_flag {
+.wrap_all > article > section.order > div > div.easy_form > form > ul.visual_first > li > small > span.second_flag {
right: -66px;
width: 56px;
height: 184px;
}
-.wrap_all > article > section.order > div > div.easy_form > form > ul:first-child > li > small > span.third_flag {
+.wrap_all > article > section.order > div > div.easy_form > form > ul.visual_first > li > small > span.third_flag {
right: -66px;
width: 56px;
height: 235px;
}
-.wrap_all > article > section.order > div > div.easy_form > form > ul:first-child > li > small > span.third_flag > span {
+.wrap_all > article > section.order > div > div.easy_form > form > ul.visual_first > li > small > span.third_flag > span {
right: -48px;
width: 46px;
border: 0;
@@ -1079,16 +1079,16 @@ body.under_overlay > div.data_checking.files {
border-bottom-color: #dfdfdf;
bottom: 0;
}
-.wrap_all > article > section.order > div > div.easy_form > form > ul:first-child > li > small > span.third_flag > i {
+.wrap_all > article > section.order > div > div.easy_form > form > ul.visual_first > li > small > span.third_flag > i {
right: -50px;
bottom: -4px;
}
-.wrap_all > article > section.order > div > div.easy_form > form > ul:first-child > li > small > span.fourth_flag {
+.wrap_all > article > section.order > div > div.easy_form > form > ul.visual_first > li > small > span.fourth_flag {
right: -66px;
width: 56px;
height: 170px;
}
-.wrap_all > article > section.order > div > div.easy_form > form > ul:first-child > li > small > span.fourth_flag > span {
+.wrap_all > article > section.order > div > div.easy_form > form > ul.visual_first > li > small > span.fourth_flag > span {
left: 0;
width: 58px;
border: 0;
@@ -1097,7 +1097,7 @@ body.under_overlay > div.data_checking.files {
border-bottom-color: #dfdfdf;
bottom: 0;
}
-.wrap_all > article > section.order > div > div.easy_form > form > ul:first-child > li > small > span.fourth_flag > i {
+.wrap_all > article > section.order > div > div.easy_form > form > ul.visual_first > li > small > span.fourth_flag > i {
left: -52px;
bottom: -4px;
}
View
@@ -1016,7 +1016,7 @@ body {
& > ul {
width: 100%;
display: inline-block;
- width: 100%;
+ //width: 100%;
margin: 0 0 50px;
& > li {
width: 235px;
@@ -1180,7 +1180,7 @@ body {
margin: 20px 0 0;
}
}
- &:first-child {
+ &.visual_first {
margin: 0 0 405px;
& > li {
& > small {
View
@@ -194,7 +194,7 @@ $(document).ready(function(){
$('form.calc').each(function(){
//сбрасываем значения hidden
- $('input[type="hidden"]').val(0);
+ $('input.flag').val(0);
//присваиваем значение по умолчанию селектам
$('select').each(function(){
@@ -246,6 +246,11 @@ $(document).ready(function(){
$('input[name="'+this_name+'"]').val(parseInt(this_val)).trigger('change');
});
+ //var $inputs = $('input.ratio');
+
+ // get an associative array of the values
+
+
//счетаем
$('input[type="hidden"]').change(function(){
var flag_val = 0,
@@ -258,8 +263,33 @@ $(document).ready(function(){
flag_val += parseInt($(this).val())||0;
});
+ var values = {};
+ $('input.ratio').each(function() {
+ var this_val = parseFloat($(this).val());
+ this_name = parseFloat($(this).attr('name')),
+ q = count_val-this_name;
+ console.log(this_val, this_name, count_val, q);
+ values[this_val] = q;
+ });
+ console.log(values);
+
+ //Array.min = function(values){
+ //return Math.min.apply(Math, values);
+ //};
+
+ //var min_q = Array.min(values);
+ //console.log(min_q);
+ $.each(values, function(key, value) {
+ //var min_q = $(this).min(value);
+ //var min_q = Math.min.apply(Math,value);
+ var qq = $(this).min();
+ console.log(qq);
+ });
+
+
sum = count_val*(flag_val+color_val+material_val);
- $('p.sum').html(sum+' руб.');
+ $('p.sum').html(sum.toFixed(2)+' руб.');
+
//console.log(sum);
});

0 comments on commit 2bcd1d4

Please sign in to comment.