Sfoglia il codice sorgente

design prompt playlists

Sevajol Bastien 11 anni fa
parent
commit
c2221dcfa9

+ 6 - 1
app/Resources/translations/elements.fr.yml Vedi File

@@ -126,4 +126,9 @@ playlist:
126 126
   user_title:            Listes de lectures de %user_username%
127 127
   openplaylist:          Consulter les partages de la liste de lecture
128 128
   delete:                Supprimer cette liste de lecture
129
-  play:                  Jouer la liste de lecture
129
+  play:                  Jouer la liste de lecture
130
+  add_this_element:      Ajouter ce partage a une liste de lecture
131
+  create_and_add:        Ajouter ce partage à une nouvelle liste de lecture:
132
+  add_to:                Ou à une liste de lecture existante:
133
+  create_submit:         Ajouter
134
+  public_label:          Publique

+ 40 - 8
src/Muzich/CoreBundle/Resources/public/css/main.css Vedi File

@@ -2169,14 +2169,6 @@ ul.playlists ul.tags_cloud li
2169 2169
   padding: 4px;
2170 2170
 }
2171 2171
 
2172
-div.playlists_prompt
2173
-{
2174
-  padding: 10px;
2175
-  border: 1px solid red;
2176
-  width: 320px;
2177
-  background-color: white;
2178
-}
2179
-
2180 2172
 ul.playlist_elements
2181 2173
 {
2182 2174
   margin-left: 0px;
@@ -2280,6 +2272,46 @@ li.playlist div.title
2280 2272
   margin-top: 3px;
2281 2273
 }
2282 2274
 
2275
+div.playlists_prompt
2276
+{
2277
+  padding: 10px;
2278
+  width: 375px;
2279
+  background-color: #F8F8F8;
2280
+}
2281
+
2282
+div.playlists_prompt h2
2283
+{
2284
+  font-size: 1em;
2285
+  margin-top: 7px;
2286
+}
2287
+
2288
+div.playlists_prompt h2.nomargintop
2289
+{
2290
+  margin-top: 0px;
2291
+}
2292
+
2293
+div.playlists_prompt input.niceinput
2294
+{
2295
+  font-size: 13px;
2296
+  height: 23px;
2297
+}
2298
+
2299
+ul.form-errors
2300
+{
2301
+  margin-left: 10px;
2302
+}
2303
+
2304
+ul.form-errors li
2305
+{
2306
+  color: red;
2307
+  list-style-type: none;
2308
+}
2309
+
2310
+div.playlists_prompt ul.form-errors li
2311
+{
2312
+  font-size: 85%;
2313
+}
2314
+
2283 2315
 /*
2284 2316
 *
2285 2317
 *

+ 8 - 2
src/Muzich/CoreBundle/Resources/public/js/muzich.js Vedi File

@@ -3153,14 +3153,18 @@ $(document).ready(function(){
3153 3153
     }
3154 3154
   });
3155 3155
   
3156
+  $('div.playlists_prompt form').live('submit', function(){
3157
+    $(this).parents('div.playlists_prompt').find('img.loader').show();
3158
+  });
3159
+  
3156 3160
   $('ul.elements a.add_to_playlist').live('click', function(event){
3157 3161
     
3158 3162
     $('div.playlists_prompt').remove();
3159
-    var prompt = $('<div class="playlists_prompt"><img class="loader" src="/bundles/muzichcore/img/ajax-loader.gif" alt="loading..." /></div>');
3163
+    var prompt = $('<div class="playlists_prompt nicebox"><img class="loader" src="/bundles/muzichcore/img/ajax-loader.gif" alt="loading..." /></div>');
3160 3164
     $('body').append(prompt);
3161 3165
     
3162 3166
     prompt.position({
3163
-      my: "left+3 bottom+0",
3167
+      my: "left+15 bottom+0",
3164 3168
       of: event,
3165 3169
       collision: "fit"
3166 3170
     });
@@ -3177,6 +3181,8 @@ $(document).ready(function(){
3177 3181
       {
3178 3182
         prompt.append(response.data);
3179 3183
         prompt.find('div.create_playlist form').ajaxForm(function(response){
3184
+          
3185
+          $('div.playlists_prompt').find('img.loader').hide();
3180 3186
           window.ResponseController.execute(
3181 3187
             response,
3182 3188
             function(){},

+ 6 - 2
src/Muzich/CoreBundle/Resources/views/SearchElement/element.html.twig Vedi File

@@ -268,8 +268,12 @@
268 268
         {% endif %}
269 269
         
270 270
         <li>
271
-          <a class="add_to_playlist" href="{{ path('playlists_add_element_prompt', { 'element_id' : element.id }) }}">
272
-            +
271
+          <a
272
+            class="add_to_playlist"
273
+            href="{{ path('playlists_add_element_prompt', { 'element_id' : element.id }) }}"
274
+            title="{{ 'playlist.add_this_element'|trans({}, 'elements') }}"
275
+          >
276
+            <img src="{{ asset('/img/icon_add_2.png') }}" alt="add to playlist" />
273 277
           </a>
274 278
         </li>
275 279
         

+ 0 - 0
src/Muzich/CoreBundle/Tests/Controller/PlaylistControllerTest.php Vedi File


+ 5 - 2
src/Muzich/PlaylistBundle/Resources/views/Show/form.html.twig Vedi File

@@ -4,9 +4,12 @@
4 4
 
5 5
 <div class="field">
6 6
   {{ form_widget(form.name, {'attr':{'class':'niceinput'}}) }}
7
+  
7 8
   {{ form_widget(form.public) }}
9
+  <label for="playlist_public">{{ 'playlist.public_label'|trans({}, 'elements') }}</label>
10
+  
11
+  <input class="niceinput" type="submit" value="{{ 'playlist.create_submit'|trans({}, 'elements') }}" />
8 12
 </div>
9 13
 
10
-{{ form_rest(form) }}
11 14
 
12
-<input type="submit" value="CREATE" />
15
+{{ form_rest(form) }}

+ 3 - 1
src/Muzich/PlaylistBundle/Resources/views/Show/prompt.html.twig Vedi File

@@ -1,5 +1,6 @@
1 1
 
2 2
 <div class="create_playlist">
3
+  <h2>{{ 'playlist.create_and_add'|trans({}, 'elements') }}</h2>
3 4
   <form action="{{ path('playlist_add_element_and_create', { 'element_id' : element_id }) }}" method="post">
4 5
     {% include 'MuzichPlaylistBundle:Show:form.html.twig' %}
5 6
   </form>
@@ -7,6 +8,7 @@
7 8
 
8 9
 <div>
9 10
   {% if playlists|length %}
11
+    <h2 class="nomargintop">{{ 'playlist.add_to'|trans({}, 'elements') }}</h2>
10 12
     <ul class="playlists_for_element">
11 13
       {% for playlist in playlists %}
12 14
         <li class="playlist">
@@ -29,6 +31,6 @@
29 31
       {% endfor %}
30 32
     </ul>
31 33
   {% else %}
32
-    <p>NO PLAYLIST</p>
34
+    
33 35
   {% endif %}
34 36
 </div>

BIN
web/img/icon_add.png Vedi File


BIN
web/img/icon_add_2.png Vedi File