public
Description: Open source non-commercial music platform: http://alonetone.com
Homepage: http://alonetone.com
Clone URL: git://github.com/sudara/alonetone.git
Search Repo:
more on sorting playlists
sudara (author)
Mon May 12 16:19:10 -0700 2008
commit  46932449792418926d8655590ecaa2981b59e431
tree    60047bef1bfd9c313fe98c9b7791f66860f9d86d
parent  71a8a123b06a4ace4d0912fb44b90c74efa2af17
...
32
33
34
 
35
36
37
...
32
33
34
35
36
37
38
0
@@ -32,6 +32,7 @@ class PlaylistsController < ApplicationController
0
   end
0
 
0
   def sort
0
+ redirect_to user_home_url(@user) unless logged_in? && (@user.id.to_s == current_user.id.to_s) || admin?
0
     respond_to do |format|
0
       format.html { @playlists = @user.playlists.include_private.find(:all) }
0
       format.js do
...
 
1
2
3
4
 
 
 
 
 
5
6
 
7
8
9
...
1
2
 
 
 
3
4
5
6
7
8
9
10
11
12
13
0
@@ -1,9 +1,13 @@
0
+
0
 <% render(:layout => 'users/user') do %>
0
-   
0
-   <%= link_to "new playlist", new_user_playlist_path(@user), :id => 'add_playlist_button', :class => 'add button' if authorized? %>
0
-
0
+   <div class="additional_options">
0
+    <%= link_to "create new playlist", new_user_playlist_path(@user), :id => 'add_playlist_button', :class => 'add button' if authorized? %>
0
+   <%= link_to "change playlist order", sort_user_playlists_path(@user), :id => 'sort_playlist_button', :class => 'sort button' if authorized? %>
0
+    
0
+   </div>
0
     <% content_for :left do %>
0
      <%= render :partial => 'playlist', :collection => @playlists_left if @playlists_left %>
0
+    
0
     <% end %>
0
     
0
     <% content_for :right do %>
...
2
3
4
5
 
 
6
7
8
...
2
3
4
 
5
6
7
8
9
0
@@ -2,7 +2,8 @@
0
 
0
   <div id="user_home">
0
      
0
-    <%= link_to "new playlist", new_user_playlist_path(@user), :id => 'add_playlist_button', :class => 'add button' if authorized? %>
0
+    <%= link_to "create new playlist", new_user_playlist_path(@user), :id => 'add_playlist_button', :class => 'add button' if authorized? %>
0
+    <%= link_to "change playlist order", sort_user_playlists_path(@user), :id => 'sort_playlist_button', :class => 'sort button' if authorized? %>
0
     
0
     <% if @user.has_public_playlists? %>
0
       <h2>Latest Playlists by <%=@user.name%></h2>
...
340
341
342
343
 
 
 
 
 
 
 
 
...
340
341
342
 
343
344
345
346
347
348
349
350
0
@@ -340,4 +340,11 @@ a.add_to_favorites, a.favorited
0
     :opacity 0.99
0
     &:hover
0
       :background-position -58px 0px
0
-
0
+
0
+// misc
0
+
0
+.additional_options
0
+ :width 100%
0
+ :height 50px
0
+ :position relative
0
+ :margin-top -35px
...
116
117
118
 
 
119
120
121
...
212
213
214
215
 
216
 
217
218
219
...
221
222
223
 
 
224
225
226
...
116
117
118
119
120
121
122
123
...
214
215
216
 
217
218
219
220
221
222
...
224
225
226
227
228
229
230
231
0
@@ -116,6 +116,8 @@ h2#kicking_ass
0
   :background-position 15px 10px
0
   :text-indent 51px
0
   
0
+h2#recently_favorited
0
+
0
 h2#latest_comments
0
   :background-image url(../images/icons/comment.png)
0
   :background-repeat no-repeat
0
@@ -212,8 +214,9 @@ a.edit
0
     :background url(../images/buttons/arrow.png) no-repeat right center
0
   
0
 a.button
0
- &.add, &.new
0
+ &.add, &.new, &.sort
0
     :background url(../images/icons/new.png) no-repeat left center
0
+ :float right
0
     :height 20px
0
     :line-height 20px
0
     :text-indent 25px
0
@@ -221,6 +224,8 @@ a.button
0
     :width 200px
0
     :margin 10px 0
0
     :font-weight bold
0
+ &.sort
0
+ :background url(../images/icons/latest.png) no-repeat left center
0
   &.delete, &.remove
0
     :position absolute
0
     :background url(../images/icons/delete.png) no-repeat center top

Comments

    No one has commented yet.