remotes/origin/1203
Назар Котюк 11 years ago
commit bb0e161ae7
  1. 2
      proj/settings.py
  2. 2
      templates/client/includes/accounts/calendar_table.html
  3. 2
      templates/client/static_client/css/main.css
  4. 2
      templates/client/static_client/css_min/main.min.css
  5. 24
      templates/client/static_client/js/_modules/block.registration.completion.js
  6. 62
      templates/client/static_client/js/_modules/page.profile.calendar.js
  7. 2
      templates/client/static_client/js_min/_modules/block.registration.completion.min.js
  8. 2
      templates/client/static_client/js_min/_modules/page.profile.calendar.min.js

@ -406,4 +406,4 @@ MONTHES = {'jan': {'value': 1, 'name': _(u'Январь')}, 'feb': {'value': 2,
'may': {'value': 5, 'name': _(u'Май')}, 'jun': {'value': 6, 'name': _(u'Июнь')},
'jul': {'value': 7, 'name': _(u'Июль')}, 'aug': {'value': 8, 'name': _(u'Август')},
'sep': {'value': 9, 'name': _(u'Сентябрь')}, 'oct': {'value': 10, 'name': _(u'Октябрь')},
'nov': {'value': 11, 'name': _(u'Ноябрь')}, 'dec': {'value': 12, 'name': _(u'Декабрь')}}
'nov': {'value': 11, 'name': _(u'Ноябрь')}, 'dec': {'value': 12, 'name': _(u'Декабрь')}}

@ -23,7 +23,7 @@
<tr>
{% for day in days %}
{% ifnotequal day current_day %}
<td width="115"><div><b>{{ day|date:"d" }}</b>/<i>{% if LANGUAGE_CODE == 'ru' %}{{ day|get_rus_day }}{% else %}{{ day|date:"D" }}{% endif %}</i></div></td>
<td><div><b>{{ day|date:"d" }}</b>/<i>{% if LANGUAGE_CODE == 'ru' %}{{ day|get_rus_day }}{% else %}{{ day|date:"D" }}{% endif %}</i></div></td>
{% else %}
<td class="c-cur">
<div>

