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
   
1757
   
1758
   function check_new_elements()
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
       // Si l'utilisateur a quitté la page on reporte le check
1762
       // Si l'utilisateur a quitté la page on reporte le check
1763
       if ($('body.blurred').length)
1763
       if ($('body.blurred').length)

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

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

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

14
    * d'éléments général et personalisable et de quoi ajouter un élément.
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
     if (!$search_object)
19
     if (!$search_object)
20
       $search_object = $this->getElementSearcher($count);
20
       $search_object = $this->getElementSearcher($count);
46
       'from_url'         => $this->getRequest()->get('from_url'),
46
       'from_url'         => $this->getRequest()->get('from_url'),
47
       'display_launch_demo' => true,
47
       'display_launch_demo' => true,
48
       'login'            => $login,
48
       'login'            => $login,
49
-      'email_token'      => $this->getEmailTokenIfExist()
49
+      'email_token'      => $this->getEmailTokenIfExist(),
50
+      'elements_context' => $context
50
     ));
51
     ));
51
   }
52
   }
52
   
53
   
55
     $es = $this->getNewElementSearcher();
56
     $es = $this->getNewElementSearcher();
56
     $es->setNoTags();
57
     $es->setNoTags();
57
     $es->setIds(array($element_id));
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
   protected function getEmailTokenIfExist()
62
   protected function getEmailTokenIfExist()