Browse Source

Evolution #675: Bouton +1 sur ses elements

Sevajol Bastien 11 years ago
parent
commit
61b642788c

+ 17 - 15
src/Muzich/CoreBundle/Resources/views/SearchElement/element.html.twig View File

@@ -55,25 +55,27 @@
55 55
         <li class="score">
56 56
           {{ element.points|format_score }}
57 57
         </li>
58
-          {% if element.owner.id != app.user.id %}
59 58
             <li class="vote thumb">
60
-              {% if element.hasVoteGood(app.user.id) %}
61
-                <a class="vote" href="{{ path('ajax_element_remove_vote_good', {
62
-                  'element_id' : element.id,
63
-                  'token'      : app.user.getPersonalHash(element.id)
64
-                }) }}" title="{{ 'element.vote.good'|trans({}, 'elements') }}">
65
-                  <img src="{{ asset('img/icon_thumb_red.png') }}" alt="vote" />
66
-                </a>
59
+              {% if element.owner.id != app.user.id %}
60
+                {% if element.hasVoteGood(app.user.id) %}
61
+                  <a class="vote" href="{{ path('ajax_element_remove_vote_good', {
62
+                    'element_id' : element.id,
63
+                    'token'      : app.user.getPersonalHash(element.id)
64
+                  }) }}" title="{{ 'element.vote.good'|trans({}, 'elements') }}">
65
+                    <img src="{{ asset('img/icon_thumb_red.png') }}" alt="vote" />
66
+                  </a>
67
+                {% else %}
68
+                  <a class="vote" href="{{ path('ajax_element_add_vote_good', {
69
+                    'element_id' : element.id,
70
+                    'token'      : app.user.getPersonalHash(element.id)
71
+                  }) }}" title="{{ 'element.vote.good'|trans({}, 'elements') }}">
72
+                    <img src="{{ asset('img/icon_thumb.png') }}" alt="vote" />
73
+                  </a>
74
+                {% endif %}
67 75
               {% else %}
68
-                <a class="vote" href="{{ path('ajax_element_add_vote_good', {
69
-                  'element_id' : element.id,
70
-                  'token'      : app.user.getPersonalHash(element.id)
71
-                }) }}" title="{{ 'element.vote.good'|trans({}, 'elements') }}">
72
-                  <img src="{{ asset('img/icon_thumb.png') }}" alt="vote" />
73
-                </a>
76
+                <img src="{{ asset('img/icon_thumb_gray.png') }}" alt="vote" />
74 77
               {% endif %}
75 78
             </li>
76
-        {% endif %}
77 79
         <li class="star">
78 80
           {% if element.hasFavoriteUser(app.user.id) %}
79 81
             <a class="favorite_link" href="{{ path('favorite_remove', { 'id': element.id, 'token': app.user.personalHash(element.id) }) }}" >

BIN
web/img/icon_thumb_gray.png View File