@ -9329,7 +9329,6 @@ a.order-button:hover .ob-text,
width: 136px;
}
.calendar-container table td {
width: 115px;
border-left: 1px dotted #cccccc;
text-align: center;
padding: 0;
@ -9353,6 +9352,7 @@ a.order-button:hover .ob-text,
font-size: 25px;
color: #959595;
padding: 8px 0 12px;
width: 136px;
}
.calendar-container .cal-body + .cal-days td {

File diff suppressed because one or more lines are too long

@ -42,10 +42,24 @@ if (EXPO.registration.completion) {
}
},
placeInput = function (width) {
$('#id_country').val('159').select2({
placeholder: "Ваша страна",
width: width
});
$('#id_country')
.val('159')
.select2({
placeholder: "Ваша страна",
width: width
})
/**
* change phone code when country is selected by user
*/
.on("change", function () {
var phoneCode = $('option:selected', this).attr("data-phone-code");
if($.trim(phoneCode) !=''){
$('#id_code_country').select2("val",phoneCode);
}else{
$('#id_code_country').select2("val",'');
}
});
$('#id_city').select2({
placeholder: "Ваш город",
@ -57,7 +71,7 @@ if (EXPO.registration.completion) {
quietMillis: 200,
data: function(term, page, country){
var country = $('#id_country').val()
var country = $('#id_country').val();
return {term: term,
page: page,
country: country};

@ -73,24 +73,23 @@ if (EXPO.profile.calendar) {
result = 0,
width = self.opt.cellWidth,
$calendar = $('#' + self.opt.calenadrId),
currentDay = $calendar.find('td.' + self.opt.currentDayClass).index(),
currentDay = $calendar.find('.'+self.opt.daysClass+' td.' + self.opt.currentDayClass).index(),
onestep = self.opt.cellsToScroll,
allDays = $calendar.find('.'+self.opt.daysClass+' td').length,
stepsCount,
currenCount;
self.stepWidth = onestep*width;
self.calendarWidth = width* allDays;
if(currentDay > 0){
currentDay++;
stepsCount = allDays / onestep;
currenCount = allDays / currentDay;
result = stepsCount - currenCount;
result = stepsCount - Math.floor(currenCount);
self.currentDay =currentDay;
if (result) {
result = Math.floor(result-1);
result--;
offset = onestep * result * width;
} else {
@ -108,12 +107,13 @@ if (EXPO.profile.calendar) {
this.$leftScroll = $leftScroll;
this.$rightScroll = $rightScroll;
this.currentOffset = currentWeekOffset();
//this.currentOffset = 0;
this.scrollStep = scrollStep;
this.$scrollBox = $scrollBox;
//$(document).ready(function () {
//
//});
this.$messages = [];
this.stepWidth = self.opt.cellsToScroll*self.opt.cellWidth;
$(function () {
$noEventsField.each(function () {
@ -127,23 +127,15 @@ if (EXPO.profile.calendar) {
);
}
});
$('.' + self.opt.eventsClass).each(function () {
index++;
if (index == 3) {
$(this).addClass('grey');
}
if (index == 4) {
$(this).addClass('grey');
index = 0;
}
});
$('.' + self.opt.eventsClass+":even").addClass('grey');
});
$(window).load(function () {
self.calendarWidth = self.opt.cellWidth* $calendar.find('.'+self.opt.daysClass+' td').length;
$scrollBox.mCustomScrollbar({
axis: 'y',
horizontalScroll: true,
setLeft:'-'+EXPO.profile.calendar.currentOffset+'px',
setLeft:'-'+self.currentOffset+'px',
mouseWheel:{enable:false},
scrollButtons:{enable:false},
contentTouchScroll:false,
@ -170,14 +162,15 @@ if (EXPO.profile.calendar) {
}
}
});
$leftScroll.one('click', function () {
self.scrollLeft(self);
});
$rightScroll.one('click', function () {
self.scrollRight(self);
});
});
$leftScroll.one('click', function () {
self.scrollLeft(self);
});
$rightScroll.one('click', function () {
self.scrollRight(self);
});
$calendarToggle.on('click', function () {
var $switch = $(this);
@ -214,7 +207,6 @@ if (EXPO.profile.calendar) {
if(!self){
self = this;
}
self.$rightScroll.off('click');
if((self.currentOffset + self.stepWidth) < self.calendarWidth){
self.currentOffset+= self.scrollStep;
@ -231,7 +223,6 @@ if (EXPO.profile.calendar) {
if(!self){
self = this;
}
self.$leftScroll.off('click');
if(self.currentOffset >= self.stepWidth){
self.currentOffset -= self.scrollStep;
console.log("!!! left scroll fired!");
@ -251,13 +242,20 @@ if (EXPO.profile.calendar) {
self = this;
}
for (var i =0; i< self.$messages.length; i++){
var marginLeft = parseInt(self.$messages[i].inlineStyle("margin-left"));
if(marginLeft>= 0){
self.$messages[i].addClass("hidden");
self.$messages[i].css({marginLeft:self.currentOffset+'px'});
self.$messages[i].removeClass("hidden");
var parentWidth = self.$messages[i].parent().width(),
parentOffset = parseInt(self.$messages[i].parent().offset().left, 10) ;
if(parentOffset){
parentOffset -= 312
}else{
parentOffset += 312
}
if(parentWidth > self.stepWidth){
// message block went over the left edge
if(parentOffset <0){
self.$messages[i].css({marginLeft:Math.abs(parentOffset+ self.stepWidth)+'px'});
}
}
}
};
return that;

@ -1 +1 @@
var EXPO=EXPO||{};EXPO.registration=EXPO.registration||{},EXPO.registration.completion?console.warn("WARNING: EXPO.registration..completion is already defined!"):EXPO.registration.completion=function(){var e={},t=function(e){var t=$("#end-reg"),o="pwf-line",i=EXPO.common.opt.activeClass,r="phone",n="label",a=EXPO.common.opt.errMessageClass;if($("."+a,t).removeClass(i),e.success)location=e.redirect;else{console.log(e);for(var s in e.errors)e.errors.hasOwnProperty(s)&&($itemWrap=$("#id_"+s).closest("."+o),$("."+a,$itemWrap).addClass(i).text(e.errors[s][0]),$itemWrap.hasClass(r)&&$("."+n,$itemWrap).hide())}},o=function(e){$("#id_country").val("159").select2({placeholder:"Ваша страна",width:e}),$("#id_city").select2({placeholder:"Ваш город",width:e,ajax:{url:"/city/get-city/",dataType:"json",quietMillis:200,data:function(e,t,o){var o=$("#id_country").val();return{term:e,page:t,country:o}},results:function(e){var t=[];return $.each(e,function(e,o){t.push({id:o.id,text:o.label})}),{results:t}}},initSelection:function(e,t){var o=$(e).val(),i=$(e).attr("data-init-text");t({id:o,text:i})}})};e.opt={};EXPO.common;return $(function(){$("body").addClass("body-fixed"),o("100%"),$("#id_code_country").select2({width:"95px"}),$.fancybox.open([{href:"#end-reg"}],{closeBtn:!1,closeClick:!1,modal:!0,scrolling:"no",helpers:{overlay:{closeClick:!1},locked:!0},keys:{close:null}}),$("#end-reg-form").on("submit",function(e){e.preventDefault();var o=$(this).attr("action"),i=$(this).serialize();$.post(o,i,t)})}),e.init=function(e){$.extend(this.opt,e)},e}();
var EXPO=EXPO||{};EXPO.registration=EXPO.registration||{},EXPO.registration.completion?console.warn("WARNING: EXPO.registration..completion is already defined!"):EXPO.registration.completion=function(){var e={},t=function(e){var t=$("#end-reg"),o="pwf-line",i=EXPO.common.opt.activeClass,r="phone",n="label",a=EXPO.common.opt.errMessageClass;if($("."+a,t).removeClass(i),e.success)location=e.redirect;else{console.log(e);for(var s in e.errors)e.errors.hasOwnProperty(s)&&($itemWrap=$("#id_"+s).closest("."+o),$("."+a,$itemWrap).addClass(i).text(e.errors[s][0]),$itemWrap.hasClass(r)&&$("."+n,$itemWrap).hide())}},o=function(e){$("#id_country").val("159").select2({placeholder:"Ваша страна",width:e}).on("change",function(){var e=$("option:selected",this).attr("data-phone-code");""!=$.trim(e)?$("#id_code_country").select2("val",e):$("#id_code_country").select2("val","")}),$("#id_city").select2({placeholder:"Ваш город",width:e,ajax:{url:"/city/get-city/",dataType:"json",quietMillis:200,data:function(e,t,o){var o=$("#id_country").val();return{term:e,page:t,country:o}},results:function(e){var t=[];return $.each(e,function(e,o){t.push({id:o.id,text:o.label})}),{results:t}}},initSelection:function(e,t){var o=$(e).val(),i=$(e).attr("data-init-text");t({id:o,text:i})}})};e.opt={};EXPO.common;return $(function(){$("body").addClass("body-fixed"),o("100%"),$("#id_code_country").select2({width:"95px"}),$.fancybox.open([{href:"#end-reg"}],{closeBtn:!1,closeClick:!1,modal:!0,scrolling:"no",helpers:{overlay:{closeClick:!1},locked:!0},keys:{close:null}}),$("#end-reg-form").on("submit",function(e){e.preventDefault();var o=$(this).attr("action"),i=$(this).serialize();$.post(o,i,t)})}),e.init=function(e){$.extend(this.opt,e)},e}();

@ -1 +1 @@
var EXPO=EXPO||{};EXPO.profile=EXPO.profile||{},EXPO.profile.calendar?console.warn("WARNING: EXPO.profile.calendar is already defined!"):EXPO.profile.calendar=function(){var e=(EXPO.common,{});return e.opt={},$(function(){$("#btn_delete").on("click",function(e){e.preventDefault();var t=$("input[name=expo]:checkbox:checked").map(function(){return $(this).val()}).get(),s=$("input[name=conf]:checkbox:checked").map(function(){return $(this).val()}).get(),o=$("input[name=seminar]:checkbox:checked").map(function(){return $(this).val()}).get(),l=$("input[name=webinar]:checkbox:checked").map(function(){return $(this).val()}).get(),n={expo:JSON.stringify(t),conf:JSON.stringify(s),seminar:JSON.stringify(o),webinar:JSON.stringify(l)};$.get("/profile/calendar/remove/",n,function(e){e.success&&location.reload()})})}),e.init=function(e){$.extend(this.opt,e);var t=this,s=$("#"+this.opt.scrollBoxId),o=$("#"+this.opt.calenadrId),l=(o.find("td."+this.opt.currentDayClass).index()*this.opt.cellWidth,$("#"+this.opt.scrollLeftId)),n=$("#"+this.opt.scrollRightId),c=$("."+this.opt.noEventsClass),i=$("."+this.opt.calendarToggleClass),r=this.opt.cellWidth*this.opt.cellsToScroll,a=0,f=function(){var e,s,o=0,l=0,n=t.opt.cellWidth,c=$("#"+t.opt.calenadrId),i=c.find("td."+t.opt.currentDayClass).index(),r=t.opt.cellsToScroll,a=c.find("."+t.opt.daysClass+" td").length;return t.stepWidth=r*n,t.calendarWidth=n*a,i>0?(i++,e=a/r,s=a/i,l=e-s,t.currentDay=i,l?(l=Math.floor(l-1),o=r*l*n):o=0):(t.currentDay=0,o=0),o};this.$leftScroll=l,this.$rightScroll=n,this.currentOffset=f(),this.scrollStep=r,this.$scrollBox=s,this.$messages=[],$(function(){c.each(function(){$(this).attr("colspan")&&1!=$(this).attr("colspan")?$(this).width()>t.stepWidth&&t.$messages.push($(".message",$(this)).width(t.stepWidth).css({marginLeft:t.currentOffset+"px"})):$(this).find("."+t.opt.eventWrapClass).addClass("small")}),$("."+t.opt.eventsClass).each(function(){a++,3==a&&$(this).addClass("grey"),4==a&&($(this).addClass("grey"),a=0)})}),$(window).load(function(){s.mCustomScrollbar({axis:"y",horizontalScroll:!0,setLeft:"-"+EXPO.profile.calendar.currentOffset+"px",mouseWheel:{enable:!1},scrollButtons:{enable:!1},contentTouchScroll:!1,scrollInertia:1e3,timeout:0,advanced:{autoScrollOnFocus:!1,updateOnContentResize:!1,updateOnBrowserResize:!1},keyboard:{enable:!1},callbacks:{onScroll:function(){t.$leftScroll.off("click").one("click",function(){t.scrollLeft(t)}),t.$rightScroll.off("click").one("click",function(){t.scrollRight(t)})}}})}),l.one("click",function(){t.scrollLeft(t)}),n.one("click",function(){t.scrollRight(t)}),i.on("click",function(){var e=$(this),t=e.closest(".ep-sect"),s=t.children("div.ep-sect-body");return t.hasClass("eps-opened")?(n.hide(),l.hide(),s.stop().animate({opacity:0},300,function(){t.removeClass("eps-opened")})):(n.show(),l.show(),s.stop().animate({opacity:1},300,function(){t.addClass("eps-opened")})),!1})},e.scrollRight=function(e){return e||(e=this),e.$rightScroll.off("click"),e.currentOffset+e.stepWidth<e.calendarWidth&&(e.currentOffset+=e.scrollStep,console.log("!!! right scroll fired!"),e.$scrollBox.mCustomScrollbar("scrollTo","-="+e.scrollStep),e.offsetMessages()),!1},e.scrollLeft=function(e){return e||(e=this),e.$leftScroll.off("click"),e.currentOffset>=e.stepWidth&&(e.currentOffset-=e.scrollStep,console.log("!!! left scroll fired!"),e.$scrollBox.mCustomScrollbar("scrollTo","+="+e.scrollStep),e.offsetMessages(e)),!1},e.offsetMessages=function(e){e||(e=this);for(var t=0;t<e.$messages.length;t++){var s=parseInt(e.$messages[t].inlineStyle("margin-left"));s>=0&&(e.$messages[t].addClass("hidden"),e.$messages[t].css({marginLeft:e.currentOffset+"px"}),e.$messages[t].removeClass("hidden"))}},e}();
var EXPO=EXPO||{};EXPO.profile=EXPO.profile||{},EXPO.profile.calendar?console.warn("WARNING: EXPO.profile.calendar is already defined!"):EXPO.profile.calendar=function(){var t=(EXPO.common,{});return t.opt={},$(function(){$("#btn_delete").on("click",function(t){t.preventDefault();var e=$("input[name=expo]:checkbox:checked").map(function(){return $(this).val()}).get(),s=$("input[name=conf]:checkbox:checked").map(function(){return $(this).val()}).get(),o=$("input[name=seminar]:checkbox:checked").map(function(){return $(this).val()}).get(),l=$("input[name=webinar]:checkbox:checked").map(function(){return $(this).val()}).get(),n={expo:JSON.stringify(e),conf:JSON.stringify(s),seminar:JSON.stringify(o),webinar:JSON.stringify(l)};$.get("/profile/calendar/remove/",n,function(t){t.success&&location.reload()})})}),t.init=function(t){$.extend(this.opt,t);var e=this,s=$("#"+this.opt.scrollBoxId),o=$("#"+this.opt.calenadrId),l=(o.find("td."+this.opt.currentDayClass).index()*this.opt.cellWidth,$("#"+this.opt.scrollLeftId)),n=$("#"+this.opt.scrollRightId),c=$("."+this.opt.noEventsClass),i=$("."+this.opt.calendarToggleClass),r=this.opt.cellWidth*this.opt.cellsToScroll,a=function(){var t,s,o=0,l=0,n=e.opt.cellWidth,c=$("#"+e.opt.calenadrId),i=c.find("."+e.opt.daysClass+" td."+e.opt.currentDayClass).index(),r=e.opt.cellsToScroll,a=c.find("."+e.opt.daysClass+" td").length;return i>0?(i++,t=a/r,s=a/i,l=t-Math.floor(s),e.currentDay=i,l?(l--,o=r*l*n):o=0):(e.currentDay=0,o=0),o};this.$leftScroll=l,this.$rightScroll=n,this.currentOffset=a(),this.scrollStep=r,this.$scrollBox=s,this.$messages=[],this.stepWidth=e.opt.cellsToScroll*e.opt.cellWidth,$(function(){c.each(function(){$(this).attr("colspan")&&1!=$(this).attr("colspan")?$(this).width()>e.stepWidth&&e.$messages.push($(".message",$(this)).width(e.stepWidth).css({marginLeft:e.currentOffset+"px"})):$(this).find("."+e.opt.eventWrapClass).addClass("small")}),$("."+e.opt.eventsClass+":even").addClass("grey")}),$(window).load(function(){e.calendarWidth=e.opt.cellWidth*o.find("."+e.opt.daysClass+" td").length,s.mCustomScrollbar({axis:"y",horizontalScroll:!0,setLeft:"-"+e.currentOffset+"px",mouseWheel:{enable:!1},scrollButtons:{enable:!1},contentTouchScroll:!1,scrollInertia:1e3,timeout:0,advanced:{autoScrollOnFocus:!1,updateOnContentResize:!1,updateOnBrowserResize:!1},keyboard:{enable:!1},callbacks:{onScroll:function(){e.$leftScroll.off("click").one("click",function(){e.scrollLeft(e)}),e.$rightScroll.off("click").one("click",function(){e.scrollRight(e)})}}}),l.one("click",function(){e.scrollLeft(e)}),n.one("click",function(){e.scrollRight(e)})}),i.on("click",function(){var t=$(this),e=t.closest(".ep-sect"),s=e.children("div.ep-sect-body");return e.hasClass("eps-opened")?(n.hide(),l.hide(),s.stop().animate({opacity:0},300,function(){e.removeClass("eps-opened")})):(n.show(),l.show(),s.stop().animate({opacity:1},300,function(){e.addClass("eps-opened")})),!1})},t.scrollRight=function(t){return t||(t=this),t.currentOffset+t.stepWidth<t.calendarWidth&&(t.currentOffset+=t.scrollStep,console.log("!!! right scroll fired!"),t.$scrollBox.mCustomScrollbar("scrollTo","-="+t.scrollStep),t.offsetMessages()),!1},t.scrollLeft=function(t){return t||(t=this),t.currentOffset>=t.stepWidth&&(t.currentOffset-=t.scrollStep,console.log("!!! left scroll fired!"),t.$scrollBox.mCustomScrollbar("scrollTo","+="+t.scrollStep),t.offsetMessages(t)),!1},t.offsetMessages=function(t){t||(t=this);for(var e=0;e<t.$messages.length;e++){var s=t.$messages[e].parent().width(),o=parseInt(t.$messages[e].parent().offset().left,10);o?o-=312:o+=312,s>t.stepWidth&&0>o&&t.$messages[e].css({marginLeft:Math.abs(o+t.stepWidth)+"px"})}},t}();
Loading…
Cancel
Save