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:
some sitemap love, add favorites to single track page, bug with 
playlists+favorites clashing
sudara (author)
Mon May 05 09:45:10 -0700 2008
commit  eb1fa0760d065d896ccd928248262e1b6eba136f
tree    d15f04198483daeec01a4489b6d7a3f7d6090494
parent  db4e478c391c6e8898a02b1f7df0ece790df6d9f
...
26
27
28
 
 
 
 
29
30
31
...
26
27
28
29
30
31
32
33
34
35
0
@@ -26,6 +26,10 @@
0
     @page_title = "About alonetone, the kickass home for musicians"
0
   end
0
   
0
+ def stats
0
+ @page_title = "Listening and Song Statistics"
0
+ end
0
+
0
   def actually_going_somewhere_with_facebooker_and_rails
0
     render :partial => 'facebooker', :layout => true
0
   end
...
17
18
19
20
21
22
23
24
25
26
 
 
 
 
 
 
 
 
 
 
 
27
28
29
...
17
18
19
 
 
 
 
 
 
 
20
21
22
23
24
25
26
27
28
29
30
31
32
33
0
@@ -17,13 +17,17 @@
0
     else
0
       @all_playlists = @user.playlists.public
0
     end
0
- # TODO: fugly array work
0
- split = @all_playlists.in_groups_of((@all_playlists.size.to_f/2).round)
0
- @playlists_left, @playlists_right = split[0].try(:compact), split[1].try(:compact)
0
- @page_title = "#{@user.name}'s albums and playlists"
0
- respond_to do |format|
0
- format.html # index.html.erb
0
- format.xml { render :xml => @playlists }
0
+ if present?(@all_playlists)
0
+ # TODO: fugly array work
0
+ split = @all_playlists.in_groups_of((@all_playlists.size.to_f/2).round)
0
+ @playlists_left, @playlists_right = split[0].try(:compact), split[1].try(:compact)
0
+ @page_title = "#{@user.name}'s albums and playlists"
0
+ respond_to do |format|
0
+ format.html # index.html.erb
0
+ format.xml { render :xml => @playlists }
0
+ end
0
+ else
0
+ redirect_to user_path(@user)
0
     end
0
   end
0
 
...
15
16
17
18
19
20
21
 
 
 
 
 
 
 
 
 
 
22
23
...
15
16
17
 
 
 
 
18
19
20
21
22
23
24
25
26
27
28
29
0
@@ -15,10 +15,16 @@
0
   protected
0
   
0
   def deliver_results
0
- @query = params[:search][:query]
0
- @users = User.paginate(:all, :conditions => User.conditions_by_like(@query,'users.display_name','users.login','users.bio'), :include => :pic, :per_page => 15, :page => params[:page])
0
- @assets = Asset.paginate(:all, :conditions => Asset.conditions_by_like(@query, 'assets.title', 'assets.description'), :include => [:user => :pic], :per_page => 15, :page => params[:page])
0
- rescue ActiveRecord::RecordNotFound
0
+ if present?(params[:query])
0
+ @query = session[:last_search] = CGI.escape(params[:query])
0
+ @users = User.paginate(:all, :conditions => User.conditions_by_like(@query,['users.display_name','users.login','users.bio']), :include => :pic, :per_page => 15, :page => params[:page])
0
+ @assets = Asset.paginate(:all, :conditions => Asset.conditions_by_like(@query,['assets.title', 'assets.description', 'assets.filename']), :include => [:user => :pic], :per_page => 15, :page => params[:page])
0
+ @page_title = "Artists and Songs that match '#{(@query)}'"
0
+ else
0
+ @page_title = "Search artists and uploads"
0
+ flash[:error] = 'Please enter an artist name, a song name, or something to search for'
0
+ end
0
+ rescue
0
   end
0
 end
...
79
80
81
82
 
83
84
85
...
79
80
81
 
82
83
84
85
0
@@ -79,7 +79,7 @@
0
   end
0
   
0
   def has_public_playlists?
0
- playlists_count > 0 && playlists.detect{|p| p.has_tracks?}
0
+ playlists.public.size >= 1
0
   end
0
   
0
   def has_tracks?
...
7
8
9
10
 
 
 
11
12
13
...
7
8
9
 
10
11
12
13
14
15
0
@@ -7,7 +7,9 @@
0
       <% end %>
0
       <%= render :partial => 'assets/assets'%>
0
 
0
-
0
+ <div class="favorite_panel no_border">
0
+ <%= favorite_toggle(@asset) %>
0
+ </div>
0
       <% if @asset.description && !@asset.description.empty? %>
0
       <div id="track_details" class="static_content">
0
           <h1>About "<%=h @asset.title %>"</h1>
...
6
7
8
9
 
10
11
12
13
 
 
14
15
16
 
 
 
 
 
 
 
 
17
18
19
20
21
22
 
 
23
24
25
26
27
28
 
29
30
31
32
33
34
 
35
36
37
...
6
7
8
 
9
10
11
 
 
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
 
 
29
30
31
32
33
34
35
 
36
37
38
39
40
41
 
