Browse Source

Anomalie #822: Pas de count new sur show one

Bastien Sevajol 11 years ago
parent
commit
7a95740ff0

+ 1 - 1
src/Muzich/CoreBundle/Resources/public/js/muzich.js View File

@@ -1757,7 +1757,7 @@ $(document).ready(function(){
1757 1757
   
1758 1758
   function check_new_elements()
1759 1759
   {
1760
-    if ($('ul.elements li').length)
1760
+    if ($('ul.elements li').length && $('ul.elements').data('context') === 'home')
1761 1761
     {
1762 1762
       // Si l'utilisateur a quitté la page on reporte le check
1763 1763
       if ($('body.blurred').length)

+ 4 - 1
src/Muzich/CoreBundle/Resources/views/SearchElement/default.html.twig View File

@@ -7,6 +7,9 @@
7 7
 {% if autoplay_context is not defined %}
8 8
   {% set autoplay_context = '' %}
9 9
 {% endif %}
10
+{% if elements_context is not defined %}
11
+  {% set elements_context = '' %}
12
+{% endif %}
10 13
 
11 14
 {% if display_new_elements %}
12 15
   <div class="display_more_elements" style="display: none;">
@@ -21,7 +24,7 @@
21 24
 {% endif %}
22 25
 
23 26
 {% if elements|length %}
24
-  {% if not app.request.isXmlHttpRequest %}<ul class="elements" data-autoplay_context="{{ autoplay_context }}">{% endif %}
27
+  {% if not app.request.isXmlHttpRequest %}<ul class="elements" data-autoplay_context="{{ autoplay_context }}" data-context="{{ elements_context }}">{% endif %}
25 28
     {% for element in elements %} 
26 29
       
27 30
       {% include "MuzichCoreBundle:SearchElement:li.element.html.twig" %}

+ 4 - 3
src/Muzich/HomeBundle/Controller/HomeController.php View File

@@ -14,7 +14,7 @@ class HomeController extends Controller
14 14
    * d'éléments général et personalisable et de quoi ajouter un élément.
15 15
    * 
16 16
    */
17
-  public function indexAction($count = null, $network = null, $login = false, $search_object = null)
17
+  public function indexAction($count = null, $network = null, $login = false, $search_object = null, $context = 'home')
18 18
   {
19 19
     if (!$search_object)
20 20
       $search_object = $this->getElementSearcher($count);
@@ -46,7 +46,8 @@ class HomeController extends Controller
46 46
       'from_url'         => $this->getRequest()->get('from_url'),
47 47
       'display_launch_demo' => true,
48 48
       'login'            => $login,
49
-      'email_token'      => $this->getEmailTokenIfExist()
49
+      'email_token'      => $this->getEmailTokenIfExist(),
50
+      'elements_context' => $context
50 51
     ));
51 52
   }
52 53
   
@@ -55,7 +56,7 @@ class HomeController extends Controller
55 56
     $es = $this->getNewElementSearcher();
56 57
     $es->setNoTags();
57 58
     $es->setIds(array($element_id));
58
-    return $this->indexAction(null, null, false, $es);
59
+    return $this->indexAction(null, null, false, $es, 'one');
59 60
   }
60 61
   
61 62
   protected function getEmailTokenIfExist()