Browse Source

Evolution #163: Evenements: Prise en comptes des autres facteurs

bastien 13 years ago
parent
commit
58ce2dcd63

+ 4 - 0
app/Resources/translations/users.fr.yml View File

17
     no:                         Pas de nouveaux commentaires sur vos partages
17
     no:                         Pas de nouveaux commentaires sur vos partages
18
     one:                        %count% nouveaux commentaire sur un de vos partages
18
     one:                        %count% nouveaux commentaire sur un de vos partages
19
     yes:                        %count% nouveaux commentaires sur vos partages
19
     yes:                        %count% nouveaux commentaires sur vos partages
20
+  new_favoriteds:
21
+    no:                         Pas de nouveaux partages mis en favoris
22
+    one:                        %count% de vos partage a été mis en favoris
23
+    yes:                        %count% de vos partages ont été mis en favoris
20
     
24
     
21
 reputation:
25
 reputation:
22
   bar:
26
   bar:

+ 2 - 1
app/Resources/translations/userui.fr.yml View File

65
   mytags:  Tous mes tags
65
   mytags:  Tous mes tags
66
   network_all:   Réseau global
66
   network_all:   Réseau global
67
   network_my:    Mon réseau
67
   network_my:    Mon réseau
68
-  new_comments:   Nvx commentaires
68
+  new_comments:     Nvx commentaires
69
+  new_favoriteds:   Nvx favoris
69
   
70
   
70
 element_add:
71
 element_add:
71
   url:
72
   url:

+ 66 - 6
src/Muzich/CoreBundle/Actions/User/Event.php View File

4
 
4
 
5
 use Muzich\CoreBundle\Entity\User;
5
 use Muzich\CoreBundle\Entity\User;
6
 use Muzich\CoreBundle\Entity\Event as EventEntity;
6
 use Muzich\CoreBundle\Entity\Event as EventEntity;
7
+use Symfony\Component\DependencyInjection\Container;
7
 
8
 
8
 /**
9
 /**
9
  * Refactorisation d'actions lié aux événement de l'utilisateur
10
  * Refactorisation d'actions lié aux événement de l'utilisateur
19
    */
20
    */
20
   protected $user;
21
   protected $user;
21
   protected $event;
22
   protected $event;
23
+  protected $new = false;
24
+  protected $container;
22
   
25
   
23
-  public function __construct(User $user, EventEntity $event)
26
+  /**
27
+   *
28
+   * @param User $user L'utilisateur concerné par l'événement
29
+   * @param Container $container 
30
+   */
31
+  public function __construct(User $user, Container $container)
24
   {
32
   {
25
     $this->user = $user;
33
     $this->user = $user;
26
-    $this->event = $event;
34
+    $this->container = $container;
35
+  }
36
+  
37
+  /**
38
+   * Cette méthode récupére (si elle existe) en base l'objet Event
39
+   * correspondant a cet événement.
40
+   * 
41
+   * @param string $type 
42
+   */
43
+  protected function initialize($type)
44
+  {
45
+    $em = $this->container->get('doctrine')->getEntityManager();
46
+    try
47
+    {
48
+      $this->event = $em->createQuery(
49
+        'SELECT e FROM MuzichCoreBundle:Event e
50
+        WHERE e.user = :uid AND e.type = :type'
51
+      )->setParameters(array(
52
+        'uid'  => $this->user->getId(),
53
+        'type' => $type
54
+      ))->getSingleResult()
55
+      ;
56
+      $this->new = false;
57
+    } 
58
+    catch (\Doctrine\ORM\NoResultException $e)
59
+    {
60
+      $this->event = new EventEntity();
61
+      $this->new = true;
62
+    }
63
+  }
64
+  
65
+  /**
66
+   * Procéde a l'ajout de l'événement a la liste de l'utilisateur.
67
+   * 
68
+   * @param string $type
69
+   * @param int $element_id
70
+   * @return Event 
71
+   */
72
+  public function proceed($type, $element_id)
73
+  {
74
+    $this->initialize($type);
75
+    if ($this->new)
76
+    {
77
+      $this->initEvent($type, $element_id);
78
+    }
79
+    else
80
+    {
81
+      $this->updateEvent($element_id);
82
+    }
83
+    
84
+    return $this->event;
27
   }
85
   }
