From 5dc85045b0409aa03b8cc9ca3e0872415f7e6fab Mon Sep 17 00:00:00 2001
From: ayjuillet <ayjuillet@git-test.afi-sa.fr>
Date: Thu, 13 Sep 2012 15:20:48 +0000
Subject: [PATCH] =?UTF-8?q?T=C3=A9l=C3=A9phone=20:=20Skin=20Jquery=20des?=
 =?UTF-8?q?=20=C3=A9crans=20de=20notice?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../views/scripts/recherche/avis.phtml        |  6 ++---
 .../views/scripts/recherche/biographie.phtml  |  8 +++---
 .../views/scripts/recherche/resume.phtml      | 26 +++++++++++++++----
 .../views/scripts/recherche/similaires.phtml  |  9 +++----
 .../views/scripts/recherche/simple.phtml      |  4 ++-
 .../views/scripts/recherche/tags.phtml        |  8 +++---
 .../views/scripts/recherche/videos.phtml      | 25 ++++++++++++------
 .../views/scripts/recherche/viewnotice.phtml  |  2 +-
 library/ZendAfi/View/Helper/Frbr.php          |  4 +--
 library/ZendAfi/View/Helper/ListeNotices.php  |  1 +
 .../View/Helper/Telephone/ListeNotices.php    |  6 ++---
 .../RechercheControllerHarryPotterTest.php    |  8 +++---
 12 files changed, 68 insertions(+), 39 deletions(-)

diff --git a/application/modules/telephone/views/scripts/recherche/avis.phtml b/application/modules/telephone/views/scripts/recherche/avis.phtml
index a651872bb1c..9820e012834 100644
--- a/application/modules/telephone/views/scripts/recherche/avis.phtml
+++ b/application/modules/telephone/views/scripts/recherche/avis.phtml
@@ -8,13 +8,13 @@ $avis_abon = $this->notice->getAvisAbonne();
 
 
 <ul data-role="listview" data-inset="true">
-  <li date-theme="c">
+  <li data-theme="c">
   <?php 
   echo $this->resumeAvis($this->_('Bibliothécaires'), $avis_bib);
   echo $this->resumeAvis($this->_('Lecteurs du portail'), $avis_abon);?>
   </li>
   
-  <li date-theme="c" data-role="list-divider">
+  <li data-theme="c" data-role="list-divider">
     <?php echo $this->_('Avis des bibliothécaires');?>
   </li>
   <?php foreach ($avis_bib as $avis) { ?>
@@ -24,7 +24,7 @@ $avis_abon = $this->notice->getAvisAbonne();
 <li><?php echo 'Aucun commentaire';?></li>
 <?php } ?>
 
