fixed latest tv. movie progress.

This commit is contained in:
Luke Pulverenti 2013-04-01 23:28:20 -04:00
parent 3eecf178f3
commit 224f57b167
10 changed files with 272 additions and 31 deletions

14
dashboard-ui/boxsets.html Normal file
View file

@ -0,0 +1,14 @@
<!DOCTYPE html>
<html>
<head>
<title>Media Browser</title>
</head>
<body>
<div id="boxsetsPage" data-role="page" class="page libraryPage noLogoPage" data-theme="a">
<h1 class="libraryPageHeader"><a href="index.html" class="imageLink">
<img src="css/images/home.png"></a>Movies</h1>
<div data-role="content">
</div>
</div>
</body>
</html>

View file

@ -1,4 +1,9 @@
.libraryPage .header {
/* Fixes the issue of jqm panels altering the page background. */
.ui-panel-content-wrap {
background: none!important;
}
.libraryPage .header {
padding-bottom: 0;
}
@ -6,12 +11,12 @@
margin: -5px 0 0;
}
.libraryPageHeader a {
margin-right: 20px;
}
.libraryPageHeader a {
margin-right: 20px;
}
.libraryPage .ui-content {
padding: 15px 30px 100px;
padding: 10px;
}
.libraryPage, .itemListContent {
@ -31,12 +36,11 @@
}
.firstListHeader {
margin-top: .5em;
margin-top: .75em;
}
.libraryViewNav {
text-align: center;
margin-bottom: 1.5em!important;
}
.libraryViewNav .ui-btn-inner {
@ -48,13 +52,30 @@
margin: 0 auto;
}
.viewSettings {
text-align: center;
margin: 1em 0;
}
.libraryItemsGrid th {
text-align: left;
}
@media all and (min-width: 650px) {
.libraryPage .ui-content {
padding: 15px 30px 100px;
}
}
@media all and (min-width: 750px) {
}
@media all and (min-width: 1200px) {
.libraryPage .ui-content {
padding-top: 0;
}
.ehsContent {
max-width: 800px;
}

View file

@ -11,18 +11,91 @@
<div data-role="controlgroup" data-type="horizontal" class="libraryViewNav" data-mini="true">
<a href="moviesrecommended.html" data-role="button">Recommended</a>
<a href="movies.html" data-role="button" class="ui-btn-active">Movies</a>
<a href="#" data-role="button">Box Sets</a>
<a href="boxsets.html" data-role="button">Box Sets</a>
<a href="#" data-role="button">Genres</a>
<a href="#" data-role="button">Actors</a>
<a href="#" data-role="button">Directors</a>
</div>
<div class="viewSettings">
<button data-mini="true" data-icon="sort" data-inline="true">Sort</button>
<button data-mini="true" data-icon="sort" data-inline="true">Sort</button>
<button data-mini="true" data-icon="sort" data-inline="true">Sort</button>
<button data-mini="true" data-icon="sort" data-inline="true" onclick="$('#sortPanel', $.mobile.activePage).panel( 'toggle' );">Sort</button>
<button data-mini="true" data-icon="filter" data-inline="true" onclick="$('#filterPanel', $.mobile.activePage).panel( 'toggle' );">Filter</button>
</div>
<div id="items"></div>
</div>
<div data-role="panel" id="sortPanel" data-position="right" data-display="overlay" data-theme="b" data-position-fixed="true">
<form>
<div id="sortpanel">
<fieldset data-role="controlgroup">
<legend>
<h3>Sort By:</h3>
</legend>
<input class="radioSortBy" data-theme="c" type="radio" name="radioSortBy" id="radioSortName" value="on" checked="checked" data-sortby="SortName">
<label for="radioSortName">Name</label>
<input class="radioSortBy" data-theme="c" type="radio" name="radioSortBy" id="radioCommunityRating" value="off" data-sortby="CommunityRating">
<label for="radioCommunityRating">Community Rating</label>
<input class="radioSortBy" data-theme="c" type="radio" name="radioSortBy" id="radioDateCreated" value="off" data-sortby="DateCreated">
<label for="radioDateCreated">Date Added</label>
<input class="radioSortBy" data-theme="c" type="radio" name="radioSortBy" id="radioDatePlayed" value="off" data-sortby="DatePlayed">
<label for="radioDatePlayed">Date Played</label>
<input class="radioSortBy" data-theme="c" type="radio" name="radioSortBy" id="radioPremiereDate" value="off" data-sortby="PremiereDate">
<label for="radioPremiereDate">Date Released</label>
<input class="radioSortBy" data-theme="c" type="radio" name="radioSortBy" id="radioPlayCount" value="off" data-sortby="PlayCount">
<label for="radioPlayCount">Play Count</label>
<input class="radioSortBy" data-theme="c" type="radio" name="radioSortBy" id="radioRandom" value="off" data-sortby="Random">
<label for="radioRandom">Random</label>
<input class="radioSortBy" data-theme="c" type="radio" name="radioSortBy" id="radioRuntime" value="off" data-sortby="Runtime">
<label for="radioRuntime">Runtime</label>
</fieldset>
<fieldset data-role="controlgroup">
<legend>
<h3>Sort Order:</h3>
</legend>
<input class="radioSortOrder" data-theme="c" type="radio" name="radioSortOrder" id="radioAscending" value="on" checked="checked" data-sortorder="Ascending">
<label for="radioAscending">Ascending</label>
<input class="radioSortOrder" data-theme="c" type="radio" name="radioSortOrder" id="radioDescending" value="off" data-sortorder="Descending">
<label for="radioDescending">Descending</label>
</fieldset>
</div>
</form>
</div>
<div data-role="panel" id="filterPanel" data-position="right" data-display="overlay" data-theme="b" data-position-fixed="true">
<form>
<fieldset data-role="controlgroup">
<legend>
<h3>Filters:</h3>
</legend>
<input class="chkStandardFilter" type="checkbox" name="chkPlayed" id="chkPlayed" data-theme="c" data-filter="IsPlayed">
<label for="chkPlayed">Played</label>
<input class="chkStandardFilter" type="checkbox" name="chkUnplayed" id="chkUnplayed" data-theme="c" data-filter="IsUnPlayed">
<label for="chkUnplayed">Unplayed</label>
<input class="chkStandardFilter" type="checkbox" name="chkIsFavorite" id="chkIsFavorite" data-theme="c" data-filter="IsFavorite">
<label for="chkIsFavorite">Favorite</label>
<input class="chkStandardFilter" type="checkbox" name="chkLikes" id="chkLikes" data-theme="c" data-filter="Likes">
<label for="chkLikes">Likes</label>
<input class="chkStandardFilter" type="checkbox" name="chkDislikes" id="chkDislikes" data-theme="c" data-filter="Dislikes">
<label for="chkDislikes">Dislikes</label>
<input class="chkStandardFilter" type="checkbox" name="chkResumable" id="chkResumable" data-theme="c" data-filter="IsResumable">
<label for="chkResumable">Resumable</label>
</fieldset>
</form>
</div>
</div>
</body>
</html>

View file

@ -11,7 +11,7 @@
<div data-role="controlgroup" data-type="horizontal" class="libraryViewNav" data-mini="true">
<a href="moviesrecommended.html" data-role="button" class="ui-btn-active">Recommended</a>
<a href="movies.html" data-role="button">Movies</a>
<a href="#" data-role="button">Box Sets</a>
<a href="boxsets.html" data-role="button">Box Sets</a>
<a href="#" data-role="button">Genres</a>
<a href="#" data-role="button">Actors</a>
<a href="#" data-role="button">Directors</a>

View file

@ -0,0 +1 @@


View file

@ -0,0 +1 @@


View file

@ -1,28 +1,131 @@
(function ($, document) {
$(document).on('pageshow', "#moviesPage", function () {
// The base query options
var query = {
SortBy: "SortName",
SortOrder: "Ascending",
IncludeItemTypes: "Movie",
Recursive: true,
Fields: "PrimaryImageAspectRatio"
};
function getTableHtml(items) {
var html = '<table data-role="table" data-mode="reflow" class="ui-responsive table-stroke libraryItemsGrid">';
html += '<thead>';
html += '<tr>';
html += '<th>Name</th>';
html += '<th>Year</th>';
html += '<th>Official Rating</th>';
html += '<th>Runtime</th>';
html += '</tr>';
html += '</thead>';
html += '<tbody>';
for (var i = 0, length = items.length; i < length; i++) {
html += getRowHtml(items[i]);
}
html += '</tbody>';
html += '</table>';
return html;
}
function getRowHtml(item) {
var html = '<tr>';
html += '<td>' + (item.Name || "") + '</td>';
html += '<td>' + (item.ProductionYear || "") + '</td>';
html += '<td>' + (item.OfficialRating || "") + '</td>';
html += '<td>' + (item.OfficialRating || "") + '</td>';
html += '</tr>';
return html;
}
function reloadItems(page) {
Dashboard.showLoadingMsg();
ApiClient.getItems(Dashboard.getCurrentUserId(), query).done(function (result) {
$('#items', page).html(Dashboard.getPosterViewHtml({
items: result.Items,
useAverageAspectRatio: true
})).html(getTableHtml(result.Items)).trigger('create');
Dashboard.hideLoadingMsg();
});
}
$(document).on('pageinit', "#moviesPage", function () {
var page = this;
var options = {
SortBy: "SortName",
SortOrder: "Ascending",
IncludeItemTypes: "Movie",
Recursive: true,
Fields: "PrimaryImageAspectRatio"
};
ApiClient.getItems(Dashboard.getCurrentUserId(), options).done(function (result) {
$('#items', page).html(Dashboard.getPosterViewHtml({
items: result.Items,
useAverageAspectRatio: true
}));
$('.radioSortBy', this).on('click', function () {
query.SortBy = this.getAttribute('data-sortby');
reloadItems(page);
});
$('.radioSortOrder', this).on('click', function () {
query.SortOrder = this.getAttribute('data-sortorder');
reloadItems(page);
});
$('.chkStandardFilter', this).on('change', function () {
var filterName = this.getAttribute('data-filter');
var filters = query.Filters || "";
filters = (',' + filters).replace(',' + filterName, '').substring(1);
if (this.checked) {
filters = filters ? (filters + ',' + filterName) : filterName;
}
query.Filters = filters;
reloadItems(page);
});
}).on('pageshow', "#moviesPage", function () {
reloadItems(this);
// Reset form values using the last used query
$('.radioSortBy', this).each(function () {
this.checked = query.SortBy == this.getAttribute('data-sortby');
}).checkboxradio('refresh');
$('.radioSortOrder', this).each(function () {
this.checked = query.SortOrder == this.getAttribute('data-sortorder');
}).checkboxradio('refresh');
$('.chkStandardFilter', this).each(function () {
var filters = "," + (query.Filters || "");
var filterName = this.getAttribute('data-filter');
this.checked = filters.indexOf(',' + filterName) != -1;
}).checkboxradio('refresh');
});
})(jQuery, document);

View file

@ -0,0 +1 @@


View file

@ -10,11 +10,24 @@
<div data-role="content">
<div data-role="controlgroup" data-type="horizontal" class="libraryViewNav" data-mini="true">
<a href="tvrecommended.html" data-role="button" class="ui-btn-active">Recommended</a>
<a href="#" data-role="button">Shows</a>
<a href="tvshows.html" data-role="button">Shows</a>
<a href="#" data-role="button">Genres</a>
<a href="#" data-role="button">Actors</a>
<a href="#" data-role="button">Favorites</a>
</div>
<div class="ehsContent">
<h1 class="listHeader firstListHeader">Latest Episodes</h1>
<div id="recentlyAddedItems">
</div>
<div id="resumableSection" style="display: none;">
<h1 class="listHeader">Resume</h1>
<div id="resumableItems">
</div>
</div>
</div>
</div>
</div>
</body>

14
dashboard-ui/tvshows.html Normal file
View file

@ -0,0 +1,14 @@
<!DOCTYPE html>
<html>
<head>
<title>Media Browser</title>
</head>
<body>
<div id="tvShowsPage" data-role="page" class="page libraryPage noLogoPage" data-theme="a">
<h1 class="libraryPageHeader"><a href="index.html" class="imageLink">
<img src="css/images/home.png"></a>TV Shows</h1>
<div data-role="content">
</div>
</div>
</body>
</html>