<% var defaultUrl = (window.svgSrcHome && window.svgSrcHome["error_no_photo"]) ? window.svgSrcHome["error_no_photo"] : ''; %>
<% if (albums.length === 0) { %>
No albums found
<% } %> <% _.each(albums, function(album, idx) { var name = album.name || album.playlistName || album.collectionName || album.title || album['@name'] || 'Untitled'; var count = album.itemCount || album.total || parseInt(album['@totalCount'], 10) || 0; var albumId = album.playlistUid || album.collectionId || (album.uid && album.uid.$ ? album.uid.$ : album.uid) || album.id || String(idx); var thumbUrl = album.thumbnail_url || ''; var bgValue = thumbUrl ? 'url(\'' + thumbUrl + '\'), url(\'' + defaultUrl + '\') no-repeat center center' : 'url(\'' + defaultUrl + '\') no-repeat center center'; var isChecked = _.contains(selectedItemsArray, albumId); // Build date label using UtilityFunctions.createDateLabel (same as album view) var dateLabel = ''; var rawDate = album.creationDate || album.created_date || ''; if (rawDate && window.UtilityFunctions && window.UtilityFunctions.createDateLabel) { var d = new Date(rawDate); if (!isNaN(d.getTime())) { dateLabel = window.UtilityFunctions.createDateLabel(d); } } var favoriteClass = album.favorite ? 'fa-star selected' : 'fa-star'; var restrictedClass = ''; if (IS_IP_RESTRICTED) { restrictedClass = RESTRICTED_CLASS; } %>
checked<% } %>/>
<%= _.escape(name) %>
<% if (dateLabel) { %><%= dateLabel %><% } %> <% if (count > 0) { %> (<%= count %> photos & videos)<% } %>
<% }); %>