<%= localize.theatresWithin %> <%= searchRadius %> <%= searchUnit %> <%= localize.of %> <%= searchValue %>
<%} else {%><%= localize.setLocationToView %>
<%}%> <%}%>>
-
<% _.each(collection.models, function (theater) {
if (theater.movies.models==undefined && theater.movies.models.length==0) return;
if(viewType != 'favorites' || favorites.indexOf(theater.get('id')) >= 0) {%>
-
<%=theater.get('name') %>
<%if(window.AppProperties.ShowTheaterDistance) {%><%=theater.get("distance").toFixed(1) %> <%= searchUnit%><%} %><%=theater.get('addressLine1')%><%= theater.get("addressLine2") ? ', ' + theater.get("addressLine2") : ''%>
<%=theater.get('addressCity') %> <%=theater.get('addressState') %> <%=theater.get('addressZip') %><% if(!window.appConfig.GroupMovies){ //Sort by tMDBName and Name var moviesSorted = theater.movies.changeSort(window.AppConfig.DefaultMovieSort || 'byName'); _.each(moviesSorted.models, function (movie) { var posterSrc = movie.get('image').small; if (posterSrc!=undefined && !jQuery.isEmptyObject(movie.get('nextPerformance'))){%><%}}); } else { var moviesInTheater = _.filter(movies.models, function(movie){return movie.theaterId == theater.id;}); //Calculate popularity of each movie group in current theater _.each(moviesInTheater,function(theaterMovie){ var groupPopularity = 0; _.each(window.ObjectCollections.MovieCollection.groupedMovies,function(group){ if(theaterMovie.get('tMDBId') == group[0].get('tMDBId')){ _.each(group,function(groupMovie){ if(groupMovie.theaterId == theater.id){ groupPopularity += groupMovie.get('totalPerformanceCount'); } }); } }); if(theaterMovie.popularityCalculated != "theaters"){ theaterMovie.set('totalPerformanceCount', groupPopularity); theaterMovie.popularityCalculated = "theaters"; } }); //Sort by tMDBName and Name var moviesSorted = new MovieCollection(moviesInTheater); moviesSorted = moviesSorted.changeSort(window.appConfig.DefaultMovieSort || 'byName'); _.each(moviesSorted.models,function(movie){ if(!jQuery.isEmptyObject(movie.get('nextPerformance'))){%> <% }}); }%>
<% }}); %>
<%if(viewType == 'favorites' && favorites.length == 0) {%>
<%=localize.addTheaterAsFavorites %>
<%} %>
style="margin: 5px 5px 0px 5px;">