define(['userSettingsBuilder', 'listViewStyle'], function (userSettingsBuilder) {
'use strict';
function renderViews(page, user, result) {
var folderHtml = '';
folderHtml += '
';
folderHtml += result.map(function (i) {
var currentHtml = '';
var id = 'chkGroupFolder' + i.Id;
var isChecked = user.Configuration.GroupedFolders.indexOf(i.Id) != -1;
var checkedHtml = isChecked ? ' checked="checked"' : '';
currentHtml += '';
return currentHtml;
}).join('');
folderHtml += '
';
page.querySelector('.folderGroupList').innerHTML = folderHtml;
}
function renderLatestItems(page, user, result) {
var folderHtml = '';
folderHtml += '
';
var excludeViewTypes = ['playlists', 'livetv', 'boxsets', 'channels'];
var excludeItemTypes = ['Channel'];
folderHtml += result.Items.map(function (i) {
if (excludeViewTypes.indexOf(i.CollectionType || []) !== -1) {
return '';
}
// not implemented yet
if (excludeItemTypes.indexOf(i.Type) !== -1) {
return '';
}
var currentHtml = '';
var id = 'chkIncludeInLatest' + i.Id;
var isChecked = user.Configuration.LatestItemsExcludes.indexOf(i.Id) == -1;
var checkedHtml = isChecked ? ' checked="checked"' : '';
currentHtml += '';
return currentHtml;
}).join('');
folderHtml += '
';
page.querySelector('.latestItemsList').innerHTML = folderHtml;
}
function renderViewOrder(page, user, result) {
var html = '';
var index = 0;
html += result.Items.map(function (view) {
var currentHtml = '';
currentHtml += '