public
Description: The kick ass (non-commercial) home for musicians and their music
Homepage: http://alonetone.com
Clone URL: git://github.com/sudara/alonetone.git
js, redirect, and css tweaks (IE7 now happy)
sudara (author)
Tue Apr 29 16:35:54 -0700 2008
commit  0b20c18a7e912a110f73872eb2308acea8bdb7fa
tree    26f8fa7202fde4b9f9f3fae6c006149706a50240
parent  b65f016d80d5a0446411a9789a68b79db7a94844
...
22
23
24
25
26
27
28
 
29
30
31
32
33
34
35
 
36
37
38
...
46
47
48
49
 
 
 
 
 
 
50
51
52
...
22
23
24
 
 
 
 
25
26
27
28
29
30
31
 
32
33
34
35
...
43
44
45
 
46
47
48
49
50
51
52
53
54
0
@@ -22,17 +22,14 @@ class ApplicationController < ActionController::Base
0
   
0
   # all errors end up here
0
   def show_error(exception)
0
- if RAILS_ENV == 'production' && admin?
0
- flash[:error] = "#{exception.message}"
0
- redirect_to_default
0
- elsif RAILS_ENV == 'production'
0
+ if RAILS_ENV == 'production'
0
       if facebook?
0
         flash[:error] = "Alonetone made a boo boo: <br/> #{exception.message}"
0
         render :partial => 'facebook_accounts/error', :layout => true
0
       else
0
         # show something decent for visitors
0
         flash[:error] = "Whups! That didn't work out. We've logged it, but feel free to let us know (bottom right) if something is giving you trouble"
0
- redirect_to_default
0
+ redirect_to :back
0
       end
0
     else
0
       # let me see what's wrong in dev mode.
0
@@ -46,7 +43,12 @@ class ApplicationController < ActionController::Base
0
   def facebook?
0
    !(params[:fb_sig] == nil)
0
   end
0
-
0
+
0
+ def user_not_found
0
+ # take them to the search
0
+ flash[:error] = "Hmm, we didn't find that alonetoner, but we did a search for you..."
0
+ redirect_to search_url(:search =>{:query => params[:login]})
0
+ end
0
 
0
   def sudo_to(destination_user)
0
     return false unless session[:sudo] || current_user.admin?
...
6
7
8
9
 
 
10
11
12
...
156
157
158
 
 
 
 
159
160
161
...
6
7
8
 
9
10
11
12
13
...
157
158
159
160
161
162
163
164
165
166
0
@@ -6,7 +6,8 @@ class AssetsController < ApplicationController
0
   before_filter :login_required, :except => [:index, :show, :latest]
0
   before_filter :find_referer, :only => :show
0
   
0
- rescue_from NoMethodError, :with => :latest
0
+ rescue_from NoMethodError, :with => :user_not_found
0
+ rescue_from ActiveRecord::RecordNotFound, :with => :not_found
0
   
0
   # GET /assets
0
   # GET /assets.xml
0
@@ -156,6 +157,10 @@ class AssetsController < ApplicationController
0
   
0
   protected
0
     
0
+ def not_found
0
+ flash[:error] = "We didn't find that mp3 from #{@user.name}, sorry. Maybe it is here?" and redirect_to user_tracks_path(@user)
0
+ end
0
+
0
     def find_referer
0
       case params[:referer]
0
         when 'itunes' then @referer = 'itunes'
...
8
9
10
 
 
11
12
13
...
149
150
151
152
 
 
 
 
153
154
155
...
8
9
10
11
12
13
14
15
...
151
152
153
 
154
155
156
157
158
159
160
0
@@ -8,6 +8,8 @@ class PlaylistsController < ApplicationController
0
   in_place_edit_for :playlist, :description
0
   in_place_edit_for :playlist, :title
0
   
0
+ rescue_from ActiveRecord::RecordNotFound, :with => :not_found
0
+ rescue_from NoMethodError, :with => :user_not_found
0
   
0
   # GET /playlists
0
   # GET /playlists.xml
0
@@ -149,7 +151,10 @@ class PlaylistsController < ApplicationController
0
   
0
   
0
   protected
0
-
0
+ def not_found
0
+ flash[:error] = "We didn't find that playlist from #{@user.name}, sorry, but try these others" and redirect_to user_playlists_path(@user)
0
+ end
0
+
0
   def authorized?
0
     (!%w(destroy admin edit update remove_track attach_pic sort_tracks add_track set_playlist_description set_playlist_title).include?(action_name)) || (@playlist.user_id.to_s == current_user.id.to_s) || admin?
0
   end
...
1
2
3
4
5
6
7
8
9
10
 
 
 
 
 
 
 
 
 
 
 
