Add Calendar Tab back. Fixes #32

pull/2/head
Leonardo Galli 8 years ago committed by GitHub
parent 199d9c93ed
commit 967d3fd5c0

@ -2,24 +2,38 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using NzbDrone.Api.Episodes; using NzbDrone.Api.Episodes;
using NzbDrone.Api.Movie;
using NzbDrone.Core.Datastore.Events;
using NzbDrone.Core.MediaCover;
using NzbDrone.Core.MediaFiles;
using NzbDrone.Core.MediaFiles.Events;
using NzbDrone.Core.Messaging.Events;
using NzbDrone.Core.MovieStats;
using NzbDrone.Core.Tv;
using NzbDrone.Core.Tv.Events;
using NzbDrone.Core.Validation.Paths;
using NzbDrone.Core.DataAugmentation.Scene;
using NzbDrone.Core.Validation;
using NzbDrone.Core.DecisionEngine; using NzbDrone.Core.DecisionEngine;
using NzbDrone.Core.Tv; using NzbDrone.Core.Tv;
using NzbDrone.SignalR; using NzbDrone.SignalR;
namespace NzbDrone.Api.Calendar namespace NzbDrone.Api.Calendar
{ {
public class CalendarModule : EpisodeModuleWithSignalR public class CalendarModule : MovieModule
{ {
public CalendarModule(IEpisodeService episodeService, public CalendarModule(IBroadcastSignalRMessage signalR,
ISeriesService seriesService, IMovieService moviesService,
IQualityUpgradableSpecification qualityUpgradableSpecification, IMovieStatisticsService moviesStatisticsService,
IBroadcastSignalRMessage signalRBroadcaster) ISceneMappingService sceneMappingService,
: base(episodeService, seriesService, qualityUpgradableSpecification, signalRBroadcaster, "calendar") IMapCoversToLocal coverMapper)
: base(signalR, moviesService, moviesStatisticsService, sceneMappingService, coverMapper, "calendar")
{ {
GetResourceAll = GetCalendar; GetResourceAll = GetCalendar;
} }
private List<EpisodeResource> GetCalendar() private List<MovieResource> GetCalendar()
{ {
var start = DateTime.Today; var start = DateTime.Today;
var end = DateTime.Today.AddDays(2); var end = DateTime.Today.AddDays(2);
@ -33,9 +47,9 @@ namespace NzbDrone.Api.Calendar
if (queryEnd.HasValue) end = DateTime.Parse(queryEnd.Value); if (queryEnd.HasValue) end = DateTime.Parse(queryEnd.Value);
if (queryIncludeUnmonitored.HasValue) includeUnmonitored = Convert.ToBoolean(queryIncludeUnmonitored.Value); if (queryIncludeUnmonitored.HasValue) includeUnmonitored = Convert.ToBoolean(queryIncludeUnmonitored.Value);
var resources = MapToResource(_episodeService.EpisodesBetweenDates(start, end, includeUnmonitored), true, true); var resources = _moviesService.GetMoviesBetweenDates(start, end, includeUnmonitored).Select(MapToResource);
return resources.OrderBy(e => e.AirDateUtc).ToList(); return resources.OrderBy(e => e.InCinemas).ToList();
} }
} }
} }

@ -28,7 +28,7 @@ namespace NzbDrone.Api.Movie
IHandle<MediaCoversUpdatedEvent> IHandle<MediaCoversUpdatedEvent>
{ {
private readonly IMovieService _moviesService; protected readonly IMovieService _moviesService;
private readonly IMovieStatisticsService _moviesStatisticsService; private readonly IMovieStatisticsService _moviesStatisticsService;
private readonly IMapCoversToLocal _coverMapper; private readonly IMapCoversToLocal _coverMapper;
@ -78,13 +78,33 @@ namespace NzbDrone.Api.Movie
PutValidator.RuleFor(s => s.Path).IsValidPath(); PutValidator.RuleFor(s => s.Path).IsValidPath();
} }
public MovieModule(IBroadcastSignalRMessage signalRBroadcaster,
IMovieService moviesService,
IMovieStatisticsService moviesStatisticsService,
ISceneMappingService sceneMappingService,
IMapCoversToLocal coverMapper,
string resource)
: base(signalRBroadcaster, resource)
{
_moviesService = moviesService;
_moviesStatisticsService = moviesStatisticsService;
_coverMapper = coverMapper;
GetResourceAll = AllMovie;
GetResourceById = GetMovie;
CreateResource = AddMovie;
UpdateResource = UpdateMovie;
DeleteResource = DeleteMovie;
}
private MovieResource GetMovie(int id) private MovieResource GetMovie(int id)
{ {
var movies = _moviesService.GetMovie(id); var movies = _moviesService.GetMovie(id);
return MapToResource(movies); return MapToResource(movies);
} }
private MovieResource MapToResource(Core.Tv.Movie movies) protected MovieResource MapToResource(Core.Tv.Movie movies)
{ {
if (movies == null) return null; if (movies == null) return null;

@ -14,6 +14,7 @@ namespace NzbDrone.Core.Tv
Movie FindByTitle(string cleanTitle, int year); Movie FindByTitle(string cleanTitle, int year);
Movie FindByImdbId(string imdbid); Movie FindByImdbId(string imdbid);
Movie FindByTitleSlug(string slug); Movie FindByTitleSlug(string slug);
List<Movie> MoviesBetweenDates(DateTime start, DateTime end, bool includeUnmonitored);
List<Movie> GetMoviesByFileId(int fileId); List<Movie> GetMoviesByFileId(int fileId);
void SetFileId(int fileId, int movieId); void SetFileId(int fileId, int movieId);
} }
@ -119,5 +120,17 @@ namespace NzbDrone.Core.Tv
{ {
return Query.Where(m => m.TitleSlug == slug).FirstOrDefault(); return Query.Where(m => m.TitleSlug == slug).FirstOrDefault();
} }
public List<Movie> MoviesBetweenDates(DateTime start, DateTime end, bool includeUnmonitored)
{
var query = Query.Where(m => m.InCinemas >= start && m.InCinemas <= end).OrWhere(m => m.PhysicalRelease >= start && m.PhysicalRelease <= end);
if (!includeUnmonitored)
{
query.AndWhere(e => e.Monitored);
}
return query.ToList();
}
} }
} }