28
   
86
   
29
-  /*
30
-   * Mise a jour de l'objet Eevnt
87
+  /**
88
+   * 
89
+   * 
90
+   * @param int $element_id 
31
    */
91
    */
32
-  public function updateEvent($element_id)
92
+  protected function updateEvent($element_id)
33
   {
93
   {
34
     $this->event->addId($element_id);
94
     $this->event->addId($element_id);
35
   }
95
   }
40
    * @param string $type
100
    * @param string $type
41
    * @param int $element_id 
101
    * @param int $element_id 
42
    */
102
    */
43
-  public function createEvent($type, $element_id)
103
+  protected function initEvent($type, $element_id)
44
   {
104
   {
45
     $this->event->addId($element_id);
105
     $this->event->addId($element_id);
46
     $this->event->setType($type);
106
     $this->event->setType($type);

+ 2 - 2
src/Muzich/CoreBundle/Controller/CoreController.php View File

309
             'network_public'   => $search_object->isNetworkPublic(),
309
             'network_public'   => $search_object->isNetworkPublic(),
310
             'elements'         => $search_object->getElements($this->getDoctrine(), $this->getUserId()),
310
             'elements'         => $search_object->getElements($this->getDoctrine(), $this->getUserId()),
311
             'more_count'       => $this->container->getParameter('search_default_count')*2,
311
             'more_count'       => $this->container->getParameter('search_default_count')*2,
312
-            'display_comments' => false
312
+            'ids_display'      => $search_object->getIdsDisplay()
313
           ));
313
           ));
314
         }
314
         }
315
         else
315
         else
336
             'add_form_name' => (isset($add_form)) ? 'add' : null,
336
             'add_form_name' => (isset($add_form)) ? 'add' : null,
337
             'more_count'    => null,
337
             'more_count'    => null,
338
             'more_route'    => 'show_group_more',
338
             'more_route'    => 'show_group_more',
339
-            'display_comments' => false
339
+            'ids_display'   => $search_object->getIdsDisplay()
340
           ));
340
           ));
341
         }
341
         }
342
 
342
 

+ 1 - 0
src/Muzich/CoreBundle/Entity/Event.php View File

