From 5fef2318513dfbd0bd8ee6ac96343f7532f6f814 Mon Sep 17 00:00:00 2001
From: gloas <gloas@afi-sa.fr>
Date: Thu, 1 Jun 2017 09:43:54 +0200
Subject: [PATCH] dev #60900 fix tests failures

---
 .../ZendAfi/View/Helper/Admin/FrontNav.php    | 29 ++++++------
 public/admin/skins/bokeh74/front_nav.css      | 45 ++++++++++++-------
 .../opac/controllers/IndexControllerTest.php  |  4 +-
 3 files changed, 46 insertions(+), 32 deletions(-)

diff --git a/library/ZendAfi/View/Helper/Admin/FrontNav.php b/library/ZendAfi/View/Helper/Admin/FrontNav.php
index 3c3cb5f03cd..1f2f08bdfbd 100644
--- a/library/ZendAfi/View/Helper/Admin/FrontNav.php
+++ b/library/ZendAfi/View/Helper/Admin/FrontNav.php
@@ -68,7 +68,8 @@ class ZendAfi_View_Helper_Admin_FrontNav extends ZendAfi_View_Helper_BaseHelper
                                    'action' => 'edit',
                                    'id' => $id],
                                   $this->_('Mon compte : %s', Class_Users::getNomAff($id)),
-                                  ['data-popup' => 'true']);
+                                  ['title' => $this->_('Accéder à la page de modification de mon compte dans l\'interface d\'administration'),
+                                   'data-popup' => 'true']);
   }
 
 
@@ -82,13 +83,12 @@ class ZendAfi_View_Helper_Admin_FrontNav extends ZendAfi_View_Helper_BaseHelper
                                                  'controller' => 'index',
                                                  'action' => 'clearcache']);
 
-    $clear_cache = $this->_('Vider le cache de Bokeh');
     $actions = [$this->view->tagAnchor($clear_cache_url,
-                                       $clear_cache .
+                                       $this->_('Vider le cache') .
                                        $this->view->tagImg(Class_Admin_Skin::current()
                                                            ->getIconUrl('actions',
                                                                         'delete')),
-                                       ['title' => $clear_cache]),
+                                       ['title' => $this->_('Vider le cache de Bokeh')]),
 
                 $this->view->tagAnchor('#',
                                        $this->_('Mettre à jour la charte graphique') .
@@ -96,7 +96,8 @@ class ZendAfi_View_Helper_Admin_FrontNav extends ZendAfi_View_Helper_BaseHelper
                                                            ->getIconUrl('icons',
                                                                         'batches'),
                                                            ['style' => 'height: 18px;']),
-                                       ['onclick' => sprintf('$.ajax(\'%s\'); $(this).find(\'img\').attr(\'src\', \'%s\'); $(this).find(\'img\').attr(\'style\', \'height: 18px; filter: invert(0);\');return true;',
+                                       ['title' => $this->_('Faire une demande de mise à jour de la charte graphique'),
+                                        'onclick' => sprintf('$.ajax(\'%s\'); $(this).find(\'img\').attr(\'src\', \'%s\'); $(this).find(\'img\').attr(\'style\', \'height: 18px; filter: invert(0);\');return true;',
                                                              Class_Url::absolute('/admin/index/update-skin/git/pull'),
                                                              URL_ADMIN_IMG . 'loading.gif')]),
 
@@ -127,9 +128,8 @@ class ZendAfi_View_Helper_Admin_FrontNav extends ZendAfi_View_Helper_BaseHelper
 
                 $this->_changeProfile()];
 
-    return $this->_tag('ul',
-                       $this->_tag('h3', $this->_('Actions d\'administration')) .
-                       implode($this->_lify($actions)));
+    return $this->_tag('h3', $this->_('Actions d\'administration')) .
+      $this->_tag('ul', implode($this->_lify($actions)));
   }
 
 
@@ -151,12 +151,11 @@ class ZendAfi_View_Helper_Admin_FrontNav extends ZendAfi_View_Helper_BaseHelper
       }
 
       return $options;
-    },
-                                                Class_Profil::getProfilsByBib('ALL', 'ALL'))])
+    },Class_Profil::getProfilsByBib('ALL', 'ALL'))])
       ->addUniqDisplayGroup('group')
       ->populate(['change_profile' => Class_Profil::getCurrentProfil()->getId()]);
 
-      return $this->view->renderForm($form);
+    return $this->view->renderForm($form->setAction('/'));
   }
 
 
@@ -168,7 +167,7 @@ class ZendAfi_View_Helper_Admin_FrontNav extends ZendAfi_View_Helper_BaseHelper
                                                         ->getIconUrl('actions',
                                                                      $img)),
                                     ['class' => $function_name,
-                                     'title' => $label,
+                                     'title' => $this->_('Activer ou désactiver : %s', $label),
                                      'onclick' => $function_name . '();return true;']);
     };
 