11
12
...
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
0
@@ -1,11 +1,12 @@
0
-<div id="share_<%=object.id.to_s%>" class="share_asset footer_content" style="display:none;">
0
-
0
-
0
-<h2>Sharing the playlist <span class="track-name"><%=h object.title %> </span>by <%=h object.user.name%></h2>
0
-<h3>Embed a flash player</h3>
0
-<%= text_area_tag "flash_player_#{object.id.to_s}", "<embed src=\"#{FLASH_PLAYER}\" width=\"320\" height=\"140\" allowfullscreen=\"true\" allowscriptaccess=\"always\" flashvars=\"&file=#{formatted_user_playlist_url(object.user, object, :xml)}&height=140&width=320&frontcolor=0x3C3C3C&backcolor=0xf3f3f3&lightcolor=0xFF944B&screencolor=0xFF944B&displaywidth=120&showdigits=false&showdownload=true\" />", :rows => 3, :cols => 50 %>
0
- <p class="tip">(customize how it looks by visiting <%= link_to 'the setup wizard', 'http://www.jeroenwijering.com/?page=wizard&example=2'%>)
0
- </p>
0
-<%= link_to "Ok, all done, thanks!",'#', :class => 'done' %>
0
-
0
+<h2 class="box">Share this playlist</h2>
0
+<div class="box">
0
+ <div class="static_content panel no_border">
0
+ <h3>Link to this playlist</h3>
0
+ <%= text_field_tag "link_#{object.id.to_s}","#{user_playlist_url(object.user.login,object)}", :size => 50%>
0
+ </div>
0
+ <div class="static_content panel">
0
+ <h3>Embed a flash player</h3>
0
+ <%= text_area_tag "flash_player_#{object.id.to_s}", "<embed src=\"#{FLASH_PLAYER}\" width=\"320\" height=\"140\" allowfullscreen=\"true\" allowscriptaccess=\"always\" flashvars=\"&file=#{formatted_user_playlist_url(object.user, object, :xml)}&height=140&width=320&frontcolor=0x3C3C3C&backcolor=0xf3f3f3&lightcolor=0xFF944B&screencolor=0xFF944B&displaywidth=120&showdigits=false&showdownload=true\" />", :rows => 3, :cols => 50 %>
0
+ (customize how it looks by visiting <%= link_to 'the setup wizard', 'http://www.jeroenwijering.com/?page=wizard&example=2'%>)
0
+ </div>
0
 </div>
0
\ No newline at end of file
...
4
5
6
 
 
 
 
7
8
...
4
5
6
7
8
9
10
11
12
0
@@ -4,4 +4,8 @@
0
     <%= render :partial => @playlist %>
0
   </div>
0
   <% end %>
0
+
0
+ <% content_for :right do %>
0
+ <%= render :partial => 'share', :object => @playlist %>
0
+ <% end %>
0
 <% end %>
0
\ No newline at end of file
...
1
2
 
 
3
4
5
6
 
7
8
9
...
1
2
3
4
5
6
7
 
8
9
10
11
0
@@ -1,9 +1,11 @@
0
 <% if !present?(@users, @assets) %>
0
   <h2>Hm, didn't find any users or tracks named "<%=h @query %>"</h2>
0
+<% else %>
0
+ <h1>Results for "<%= h @query %>"</h1>
0
 <% end %>
0
 
0
 <% if present?(@users) %>
0
- <% content_for :right do %>
0
+ <% content_for :left do %>
0
   <h2>Matching Users</h2>
0
   <div id="user_search_results">
0
     <%= render :partial => 'shared/user', :collection => @users %>
...
187
188
189
190
191
192
193
...
271
272
273
274
275
276
277
...
187
188
189
 
190
191
192
...
270
271
272
 
273
274
275
0
@@ -187,7 +187,6 @@ Uploader = $.klass({
0
     this.form.submit($.bind(this.waiting, this));
0
   },
0
   addField: function(e){
0
- console.log('add field');
0
     $('ul#filefields').append(this.clone.clone());
0
     $('ul#filefields li:last input').val('').change($.bind(this.addField, this));
0
     this.count++;
0
@@ -271,7 +270,6 @@ SlideOpenNext = $.klass({
0
     this.next = (to_open == undefined ? this.element.next() : (to_open == 'href' ? $(this.element.attr('href')) : $(to_open)));
0
   },
0
   onclick:function(){
0
- console.log('opening '+this.next.attr('id'));
0
     this.next.slideToggle('slow');
0
     return false;
0
   }
...
24
25
26
27
 
28
29
30
31
32
33
 
34
35
 
36
37
38
...
87
88
89
90
 
91
92
93
...
24
25
26
 
27
28
29
30
31
32
 
33
34
 
35
36
37
38
...
87
88
89
 
90
91
92
93
0
@@ -24,15 +24,15 @@ div.tabs,div.big_tabs
0
     :height 35px
0
     :padding 0 30px
0
     :background url(../images/backgrounds/tabs.png) no-repeat left top
0
-// position relative makes opacity fail for disabled tab in IE */
0
+// position relative makes opacity fail for disabled tab in IE
0
     :color = !white
0
     :font-weight bold
0
     :line-height 35px
0
     :text-align center
0
     :text-decoration none
0
-// required in IE 6 */
0
+// required in IE 6
0
     :white-space nowrap
0
-// prevent dotted border in Firefox */
0
+// prevent dotted border in Firefox
0
     :outline 0
0
   .ui-tabs-selected a
0
     :background-position -420px 0px
0
@@ -87,7 +87,7 @@ div.tabs,div.big_tabs
0
   :clear both
0
   :padding 15px 20px 10px 20px
0
   :background #e1e2e1
0
- :position relative
0
+// again, NO position:relative, it makes IE fail
0
 // declare background color for container to avoid distorted fonts in IE while fading
0
   a,a:visited
0
     :color = !text_color
...
218
219
220
 
221
222
223
...
218
219
220
221
222
223
224
0
@@ -218,6 +218,7 @@ a.button
0
     :line-height 20px
0
     :text-indent 25px
0
     :display block
0
+ :width 200px
0
     :margin 10px 0
0
     :font-weight bold
0
   &.delete, &.remove

Comments

    No one has commented yet.