19
 {
19
 {
20
   
20
   
21
   const TYPE_COMMENT_ADDED_ELEMENT = "com.adde.ele";
21
   const TYPE_COMMENT_ADDED_ELEMENT = "com.adde.ele";
22
+  const TYPE_FAV_ADDED_ELEMENT     = "fav.adde.ele";
22
   
23
   
23
   /**
24
   /**
24
    * @ORM\Id
25
    * @ORM\Id

+ 6 - 0
src/Muzich/CoreBundle/Extension/MyTwigExtension.php View File

124
       case 'TYPE_COMMENT_ADDED_ELEMENT':
124
       case 'TYPE_COMMENT_ADDED_ELEMENT':
125
         return \Muzich\CoreBundle\Entity\Event::TYPE_COMMENT_ADDED_ELEMENT;
125
         return \Muzich\CoreBundle\Entity\Event::TYPE_COMMENT_ADDED_ELEMENT;
126
       break;
126
       break;
127
+      case 'TYPE_FAV_ADDED_ELEMENT':
128
+        return \Muzich\CoreBundle\Entity\Event::TYPE_FAV_ADDED_ELEMENT;
129
+      break;
130
+      default:
131
+        throw new \Exception('Constante non géré dans MyTwigExtension::event_const');
132
+      break;
127
     }
133
     }
128
     return null;
134
     return null;
129
   }
135
   }

+ 7 - 34
src/Muzich/CoreBundle/Propagator/EventElement.php View File

26
    */
26
    */
27
   public function commentAdded(Element $element)
27
   public function commentAdded(Element $element)
28
   {
28
   {
29
-    $em = $this->container->get('doctrine')->getEntityManager();
30
-    
31
-    try
32
-    {
33
-      $event = $em->createQuery(
34
-        'SELECT e FROM MuzichCoreBundle:Event e
35
-        WHERE e.user = :uid AND e.type = :type'
36
-      )->setParameters(array(
37
-        'uid' => $element->getOwner()->getId(),
38
-        'type' => Event::TYPE_COMMENT_ADDED_ELEMENT
39
-      ))->getSingleResult()
40
-      ;
41
-      $new = false;
42
-    } 
43
-    catch (\Doctrine\ORM\NoResultException $e)
44
-    {
45
-      $event = new Event();
46
-      $new = true;
47
-    }
48
-    
49
-    $uea = new UserEventAction($element->getOwner(), $event);
50
-    if ($new)
51
-    {
52
-      $uea->createEvent(
53
-        Event::TYPE_COMMENT_ADDED_ELEMENT,
54
-        $element->getId()
55
-      );
56
-    }
57
-    else
58
-    {
59
-      $uea->updateEvent($element->getId());
60
-    }
61
-    
62
-    $em->persist($event);
29
+    $uea = new UserEventAction($element->getOwner(), $this->container);
30
+    $event = $uea->proceed(Event::TYPE_COMMENT_ADDED_ELEMENT, $element->getId());
31
+    $this->container->get('doctrine')->getEntityManager()->persist($event);
63
   }
32
   }
64
   
33
   
65
   /**
34
   /**
103
     $ur->addPoints(
72
     $ur->addPoints(
104
       $this->container->getParameter('reputation_element_favorite_value')
73
       $this->container->getParameter('reputation_element_favorite_value')
105
     );
74
     );
75
+    
76
+    $uea = new UserEventAction($element->getOwner(), $this->container);
77
+    $event = $uea->proceed(Event::TYPE_FAV_ADDED_ELEMENT, $element->getId());
78
+    $this->container->get('doctrine')->getEntityManager()->persist($event);
106
   }
79
   }
107
   
80
   
108
   /**
81
   /**

+ 11 - 3
src/Muzich/CoreBundle/Resources/views/SearchElement/form.html.twig View File

7
       {{ form_widget(search_form.network, { 'attr': {'style': 'display: none;'} }) }}
7
       {{ form_widget(search_form.network, { 'attr': {'style': 'display: none;'} }) }}
8
     </div>
8
     </div>
9
     
9
     
10
-    <a href="#" class="button all_network {% if network_public and not display_comments %}active{% endif %}">
10
+    <a href="#" class="button all_network {% if network_public and not ids_display %}active{% endif %}">
11
       {{ 'filter.network_all'|trans({}, 'userui') }}
11
       {{ 'filter.network_all'|trans({}, 'userui') }}
12
     </a>
12
     </a>
13
-    <a href="#" class="button my_network {% if not network_public and not display_comments %}active{% endif %}">
13
+    <a href="#" class="button my_network {% if not network_public and not ids_display %}active{% endif %}">
14
       {{ 'filter.network_my'|trans({}, 'userui') }}
14
       {{ 'filter.network_my'|trans({}, 'userui') }}
15
     </a>
15
     </a>
16
       
16
       
17
   </div>
17
   </div>
18
 
18
 
19
   <div class="more_filters">
19
   <div class="more_filters">
20
-    <a href="{{ path('ajax_filter_remove_ids') }}" class="button active new_comments" style="{% if not display_comments %}display: none;{% endif %}">
20
+    <a href="{{ path('ajax_filter_remove_ids') }}" class="button active new_comments" 
21
+       style="{% if ids_display != event_const('TYPE_COMMENT_ADDED_ELEMENT') %}display: none;{% endif %}"
22
+    >
21
       {{ 'filter.new_comments'|trans({}, 'userui') }}
23
       {{ 'filter.new_comments'|trans({}, 'userui') }}
22
       <img src="{{ asset('bundles/muzichcore/img/1328276855_list-remove.png') }}" alt="remove" />
24
       <img src="{{ asset('bundles/muzichcore/img/1328276855_list-remove.png') }}" alt="remove" />
23
     </a>
25
     </a>
26
+    <a href="{{ path('ajax_filter_remove_ids') }}" class="button active new_favorites" 
27
+       style="{% if ids_display != event_const('TYPE_FAV_ADDED_ELEMENT') %}display: none;{% endif %}"
28
+    >
29
+      {{ 'filter.new_favoriteds'|trans({}, 'userui') }}
30
+      <img src="{{ asset('bundles/muzichcore/img/1328276855_list-remove.png') }}" alt="remove" />
31
+    </a>
24
   </div>
32
   </div>
25
   
33
   
26
   {% include "MuzichCoreBundle:Tag:tagsPrompt.html.twig" with { 
34
   {% include "MuzichCoreBundle:Tag:tagsPrompt.html.twig" with { 

+ 29 - 9
src/Muzich/CoreBundle/Searcher/ElementSearcher.php View File

83
   protected $ids;
83
   protected $ids;
84
   
84
   
85
   /**
85
   /**
86
+   * On stocke la dedans le bouton a afficher dans le gestionnaire de filtres
87
+   * correspondant aux ids filtrés. La valeur doit correspondre a une constante
88
+   * de l'Entité metier Event.
89
+   * 
90
+   * @var string 
91
+   */
92
+  protected $ids_display;
93
+  
94
+  /**
86
    * @see SearcherInterface
95
    * @see SearcherInterface
87
    * @param array $params 
96
    * @param array $params 
88
    */
97
    */
95
     
104
     
96
     // Mise a jour des attributs
105
     // Mise a jour des attributs
97
     $this->setAttributes(array(
106
     $this->setAttributes(array(
98
-      'network', 'tags', 'count', 'user_id', 'group_id', 'favorite', 'id_limit', 'searchnew', 'ids'
107
+      'network', 'tags', 'count', 'user_id', 'group_id', 'favorite', 'id_limit', 'searchnew', 'ids', 'ids_display'
99
     ), $params);
108
     ), $params);
100
     
109
     
101
   }
110
   }
