EXPO-11 complete (my calenadar)

remotes/origin/1203
pavel 11 years ago
parent f10cc403aa
commit 85326c7079
  1. 21
      templates/client/includes/accounts/calendar_table.html
  2. 21
      templates/client/static_client/css/main.css
  3. 28
      templates/client/static_client/js/_modules/page.profile.calendar.js
  4. 2
      templates/client/static_client/js_min/_modules/page.profile.calendar.min.js

@ -51,7 +51,7 @@
{% else %}
{% if day_colspan|get_item:day|get_item:'counter' %}
{# здесь ячейка с днями без событий #}
<td class="c-cur" colspan="{{ day_colspan|get_item:day|get_item:'counter' }}">
<td class="c-cur no-events" colspan="{{ day_colspan|get_item:day|get_item:'counter' }}">
<div class="c-event">
<div class="ce-wrap">{% trans "Нет отмеченых событий" %}</div>
</div>
@ -64,7 +64,17 @@
{% endfor %}
</tr>
<tr class="c-sep">
{% for day in days %}
{% ifnotequal day current_day %}
<td></td>
{% else %}
<td class="c-cur"></td>
{% endifnotequal %}
{% endfor %}
</tr>
{% for event in events %}
<tr>
{% for day in days %}
@ -73,7 +83,7 @@
{% 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="c-event active-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>
@ -151,7 +161,9 @@
<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' %}{% if debug %}/{% else %}_min/{% endif %}_modules/page.profile.calendar{% if debug %}{% else %}.min{% endif %}.js"></script>
<!--todo: вернуть минифицированную версию-->
<!--<script src="{% static 'client/js' %}{% if debug %}/{% else %}_min/{% endif %}_modules/page.profile.calendar{% if debug %}{% else %}.min{% endif %}.js"></script>-->
<script src="{% static 'client/js/_modules/page.profile.calendar.js' %}"></script>
<script>
EXPO.profile.calendar.init({
calenadrId:'calendar-table',
@ -162,6 +174,9 @@
scrollLeftId: 'cal-scroll-left',
scrollRightId: 'cal-scroll-right',
calendarToggleClass:'eps-open',
noEventsClass:'no-events',
eventsClass:'active-event',
eventWrapClass:'ce-wrap',
cellWidth: 137,
cellsToScroll:7

@ -12616,6 +12616,27 @@ hr + .rq-note {
.calenadar-body{
overflow: hidden;
}
.no-events .c-event{
background-color: #CACACA;
}
.no-events .c-event .ce-wrap{
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
height: 60px;
text-align: center;
padding-top: 20px;
font-size: 20px;
/*line-height: 44px;*/
color: #464646;
font-family: 'dindisplay_pro';
text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
}
.no-events .c-event .ce-wrap.small{
font-size: 14px;
padding-top: 14px;
}
/************************\
# страница редактирования профиля

@ -25,13 +25,34 @@ if (EXPO.profile.calendar){
* depend on mCustomScroll Jquery plugin
* @type {*|jQuery|HTMLElement}
*/
var $scrollBox = $('#'+this.opt.scrollBoxId),
var self = this,
$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;
$noEventsField = $('.'+this.opt.noEventsClass),
$calendarToggle = $('.'+this.opt.calendarToggleClass),
scrollStep = this.opt.cellWidth*this.opt.cellsToScroll,
index = 0;
$(function () {
$noEventsField.each(function () {
if(!$(this).attr('colspan') || $(this).attr('colspan') == 1){
$(this).find('.'+self.opt.eventWrapClass).addClass('small');
}
});
$('.'+self.opt.eventsClass).each(function () {
index++;
if(index == 3 ){
$(this).addClass('grey');
}
if(index == 4 ){
$(this).addClass('grey');
index = 0;
}
});
});
$(window).load(function(){
$scrollBox.mCustomScrollbar({
@ -80,6 +101,7 @@ if (EXPO.profile.calendar){
return false;
});
};
return that;
}());

@ -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 o=(EXPO.common,{});return o.opt={},$(function(){}),o.init=function(o){$.extend(this.opt,o);var l=$("#"+this.opt.scrollBoxId),t=$("#"+this.opt.calenadrId),e=t.find("td."+this.opt.currentDayClass).index()*this.opt.cellWidth,s=$("#"+this.opt.scrollLeftId),n=$("#"+this.opt.scrollRightId),c=$("."+this.opt.calendarToggleClass);scrollStep=this.opt.cellWidth*this.opt.cellsToScroll,$(window).load(function(){l.mCustomScrollbar({axis:"y",horizontalScroll:!0,advanced:{autoScrollOnFocus:!1,updateOnContentResize:!1,updateOnBrowserResize:!1}}),l.mCustomScrollbar("scrollTo",e)}),s.on("click",function(){l.mCustomScrollbar("scrollTo","+="+scrollStep)}),n.on("click",function(){l.mCustomScrollbar("scrollTo","-="+scrollStep)}),c.on("click",function(){var o=$(this),l=o.closest(".ep-sect"),t=l.children("div.ep-sect-body");return l.hasClass("eps-opened")?(n.hide(),s.hide(),t.stop().animate({opacity:0},300,function(){l.removeClass("eps-opened")})):(n.show(),s.show(),t.stop().animate({opacity:1},300,function(){l.addClass("eps-opened")})),!1})},o}();
var EXPO=EXPO||{};EXPO.profile=EXPO.profile||{},EXPO.profile.calendar?console.warn("WARNING: EXPO.profile.calendar is already defined!"):EXPO.profile.calendar=function(){var o=(EXPO.common,{});return o.opt={},$(function(){}),o.init=function(o){$.extend(this.opt,o);var t=this,s=$("#"+this.opt.scrollBoxId),l=$("#"+this.opt.calenadrId),e=l.find("td."+this.opt.currentDayClass).index()*this.opt.cellWidth,n=$("#"+this.opt.scrollLeftId),i=$("#"+this.opt.scrollRightId),a=$("."+this.opt.noEventsClass),c=$("."+this.opt.calendarToggleClass),r=this.opt.cellWidth*this.opt.cellsToScroll,d=0;$(function(){a.each(function(){$(this).attr("colspan")&&1!=$(this).attr("colspan")||$(this).find("."+t.opt.eventWrapClass).addClass("small")}),$("."+t.opt.eventsClass).each(function(){d++,3==d&&$(this).addClass("grey"),4==d&&($(this).addClass("grey"),d=0)})}),$(window).load(function(){s.mCustomScrollbar({axis:"y",horizontalScroll:!0,advanced:{autoScrollOnFocus:!1,updateOnContentResize:!1,updateOnBrowserResize:!1}}),s.mCustomScrollbar("scrollTo",e)}),n.on("click",function(){s.mCustomScrollbar("scrollTo","+="+r)}),i.on("click",function(){s.mCustomScrollbar("scrollTo","-="+r)}),c.on("click",function(){var o=$(this),t=o.closest(".ep-sect"),s=t.children("div.ep-sect-body");return t.hasClass("eps-opened")?(i.hide(),n.hide(),s.stop().animate({opacity:0},300,function(){t.removeClass("eps-opened")})):(i.show(),n.show(),s.stop().animate({opacity:1},300,function(){t.addClass("eps-opened")})),!1})},o}();
Loading…
Cancel
Save