Browse Source

design pour page playlists user

Bastien Sevajol 11 years ago
parent
commit
27c8b27195

+ 14 - 1
app/Resources/translations/elements.fr.yml View File

113
       count:            %count_owned% partages (dont %count_favorited% mis en favoris par %count_favorited_users% utilisateurs)
113
       count:            %count_owned% partages (dont %count_favorited% mis en favoris par %count_favorited_users% utilisateurs)
114
 
114
 
115
 tag_favorites:
115
 tag_favorites:
116
-  help:                 Filtrer les partages en selectionnant différents tags ci-dessous (vous pouvez en choisir plusieurs).
116
+  help:                 Filtrer les partages en selectionnant différents tags ci-dessous (vous pouvez en choisir plusieurs).
117
+
118
+playlist:
119
+  start_here:            Commencer la lecture d'ici
120
+  remove_element:        Retirer ce partage de la liste de lecture
121
+  open:                  Ouvrir
122
+  read:                  Lire
123
+  pick:                  Ajouter a mes listes
124
+  unpick:                Enlever de mes listes
125
+  gotoplaylists:         Retourner aux listes de lectures de %user_username%
126
+  user_title:            Listes de lectures de %user_username%
127
+  openplaylist:          Consulter les partages de la liste de lecture
128
+  delete:                Supprimer cette liste de lecture
129
+  play:                  Jouer la liste de lecture

+ 1 - 1
src/Muzich/CoreBundle/Controller/ElementController.php View File

1087
     ));
1087
     ));
1088
     }
1088
     }
1089
     
1089
     
1090
-    $html = $this->render('MuzichCoreBundle:SearchElement:element.html.twig', array(
1090
+    $html = $this->render('MuzichCoreBundle:SearchElement:li.element.html.twig', array(
1091
       'element'               => $element,
1091
       'element'               => $element,
1092
       'display_edit_actions'  => false,
1092
       'display_edit_actions'  => false,
1093
       'display_player'        => true,
1093
       'display_player'        => true,

+ 48 - 8
src/Muzich/CoreBundle/Resources/public/css/main.css View File

2182
   margin-left: 0px;
2182
   margin-left: 0px;
2183
 }
2183
 }
2184
 
2184
 
2185
-ul.playlist_elements li.playlist_element
2186
-{
2187
-  background-color: #F8F8F8;
2188
-}
2189
-
2190
-li.playlist_element div.actions
2185
+li.playlist_element div.actions, li.playlist div.actions
2191
 {
2186
 {
2192
   float: left;
2187
   float: left;
2193
   margin-top: 4px;
2188
   margin-top: 4px;
2204
   margin-top: 4px;
2199
   margin-top: 4px;
2205
 }
2200
 }
2206
 
2201
 
2207
-li.playlist_element div.actions a
2202
+li.playlist_element div.actions a, li.playlist div.actions a
2208
 {
2203
 {
2209
   margin-left: -5px;
2204
   margin-left: -5px;
2210
 }
2205
 }
2225
   color: black;
2220
   color: black;
2226
 }
2221
 }
2227
 
2222
 
2228
-li.playlist_element
2223
+ul.playlist_elements li.playlist_element
2229
 {
2224
 {
2230
   border-top: 1px solid #C8C8C8;
2225
   border-top: 1px solid #C8C8C8;
2231
   height: 27px;
2226
   height: 27px;
2232
   list-style: none outside none;
2227
   list-style: none outside none;
2228
+  background-color: #F8F8F8;
2233
 }
2229
 }
2234
 
2230
 
2235
 ul.playlist_elements li.playlist_element ul.elements li.element
2231
 ul.playlist_elements li.playlist_element ul.elements li.element
2237
   border-top: none;
2233
   border-top: none;
2238
 }
2234
 }
2239
 
2235
 
2236
+a.button img
2237
+{
2238
+  float: left;
2239
+}
2240
 