108
   {
117
   {
109
     // Mise a jour des attributs
118
     // Mise a jour des attributs
110
     $this->setAttributes(array(
119
     $this->setAttributes(array(
111
-      'network', 'tags', 'count', 'user_id', 'group_id', 'favorite', 'id_limit', 'searchnew', 'ids'
120
+      'network', 'tags', 'count', 'user_id', 'group_id', 'favorite', 'id_limit', 'searchnew', 'ids', 'ids_display'
112
     ), $params);
121
     ), $params);
113
   }
122
   }
114
   
123
   
120
   public function getParams($tags_string = false)
129
   public function getParams($tags_string = false)
121
   {
130
   {
122
     return array(
131
     return array(
123
-      'network'  => $this->getNetwork(),
124
-      'tags'     => $this->getTags($tags_string),
125
-      'count'    => $this->getCount(),
126
-      'user_id'  => $this->getUserId(),
127
-      'group_id' => $this->getGroupId(),
128
-      'favorite' => $this->isFavorite(),
129
-      'ids'      => $this->getIds()
132
+      'network'     => $this->getNetwork(),
133
+      'tags'        => $this->getTags($tags_string),
134
+      'count'       => $this->getCount(),
135
+      'user_id'     => $this->getUserId(),
136
+      'group_id'    => $this->getGroupId(),
137
+      'favorite'    => $this->isFavorite(),
138
+      'ids'         => $this->getIds(),
139
+      'ids_display' => $this->getIdsDisplay()
130
     );
140
     );
131
   }
141
   }
132
   
142
   
211
     }
221
     }
212
     return false;
222
     return false;
213
   }
223
   }