42
43
44
45
0
@@ -6,32 +6,40 @@
0
     xml.changefreq "daily"
0
     xml.priority 0.9
0
   end
0
- ['signup', 'about', 'users', 'updates','user_reports'].each do |static|
0
+ ['login', 'signup', 'about', 'search'].each do |static|
0
     xml.url do
0
       xml.loc "http://alonetone.com/#{static}"
0
- xml.lastmod w3c_date(User.find(:all, :order => 'created_at DESC').first.created_at)
0
- xml.changefreq "daily"
0
+ xml.lastmod w3c_date(Time.now)
0
+ xml.changefreq "monthly"
0
       xml.priority 0.8
0
     end
0
   end
0
+ ['users', 'updates','user_reports','stats', 'radio/latest', 'radio/favorites', 'top/40'].each do |static|
0
+ xml.url do
0
+ xml.loc "http://alonetone.com/#{static}"
0
+ xml.lastmod w3c_date(Time.now)
0
+ xml.changefreq "daily"
0
+ xml.priority 0.7
0
+ end
0
+ end
0
   @users.each do |user|
0
     xml.url do
0
       xml.loc user_home_url(user)
0
       xml.lastmod w3c_date(user.last_seen_at || user.updated_at)
0
- xml.changefreq "weekly"
0
- xml.priority 0.7
0
+ xml.changefreq "daily"
0
+ xml.priority 0.6
0
     end if user.activated?
0
     xml.url do
0
       xml.loc user_tracks_url(user)
0
       xml.lastmod w3c_date(user.assets.first.created_at)
0
       xml.changefreq "weekly"
0
- xml.priority 0.6
0
+ xml.priority 0.5
0
     end if user.assets_count > 0
0
     xml.url do
0
       xml.loc user_playlists_url(user)
0
       xml.lastmod w3c_date(user.playlists.first.updated_at)
0
       xml.changefreq "weekly"
0
- xml.priority 0.6
0
+ xml.priority 0.5
0
     end if user.playlists_count > 0
0
     
0
     if user.assets_count > 0
...
6
7
8
9
 
10
11
12
...
16
17
18
19
 
20
21
22
...
6
7
8
 
9
10
11
12
...
16
17
18
 
19
20
21
22
0
@@ -6,7 +6,7 @@
0
 
0
 <% if present?(@users) %>
0
   <% content_for :left do %>
0
- <h2>Matching Users</h2>
0
+ <h2>Alonetone Artists and Listeners</h2>
0
   <div id="user_search_results">
0
     <%= render :partial => 'shared/user', :collection => @users %>
0
   </div>
0
@@ -16,7 +16,7 @@
0
 
0
 <% if present?(@assets) %>
0
   <% content_for :right do %>
0
- <h2>Matching Tracks</h2>
0
+ <h2>Uploaded tracks from alonetoners </h2>
0
   <%= render :partial => 'assets/asset', :collection => @assets if @assets %>
0
   <% end %>
0
 <% end %>
...
1
2
3
4
 
5
6
...
1
2
3
 
4
5
6
0
@@ -1,7 +1,7 @@
0
 <div id="search">
0
   <%= link_to '','#',:id => 'search_button' %>
0
   <% form_tag search_url, :style => 'display:none;' do %>
0
- <%= text_field 'search','query' %>
0
+ <%= text_field_tag 'query', (@query || session[:last_query] || '') %>
0
   <% end %>
0
 </div>
...
20
21
22
 
23
24
25
...
20
21
22
23
24
25
26
0
@@ -20,6 +20,7 @@
0
 
0
 require 'randomness'
0
 require 'goodies'
0
+require 'utils'
0
 PASSWORD_SALT = 'so_salty_its_unbearable'
0
 
0
 # DEPENDENCIES
...
17
18
19
20
 
21
22
23
...
17
18
19
 
20
21
22
23
0
@@ -17,7 +17,7 @@
0
   map.halp 'about/halp/:action', :controller => 'pages'
0
   
0
   map.search 'search', :controller => 'search', :action => 'index'
0
-
0
+ map.search_query 'search/:query', :controller => 'search', :action => 'index'
0
   map.resources :updates
0
 
0
   map.logged_exceptions 'logged_exceptions/:action/:id', :controller => 'logged_exceptions'
...
 
 
 
 
 
...
1
2
3
4
5
0
@@ -1 +1,6 @@
0
+class SessionCleaner
0
+ def self.remove_stale_sessions
0
+ CGI::Session::ActiveRecordStore::Session.destroy_all(['updated_at < ?',1.day.ago])
0
+ end
0
+end
...
602
603
604
605
 
606
 
607
608
...
602
603
604
 
605
606
607
608
609
0
@@ -602,8 +602,9 @@
0
   // uploader
0
   $('#uploader').attach(Uploader);
0
   
0
- // comments on the single track page
0
+ // single track page love
0
   $('#single_track .comment_form form').attach(CommentForm);
0
+ $('#single_track a.add_to_favorites').attach(FavoriteToggle);
0
 
0
 });

Comments

    No one has commented yet.