define(['listViewStyle'], function () {
function renderViews(page, user, result) {
var folderHtml = '';
folderHtml += '
';
folderHtml += result.map(function (i) {
var currentHtml = '';
var id = 'chkGroupFolder' + i.Id;
var isChecked = (user.Configuration.ExcludeFoldersFromGrouping != null && user.Configuration.ExcludeFoldersFromGrouping.indexOf(i.Id) == -1) ||
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 += '
';
folderHtml += result.Items.map(function (i) {
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 += '