224
+  
225
+  public function setIdsDisplay($display)
226
+  {
227
+    $this->ids_display = $display;
228
+  }
229
+  
230
+  public function getIdsDisplay()
231
+  {
232
+    return $this->ids_display;
233
+  }
214
 
234
 
215
   /**
235
   /**
216
    * Construction de l'objet Query
236
    * Construction de l'objet Query

+ 97 - 0
src/Muzich/CoreBundle/Tests/Controller/EventTest.php View File

202
     
202
     
203
   }
203
   }
204
   
204
   
205
+  public function testFavoriteAdded()
206
+  {
207
+    $this->client = self::createClient();
208
+    $this->connectUser('paul', 'toor');
209
+    
210
+    $paul = $this->getUser();
211
+    $bux = $this->getUser('bux');
212
+    
213
+    // Actuellement il n'y a aucun event d'ouvert pour bux (fixtures)
214
+    $result = $this->getDoctrine()->getEntityManager()
215
+      ->createQuery('SELECT e FROM MuzichCoreBundle:Event e
216
+        WHERE e.user = :uid'
217
+      )
218
+      ->setParameter('uid', $bux->getId())
219
+      ->getArrayResult()
220
+    ;
221
+    $this->assertEquals(count($result), 0);
222
+    
223
+    $element = $this->getDoctrine()->getRepository('MuzichCoreBundle:Element')
224
+      ->findOneByName('Ed Cox - La fanfare des teuffeurs (Hardcordian)')
225
+    ;
226
+        
227
+    // Ajout d'un élément en favoris
228
+    // Il ajoute cet élément en favoris
229
+    $url = $this->generateUrl('favorite_add', array(
230
+      'id'    => $element->getId(),
231
+      'token' => $paul->getPersonalHash()
232
+    ));
233
+    
234
+    $crawler = $this->client->request('GET', $url, array(), array(), array(
235
+        'HTTP_X-Requested-With' => 'XMLHttpRequest',
236
+    ));
237
+    
238
+    $this->isResponseSuccess();
239
+    
240
+    // On contrôle la présence du favoris
241
+    $fav = $this->getDoctrine()->getRepository('MuzichCoreBundle:UsersElementsFavorites')
242
+      ->findOneBy(array(
243
+        'user'    => $paul->getId(),
244
+        'element' => $element->getId()
245
+      ));
246
+    
247
+    $this->assertTrue(!is_null($fav));
248
+    
249
+    // bux a maintenant un event en base
250
+    $result = $this->getDoctrine()->getEntityManager()
251
+      ->createQuery('
252
+        SELECT e FROM MuzichCoreBundle:Event e
253
+        WHERE e.user = :uid'
254
+      )
255
+      ->setParameter('uid', $bux->getId())
256
+      ->getArrayResult()
257
+    ;
258
+    $this->assertEquals(count($result), 1);
259
+    $this->assertEquals($result[0]['type'], Event::TYPE_FAV_ADDED_ELEMENT);
260
+    $this->assertEquals($result[0]['count'], 1);
261
+    $this->assertEquals($result[0]['ids'], json_encode(array((string)$element->getId())));
262
+    
263
+    // On enlève des favoris
264
+    $url = $this->generateUrl('favorite_remove', array(
265
+      'id'    => $element->getId(),
266
+      'token' => $paul->getPersonalHash()
267
+    ));
268
+    
269
+    $crawler = $this->client->request('GET', $url, array(), array(), array(
270
+        'HTTP_X-Requested-With' => 'XMLHttpRequest',
271
+    ));
272
+    
273
+    // On contrôle l'absence du favoris
274
+    $fav = $this->getDoctrine()->getRepository('MuzichCoreBundle:UsersElementsFavorites')
275
+      ->findOneBy(array(
276
+        'user'    => $paul->getId(),
277
+        'element' => $element->getId()
278
+      ));
279
+    
280
+    $this->assertTrue(is_null($fav));
281
+    
282
+    // bux a toujours qu'un event avec un seul element signalé.
283
+    $result = $this->getDoctrine()->getEntityManager()
284
+      ->createQuery('
285
+        SELECT e FROM MuzichCoreBundle:Event e
286
+        WHERE e.user = :uid'
287
+      )
288
+      ->setParameter('uid', $bux->getId())
289
+      ->getArrayResult()
290
+    ;
291
+    $this->assertEquals(count($result), 1);
292
+    $this->assertEquals($result[0]['type'], Event::TYPE_FAV_ADDED_ELEMENT);
293
+    $this->assertEquals($result[0]['count'], 1);
294
+    $this->assertEquals($result[0]['ids'], json_encode(array((string)$element->getId())));
295
+    
296
+    // Pour le moment pas de tests supplémentaire comme mettre de nouveaux favoris 
297
+    // ou consulter la liste des éléments concernés. Il faudrait coder ces test certe.
298
+    // Mais la refactorisation du code fait qu'il n'y a que le type (Event) de diféfrent.
299
+    // donc a coder (tests) mais pas urgent a l'isntant.
300
+  }
301
+  
205
 }
302
 }

+ 4 - 2
src/Muzich/CoreBundle/Tests/Searcher/ElementSearcherTest.php View File

17
         'user_id'   => 185, 
17
         'user_id'   => 185, 
18
         'group_id'  => null, 
18
         'group_id'  => null, 
19
         'favorite'  => false,
19
         'favorite'  => false,
20
-        'ids'       => null
20
+        'ids'       => null,
21
+        'ids_display' => null
21
     ));
22
     ));
22
 
23
 
23
     $this->assertEquals($ia, $es->getParams());
24
     $this->assertEquals($ia, $es->getParams());
41
         'user_id'   => 115, 
42
         'user_id'   => 115, 
42
         'group_id'  => null, 
43
         'group_id'  => null, 
43
         'favorite'  => false,
44
         'favorite'  => false,
44
-        'ids'       => null
45
+        'ids'       => null,
46
+        'ids_display' => null
45
     ));
47
     ));
46
 
48
 
47
     $this->assertEquals($ua, $es->getParams());
49
     $this->assertEquals($ua, $es->getParams());

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

30
     
30
     
31
     return array(
31
     return array(
32
       'search_tags_id'   => $search_object->getTags(),
32
       'search_tags_id'   => $search_object->getTags(),
33
-      'display_comments' => $search_object->hasIds(),
33
+      'ids_display'      => $search_object->getIdsDisplay(),
34
       'user'             => $this->getUser(),
34
       'user'             => $this->getUser(),
35
       'add_form'         => $add_form->createView(),
35
       'add_form'         => $add_form->createView(),
36
       'add_form_name'    => 'add',
36
       'add_form_name'    => 'add',

+ 1 - 0
src/Muzich/UserBundle/Controller/EventController.php View File

55
     
55
     
56
     $es = $this->getElementSearcher();
56
     $es = $this->getElementSearcher();
57
     $es->setIds($event->getIds());
57
     $es->setIds($event->getIds());
58
+    $es->setIdsDisplay($event->getType());
58
     $this->setElementSearcherParams($es->getParams());
59
     $this->setElementSearcherParams($es->getParams());
59
     $this->getDoctrine()->getEntityManager()->remove($event);
60
     $this->getDoctrine()->getEntityManager()->remove($event);
60
     $this->getDoctrine()->getEntityManager()->flush();
61
     $this->getDoctrine()->getEntityManager()->flush();

+ 19 - 0
src/Muzich/UserBundle/Resources/views/Info/bar.html.twig View File

21
           <img title="{{ 'events.new_comments.no'|trans({}, 'users') }}" src="{{ asset('bundles/muzichcore/img/1332286007_comments_reply.png') }}" alt="comments" />
21
           <img title="{{ 'events.new_comments.no'|trans({}, 'users') }}" src="{{ asset('bundles/muzichcore/img/1332286007_comments_reply.png') }}" alt="comments" />
22
           <span class="new_comments">0</span>
22
           <span class="new_comments">0</span>
23
         {% endif %}
23
         {% endif %}
24
+          
25
+    </div>
26
+    
27
+    <div class="favorites">
28
+      
29
+        {% if events[event_const('TYPE_FAV_ADDED_ELEMENT')] is defined %}
30
+          <a 
31
+            href="{{ path('event_view_elements', {'event_id':events[event_const('TYPE_FAV_ADDED_ELEMENT')].id}) }}" 
32
+            title="{%if events[event_const('TYPE_FAV_ADDED_ELEMENT')].count == 1 %}{{ 'events.new_favoriteds.one'|trans({'%count%':1}, 'users') }}{% else %}{{ 'events.new_favoriteds.yes'|trans({'%count%':events[event_const('TYPE_FAV_ADDED_ELEMENT')].count}, 'users') }}{% endif %}"
33
+            class="view_elements_event"
34
+          >
35
+            <img src="{{ asset('bundles/muzichcore/img/favorite.png') }}" alt="favoriteds" />
36
+            <span class="new_comments">{{ events[event_const('TYPE_FAV_ADDED_ELEMENT')].count }}</span>
37
+          </a>
38
+        {% else %}
39
+          <img title="{{ 'events.new_favoriteds.no'|trans({}, 'users') }}" src="{{ asset('bundles/muzichcore/img/favorite_bw.png') }}" alt="favoriteds" />
40
+          <span class="new_comments">0</span>
41
+        {% endif %}
42
+          
24
     </div>
43
     </div>
25
   
44
   
26
   </div>
45
   </div>

+ 12 - 0
web/bundles/muzichcore/css/main.css View File

1142
 {
1142
 {
1143
   font-weight: bold;
1143
   font-weight: bold;
1144
   margin-left: 5px;
1144
   margin-left: 5px;
1145
+}
1146
+
1147
+div#events div.favorites img
1148
+{
1149
+  margin-left: 3px;
1150
+  margin-bottom: -2px;
1151
+}
1152
+
1153
+div#events div.favorites span
1154
+{
1155
+  font-weight: bold;
1156
+  margin-left: 5px;
1145
 }
1157
 }

+ 2 - 1
web/bundles/muzichcore/js/muzich.js View File

1685
   
1685
   
1686
   
1686
   
1687
   // Enlever les ids du ElementSearch
1687
   // Enlever les ids du ElementSearch
1688
-  $('div.more_filters a.new_comments').live('click', function(){
1688
+  $('div.more_filters a.new_comments, div.more_filters a.new_favorites').live('click', function(){
1689
     
1689
     
1690
     $('img.elements_more_loader').show();
1690
     $('img.elements_more_loader').show();
1691
     $('ul.elements').html('');
1691
     $('ul.elements').html('');
1702
       {
1702
       {
1703
         $('form[name="search"]').submit();
1703
         $('form[name="search"]').submit();
1704
         $('div.more_filters a.new_comments').hide();
1704
         $('div.more_filters a.new_comments').hide();
1705
+        $('div.more_filters a.new_favorites').hide();
1705
       }
1706
       }
1706
       
1707
       
1707
     });
1708
     });

+ 10 - 1
web/bundles/muzichhome/css/home.css View File

85
   background-position: 2px 3px;
85
   background-position: 2px 3px;
86
 }
86
 }
87
 
87
 
88
-div.more_filters a.new_comments img
88
+div.more_filters a.new_favorites
89
+{
90
+  margin-top: 5px;
91
+  padding-left: 20px;
92
+  background-image: url(/bundles/muzichcore/img/favorite.png);
93
+  background-repeat: no-repeat;
94
+  background-position: 2px 3px;
95
+}
96
+
97
+div.more_filters a.new_comments img, div.more_filters a.new_favorites img
89
 {
98
 {
90
   margin-bottom: -3px;
99
   margin-bottom: -3px;
91
 }
100
 }