expo-11 frontend ready

remotes/origin/1203
pavel 11 years ago
parent 2db0813f74
commit f5cdb64893
  1. 176
      templates/client/includes/accounts/calendar_table.html
  2. 1314
      templates/client/static_client/css/jquery.mCustomScrollbar.min.css
  3. 84
      templates/client/static_client/css/main.css
  4. 88
      templates/client/static_client/js/_modules/page.profile.calendar.js
  5. 54
      templates/client/static_client/js/main.js

@ -6,7 +6,7 @@
<div class="ep-sect eps-opened">
<div class="ep-sect-title"><a class="eps-open" href="#">{% trans 'визуализация' %}</a></div>
<div class="ep-sect-body">
<div class="ep-sect-body calenadar-body">
<header>
<div class="pc-month-wrap">
<a class="pcm-prev" href="/profile/calendar/?year={{ days.0|add_month:'-1'|date:'Y' }}&month={{ days.0|add_month:'-1'|date:'m' }}">&lt;</a>
@ -15,14 +15,15 @@
</div>
</header>
<div class="cal-wrap">
<div class="calendar-container" id="calendar-container">
<div class="scroll-content">
<table>
<div class="calendar-container" >
<div class="scroll-content" id="calendar-scroll-box">
<table id="calendar-table">
<tbody class="cal-days">
<tr>
{% for day in days %}
{% ifnotequal day current_day %}
<td><div><b>{{ day|date:"d" }}</b>/<i>{{ day|date:"D"|lower }}</i></div></td>
<td width="115"><div><b>{{ day|date:"d" }}</b>/<i>{{ day|date:"D"|lower }}</i></div></td>
{% else %}
<td class="c-cur">
<div>
@ -35,115 +36,126 @@
</tr>
</tbody>
<tbody class="cal-body">
{% for event in events %}
<tr>
{% for day in days %}
{% if event|in_event:day %}
{% if day.month == event.data_begin.month %}
{% if day.day == event.data_begin.day %}
<td class="c-cur" colspan="{{ event|duration:day.month }}">
<div class="c-event {% if day.month != event.data_end.month %}cont-next{% endif %}">
<div class="ce-wrap">
<h3><a href="{{ event.get_permanent_url }}">{{ event.name|safe }}</a></h3>
<div class="ce-info">
<div class="cei-icons">
<span class="ce-ico icon-check"></span>
<span class="ce-ico icon-fav"></span>
</div>
<div class="cei-place">{{ event.country }}, {{ event.city }}
{% if event.plave %}
, {{ event.place.address.address }}
{% endif %}
</div>
<tbody class="cal-body">
{% for event in events %}
<tr>
{% for day in days %}
{% if event|in_event:day %}
{% if day.month == event.data_begin.month %}
{% if day.day == event.data_begin.day %}
<td class="c-cur" colspan="{{ event|duration:day.month }}">
<div class="c-event {% if day.month != event.data_end.month %}cont-next{% endif %}">
<div class="ce-wrap">
<h3><a href="{{ event.get_permanent_url }}">{{ event.name|safe }}</a></h3>
<div class="ce-info">
<div class="cei-icons">
<span class="ce-ico icon-check"></span>
<span class="ce-ico icon-fav"></span>
</div>
<div class="cei-place">{{ event.country }}, {{ event.city }}
{% if event.plave %}
, {{ event.place.address.address }}
{% endif %}
</div>
</div>
</div>
</td>
{% endif %}
{% else %}
{% if day.day == event.data_end.day %}
<td class="c-cur" colspan="{{ event|duration:day.month }}">
<div class="c-event cont-prev">
<div class="ce-wrap">
<h3><a href="{{ event.get_permanent_url }}">{{ event.name|safe }}</a></h3>
<div class="ce-info">
<div class="cei-icons">
<span class="ce-ico icon-check"></span>
<span class="ce-ico icon-fav"></span>
</div>
<div class="cei-place">{{ event.country }}, {{ event.city }}
{% if event.plave %}
, {{ event.place.address.address }}
{% endif %}
</div>
</div>
</td>
{% endif %}
{% else %}
{% if day.day == event.data_end.day %}
<td class="c-cur" colspan="{{ event|duration:day.month }}">
<div class="c-event cont-prev">
<div class="ce-wrap">
<h3><a href="{{ event.get_permanent_url }}">{{ event.name|safe }}</a></h3>
<div class="ce-info">
<div class="cei-icons">
<span class="ce-ico icon-check"></span>
<span class="ce-ico icon-fav"></span>
</div>
<div class="cei-place">{{ event.country }}, {{ event.city }}
{% if event.plave %}
, {{ event.place.address.address }}
{% endif %}
</div>
</div>
</div>
</td>
{% endif %}
</div>
</td>
{% endif %}
{% else %}
{% ifnotequal day current_day %}
<td></td>
{% else %}
<td class="c-cur"></td>
{% endifnotequal %}
{% endif %}
{% endfor %}
</tr>
<tr class="c-sep">
{% for day in days %}
{% else %}
{% ifnotequal day current_day %}
<td></td>
{% else %}
<td class="c-cur"></td>
<td class="c-cur"></td>
{% endifnotequal %}
{% endfor %}
</tr>
{% endif %}
{% endfor %}
</tbody>
{% if events %}
<tbody class="cal-days">
<tr>
</tr>
<tr class="c-sep">
{% for day in days %}
{% ifnotequal day current_day %}
<td><div><b>{{ day|date:"d" }}</b>/<i>{{ day|date:"D"|lower }}</i></div></td>
<td></td>
{% else %}
<td class="c-cur">
<div>
<div class="cur-mark">{% trans 'Сегодня' %}</div>
<b>{{ day|date:"d" }}</b>/<i>{{ day|date:"D"|lower }}</i>
</div>
</td>
<td class="c-cur"></td>
{% endifnotequal %}
{% endfor %}
</tr>
</tbody>
{% endif %}
</tr>
{% endfor %}
</tbody>
{% comment %}
{% if events %}
<tbody class="cal-days">
<tr>
{% for day in days %}
{% ifnotequal day current_day %}
<td><div><b>{{ day|date:"d" }}</b>/<i>{{ day|date:"D"|lower }}</i></div></td>
{% else %}
<td class="c-cur">
<div>
<div class="cur-mark">{% trans 'Сегодня' %}</div>
<b>{{ day|date:"d" }}</b>/<i>{{ day|date:"D"|lower }}</i>
</div>
</td>
{% endifnotequal %}
{% endfor %}
</tr>
</tbody>
{% endif %}
{% endcomment %}
</table>
</div>
</div>
</div>
</div>
<div class="cal-scroll-button to-left" id="cal-scroll-left"><span class="sprite">&nbsp;</span></div>
<div class="cal-scroll-button to-right" id="cal-scroll-right"><span class="sprite">&nbsp;</span></div>
</div>
{% block scripts %}
<script src="{% static 'client/js/_modules/page.profile.calendar.js' %}"></script>
<script>
EXPO.calendar.init({
containerId: 'calendar-container',
EXPO.profile.calendar.init({
calenadrId:'calendar-table',
scrollBoxId: 'calendar-scroll-box',
currentDayClass:'c-cur',
daysClass:'cal-days',
bodyClass: 'cal-body'
bodyClass: 'cal-body',
scrollLeftId: 'cal-scroll-left',
scrollRightId: 'cal-scroll-right',
calendarToggleClass:'eps-open',
cellWidth: 137,
cellsToScroll:7
});
</script>

File diff suppressed because one or more lines are too long

@ -9290,14 +9290,29 @@ a.order-button:hover .ob-text,
margin: 0 -20px;
}
.calendar-container{
width: 100%;
position: relative;
padding-right: 20px;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.calendar-container .scroll-content {
padding: 25px 20px 5px;
padding: 25px 0 5px;
width: 100%;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.calendar-container table {
border-collapse: collapse;
}
.calendar-container .cal-days td > div {
width: 136px;
}
.calendar-container table td {
width: 115px;
border-left: 1px dotted #cccccc;
@ -9331,7 +9346,7 @@ a.order-button:hover .ob-text,
.calendar-container .cal-days td.c-cur > div {
position: relative;
width: 100%;
width: 136px;
background: #fff0e5;
padding-top: 33px;
margin: -33px -1px 0;
@ -12550,3 +12565,68 @@ hr + .rq-note {
list-style-type: none;
}
/************************\
# страница календаря /profile/calendar/
\***********************/
.cal-scroll-button .sprite{
display: block;
width: 17px;
height: 17px;
border-radius: 10px;
background: #464646;
-webkit-transition: all .3s;
-o-transition: all .3s;
transition: all .3s;
padding-left: 4px;
padding-top: 3px;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.cal-scroll-button .sprite:before{
display: block;
content: '';
width: 8px;
height: 12px;
background: transparent url(../img/sprites.png) -225px -134px no-repeat;
}
.cal-scroll-button:hover .sprite{
background: #ff6600;
}
.cal-scroll-button{
position: absolute;
top: 0;
width: 34px;
height: 34px;
border-radius: 17px;
background: #FCFCFB;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
padding-left: 9px;
padding-top: 9px;
cursor: pointer;
margin-top: 96px;
}
.cal-scroll-button.to-left{
left: 0;
margin-left: 6px;
}
.cal-scroll-button.to-right{
right: 0;
margin-right: 6px;
}
.cal-scroll-button.to-right .sprite{
padding-left: 5px;
}
.cal-scroll-button.to-right .sprite:before{
background-position: -175px 0;
}
.calenadar-body{
overflow: hidden;
}

@ -0,0 +1,88 @@
var EXPO = EXPO || {}; //isolated namespace
EXPO.profile = EXPO.profile || {};
if (EXPO.profile.calendar){
console.warn('WARNING: EXPO.profile.calendar is already defined!');
}else {
EXPO.profile.calendar = (function () {
// dependencies
var com = EXPO.common;
// variables
var that = {};
that.opt = {}; //свойства по умолчанию
//private
$(function () {
});
// methods
//инициализация общих свойств
that.init = function (options) {
$.extend(this.opt, options);
/**
* scrolling calendar object
* depend on mCustomScroll Jquery plugin
* @type {*|jQuery|HTMLElement}
*/
var $scrollBox = $('#'+this.opt.scrollBoxId),
$calendar = $('#'+this.opt.calenadrId),
currentDayOffset = $calendar.find('td.'+this.opt.currentDayClass).index()*this.opt.cellWidth,
$leftScroll = $('#'+this.opt.scrollLeftId),
$rightScroll = $('#'+this.opt.scrollRightId),
$calendarToggle = $('.'+this.opt.calendarToggleClass);
scrollStep = this.opt.cellWidth*this.opt.cellsToScroll;
$(window).load(function(){
$scrollBox.mCustomScrollbar({
axis:'y',
horizontalScroll: true,
advanced:{ // Advanced options
autoScrollOnFocus: false,
updateOnContentResize: false, // Scrollbar will be updated on content resize
updateOnBrowserResize: false // Scrollbar will be updated on browser resize
}
});
$scrollBox.mCustomScrollbar("scrollTo",currentDayOffset);
});
$leftScroll.on('click', function () {
$scrollBox.mCustomScrollbar("scrollTo",'+='+scrollStep);
});
$rightScroll.on('click', function () {
$scrollBox.mCustomScrollbar("scrollTo",'-='+scrollStep);
});
$calendarToggle.on('click', function () {
var $switch = $(this);
var $sect = $switch.closest('.ep-sect');
var $sectBody = $sect.children('div.ep-sect-body');
if ($sect.hasClass('eps-opened')) {
$rightScroll.hide();
$leftScroll.hide();
$sectBody
.stop()
.animate({
height: 0,
opacity: 0
}, 300, function () {
$sect.removeClass('eps-opened');
});
} else {
$rightScroll.show();
$leftScroll.show();
$sectBody
.stop()
.animate({
height: 'auto',
opacity: 1
}, 300, function () {
$sect.addClass('eps-opened');
});
}
return false;
});
};
return that;
}());
}

@ -1023,33 +1023,33 @@ function placeInput(width){
return false;
});
$('a.eps-open').on('click', function () {
var $switch = $(this);
var $sect = $switch.closest('.ep-sect');
var $sectBody = $sect.children('div.ep-sect-body');
if ($sect.hasClass('eps-opened')) {
$sectBody
.stop()
.animate({
height: 'hide',
opacity: 'hide'
}, 300, function () {
$sect.removeClass('eps-opened');
});
} else {
$sectBody
.stop()
.animate({
height: 'show',
opacity: 'show'
}, 300, function () {
$sect.addClass('eps-opened');
});
}
return false;
});
//$('a.eps-open').on('click', function () {
// var $switch = $(this);
// var $sect = $switch.closest('.ep-sect');
// var $sectBody = $sect.children('div.ep-sect-body');
//
// if ($sect.hasClass('eps-opened')) {
// $sectBody
// .stop()
// .animate({
// height: 'hide',
// opacity: 'hide'
// }, 300, function () {
// $sect.removeClass('eps-opened');
// });
// } else {
// $sectBody
// .stop()
// .animate({
// height: 'show',
// opacity: 'show'
// }, 300, function () {
// $sect.addClass('eps-opened');
// });
// }
//
// return false;
//});
/* Custom scroll для календаря*/
//$('div.calendar-container').each(function () {

Loading…
Cancel
Save