@@ -221,7 +220,8 @@ class ZendAfi_View_Helper_Admin_FrontNav extends ZendAfi_View_Helper_BaseHelper
                                      $this->view->tagImg(Class_Admin_Skin::current()
                                                          ->getIconUrl('icons',
                                                                       'home'),
-                                                         ['style' => 'height: 18px; filter: invert(0);'])),
+                                                         ['style' => 'height: 18px;']),
+                                     ['title' => $this->_('Accéder à l\'interface d\'administration')]),
 
               $this->view->tagAnchor($this->view->url(['module' => 'admin',
                                                        'controller' => 'profil',
@@ -233,7 +233,8 @@ class ZendAfi_View_Helper_Admin_FrontNav extends ZendAfi_View_Helper_BaseHelper
                                      $this->view->tagImg(Class_Admin_Skin::current()
                                                          ->getIconUrl('actions',
                                                                       'edit'),
-                                                         ['style' => 'height: 18px;']))];
+                                                         ['style' => 'height: 18px;']),
+                                     ['title' => $this->_('Accéder à l\'interface d\'administration pour paramétrer cette page')])];
 
     return $this->_tag('ul',
                        $this->_tag('h3', $this->_('Accéder à l\'administration')) .
diff --git a/public/admin/skins/bokeh74/front_nav.css b/public/admin/skins/bokeh74/front_nav.css
index b75e6bc92e6..1a65356fe9e 100644
--- a/public/admin/skins/bokeh74/front_nav.css
+++ b/public/admin/skins/bokeh74/front_nav.css
@@ -3,6 +3,29 @@
     font-family: arial, sans-serif;
 }
 
+.menu_admin_front .form select,
+.menu_admin_front > div {
+    background-color: var(--widget-background);
+}
+
+.menu_admin_front .form select,
+.menu_admin_front label,
+.menu_admin_front h3 {
+    color: var(--main-text);
+}
+
+.menu_admin_front a {
+    color: var(--anchor);
+}
+
+.menu_admin_front .form select {
+    border: 1px solid var(--border-highlight);
+}
+
+.menu_admin_front > div {
+    box-shadow: 1px 1px 5px var(--widget-shadow);
+}
+
 .menu_admin_front {
     position: fixed;
     top: 0;
@@ -15,15 +38,9 @@
     transition: all 0.4s;
 }
 
-.menu_admin_front .form select,
-.menu_admin_front > div {
-    background-color: var(--nav-background);
-}
-
 .menu_admin_front > div {
     overflow: hidden;
     width: 300px;
-    height: 500px;
 }
 
 .menu_admin_front.hidden > div {
@@ -39,13 +56,6 @@
     transform: rotate(45deg);
 }
 
-.menu_admin_front .form select,
-.menu_admin_front label,
-.menu_admin_front h3,
-.menu_admin_front a {
-    color: var(--nav-text);
-}
-
 .menu_admin_front form tr,
 .menu_admin_front h3,
 .menu_admin_front a {
@@ -54,7 +64,6 @@
 }
 
 .menu_admin_front a img {
-    filter: invert(1);
     float: right;
     vertical-align: middle;
     padding-right: 1.5em;
@@ -104,7 +113,6 @@
 
 .menu_admin_front .form select {
     height: 2em;
-    border: 1px solid var(--nav-text);
     width: 149px;
 }
 
@@ -124,4 +132,9 @@
 #site_web_wrapper a[href*="/admin"] {
     display: none !important;
     opacity: 1 !important;
-}
\ No newline at end of file
+}
+
+.menu_admin_front a:hover, 
+.menu_admin_front a:focus {
+    text-decoration: underline;
+}
diff --git a/tests/application/modules/opac/controllers/IndexControllerTest.php b/tests/application/modules/opac/controllers/IndexControllerTest.php
index 86ffcfee980..1bf47cc173e 100644
--- a/tests/application/modules/opac/controllers/IndexControllerTest.php
+++ b/tests/application/modules/opac/controllers/IndexControllerTest.php
@@ -666,7 +666,7 @@ class IndexControllerHeartBeatTest extends Admin_AbstractControllerTestCase {
   /** @test */
   public function indexAsAdminShouldContainsClearCacheButton() {
     $this->dispatch('/opac/index/index', true);
-    $this->assertXPathContentContains('//script', '<button class="clear_cache"');
+    $this->assertXPathContentContains('//a[contains(@href, "/admin/index/clearcache")]', 'Vider le cache');
   }
 
 
@@ -817,4 +817,4 @@ class IndexControllerWithBibAdminLoggedTest extends AbstractControllerTestCase {
   public function scriptToShowAmberIdeShouldBePresent() {
     $this->assertXPathContentContains('//script', 'showAmberIDE()');
   }
-}
+}
\ No newline at end of file
-- 
GitLab