optimisation for films list
authorGautier Thibault <gthibault@universcine.com>
Tue, 20 Apr 2010 17:30:13 +0200
changeset 71 77de27265833
parent 70 9452e144c4d4
child 72 b1bc73ec3bcc
optimisation for films list
web/thdProject/apps/frontend/modules/search/templates/_searchList.php
web/thdProject/apps/frontend/modules/search/templates/viewSearchListSuccess.php
--- a/web/thdProject/apps/frontend/modules/search/templates/_searchList.php	Tue Apr 20 16:42:31 2010 +0200
+++ b/web/thdProject/apps/frontend/modules/search/templates/_searchList.php	Tue Apr 20 17:30:13 2010 +0200
@@ -1,52 +1,13 @@
 <div id="search-list">
-	<ul>
-	<?php 
-	foreach($searchFilms as $item): 
-		$ref = $item->getRef();
-		$slug = $item->getSlugUrl();
-		$title = $item->getTitle();
-		
-		// image file
-		$image_file = $item->getImages();
-		// image file
-		$video_file = $item->getVideos();
-		// directors list
-		$directors = $item->getDirectorsArray();
-	?>
-	<li class="film-item">	
-		<div id="player-<?php echo $ref; ?>" class="player-item" style="background:transparent url('<?php echo image_path('posters/'.$image_file[0]['file'].'.jpg'); ?>') no-repeat;" href="<?php echo video_path($video_file[0]['file']);?>">
-			<div class="infos">
-		    	<a href="<?php echo url_for('@editor?ref='.$ref.'&film_slug='.$slug); ?>" class="title"><?php echo $title; ?></a> <span class="film-infos">De <?php echo thd_render_flat_list($item->getDirectorsArray(), 'name'); ?></span>
-		    </div>
-		    <img src="<?php echo image_path('buttons/btn_play.png'); ?>"/ id="play"></a>
-		     <div class="tags">
-				<ul class="item-list tag-list">
-				<li><span class="head">
-			    <i>Tags liƩs au film :</i>
-				</span></li>
-				 <li class="tag-score-<?php echo $tag['score']; ?>">
-				    <a href="">anna</a>
-				  </li><li class="tag-score-5">
-				    <a href="">Jalousie</a>
-				  </li><li class="tag-score-3">
-				    <a href="">erotomanie</a>
-				  </li><li class="tag-score-2">
-				    <a href="">violence</a>
-				  </li>
-				  <li class="tag-score-<?php echo $tag['score']; ?>">
-				    <a href="">anna</a>
-				  </li><li class="tag-score-5">
-				    <a href="">Jalousie</a>
-				  </li><li class="tag-score-3">
-				    <a href="">erotomanie</a>
-				  </li><li class="tag-score-2">
-				    <a href="">violence</a>
-				  </li>
-				</ul>
-		    </div>
-		</div>
-		<div class="tag-action"><a href="<?php echo url_for('@editor?ref='.$ref.'&film_slug='.$slug); ?>" class="link-button">Tagger le film</a></div>
-	</li>
-	<?php endforeach; ?>
-	</ul>
+	<ul class="film-list">
+  <?php
+  foreach($searchFilms as $item):
+    $tagFilmUri = url_for('@editor?ref='.$item->getRef().'&film_slug='.$item->getSlugUrl());
+  ?>
+    <li class="film-item">
+      <?php include_component('partials', 'filmItem', Array('film' => $item, 'actionUri' => $tagFilmUri)); ?>
+      <div class="tag-action"><a href="<?php echo $tagFilmUri ?>" class="link-button">Tagger le film</a></div>
+    </li>
+  <?php endforeach; ?>
+  </ul>
 </div>
\ No newline at end of file
--- a/web/thdProject/apps/frontend/modules/search/templates/viewSearchListSuccess.php	Tue Apr 20 16:42:31 2010 +0200
+++ b/web/thdProject/apps/frontend/modules/search/templates/viewSearchListSuccess.php	Tue Apr 20 17:30:13 2010 +0200
@@ -2,19 +2,3 @@
 <?php include_component( "search", "selectedFilm") ?>
 <?php include_partial('search/searchList', array('filter' => 'all', 'filmCount' => '10', 'searchFilms' => $searchFilms, 'pageIndex' => $pageIndex, 'pageNbItems' => $pageNbItems)); ?>	
 
-<script language="JavaScript">
-	// a very simple setup
-	flowplayer("div.player-item", "../flashes/flowplayer-3.1.3.swf",
-	{
-		// configuration for a clip
-			clip: {
-				autoPlay: true,
-		    	autoBuffering: true,
-		    	scaling: 'fit',
-			},
-			// setup controlbar to use skins
-			plugins: {
-			  	controls: conf.skins.universcine
-			}
-	});
-</script>
\ No newline at end of file