-  <li date-theme="c" data-role="list-divider">
+  <li data-theme="c" data-role="list-divider">
     <?php echo $this->_('Avis des lecteurs');?>
   </li>
   <?php foreach ($avis_abon as $avis) { ?>
diff --git a/application/modules/telephone/views/scripts/recherche/biographie.phtml b/application/modules/telephone/views/scripts/recherche/biographie.phtml
index 6c3eb17db60..41715985e30 100644
--- a/application/modules/telephone/views/scripts/recherche/biographie.phtml
+++ b/application/modules/telephone/views/scripts/recherche/biographie.phtml
@@ -3,7 +3,9 @@ echo $this->toolbar($this->_("Biographie"), array('action' => 'viewnotice'), tru
 echo '<h1>'.$this->notice->getTitrePrincipal().'</h1>';
 ?>
 
-<div class="pave">
-	<?php echo $this->biographie($this->notice); ?>
-</div>
+<ul data-role="listview" data-inset="true">
+  <li>
+    <?php echo $this->biographie($this->notice); ?>
+  </li>
+</ul>
 
diff --git a/application/modules/telephone/views/scripts/recherche/resume.phtml b/application/modules/telephone/views/scripts/recherche/resume.phtml
index 45d8b97c3da..1ecc414f37e 100644
--- a/application/modules/telephone/views/scripts/recherche/resume.phtml
+++ b/application/modules/telephone/views/scripts/recherche/resume.phtml
@@ -5,9 +5,25 @@ echo $this->toolbar($this->_("Résumés"),
 echo '<h1>'.$this->notice->getTitrePrincipal().'</h1>';
 ?>
 
-<div class="resumes">
+<ul data-role="listview" data-inset="true">
+  
 <?php
-$notice_html=new Class_NoticeHtml($this->notice);
-echo $notice_html->getResume($this->notice->findAllResumes());
-?>
-</div>
+
+  $resumes = $this->notice->findAllResumes();
+foreach($resumes as $resume){?>
+  <li data-role="list-divider">
+    <?php echo $this->_('Source : ') . $resume["source"];?>
+  </li>
+  <li>
+    <?php echo $resume["texte"];?>
+  </li>
+    <?php } ?>
+    <?php  if (empty($resumes)) { ?>
+  <li><?php echo 'Aucun resumé';?></li>
+    <?php } ?>
+</ul>
+  
+
+    
+
+
diff --git a/application/modules/telephone/views/scripts/recherche/similaires.phtml b/application/modules/telephone/views/scripts/recherche/similaires.phtml
index 778ee0127e1..ed0780ecd2e 100644
--- a/application/modules/telephone/views/scripts/recherche/similaires.phtml
+++ b/application/modules/telephone/views/scripts/recherche/similaires.phtml
@@ -3,12 +3,9 @@ echo $this->toolbar($this->_("Notices similaires"), array('action' => 'viewnotic
 echo '<h1>'.$this->notice->getTitrePrincipal().'</h1>';
 ?>
 
-<div class="pave">
+<ul data-role="listview">
 <?php
-	echo $this->listeNotices($this->notices, 
-													 count($this->notices), 
-													 1, 
-													 $this->preferences);
+	echo $this->listeNotices($this->notices,count($this->notices),1,$this->preferences);
 ?>
-</div>
+</ul>
 
diff --git a/application/modules/telephone/views/scripts/recherche/simple.phtml b/application/modules/telephone/views/scripts/recherche/simple.phtml
index 7a19e40090d..9bda89ed472 100644
--- a/application/modules/telephone/views/scripts/recherche/simple.phtml
+++ b/application/modules/telephone/views/scripts/recherche/simple.phtml
@@ -1,7 +1,8 @@
+<ul data-role="listview">
 <?php
 echo $this->toolbar("Recherche", $this->url(array(), null, true));
 echo '<div>' . $this->texte_selection . '</div>';
-// Liste notices
+
 echo $this->listeNotices($this->liste,
 												 $this->resultat['nombre'],
 												 $this->resultat['page_cours'],
@@ -12,3 +13,4 @@ echo $this->pager($this->resultat['nombre'],
 									$this->resultat['page_cours'],
 									$this->url_retour);
 ?>
+</ul>
diff --git a/application/modules/telephone/views/scripts/recherche/tags.phtml b/application/modules/telephone/views/scripts/recherche/tags.phtml
index e14ed81d205..6b3b509f789 100644
--- a/application/modules/telephone/views/scripts/recherche/tags.phtml
+++ b/application/modules/telephone/views/scripts/recherche/tags.phtml
@@ -3,7 +3,9 @@ echo $this->toolbar($this->_("Tags"), array('action' => 'viewnotice') ,true);
 echo '<h1>'.$this->notice->getTitrePrincipal().'</h1>';
 ?>
 
-<div class="pave">
-<?php echo $this->tags; ?>
-</div>
+<ul data-role="listview" data-inset="true">
+  <li>
+   <?php echo $this->tags; ?>
+  </li>
+</ul>
 
diff --git a/application/modules/telephone/views/scripts/recherche/videos.phtml b/application/modules/telephone/views/scripts/recherche/videos.phtml
index cac0db02726..d8bcabcaf05 100644
--- a/application/modules/telephone/views/scripts/recherche/videos.phtml
+++ b/application/modules/telephone/views/scripts/recherche/videos.phtml
@@ -1,11 +1,20 @@
+
+
+  <?php
+  echo $this->toolbar($this->_("Vidéos"));
+  echo '<h1>'.$this->notice->getTitrePrincipal().'</h1>';?>
+<ul data-role="listview" data-inset="true">
+<li data-theme="c">
 <?php
-echo $this->toolbar($this->_("Vidéos"));
-echo '<h1>'.$this->notice->getTitrePrincipal().'</h1>';
-if ($this->video_id) 
-	echo sprintf('<iframe width="320px" src="http://www.youtube.com/embed/%s"></iframe>',
-							 $this->video_id);
-else
-	echo sprintf('<p>%s</p>', $this->_('Aucune vidéo trouvée'));
-?>
+     if ($this->video_id) 
+       echo sprintf('<iframe src="http://www.youtube.com/embed/%s" frameborder="0" allowfullscreen></iframe>',$this->video_id);
+     else
+       echo $this->_('Aucune vidéo trouvée');
+  ?>
+</li>
+</ul>
+
+ 
+
 
 
diff --git a/application/modules/telephone/views/scripts/recherche/viewnotice.phtml b/application/modules/telephone/views/scripts/recherche/viewnotice.phtml
index efd89d82551..105fa3cc7f6 100644
--- a/application/modules/telephone/views/scripts/recherche/viewnotice.phtml
+++ b/application/modules/telephone/views/scripts/recherche/viewnotice.phtml
@@ -3,7 +3,7 @@ echo $this->toolbar($this->_("Recherche"),
 		    array('action' => 'simple')); ?>
 
 <ul data-role="listview" data-inset="true">
-  <li date-theme="c">
+  <li data-theme="c">
     <img src="<?php echo $this->notice->getUrlVignette();?>">
     <h3><?php echo $this->iconeSupport($this->notice->getTypeDoc()) . $this->notice->getTitrePrincipal() ;?></h3>
     <p><?php echo $this->notice->getAuteurPrincipal();?></p>
diff --git a/library/ZendAfi/View/Helper/Frbr.php b/library/ZendAfi/View/Helper/Frbr.php
index bce96c5ea0e..378aaa314b9 100644
--- a/library/ZendAfi/View/Helper/Frbr.php
+++ b/library/ZendAfi/View/Helper/Frbr.php
@@ -21,7 +21,7 @@
 
 class ZendAfi_View_Helper_Frbr extends Zend_View_Helper_HtmlElement{
    protected $linksRenderer;
-
+   const NO_RESULT_MESSAGE = 'Aucun lien n\'a été trouvé';
   /**
    * Retourne les notices liées
    *
@@ -35,7 +35,7 @@ class ZendAfi_View_Helper_Frbr extends Zend_View_Helper_HtmlElement{
 
     if (0 == count($sourceLinks) and 0 == count($targetLinks)){
       $noResultMessage = $this->linksRenderer->returnNoResultMessage();
-      return $noResultMessage;
+      return $noresultmessage;
       }
  
     
diff --git a/library/ZendAfi/View/Helper/ListeNotices.php b/library/ZendAfi/View/Helper/ListeNotices.php
index 65bd18edf88..df2171c0dd0 100644
--- a/library/ZendAfi/View/Helper/ListeNotices.php
+++ b/library/ZendAfi/View/Helper/ListeNotices.php
@@ -25,6 +25,7 @@
 //										3=liste vignette
 //										4= Liste images bookflip
 //////////////////////////////////////////////////////////////////////////////////////////
+
 class ZendAfi_View_Helper_ListeNotices extends ZendAfi_View_Helper_BaseHelper {
 	/**
 	 * @param array $notices
diff --git a/library/ZendAfi/View/Helper/Telephone/ListeNotices.php b/library/ZendAfi/View/Helper/Telephone/ListeNotices.php
index d35485534f9..7a25598295f 100644
--- a/library/ZendAfi/View/Helper/Telephone/ListeNotices.php
+++ b/library/ZendAfi/View/Helper/Telephone/ListeNotices.php
@@ -56,13 +56,13 @@ class ZendAfi_View_Helper_Telephone_ListeNotices extends ZendAfi_View_Helper_Bas
     if ($nombre_resultats == 1) 
 			$html .= $this->translate()->_('1 notice trouvée');
     if ($nombre_resultats > 1) 
-			$html .= $this->translate()->_('%s notices trouvées', $nombre_resultats) . '</td><td align="right">page&nbsp;' . $page;
+      $html .= $this->translate()->_('%s notices trouvées', $nombre_resultats) . '</td><td align="right">page&nbsp;' . $page;
 
     $html .= '</td></tr></table>';
 
     // Liste en fonction du format
 		$html .= $this->listeVignette($notices, $preferences["liste_codes"]);
-    return $html;
+    return '<li>' . $html . '</li>';
 	}
 
 
@@ -71,7 +71,7 @@ class ZendAfi_View_Helper_Telephone_ListeNotices extends ZendAfi_View_Helper_Bas
 		$html = '';
 		foreach ($data as $notice)
 			$this->_writeNoticeOn($notice, $champs, $html);		
-		return '<div class="liste"><ul>' . $html . '</ul></div>';
+		return $html;
 	}
 
 
diff --git a/tests/application/modules/telephone/controllers/RechercheControllerHarryPotterTest.php b/tests/application/modules/telephone/controllers/RechercheControllerHarryPotterTest.php
index 2e50f263828..0c22736c499 100644
--- a/tests/application/modules/telephone/controllers/RechercheControllerHarryPotterTest.php
+++ b/tests/application/modules/telephone/controllers/RechercheControllerHarryPotterTest.php
@@ -62,13 +62,13 @@ class Telephone_RechercheControllerHarryPotterViewNoticeTest extends Telephone_R
 
 	/** @test */
 	public function titleShouldBeHarryPotter() {
-		$this->assertXPathContentContains('//h1', 'Harry Potter à l\'ecole des sorciers');
+		$this->assertXPathContentContains('//li[@data-theme="c"]', 'Harry Potter à l\'ecole des sorciers');
 	}
 
 
 	/** @test */
 	public function auteurShouldBeJKRowling() {
-		$this->assertXPathContentContains('//h1', 'J.K. Rowling');
+		$this->assertXPathContentContains('//li[@data-theme="c"]', 'J.K. Rowling');
 	}
 
 
@@ -86,7 +86,7 @@ class Telephone_RechercheControllerHarryPotterViewNoticeTest extends Telephone_R
 
 	/** @test */
 	public function pageShouldContainsVignetteForHarryPotter() {
-		$this->assertXPath('//a[contains(@href, "recherche/grandeimage")]//img[contains(@src, "potter.jpg")]');
+		$this->assertXPath('//img[contains(@src, "potter.jpg")]');
 	}
 
 
@@ -769,7 +769,7 @@ class Telephone_RechercheControllerHarryPotterVideoNotFoundTest extends Telephon
 
 	/** @test */
 	public function pageShouldDisplayAucuneVideoTrouvee() {
-		$this->assertXPathContentContains('//p', 'Aucune vidéo');
+		$this->assertXPathContentContains('//li[@data-theme="c"]', 'Aucune vidéo');
 	}
 }
 
-- 
GitLab