diff --git a/VERSIONS_HOTLINE/134207 b/VERSIONS_HOTLINE/134207 new file mode 100644 index 0000000000000000000000000000000000000000..8cc6cf717709ff972e6835fe9853adf853b8df9d --- /dev/null +++ b/VERSIONS_HOTLINE/134207 @@ -0,0 +1 @@ + - ticket #134207 : Magasin de thèmes : Ajout de classes sur les avis sans titre et critique pour faciliter la personnalisation. Les nouvelles classes sont : score_rating et score_date. \ No newline at end of file diff --git a/library/templates/Intonation/Library/Settings.php b/library/templates/Intonation/Library/Settings.php index 063619813bc677d17adb3af8a3b99990491a29f3..9bfe28ca661fd034c981fb4fbba8dd846b3b99b4 100644 --- a/library/templates/Intonation/Library/Settings.php +++ b/library/templates/Intonation/Library/Settings.php @@ -283,6 +283,10 @@ class Intonation_Library_Settings extends Intonation_System_Abstract { 'span class loan_library' => 'badge-secondary', 'span class loan_holded' => 'badge-warning', 'span class loan_renewed' => 'badge-info', + 'div class review_rating' => 'col-12', + 'div class review_title' => 'col-12', + 'div class score_rating' => 'col-12 col-lg-6 text-md-left', + 'div class score_date' => 'col-12 col-lg-5 text-md-right', ], 'icons_map_doc_types' => [], diff --git a/library/templates/Intonation/Library/View/Wrapper/Review.php b/library/templates/Intonation/Library/View/Wrapper/Review.php index 70a9dfa6b57c73e8621dbd9d4eb909c6fdb5f9b2..da31ee306457858b2f635e680c6c8bb7095affc8 100644 --- a/library/templates/Intonation/Library/View/Wrapper/Review.php +++ b/library/templates/Intonation/Library/View/Wrapper/Review.php @@ -36,10 +36,10 @@ class Intonation_Library_View_Wrapper_Review extends Intonation_Library_View_Wra $this->_('le %s', $this->_model->getHumanDate()), ['class' => 'text-muted small'])), - $this->_view->div(['class' => 'col-12'], + $this->_view->div(['class' => 'review_rating'], $this->_view->rating($this->_model->getNote())), - $this->_view->div(['class' => 'col-12'], + $this->_view->div(['class' => 'review_title'], $title) ]; @@ -47,10 +47,10 @@ class Intonation_Library_View_Wrapper_Review extends Intonation_Library_View_Wra } $html = [ - $this->_view->div(['class' => 'col-12 col-lg-6 text-md-left'], + $this->_view->div(['class' => 'score_rating'], $this->_view->rating($this->_model->getNote())), - $this->_view->div(['class' => 'col-12 col-lg-5 text-md-right'], + $this->_view->div(['class' => 'score_date'], $this->_view->tag('span', $this->_('le %s', $this->_model->getHumanDate()), ['class' => 'text-muted small', diff --git a/tests/scenarios/Templates/TemplatesSearchTest.php b/tests/scenarios/Templates/TemplatesSearchTest.php index ab71cf2f8b3e7d71a7fb9cae2424b18d0cfe54a2..afe817e4dac959dcfacb2a9eccb7600065098865 100644 --- a/tests/scenarios/Templates/TemplatesSearchTest.php +++ b/tests/scenarios/Templates/TemplatesSearchTest.php @@ -219,6 +219,22 @@ class TemplatesSearchViewRecordTest extends TemplatesIntonationTestCase { 'id_notice' => 456, 'source_author' => null]); + $this->fixture('Class_AvisNotice', + ['id' => 13434, + 'entete' => 'gonna be delete', + 'avis' => 'gonna be delete too', + 'clef_oeuvre' => 'PSYKO', + 'note' => 4, + 'date_avis' => '2016-03-18 13:00:00', + 'statut' => 1, + 'abon_ou_bib' => 0, + 'id_notice' => 456, + 'source_author' => null]) + ->beImportMode() + ->setEntite('') + ->setAvis('') + ->assertSave(); + ZendAfi_Auth::getInstance() ->logUser(Class_Users::newInstanceWithIdAssertSave(332, ['login' => 'bob', @@ -246,6 +262,18 @@ class TemplatesSearchViewRecordTest extends TemplatesIntonationTestCase { } + /** @test */ + public function scoreRating4StarsShouldBeDisplay() { + $this->assertXPath('//div[@class = "score_rating col-12 col-lg-6 text-md-left"]//span/i[@title="Note : 4 / 5"]'); + } + + + /** @test */ + public function scoreDateIn2016ShouldBeDisplay() { + $this->assertXPathContentContains('//div[@class = "score_date col-12 col-lg-5 text-md-right"]//span', 'le 18 mars 2016'); + } + + /** @test */ public function ratingDateForLostHeighwayShouldBe20150318() { $this->assertXPathContentContains('//div', '18 mars 2015'); @@ -253,8 +281,8 @@ class TemplatesSearchViewRecordTest extends TemplatesIntonationTestCase { /** @test */ - public function badgesShouldContainsOneBorrowerReview() { - $this->assertXPathContentContains('//span[contains(@class, "badge")]', '1 avis abonné'); + public function badgesShouldContainsTwoBorrowerReview() { + $this->assertXPathContentContains('//span[contains(@class, "badge")]', '2 avis abonné'); }