@ -26,6 +26,7 @@ namespace NzbDrone.Core.Tv
Movie FindByTitleInexact(string title); Movie FindByTitleInexact(string title);
Movie FindByTitleSlug(string slug); Movie FindByTitleSlug(string slug);
Movie GetMovieByFileId(int fileId); Movie GetMovieByFileId(int fileId);
List<Movie> GetMoviesBetweenDates(DateTime start, DateTime end, bool includeUnmonitored);
void DeleteMovie(int movieId, bool deleteFiles); void DeleteMovie(int movieId, bool deleteFiles);
List<Movie> GetAllMovies(); List<Movie> GetAllMovies();
Movie UpdateMovie(Movie movie); Movie UpdateMovie(Movie movie);
@ -224,5 +225,12 @@ namespace NzbDrone.Core.Tv
{ {
return _movieRepository.FindByTitleSlug(slug); return _movieRepository.FindByTitleSlug(slug);
} }
public List<Movie> GetMoviesBetweenDates(DateTime start, DateTime end, bool includeUnmonitored)
{
var episodes = _movieRepository.MoviesBetweenDates(start.ToUniversalTime(), end.ToUniversalTime(), includeUnmonitored);
return episodes;
}
} }
} }

@ -26,6 +26,12 @@ var QueueCollection = PageableCollection.extend({
}); });
}, },
findMovie : function(movieId) {
return _.find(this.fullCollection.models, function(queueModel) {
return queueModel.get('movie').id === movieId;
});
},
sortMappings : { sortMappings : {
series : { series : {
sortValue : function(model, attr) { sortValue : function(model, attr) {

@ -1,5 +1,5 @@
var Backbone = require('backbone'); var Backbone = require('backbone');
var EpisodeModel = require('../Series/EpisodeModel'); var EpisodeModel = require('../Movies/MovieModel');
module.exports = Backbone.Collection.extend({ module.exports = Backbone.Collection.extend({
url : window.NzbDrone.ApiRoot + '/calendar', url : window.NzbDrone.ApiRoot + '/calendar',
@ -7,7 +7,7 @@ module.exports = Backbone.Collection.extend({
tableName : 'calendar', tableName : 'calendar',
comparator : function(model) { comparator : function(model) {
var date = new Date(model.get('airDateUtc')); var date = new Date(model.get('inCinemas'));
var time = date.getTime(); var time = date.getTime();
return time; return time;
} }

@ -23,24 +23,6 @@
</div> </div>
</div> </div>
</div> </div>
<div class="form-group">
<label class="col-sm-3 control-label">Season Premiers Only</label>
<div class="col-sm-4">
<div class="input-group">
<label class="checkbox toggle well">
<input type="checkbox" name="premiersOnly" class="form-control x-premiersOnly"/>
<p>
<span>Yes</span>
<span>No</span>
</p>
<div class="btn btn-primary slide-button"/>
</label>
</div>
</div>
</div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">Tags</label> <label class="col-sm-3 control-label">Tags</label>

@ -10,13 +10,13 @@
<div id="x-calendar" class="calendar"/> <div id="x-calendar" class="calendar"/>
<div class="legend calendar"> <div class="legend calendar">
<ul class='legend-labels'> <ul class='legend-labels'>
<li class="legend-label"><span class="premiere" title="Premiere episode hasn't aired yet"></span>Unaired Premiere</li> <li class="legend-label"><span class="premiere" title="This Movie is still in cinemas and hasn't been released yet. Only poor qualities will be available"></span>In Cinemas</li>
<li class="legend-label"><span class="primary" title="Episode hasn't aired yet"></span>Unaired</li> <li class="legend-label"><span class="primary" title="This movie has only been announced yet."></span>Announced</li>
<li class="legend-label"><span class="warning" title="Episode is currently airing"></span>On Air</li> <!--<li class="legend-label"><span class="warning" title="Episode is currently airing"></span>On Air</li>-->
<li class="legend-label"><span class="purple" title="Episode is currently downloading"></span>Downloading</li> <li class="legend-label"><span class="purple" title="Movie is currently downloading"></span>Downloading</li>
<li class="legend-label"><span class="danger" title="Episode file has not been found"></span>Missing</li> <li class="legend-label"><span class="danger" title="Movie file has not been found"></span>Missing</li>
<li class="legend-label"><span class="success" title="Episode was downloaded and sorted"></span>Downloaded</li> <li class="legend-label"><span class="success" title="Movie was downloaded and sorted"></span>Downloaded</li>
<li class="legend-label"><span class="unmonitored" title="Episode is unmonitored"></span>Unmonitored</li> <li class="legend-label"><span class="unmonitored" title="Movie is unmonitored"></span>Unmonitored</li>
</ul> </ul>
</div> </div>
</div> </div>

@ -98,10 +98,6 @@ module.exports = Marionette.ItemView.extend({
else if (event.model.get('unverifiedSceneNumbering')) { else if (event.model.get('unverifiedSceneNumbering')) {
this._addStatusIcon(element, 'icon-sonarr-form-warning', 'Scene number hasn\'t been verified yet.'); this._addStatusIcon(element, 'icon-sonarr-form-warning', 'Scene number hasn\'t been verified yet.');
} }
else if (event.model.get('series').seriesType === 'anime' && event.model.get('seasonNumber') > 0 && !event.model.has('absoluteEpisodeNumber')) {
this._addStatusIcon(element, 'icon-sonarr-form-warning', 'Episode does not have an absolute episode number');
}
}, },
_eventAfterAllRender : function () { _eventAfterAllRender : function () {
@ -135,11 +131,11 @@ module.exports = Marionette.ItemView.extend({
end : end, end : end,
unmonitored : this.showUnmonitored unmonitored : this.showUnmonitored
}, },
success : this._setEventData.bind(this) success : this._setEventData.bind(this, new Date(start), new Date(end))
}); });
}, },
_setEventData : function(collection) { _setEventData : function(startD, endD, collection) {
if (collection.length === 0) { if (collection.length === 0) {
return; return;
} }
@ -148,20 +144,24 @@ module.exports = Marionette.ItemView.extend({
var self = this; var self = this;
collection.each(function(model) { collection.each(function(model) {
var seriesTitle = model.get('series').title; var seriesTitle = model.get('title');
var start = model.get('airDateUtc'); var start = model.get('inCinemas');
var runtime = model.get('series').runtime; var startDate = new Date(start);
if (!(startD <= startDate && startDate <= endD)) {
start = model.get("physicalRelease");
}
var runtime = model.get('runtime');
var end = moment(start).add('minutes', runtime).toISOString(); var end = moment(start).add('minutes', runtime).toISOString();
var event = { var event = {
title : seriesTitle, title : seriesTitle,
start : moment(start), start : moment(start),
end : moment(end), end : moment(end),
allDay : false, allDay : true,
statusLevel : self._getStatusLevel(model, end), statusLevel : self._getStatusLevel(model, end),
downloading : QueueCollection.findEpisode(model.get('id')), downloading : QueueCollection.findMovie(model.get('id')),
model : model, model : model,
sortOrder : (model.get('seasonNumber') === 0 ? 1000000 : model.get('seasonNumber') * 10000) + model.get('episodeNumber') sortOrder : 0
}; };
events.push(event); events.push(event);
@ -172,11 +172,12 @@ module.exports = Marionette.ItemView.extend({
_getStatusLevel : function(element, endTime) { _getStatusLevel : function(element, endTime) {
var hasFile = element.get('hasFile'); var hasFile = element.get('hasFile');
var downloading = QueueCollection.findEpisode(element.get('id')) || element.get('grabbed'); var downloading = QueueCollection.findMovie(element.get('id')) || element.get('grabbed');
var currentTime = moment(); var currentTime = moment();
var start = moment(element.get('airDateUtc')); var start = moment(element.get('inCinemas'));
var status = element.getStatus();
var end = moment(endTime); var end = moment(endTime);
var monitored = element.get('series').monitored && element.get('monitored'); var monitored = element.get('monitored');
var statusLevel = 'primary'; var statusLevel = 'primary';
@ -192,16 +193,16 @@ module.exports = Marionette.ItemView.extend({
statusLevel = 'unmonitored'; statusLevel = 'unmonitored';
} }
else if (currentTime.isAfter(start) && currentTime.isBefore(end)) { else if (status == "inCinemas") {
statusLevel = 'warning'; statusLevel = 'premiere';
} }
else if (start.isBefore(currentTime) && !hasFile) { else if (status == "released") {
statusLevel = 'danger'; statusLevel = 'danger';
} }
else if (element.get('episodeNumber') === 1) { else if (status == "announced") {
statusLevel = 'premiere'; statusLevel = 'primary';
} }
if (end.isBefore(currentTime.startOf('day'))) { if (end.isBefore(currentTime.startOf('day'))) {
@ -213,12 +214,15 @@ module.exports = Marionette.ItemView.extend({
_reloadCalendarEvents : function() { _reloadCalendarEvents : function() {
this.$el.fullCalendar('removeEvents'); this.$el.fullCalendar('removeEvents');
this._setEventData(this.collection); var view = this.$el.fullCalendar('getView');
var start = moment(view.start.toISOString()).toISOString();
var end = moment(view.end.toISOString()).toISOString();
this._setEventData(new Date(start), new Date(end), this.collection);
}, },
_getOptions : function() { _getOptions : function() {
var options = { var options = {
allDayDefault : false, allDayDefault : true,
weekMode : 'variable', weekMode : 'variable',
firstDay : UiSettings.get('firstDayOfWeek'), firstDay : UiSettings.get('firstDayOfWeek'),
timeFormat : 'h(:mm)t', timeFormat : 'h(:mm)t',
@ -227,41 +231,38 @@ module.exports = Marionette.ItemView.extend({
eventAfterAllRender : this._eventAfterAllRender.bind(this), eventAfterAllRender : this._eventAfterAllRender.bind(this),
windowResize : this._windowResize.bind(this), windowResize : this._windowResize.bind(this),
eventClick : function(event) { eventClick : function(event) {
vent.trigger(vent.Commands.ShowEpisodeDetails, { episode : event.model }); //vent.trigger(vent.Commands.ShowMovieDetails, { movie : event.model });
window.location.href = "movies/"+event.model.get("titleSlug");
} }
}; };
if ($(window).width() < 768) { if ($(window).width() < 768) {
options.defaultView = Config.getValue(this.storageKey, 'basicDay'); options.defaultView = Config.getValue(this.storageKey, 'listYear');
options.header = { options.header = {
left : 'prev,next today', left : 'prev,next today',
center : 'title', center : 'title',
right : 'basicWeek,basicDay' right : 'listYear'
}; };
} }
else { else {
options.defaultView = Config.getValue(this.storageKey, 'basicWeek'); options.defaultView = Config.getValue(this.storageKey, 'month');
options.header = { options.header = {
left : 'prev,next today', left : 'prev,next today',
center : 'title', center : 'title',
right : 'month,basicWeek,basicDay' right : 'month,listYear'
}; };
} }
options.titleFormat = { options.titleFormat = "L";
month : 'MMMM YYYY',
week : UiSettings.get('shortDateFormat'),
day : UiSettings.get('longDateFormat')
};
options.columnFormat = { options.columnFormat = "L"/*{
month : 'ddd', month : 'ddd',
week : UiSettings.get('calendarWeekColumnHeader'), week : UiSettings.get('calendarWeekColumnHeader'),
day : 'dddd' day : 'dddd'
}; };*///For now ignore settings. TODO update that.
options.timeFormat = UiSettings.get('timeFormat'); options.timeFormat = UiSettings.get('timeFormat');

@ -1,17 +1,17 @@
var Backbone = require('backbone'); var Backbone = require('backbone');
var moment = require('moment'); var moment = require('moment');
var EpisodeModel = require('../Series/EpisodeModel'); var EpisodeModel = require('../Movies/MovieModel');
module.exports = Backbone.Collection.extend({ module.exports = Backbone.Collection.extend({
url : window.NzbDrone.ApiRoot + '/calendar', url : window.NzbDrone.ApiRoot + '/calendar',
model : EpisodeModel, model : EpisodeModel,
comparator : function(model1, model2) { comparator : function(model1, model2) {
var airDate1 = model1.get('airDateUtc'); var airDate1 = model1.get('inCinemas');
var date1 = moment(airDate1); var date1 = moment(airDate1);
var time1 = date1.unix(); var time1 = date1.unix();
var airDate2 = model2.get('airDateUtc'); var airDate2 = model2.get('inCinemas');
var date2 = moment(airDate2); var date2 = moment(airDate2);
var time2 = date2.unix(); var time2 = date2.unix();

@ -11,8 +11,8 @@ module.exports = Marionette.ItemView.extend({
}, },
initialize : function() { initialize : function() {
var start = this.model.get('airDateUtc'); var start = this.model.get('inCinemas');
var runtime = this.model.get('series').runtime; var runtime = this.model.get('runtime');
var end = moment(start).add('minutes', runtime); var end = moment(start).add('minutes', runtime);
this.model.set({ this.model.set({

@ -43,6 +43,16 @@
.past { .past {
opacity : 0.8; opacity : 0.8;
} }
.fc-title {
white-space: normal;
}
.fc-list-table {
.past {
opacity: 1.0;
}
}
} }
.event { .event {
@ -102,6 +112,7 @@
.danger { .danger {
border-color : @btn-danger-bg; border-color : @btn-danger-bg;
color: white;
} }
.success { .success {
@ -172,7 +183,7 @@
.danger { .danger {
border-color : @btn-danger-bg; border-color : @btn-danger-bg;
background-color : @btn-danger-bg; background-color : @btn-danger-bg;
color: white;
.color-impaired-background-gradient(90deg, @btn-danger-bg); .color-impaired-background-gradient(90deg, @btn-danger-bg);
} }

@ -1,7 +1,7 @@
/*! /*!
* FullCalendar v2.3.2 Stylesheet * FullCalendar v3.1.0 Stylesheet
* Docs & License: http://fullcalendar.io/ * Docs & License: http://fullcalendar.io/
* (c) 2015 Adam Shaw * (c) 2016 Adam Shaw
*/ */
@ -28,7 +28,10 @@ body .fc { /* extra precedence to overcome jqui */
.fc-unthemed tbody, .fc-unthemed tbody,
.fc-unthemed .fc-divider, .fc-unthemed .fc-divider,
.fc-unthemed .fc-row, .fc-unthemed .fc-row,
.fc-unthemed .fc-popover { .fc-unthemed .fc-content, /* for gutter border */
.fc-unthemed .fc-popover,
.fc-unthemed .fc-list-view,
.fc-unthemed .fc-list-heading td {
border-color: #ddd; border-color: #ddd;
} }
@ -37,7 +40,8 @@ body .fc { /* extra precedence to overcome jqui */
} }
.fc-unthemed .fc-divider, .fc-unthemed .fc-divider,
.fc-unthemed .fc-popover .fc-header { .fc-unthemed .fc-popover .fc-header,
.fc-unthemed .fc-list-heading td {
background: #eee; background: #eee;
} }
@ -45,20 +49,18 @@ body .fc { /* extra precedence to overcome jqui */
color: #666; color: #666;
} }
.fc-unthemed .fc-today { .fc-unthemed td.fc-today {
background: #fcf8e3; background: #fcf8e3;
} }
.fc-highlight { /* when user is selecting cells */ .fc-highlight { /* when user is selecting cells */
background: #bce8f1; background: #bce8f1;
opacity: .3; opacity: .3;
filter: alpha(opacity=30); /* for IE */
} }
.fc-bgevent { /* default look for background events */ .fc-bgevent { /* default look for background events */
background: rgb(143, 223, 130); background: rgb(143, 223, 130);
opacity: .3; opacity: .3;
filter: alpha(opacity=30); /* for IE */
} }
.fc-nonbusiness { /* default look for non-business-hours areas */ .fc-nonbusiness { /* default look for non-business-hours areas */
@ -72,7 +74,6 @@ body .fc { /* extra precedence to overcome jqui */
.fc-icon { .fc-icon {
display: inline-block; display: inline-block;
width: 1em;
height: 1em; height: 1em;
line-height: 1em; line-height: 1em;
font-size: 1em; font-size: 1em;
@ -99,7 +100,6 @@ NOTE: use percentage font sizes or else old IE chokes
.fc-icon:after { .fc-icon:after {
position: relative; position: relative;
margin: 0 -1em; /* ensures character will be centered, regardless of width */
} }
.fc-icon-left-single-arrow:after { .fc-icon-left-single-arrow:after {
@ -107,7 +107,6 @@ NOTE: use percentage font sizes or else old IE chokes
font-weight: bold; font-weight: bold;
font-size: 200%; font-size: 200%;
top: -7%; top: -7%;
left: 3%;
} }
.fc-icon-right-single-arrow:after { .fc-icon-right-single-arrow:after {
@ -115,7 +114,6 @@ NOTE: use percentage font sizes or else old IE chokes
font-weight: bold; font-weight: bold;
font-size: 200%; font-size: 200%;
top: -7%; top: -7%;
left: -3%;
} }
.fc-icon-left-double-arrow:after { .fc-icon-left-double-arrow:after {
@ -134,14 +132,12 @@ NOTE: use percentage font sizes or else old IE chokes
content: "\25C4"; content: "\25C4";
font-size: 125%; font-size: 125%;
top: 3%; top: 3%;
left: -2%;
} }
.fc-icon-right-triangle:after { .fc-icon-right-triangle:after {
content: "\25BA"; content: "\25BA";
font-size: 125%; font-size: 125%;
top: 3%; top: 3%;
left: 2%;
} }
.fc-icon-down-triangle:after { .fc-icon-down-triangle:after {
@ -252,7 +248,6 @@ NOTE: use percentage font sizes or else old IE chokes
cursor: default; cursor: default;
background-image: none; background-image: none;
opacity: 0.65; opacity: 0.65;
filter: alpha(opacity=65);
box-shadow: none; box-shadow: none;
} }
@ -372,6 +367,7 @@ hr.fc-divider {
.fc table { .fc table {
width: 100%; width: 100%;
box-sizing: border-box; /* fix scrollbar issue in firefox */
table-layout: fixed; table-layout: fixed;
border-collapse: collapse; border-collapse: collapse;
border-spacing: 0; border-spacing: 0;
@ -395,6 +391,18 @@ hr.fc-divider {
} }
/* Internal Nav Links
--------------------------------------------------------------------------------------------------*/
a[data-goto] {
cursor: pointer;
}
a[data-goto]:hover {
text-decoration: underline;
}
/* Fake Table Rows /* Fake Table Rows
--------------------------------------------------------------------------------------------------*/ --------------------------------------------------------------------------------------------------*/
@ -491,15 +499,15 @@ temporary rendered events).
/* Scrolling Container /* Scrolling Container
--------------------------------------------------------------------------------------------------*/ --------------------------------------------------------------------------------------------------*/
.fc-scroller { /* this class goes on elements for guaranteed vertical scrollbars */ .fc-scroller {
overflow-y: scroll; -webkit-overflow-scrolling: touch;
overflow-x: hidden;
} }
.fc-scroller > * { /* we expect an immediate inner element */ /* TODO: move to agenda/basic */
.fc-scroller > .fc-day-grid,
.fc-scroller > .fc-time-grid {
position: relative; /* re-scope all positions */ position: relative; /* re-scope all positions */
width: 100%; /* hack to force re-sizing this inner element when scrollbars appear/disappear */ width: 100%; /* hack to force re-sizing this inner element when scrollbars appear/disappear */
overflow: hidden; /* don't let negative margins or absolute positioning create further scroll */
} }
@ -513,10 +521,14 @@ temporary rendered events).
line-height: 1.3; line-height: 1.3;
border-radius: 3px; border-radius: 3px;
border: 1px solid #3a87ad; /* default BORDER color */ border: 1px solid #3a87ad; /* default BORDER color */
background-color: #3a87ad; /* default BACKGROUND color */
font-weight: normal; /* undo jqui's ui-widget-header bold */ font-weight: normal; /* undo jqui's ui-widget-header bold */
} }
.fc-event,
.fc-event-dot {
background-color: #3a87ad; /* default BACKGROUND color */
}
/* overpower some of bootstrap's and jqui's styles on <a> tags */ /* overpower some of bootstrap's and jqui's styles on <a> tags */
.fc-event, .fc-event,
.fc-event:hover, .fc-event:hover,
@ -539,7 +551,6 @@ temporary rendered events).
z-index: 1; z-index: 1;
background: #fff; background: #fff;
opacity: .25; opacity: .25;
filter: alpha(opacity=25); /* for IE */
} }
.fc-event .fc-content { .fc-event .fc-content {
@ -547,15 +558,68 @@ temporary rendered events).
z-index: 2; z-index: 2;
} }
/* resizer (cursor AND touch devices) */
.fc-event .fc-resizer { .fc-event .fc-resizer {
position: absolute; position: absolute;
z-index: 3; z-index: 4;
}
/* resizer (touch devices) */
.fc-event .fc-resizer {
display: none;
}
.fc-event.fc-allow-mouse-resize .fc-resizer,
.fc-event.fc-selected .fc-resizer {
/* only show when hovering or selected (with touch) */
display: block;
}
/* hit area */
.fc-event.fc-selected .fc-resizer:before {
/* 40x40 touch area */
content: "";
position: absolute;
z-index: 9999; /* user of this util can scope within a lower z-index */
top: 50%;
left: 50%;
width: 40px;
height: 40px;
margin-left: -20px;
margin-top: -20px;
}
/* Event Selection (only for touch devices)
--------------------------------------------------------------------------------------------------*/
.fc-event.fc-selected {
z-index: 9999 !important; /* overcomes inline z-index */
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}
.fc-event.fc-selected.fc-dragging {
box-shadow: 0 2px 7px rgba(0, 0, 0, 0.3);
} }
/* Horizontal Events /* Horizontal Events
--------------------------------------------------------------------------------------------------*/ --------------------------------------------------------------------------------------------------*/
/* bigger touch area when selected */
.fc-h-event.fc-selected:before {
content: "";
position: absolute;
z-index: 3; /* below resizers */
top: -10px;
bottom: -10px;
left: 0;
right: 0;
}
/* events that are continuing to/from another week. kill rounded corners and butt up against edge */ /* events that are continuing to/from another week. kill rounded corners and butt up against edge */
.fc-ltr .fc-h-event.fc-not-start, .fc-ltr .fc-h-event.fc-not-start,
@ -576,36 +640,56 @@ temporary rendered events).
border-bottom-right-radius: 0; border-bottom-right-radius: 0;
} }
/* resizer */ /* resizer (cursor AND touch devices) */
.fc-h-event .fc-resizer { /* positioned it to overcome the event's borders */
top: -1px;
bottom: -1px;
left: -1px;
right: -1px;
width: 5px;
}
/* left resizer */ /* left resizer */
.fc-ltr .fc-h-event .fc-start-resizer, .fc-ltr .fc-h-event .fc-start-resizer,
.fc-ltr .fc-h-event .fc-start-resizer:before, .fc-rtl .fc-h-event .fc-end-resizer {
.fc-ltr .fc-h-event .fc-start-resizer:after,
.fc-rtl .fc-h-event .fc-end-resizer,
.fc-rtl .fc-h-event .fc-end-resizer:before,
.fc-rtl .fc-h-event .fc-end-resizer:after {
right: auto; /* ignore the right and only use the left */
cursor: w-resize; cursor: w-resize;
left: -1px; /* overcome border */
} }
/* right resizer */ /* right resizer */
.fc-ltr .fc-h-event .fc-end-resizer, .fc-ltr .fc-h-event .fc-end-resizer,
.fc-ltr .fc-h-event .fc-end-resizer:before, .fc-rtl .fc-h-event .fc-start-resizer {
.fc-ltr .fc-h-event .fc-end-resizer:after,
.fc-rtl .fc-h-event .fc-start-resizer,
.fc-rtl .fc-h-event .fc-start-resizer:before,
.fc-rtl .fc-h-event .fc-start-resizer:after {
left: auto; /* ignore the left and only use the right */
cursor: e-resize; cursor: e-resize;
right: -1px; /* overcome border */
}
/* resizer (mouse devices) */
.fc-h-event.fc-allow-mouse-resize .fc-resizer {
width: 7px;
top: -1px; /* overcome top border */
bottom: -1px; /* overcome bottom border */
}
/* resizer (touch devices) */
.fc-h-event.fc-selected .fc-resizer {
/* 8x8 little dot */
border-radius: 4px;
border-width: 1px;
width: 6px;
height: 6px;
border-style: solid;
border-color: inherit;
background: #fff;
/* vertically center */
top: 50%;
margin-top: -4px;
}
/* left resizer */
.fc-ltr .fc-h-event.fc-selected .fc-start-resizer,
.fc-rtl .fc-h-event.fc-selected .fc-end-resizer {
margin-left: -4px; /* centers the 8x8 dot on the left edge */
}
/* right resizer */
.fc-ltr .fc-h-event.fc-selected .fc-end-resizer,
.fc-rtl .fc-h-event.fc-selected .fc-start-resizer {
margin-right: -4px; /* centers the 8x8 dot on the right edge */
} }
@ -620,6 +704,23 @@ be a descendant of the grid when it is being dragged.
padding: 0 1px; padding: 0 1px;
} }
tr:first-child > td > .fc-day-grid-event {
margin-top: 2px; /* a little bit more space before the first event */
}
.fc-day-grid-event.fc-selected:after {
content: "";
position: absolute;
z-index: 1; /* same z-index as fc-bg, behind text */
/* overcome the borders */
top: -1px;
right: -1px;
bottom: -1px;
left: -1px;
/* darkening effect */
background: #000;
opacity: .25;
}
.fc-day-grid-event .fc-content { /* force events to be one-line tall */ .fc-day-grid-event .fc-content { /* force events to be one-line tall */
white-space: nowrap; white-space: nowrap;
@ -630,10 +731,18 @@ be a descendant of the grid when it is being dragged.
font-weight: bold; font-weight: bold;
} }
.fc-day-grid-event .fc-resizer { /* enlarge the default hit area */ /* resizer (cursor devices) */
left: -3px;
right: -3px; /* left resizer */
width: 7px; .fc-ltr .fc-day-grid-event.fc-allow-mouse-resize .fc-start-resizer,
.fc-rtl .fc-day-grid-event.fc-allow-mouse-resize .fc-end-resizer {
margin-left: -2px; /* to the day cell's edge */
}
/* right resizer */
.fc-ltr .fc-day-grid-event.fc-allow-mouse-resize .fc-end-resizer,
.fc-rtl .fc-day-grid-event.fc-allow-mouse-resize .fc-start-resizer {
margin-right: -2px; /* to the day cell's edge */
} }
@ -672,14 +781,46 @@ a.fc-more:hover {
padding: 10px; padding: 10px;
} }
/* Now Indicator
--------------------------------------------------------------------------------------------------*/
.fc-now-indicator {
position: absolute;
border: 0 solid red;
}
/* Utilities
--------------------------------------------------------------------------------------------------*/
.fc-unselectable {
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
-webkit-touch-callout: none;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
/* Toolbar /* Toolbar
--------------------------------------------------------------------------------------------------*/ --------------------------------------------------------------------------------------------------*/
.fc-toolbar { .fc-toolbar {
text-align: center; text-align: center;
}
.fc-toolbar.fc-header-toolbar {
margin-bottom: 1em; margin-bottom: 1em;
} }
.fc-toolbar.fc-footer-toolbar {
margin-top: 1em;
}
.fc-toolbar .fc-left { .fc-toolbar .fc-left {
float: left; float: left;
} }
@ -753,6 +894,8 @@ a.fc-more:hover {
z-index: 1; z-index: 1;
} }
/* BasicView /* BasicView
--------------------------------------------------------------------------------------------------*/ --------------------------------------------------------------------------------------------------*/
@ -760,8 +903,7 @@ a.fc-more:hover {
.fc-basicWeek-view .fc-content-skeleton, .fc-basicWeek-view .fc-content-skeleton,
.fc-basicDay-view .fc-content-skeleton { .fc-basicDay-view .fc-content-skeleton {
/* we are sure there are no day numbers in these views, so... */ /* there may be week numbers in these views, so no padding-top */
padding-top: 1px; /* add a pixel to make sure there are 2px padding above events */
padding-bottom: 1em; /* ensure a space at bottom of cell for user selecting/clicking */ padding-bottom: 1em; /* ensure a space at bottom of cell for user selecting/clicking */
} }
@ -784,42 +926,45 @@ a.fc-more:hover {
/* week and day number styling */ /* week and day number styling */
.fc-day-top.fc-other-month {
opacity: 0.3;
}
.fc-basic-view .fc-week-number, .fc-basic-view .fc-week-number,
.fc-basic-view .fc-day-number { .fc-basic-view .fc-day-number {
padding: 0 2px; padding: 2px;
} }
.fc-basic-view td.fc-week-number span, .fc-basic-view th.fc-week-number,
.fc-basic-view td.fc-day-number { .fc-basic-view th.fc-day-number {
padding-top: 2px; padding: 0 2px; /* column headers can't have as much v space */
padding-bottom: 2px;
} }
.fc-basic-view .fc-week-number { .fc-ltr .fc-basic-view .fc-day-top .fc-day-number { float: right; }
.fc-rtl .fc-basic-view .fc-day-top .fc-day-number { float: left; }
.fc-ltr .fc-basic-view .fc-day-top .fc-week-number { float: left; border-radius: 0 0 3px 0; }
.fc-rtl .fc-basic-view .fc-day-top .fc-week-number { float: right; border-radius: 0 0 0 3px; }
.fc-basic-view .fc-day-top .fc-week-number {
min-width: 1.5em;
text-align: center; text-align: center;
background-color: #f2f2f2;
color: #808080;
} }
.fc-basic-view .fc-week-number span { /* when week/day number have own column */
/* work around the way we do column resizing and ensure a minimum width */
display: inline-block;
min-width: 1.25em;
}
.fc-ltr .fc-basic-view .fc-day-number { .fc-basic-view td.fc-week-number {
text-align: right; text-align: center;
} }
.fc-rtl .fc-basic-view .fc-day-number { .fc-basic-view td.fc-week-number > * {
text-align: left; /* work around the way we do column resizing and ensure a minimum width */
display: inline-block;
min-width: 1.25em;
} }
.fc-day-number.fc-other-month {
opacity: 0.3;
filter: alpha(opacity=30); /* for IE */
/* opacity with small font can sometimes look too faded
might want to set the 'color' property instead
making day-numbers bold also fixes the problem */
}
/* AgendaView all-day area /* AgendaView all-day area
--------------------------------------------------------------------------------------------------*/ --------------------------------------------------------------------------------------------------*/
@ -834,7 +979,6 @@ a.fc-more:hover {
} }
.fc-agenda-view .fc-day-grid .fc-row .fc-content-skeleton { .fc-agenda-view .fc-day-grid .fc-row .fc-content-skeleton {
padding-top: 1px; /* add a pixel to make sure there are 2px padding above events */
padding-bottom: 1em; /* give space underneath events for clicking/selecting days */ padding-bottom: 1em; /* give space underneath events for clicking/selecting days */
} }
@ -888,27 +1032,46 @@ a.fc-more:hover {
z-index: 2; z-index: 2;
} }
.fc-time-grid .fc-bgevent-skeleton, .fc-time-grid .fc-content-col {
position: relative; /* because now-indicator lives directly inside */
}
.fc-time-grid .fc-content-skeleton { .fc-time-grid .fc-content-skeleton {
position: absolute; position: absolute;
z-index: 3;
top: 0; top: 0;
left: 0; left: 0;
right: 0; right: 0;
} }
.fc-time-grid .fc-bgevent-skeleton { /* divs within a cell within the fc-content-skeleton */
.fc-time-grid .fc-business-container {
position: relative;
z-index: 1;
}
.fc-time-grid .fc-bgevent-container {
position: relative;
z-index: 2;
}
.fc-time-grid .fc-highlight-container {
position: relative;
z-index: 3; z-index: 3;
} }
.fc-time-grid .fc-highlight-skeleton { .fc-time-grid .fc-event-container {
position: relative;
z-index: 4; z-index: 4;
} }
.fc-time-grid .fc-content-skeleton { .fc-time-grid .fc-now-indicator-line {
z-index: 5; z-index: 5;
} }
.fc-time-grid .fc-helper-skeleton { .fc-time-grid .fc-helper-container { /* also is fc-event-container */
position: relative;
z-index: 6; z-index: 6;
} }
@ -948,11 +1111,6 @@ a.fc-more:hover {
/* TimeGrid Event Containment /* TimeGrid Event Containment
--------------------------------------------------------------------------------------------------*/ --------------------------------------------------------------------------------------------------*/
.fc-time-grid .fc-event-container, /* a div within a cell within the fc-content-skeleton */
.fc-time-grid .fc-bgevent-container { /* a div within a cell within the fc-bgevent-skeleton */
position: relative;
}
.fc-ltr .fc-time-grid .fc-event-container { /* space on the sides of events for LTR (default) */ .fc-ltr .fc-time-grid .fc-event-container { /* space on the sides of events for LTR (default) */
margin: 0 2.5% 0 2px; margin: 0 2.5% 0 2px;
} }
@ -1008,6 +1166,20 @@ be a descendant of the grid when it is being dragged.
overflow: hidden; /* don't let the bg flow over rounded corners */ overflow: hidden; /* don't let the bg flow over rounded corners */
} }
.fc-time-grid-event.fc-selected {
/* need to allow touch resizers to extend outside event's bounding box */
/* common fc-selected styles hide the fc-bg, so don't need this anyway */
overflow: visible;
}
.fc-time-grid-event.fc-selected .fc-bg {
display: none; /* hide semi-white background, to appear darker */
}
.fc-time-grid-event .fc-content {
overflow: hidden; /* for when .fc-selected */
}
.fc-time-grid-event .fc-time, .fc-time-grid-event .fc-time,
.fc-time-grid-event .fc-title { .fc-time-grid-event .fc-title {
padding: 0 1px; padding: 0 1px;
@ -1049,9 +1221,9 @@ be a descendant of the grid when it is being dragged.
padding: 0; /* undo padding from above */ padding: 0; /* undo padding from above */
} }
/* resizer */ /* resizer (cursor device) */
.fc-time-grid-event .fc-resizer { .fc-time-grid-event.fc-allow-mouse-resize .fc-resizer {
left: 0; left: 0;
right: 0; right: 0;
bottom: 0; bottom: 0;
@ -1064,6 +1236,169 @@ be a descendant of the grid when it is being dragged.
cursor: s-resize; cursor: s-resize;
} }
.fc-time-grid-event .fc-resizer:after { .fc-time-grid-event.fc-allow-mouse-resize .fc-resizer:after {
content: "="; content: "=";
} }
/* resizer (touch device) */
.fc-time-grid-event.fc-selected .fc-resizer {
/* 10x10 dot */
border-radius: 5px;
border-width: 1px;
width: 8px;
height: 8px;
border-style: solid;
border-color: inherit;
background: #fff;
/* horizontally center */
left: 50%;
margin-left: -5px;
/* center on the bottom edge */
bottom: -5px;
}
/* Now Indicator
--------------------------------------------------------------------------------------------------*/
.fc-time-grid .fc-now-indicator-line {
border-top-width: 1px;
left: 0;
right: 0;
}
/* arrow on axis */
.fc-time-grid .fc-now-indicator-arrow {
margin-top: -5px; /* vertically center on top coordinate */
}
.fc-ltr .fc-time-grid .fc-now-indicator-arrow {
left: 0;
/* triangle pointing right... */
border-width: 5px 0 5px 6px;
border-top-color: transparent;
border-bottom-color: transparent;
}
.fc-rtl .fc-time-grid .fc-now-indicator-arrow {
right: 0;
/* triangle pointing left... */
border-width: 5px 6px 5px 0;
border-top-color: transparent;
border-bottom-color: transparent;
}
/* List View
--------------------------------------------------------------------------------------------------*/
/* possibly reusable */
.fc-event-dot {
display: inline-block;
width: 10px;
height: 10px;
border-radius: 5px;
}
/* view wrapper */
.fc-rtl .fc-list-view {
direction: rtl; /* unlike core views, leverage browser RTL */
}
.fc-list-view {
border-width: 1px;
border-style: solid;
}
/* table resets */
.fc .fc-list-table {
table-layout: auto; /* for shrinkwrapping cell content */
}
.fc-list-table td {
border-width: 1px 0 0;
padding: 8px 14px;
}
.fc-list-table tr:first-child td {
border-top-width: 0;
}
/* day headings with the list */
.fc-list-heading {
border-bottom-width: 1px;
}
.fc-list-heading td {
font-weight: bold;
}
.fc-ltr .fc-list-heading-main { float: left; }
.fc-ltr .fc-list-heading-alt { float: right; }
.fc-rtl .fc-list-heading-main { float: right; }
.fc-rtl .fc-list-heading-alt { float: left; }
/* event list items */
.fc-list-item.fc-has-url {
cursor: pointer; /* whole row will be clickable */
}
.fc-list-item:hover td {
background-color: #f5f5f5;
}
.fc-list-item-marker,
.fc-list-item-time {
white-space: nowrap;
width: 1px;
}
/* make the dot closer to the event title */
.fc-ltr .fc-list-item-marker { padding-right: 0; }
.fc-rtl .fc-list-item-marker { padding-left: 0; }
.fc-list-item-title a {
/* every event title cell has an <a> tag */
text-decoration: none;
color: inherit;
}
.fc-list-item-title a[href]:hover {
/* hover effect only on titles with hrefs */
text-decoration: underline;
}
/* message when no events */
.fc-list-empty-wrap2 {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
}
.fc-list-empty-wrap1 {
width: 100%;
height: 100%;
display: table;
}
.fc-list-empty {
display: table-cell;
vertical-align: middle;
text-align: center;
}
.fc-unthemed .fc-list-empty { /* theme will provide own background */
background-color: #eee;
}

@ -21,7 +21,7 @@ Handlebars.registerHelper('StatusLevel', function() {
var start = moment(this.airDateUtc); var start = moment(this.airDateUtc);
var end = moment(this.end); var end = moment(this.end);
var monitored = this.series.monitored && this.monitored; var monitored = this.series.monitored && this.monitored;
debugger;
if (hasFile) { if (hasFile) {
return 'success'; return 'success';
} }

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save