2240
 
2241
+a.button span
2242
+{
2243
+  float: left;
2244
+  margin-top: 4px;
2245
+}
2246
+
2247
+ul.playlists
2248
+{
2249
+  margin-left: 0px;
2250
+  margin-bottom: 10px;
2251
+}
2241
 
2252
 
2253
+ul.playlists li.playlist
2254
+{
2255
+  border-top: 1px solid #C8C8C8;
2256
+  list-style: none outside none;
2257
+  background-color: #F8F8F8;
2258
+}
2259
+
2260
+ul.playlists li.playlist a.title
2261
+{
2262
+  color: black;
2263
+  font-weight: bold;
2264
+  font-size: 110%;
2265
+}
2266
+
2267
+ul.playlists li.playlist a.title:hover
2268
+{
2269
+  text-decoration: underline;
2270
+}
2271
+
2272
+ul.playlists li.playlist ul.tags_cloud
2273
+{
2274
+  margin-left: 25px;
2275
+}
2276
+
2277
+li.playlist div.title
2278
+{
2279
+  margin-left: 42px;
2280
+  margin-top: 3px;
2281
+}
2242
 
2282
 
2243
 /*
2283
 /*
2244
 *
2284
 *

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

436
   // 1328283201_emblem-symbolic-link.png
436
   // 1328283201_emblem-symbolic-link.png
437
   $('a.element_embed_open_link, a.element_name_embed_open_link').live("click", function(){
437
   $('a.element_embed_open_link, a.element_name_embed_open_link').live("click", function(){
438
     
438
     
439
-     var li = $(this).parents('li.element');
439
+    var li = $(this).parents('li.element');
440
      
440
      
441
-     element_last_opened(li);
442
-     li.find('a.element_embed_close_link').show();
443
-     li.find('a.element_embed_open_link_text').hide();
444
-     li.find('div.element_embed').show();
441
+    element_last_opened(li);
442
+    li.find('a.element_embed_close_link').show();
443
+    li.find('a.element_embed_open_link_text').hide();
444
+    li.find('div.element_embed').show();
445
      
445
      
446
     if ((player = window.dynamic_player.play(
446
     if ((player = window.dynamic_player.play(
447
       li.find('div.element_embed'),
447
       li.find('div.element_embed'),
3113
 
3113
 
3114
         if (response.status === 'success')
3114
         if (response.status === 'success')
3115
         {
3115
         {
3116
-          line.find('div.content_opened').html('<ul class="elements"><li class="element">' + response.data + '</li></ul>');
3116
+          line.find('div.content_opened').html('<ul class="elements">' + response.data + '</ul>');
3117
         }
3117
         }
3118
       });
3118
       });
3119
     }
3119
     }
3120
     else
3120
     else
3121
     {
3121
     {
3122
       line.find('div.content_opened').html('');
3122
       line.find('div.content_opened').html('');
3123
+      line.removeClass('open');
3123
       line.css('height', playlist_line_height);
3124
       line.css('height', playlist_line_height);
3124
     }
3125
     }
3125
       
3126
       
3127
     return false;
3128
     return false;
3128
   });
3129
   });
3129
   
3130
   
3130
-  $('ul.playlist_elements').sortable({
3131
+  $('ul.playlist_elements.owned').sortable({
3131
     update: function( event, ui ) {
3132
     update: function( event, ui ) {
3132
       
3133
       
3133
       var form = ui.item.parents('form')
3134
       var form = ui.item.parents('form')
3225
     return false;
3226
     return false;
3226
   });
3227
   });
3227
   
3228
   
3229
+  $('ul.playlist_elements a.remove_element').jConfirmAction({
3230
+    question : string_element_removefromplaylist_confirm_sentence, 
3231
+    yesAnswer : string_element_delete_confirm_yes, 
3232
+    cancelAnswer : string_element_delete_confirm_no,
3233
+    onYes: function(link){
3234
+      
3235
+      $.getJSON(link.attr('href'), function(response) {
3236
+        window.ResponseController.execute(
3237
+          response,
3238
+          function(){},
3239
+          function(){}
3240
+        );
3241
+      });
3242
+
3243
+      link.parents('li.playlist_element').remove();
3244
+      return false;
3245
+    },
3246
+    onOpen: function(link){},
3247
+    onClose: function(link){}
3248
+  });
3228
   
3249
   
3229
-  $('ul.playlist_elements a.remove_element').live('click', function () {
3230
-    
3231
-    $.getJSON($(this).attr('href'), function(response) {
3232
-      window.ResponseController.execute(
3233
-        response,
3234
-        function(){},
3235
-        function(){}
3236
-      );
3237
-    });
3238
-    
3239
-    $(this).parents('li.playlist_element').remove();
3240
-    return false;
3250
+  $('ul.playlists a.playlist_delete').jConfirmAction({
3251
+    question : string_element_deleteplaylist_confirm_sentence, 
3252
+    yesAnswer : string_element_delete_confirm_yes, 
3253
+    cancelAnswer : string_element_delete_confirm_no,
3254
+    onYes: function(link){
3255
+      $(location).attr('href', link.attr('href'));
3256
+    },
3257
+    onOpen: function(link){},
3258
+    onClose: function(link){}
3241
   });
3259
   });
3242
    
3260
    
3243
 });
3261
 });

+ 2 - 0
src/Muzich/CoreBundle/Resources/views/Layout/head_js.html.twig View File

104
   string_removefromgroup_sentence = "{{ 'element.group.remove_from.confirm.title'|trans({}, 'elements') }}";
104
   string_removefromgroup_sentence = "{{ 'element.group.remove_from.confirm.title'|trans({}, 'elements') }}";
105
   string_removefromgroup_confirm_yes = "{{ 'element.group.remove_from.confirm.yes'|trans({}, 'elements') }}";
105
   string_removefromgroup_confirm_yes = "{{ 'element.group.remove_from.confirm.yes'|trans({}, 'elements') }}";
106
   string_removefromgroup_confirm_no = "{{ 'element.group.remove_from.confirm.no'|trans({}, 'elements') }}";
106
   string_removefromgroup_confirm_no = "{{ 'element.group.remove_from.confirm.no'|trans({}, 'elements') }}";
107
+  string_element_removefromplaylist_confirm_sentence = "{{ 'playlist.remove_element'|trans({}, 'elements') }}";
108
+  string_element_deleteplaylist_confirm_sentence = "{{ 'playlist.delete'|trans({}, 'elements') }}";
107
 
109
 
108
   url_home = "{{ path('home') }}";
110
   url_home = "{{ path('home') }}";
109
   url_search_tag = "{{ path('search_tag') }}";
111
   url_search_tag = "{{ path('search_tag') }}";

+ 24 - 7
src/Muzich/PlaylistBundle/Controller/EditController.php View File

108
     $this->getPlaylistManager()->deletePlaylist($playlist);
108
     $this->getPlaylistManager()->deletePlaylist($playlist);
109
     $this->flush();
109
     $this->flush();
110
     $this->setFlash('success', 'playlist.delete.success');
110
     $this->setFlash('success', 'playlist.delete.success');
111
+    
111
     return $this->redirect($this->generateUrl('playlists_user', array('user_slug' => $this->getUser()->getSlug())));
112
     return $this->redirect($this->generateUrl('playlists_user', array('user_slug' => $this->getUser()->getSlug())));
112
   }
113
   }
113
   
114
   
114
-  public function unpickAction($playlist_id)
115
+  public function unpickAction($playlist_id, $redirect_owner = false)
115
   {
116
   {
116
     if (($uncondition = $this->userHaveNonConditionToMakeAction(SecurityContext::ACTION_PLAYLIST_UNPICK)) !== false)
117
     if (($uncondition = $this->userHaveNonConditionToMakeAction(SecurityContext::ACTION_PLAYLIST_UNPICK)) !== false)
117
       throw $this->createNotFoundException();
118
       throw $this->createNotFoundException();
124
     $playlist_manager->removePickedPlaylistToUser($this->getUser(), $playlist);
125
     $playlist_manager->removePickedPlaylistToUser($this->getUser(), $playlist);
125
     $this->flush();
126
     $this->flush();
126
     $this->setFlash('success', 'playlist.delete.success');
127
     $this->setFlash('success', 'playlist.delete.success');
128
+    
129
+    if ($redirect_owner)
130
+      return $this->redirect($this->generateUrl('playlists_user', array('user_slug' => $playlist->getOwner()->getSlug())));
131
+    
127
     return $this->redirect($this->generateUrl('playlists_user', array('user_slug' => $this->getUser()->getSlug())));
132
     return $this->redirect($this->generateUrl('playlists_user', array('user_slug' => $this->getUser()->getSlug())));
128
   }
133
   }
129
   
134
   
130
-  public function pickAction($playlist_id)
135
+  public function pickAction($playlist_id, $redirect_owner = false)
131
   {
136
   {
132
     if (($uncondition = $this->userHaveNonConditionToMakeAction(SecurityContext::ACTION_PLAYLIST_PICK)) !== false)
137
     if (($uncondition = $this->userHaveNonConditionToMakeAction(SecurityContext::ACTION_PLAYLIST_PICK)) !== false)
133
-      return $this->jsonResponseError($uncondition);
134
-    
138
+    {
139
+      if ($this->getRequest()->isXmlHttpRequest())
140
+        return $this->jsonResponseError($uncondition);
141
+      throw $this->createNotFoundException();
142
+    }
135
     if (!$this->tokenIsCorrect() || !($playlist = $this->getPlaylistManager()->findOneAccessiblePlaylistWithId($playlist_id)))
143
     if (!$this->tokenIsCorrect() || !($playlist = $this->getPlaylistManager()->findOneAccessiblePlaylistWithId($playlist_id)))
136
-      return $this->jsonNotFoundResponse();
137
-    
144
+    {
145
+      if ($this->getRequest()->isXmlHttpRequest())
146
+        return $this->jsonNotFoundResponse();
147
+      throw $this->createNotFoundException();
148
+    }
138
     $this->getPlaylistManager()->addPickedPlaylistToUser($this->getUser(), $playlist);
149
     $this->getPlaylistManager()->addPickedPlaylistToUser($this->getUser(), $playlist);
139
     $this->flush();
150
     $this->flush();
140
     
151
     
141
-    return $this->jsonSuccessResponse();
152
+    if ($this->getRequest()->isXmlHttpRequest())
153
+      return $this->jsonSuccessResponse();
154
+    
155
+    if ($redirect_owner)
156
+      return $this->redirect($this->generateUrl('playlists_user', array('user_slug' => $playlist->getOwner()->getSlug())));
157
+    
158
+    return $this->redirect($this->generateUrl('playlists_user', array('user_slug' => $this->getUser()->getSlug())));
142
   }
159
   }
143
   
160
   
144
 }
161
 }

+ 4 - 4
src/Muzich/PlaylistBundle/Resources/config/routing.yml View File

11
   defaults: { _controller: MuzichPlaylistBundle:Edit:delete }
11
   defaults: { _controller: MuzichPlaylistBundle:Edit:delete }
12
 
12
 
13
 playlist_unpick:
13
 playlist_unpick:
14
-  pattern: /playlist/unpick/{playlist_id}/{token}
15
-  defaults: { _controller: MuzichPlaylistBundle:Edit:unpick }
14
+  pattern: /playlist/unpick/{playlist_id}/{token}/{redirect_owner}
15
+  defaults: { _controller: MuzichPlaylistBundle:Edit:unpick, redirect_owner: false }
16
 
16
 
17
 playlist_pick:
17
 playlist_pick:
18
-  pattern: /playlist/pick/{playlist_id}/{token}
19
-  defaults: { _controller: MuzichPlaylistBundle:Edit:pick }
18
+  pattern: /playlist/pick/{playlist_id}/{token}/{redirect_owner}
19
+  defaults: { _controller: MuzichPlaylistBundle:Edit:pick, redirect_owner: false }
20
 
20
 
21
 playlist_datas_for_autoplay:
21
 playlist_datas_for_autoplay:
22
   pattern: /ajax/autoplay/playlist/datas/{playlist_id}/{offset}
22
   pattern: /ajax/autoplay/playlist/datas/{playlist_id}/{offset}

+ 55 - 28
src/Muzich/PlaylistBundle/Resources/views/Show/show.html.twig View File

1
 {% extends "MuzichFavoriteBundle::layout.html.twig" %}
1
 {% extends "MuzichFavoriteBundle::layout.html.twig" %}
2
 
2
 
3
-{% block title %}{% endblock %}
3
+{% block title %}{{ playlist.name }}{% endblock %}
4
 {% block mainbox_classes %}{% endblock %}
4
 {% block mainbox_classes %}{% endblock %}
5
 
5
 
6
 {% block content %}
6
 {% block content %}
7
   
7
   
8
   <div class="top_tools">
8
   <div class="top_tools">
9
-    
10
-    <a class="autoplay_playlist" href="{{ path('playlist_datas_for_autoplay', { 'playlist_id' : playlist.id }) }}" >
11
-      Lire
12
-    </a>
13
-    
14
-    {% if app.user %}
15
-      {% if not playlist.owned(app.user) and viewed_user.id != app.user.id %}
16
-        {% if not app.user.havePlaylistPicked(playlist) %}
17
-          <a class="playlist_pick" href="{{ path_token('playlist_pick', { 'playlist_id' : playlist.id }) }}" >
18
-            P
19
-          </a>
20
-        {% else %}
21
-          <a class="playlist_unpick" href="{{ path_token('playlist_unpick', { 'playlist_id' : playlist.id }) }}" >
22
-            uP
23
-          </a>
9
+    <div class="show_options">
10
+      
11
+      <a class="autoplay_playlist button darkbutton" href="{{ path('playlist_datas_for_autoplay', { 'playlist_id' : playlist.id }) }}" >
12
+        <img src="{{ asset('/img/1361037350_control_play.png') }}" alt="playlist" />
13
+        <span>{{ 'playlist.read'|trans({}, 'elements') }}</span>
14
+      </a>
15
+
16
+      {% if app.user %}
17
+        {% if not playlist.owned(app.user) and viewed_user.id != app.user.id %}
18
+          {% if not app.user.havePlaylistPicked(playlist) %}
19
+            <a class="playlist_pick button darkbutton" href="{{ path_token('playlist_pick', { 'playlist_id' : playlist.id }) }}" >
20
+              {{ 'playlist.pick'|trans({}, 'elements') }}
21
+            </a>
22
+          {% else %}
23
+            <a class="playlist_unpick button darkbutton" href="{{ path_token('playlist_unpick', { 'playlist_id' : playlist.id }) }}" >
24
+              {{ 'playlist.unpick'|trans({}, 'elements') }}
25
+            </a>
26
+          {% endif %}
24
         {% endif %}
27
         {% endif %}
25
       {% endif %}
28
       {% endif %}
26
-    {% endif %}
29
+      
30
+    </div>
31
+    
32
+    <h1>{{ playlist.name }}</h1>
27
     
33
     
28
-    <h2>{{ playlist.name }}</h2>
34
+    <a href="{{ path('playlists_user', { 'user_slug' : playlist.owner.slug }) }}">
35
+      {{ 'playlist.gotoplaylists'|trans({ '%user_username%' : playlist.owner.username }, 'elements') }}
36
+    </a>
29
     
37
     
30
     {% include "MuzichCoreBundle:Tag:tag_cloud.html.twig" with {
38
     {% include "MuzichCoreBundle:Tag:tag_cloud.html.twig" with {
31
       'tags' : playlist.tags
39
       'tags' : playlist.tags
33
     
41
     
34
     {% if playlist.elements|length %}
42
     {% if playlist.elements|length %}
35
       <form action="{{ path_token('playlist_update_order', { 'playlist_id' : playlist.id }) }}" method="post">
43
       <form action="{{ path_token('playlist_update_order', { 'playlist_id' : playlist.id }) }}" method="post">
36
-        <ul class="playlist_elements">
44
+        <ul class="playlist_elements {% if app.user%}{% if playlist.owned(app.user) %}owned{% endif %}{% endif %}">
37
           {% for element in playlist.elements %}
45
           {% for element in playlist.elements %}
38
             <li class="playlist_element">
46
             <li class="playlist_element">
39
               
47
               
42
               
50
               
43
               <div class="actions">
51
               <div class="actions">
44
                 
52
                 
45
-                <a class="drag" href="#">
46
-                  <img src="{{ asset('/img/drag3.png') }}" alt="drag" />
47
-                </a>
53
+                {% if app.user%}
54
+                  {% if playlist.owned(app.user) %}
55
+                    <a class="drag" href="#">
56
+                      <img src="{{ asset('/img/drag3.png') }}" alt="drag" />
57
+                    </a>
58
+                  {% endif %}
59
+                {% endif %}
48
                 
60
                 
49
                 {% if element.type|can_autoplay_type %}
61
                 {% if element.type|can_autoplay_type %}
50
-                  <a class="autoplay_playlist" href="{{ path('playlist_datas_for_autoplay', { 'playlist_id' : playlist.id, 'offset' : loop.index0 }) }}">
62
+                  <a class="autoplay_playlist" 
63
+                    href="{{ path('playlist_datas_for_autoplay', { 'playlist_id' : playlist.id, 'offset' : loop.index0 }) }}"
64
+                    title="{{ 'playlist.start_here'|trans({}, 'elements') }}"
65
+                  >
51
                     <img src="{{ asset('/img/1361037350_control_play.png') }}" alt="playlist" />
66
                     <img src="{{ asset('/img/1361037350_control_play.png') }}" alt="playlist" />
52
                   </a>
67
                   </a>
53
                 {% else %}
68
                 {% else %}
54
                   <img class="autoplay_off" src="{{ asset('/img/1361037350_control_play_off.png') }}" alt="playlist" />
69
                   <img class="autoplay_off" src="{{ asset('/img/1361037350_control_play_off.png') }}" alt="playlist" />
55
                 {% endif %}
70
                 {% endif %}
56
-
57
-                <a class="remove_element" href="{{ path_token('playlist_remove_element', { 'playlist_id' : playlist.id, 'element_id' : element.id }) }}">
58
-                  <img src="{{ asset('/img/icon_close_2.png') }}" alt="delete" />
59
-                </a>
71
+                
72
+                {% if app.user%}
73
+                  {% if playlist.owned(app.user) %}
74
+                    <a 
75
+                      class="remove_element" 
76
+                      href="{{ path_token('playlist_remove_element', { 'playlist_id' : playlist.id, 'element_id' : element.id }) }}"
77
+                      title="{{ 'playlist.remove_element'|trans({}, 'elements') }}"
78
+                    >
79
+                      <img src="{{ asset('/img/icon_close_2.png') }}" alt="delete" />
80
+                    </a>
81
+                  {% endif %}
82
+                {% endif %}
60
               </div>
83
               </div>
61
               
84
               
62
               <div class="actions_right">
85
               <div class="actions_right">
63
-                <a class="open_element" href="{{ path('element_get_one', { 'element_id' : element.id }) }}" data-id="{{ element.id }}">
86
+                <a 
87
+                  class="open_element" 
88
+                  href="{{ path('element_get_one', { 'element_id' : element.id }) }}" data-id="{{ element.id }}"
89
+                  title="{{ 'playlist.open'|trans({}, 'elements') }}"
90
+                  >
64
                   <img src="{{ asset('/img/icon_more_2.png') }}" alt="open" />
91
                   <img src="{{ asset('/img/icon_more_2.png') }}" alt="open" />
65
                 </a>
92
                 </a>
66
               </div>
93
               </div>

+ 98 - 48
src/Muzich/PlaylistBundle/Resources/views/Show/user.html.twig View File

1
 {% extends "MuzichHomeBundle::layout.html.twig" %}
1
 {% extends "MuzichHomeBundle::layout.html.twig" %}
2
 
2
 
3
-{% block title %}{% endblock %}
3
+{% block title %}{{ 'playlist.user_title'|trans({'%user_username%' : viewed_user.username }, 'elements') }}{% endblock %}
4
 {% block mainbox_classes %}{% endblock %}
4
 {% block mainbox_classes %}{% endblock %}
5
 
5
 
6
 {% block content %}
6
 {% block content %}
7
   
7
   
8
-  {% if playlists|length %}
9
-  <ul class="playlists">
10
-    {% for playlist in playlists %}
11
-      <li class="playlist">
12
-        
13
-        <a class="autoplay_playlist" href="{{ path('playlist_datas_for_autoplay', { 'playlist_id' : playlist.id }) }}" >
14
-          Lire
15
-        </a>
16
-        
17
-        <a href="{{ path('playlist', { 'user_slug' : playlist.owner.slug, 'playlist_id' : playlist.id }) }}">
18
-          {{ playlist.name }}
19
-        </a>
20
-        
21
-        {% if app.user %}
22
-          {% if viewed_user.id == app.user.id %}
23
-            {% if playlist.owned(app.user) %}
24
-              <a class="playlist_delete" href="{{ path_token('playlist_delete', { 'playlist_id' : playlist.id }) }}" >
25
-                X
26
-              </a>
27
-            {% else %}
28
-              <a class="playlist_unpick" href="{{ path_token('playlist_unpick', { 'playlist_id' : playlist.id }) }}" >
29
-                X
30
-              </a>
8
+  <div class="top_tools">
9
+    
10
+    <div class="show_options">
11
+      
12
+      <a class="button darkbutton" href="{{ path('show_user', {'slug' : viewed_user.slug}) }}" >
13
+        {{ 'user.view_profile'|trans({}, 'users') }}
14
+      </a>
15
+      
16
+    </div>
17
+    
18
+    <h1>{{ 'playlist.user_title'|trans({'%user_username%' : viewed_user.username }, 'elements') }}</h1>
19
+
20
+    {% if playlists|length %}
21
+    <ul class="playlists">
22
+      {% for playlist in playlists %}
23
+        <li class="playlist">
24
+
25
+          <div class="actions">
26
+            
27
+            <a 
28
+              class="autoplay_playlist" 
29
+              href="{{ path('playlist_datas_for_autoplay', { 'playlist_id' : playlist.id }) }}"
30
+              title="{{ 'playlist.play'|trans({}, 'elements') }}"
31
+            >
32
+              <img src="{{ asset('/img/1361037350_control_play.png') }}" alt="playlist" />
33
+            </a>
34
+
35
+            {% if app.user %}
36
+              {% if not playlist.owned(app.user) and viewed_user.id != app.user.id %}
37
+                {% if not app.user.havePlaylistPicked(playlist) %}
38
+                  <a 
39
+                    class="playlist_pick_noajax" 
40
+                    href="{{ path_token('playlist_pick', { 
41
+                      'playlist_id'    : playlist.id,
42
+                      'redirect_owner' : true
43
+                    }) }}" 
44
+                    title="{{ 'playlist.pick'|trans({}, 'elements') }}"
45
+                  >
46
+                    <img src="{{ asset('/img/tick_untick.png') }}" alt="playlist" />
47
+                  </a>
48
+                {% else %}
49
+                  <a 
50
+                    class="playlist_unpick_noajax" 
51
+                    href="{{ path_token('playlist_unpick', { 
52
+                      'playlist_id'    : playlist.id,
53
+                      'redirect_owner' : true
54
+                    }) }}"
55
+                    title="{{ 'playlist.unpick'|trans({}, 'elements') }}"
56
+                  >
57
+                    <img src="{{ asset('/img/tick_ticked.png') }}" alt="playlist" />
58
+                  </a>
59
+                {% endif %}
60
+              {% endif %}
31
             {% endif %}
61
             {% endif %}
32
-          {% endif %}
33
-        {% endif %}
34
-        
35
-        {% if app.user %}
36
-          {% if not playlist.owned(app.user) and viewed_user.id != app.user.id %}
37
-            {% if not app.user.havePlaylistPicked(playlist) %}
38
-              <a class="playlist_pick" href="{{ path_token('playlist_pick', { 'playlist_id' : playlist.id }) }}" >
39
-                P
40
-              </a>
41
-            {% else %}
42
-              <a class="playlist_unpick" href="{{ path_token('playlist_unpick', { 'playlist_id' : playlist.id }) }}" >
43
-                uP
44
-              </a>
62
+            
63
+            {% if app.user %}
64
+            {% if viewed_user.id == app.user.id %}
65
+              {% if playlist.owned(app.user) %}
66
+                <a 
67
+                  class="playlist_delete" 
68
+                  href="{{ path_token('playlist_delete', { 'playlist_id' : playlist.id }) }}" 
69
+                  title="{{ 'playlist.delete'|trans({}, 'elements') }}"
70
+                >
71
+                  <img src="{{ asset('/img/icon_close_2.png') }}" alt="delete" />
72
+                </a>
73
+              {% else %}
74
+                <a 
75
+                  class="playlist_unpick" 
76
+                  href="{{ path_token('playlist_unpick', { 'playlist_id' : playlist.id }) }}"
77
+                  title="{{ 'playlist.unpick'|trans({}, 'elements') }}"
78
+                >
79
+                  <img src="{{ asset('/img/icon_close_2.png') }}" alt="delete" />
80
+                </a>
81
+              {% endif %}
45
             {% endif %}
82
             {% endif %}
46
           {% endif %}
83
           {% endif %}
47
-        {% endif %}
48
-      
49
-        
50
-        {% include "MuzichCoreBundle:Tag:tag_cloud.html.twig" with {
51
-          'tags' : playlist.tags
52
-        } %}
53
-        
54
-      </li>
55
-    {% endfor %}
56
-  </ul>
57
-  {% endif %}
84
+          
85
+          </div>
86
+
87
+          <div class="title">
88
+            <a 
89
+              class="title" 
90
+              href="{{ path('playlist', { 'user_slug' : playlist.owner.slug, 'playlist_id' : playlist.id }) }}"
91
+              title="{{ 'playlist.openplaylist'|trans({}, 'elements') }}"
92
+            >
93
+              {{ playlist.name }}
94
+            </a>
95
+          </div>
96
+          
97
+
98
+          {% include "MuzichCoreBundle:Tag:tag_cloud.html.twig" with {
99
+            'tags' : playlist.tags
100
+          } %}
101
+
102
+        </li>
103
+      {% endfor %}
104
+    </ul>
105
+    {% endif %}
106
+  
107
+  </div>
58
   
108
   
59
 {% endblock %}
109
 {% endblock %}

BIN
web/img/tick_ticked.png View File


BIN
web/img/tick_untick.png View File