2015-06-26 15:25:44 -04:00

71 lines
2.7 KiB
PHTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.16/angular.js" type="text/javascript"></script>
<link rel="stylesheet" href="<?php echo $this->css?>" type="text/css">
<script src="<?php echo $this->jquery ?>" type="text/javascript"></script>
<link href='https://fonts.googleapis.com/css?family=Roboto:400,100,300,700' rel='stylesheet' type='text/css'>
<script type="text/javascript">
$(document).ready(function() {
//initialize first day to active
$('.tabs').find("li").first().addClass("active");
$('.schedule_content').find('.schedule_item').first().addClass("active");
$('.tabs li').click(function(){
//var tab_id = $(this).attr('data-tab');
var tab_id = "day-"+$(this).find('span').text();
$('.tabs li').removeClass('active');
$('.schedule_item').removeClass('active');
$(this).addClass('active');
$("#"+tab_id).addClass('active');
});
});
var schedule_data = <?php echo $this->schedule_data; ?>;
console.log(schedule_data);
var app = angular.module('scheduleWidget', []);
app.controller('scheduleController', ['$scope', '$window', function($scope, $window) {
$scope.schedule_data = $window.schedule_data["scheduleData"];
$scope.isEmpty = function(obj) {
return obj.length == 0;
};
}]);
</script>
</head>
<body ng-app="scheduleWidget" ng-controller="scheduleController">
<div class="schedule tab_content current">
<ul class="tabs">
<li ng-repeat="x in schedule_data track by $index">
{{x.dayOfWeek}}<span>{{x.dayOfMonth}}</span>
</li>
</ul>
<div class="schedule_content">
<div ng-repeat="x in schedule_data track by $index" ng-attr-id="{{'day-' + x.dayOfMonth}}" class="schedule_item">
<div ng-if="isEmpty(x.shows)" class="row empty-schedule">Looks like there are no shows scheduled on this day.</div>
<div ng-repeat="show in x.shows" class="row">
<div class="time_grid">{{show.show_start_hour}} - {{show.show_end_hour}}</div>
<div class="name_grid">{{show.name}}</div>
</div>
</div>
</div>
<div class="weekly-schedule-widget-footer" <?php if ($this->widgetStyle == "premium") echo "style='display:none'"; ?>>
<a href="https://airtime.pro" target="_blank">Powered by <span>Airtime Pro</span></a>
</div>
</div>
</body>
</html>