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
Start using last_session_at to our advantage.
sudara (author)
Sun Aug 24 12:46:51 -0700 2008
commit  6c14d9c314656889e1cb2a1e827db50e54a7349e
tree    24f3a8b8a2e9610998c83ac46ecc702a49b0094a
parent  f9b8b48ed08f27753bc9839a0a72ff7dcc6fa99f
...
3
4
5
6
 
7
8
...
3
4
5
 
6
7
8
0
@@ -3,6 +3,6 @@ module AssetsHelper
0
   def radio_option(path,name, default = false,disabled_if_not_logged_in=false)
0
       content_tag :li, (radio_button_tag('source', path, (params[:source] == path || (!params[:source]) && default),
0
         :disabled => !logged_in? && disabled_if_not_logged_in) + content_tag(:span, (disabled_if_not_logged_in ? "#{name} #{login_link}" : name), :class=> 'channel_name')),
0
- :class => "radio_channel #{params[:source] == path ? 'selected' : ''} #{disabled_if_not_logged_in ? 'disabled' : ''}"
0
+ :class => "radio_channel #{params[:source] == path ? 'selected' : ''} #{!logged_in? && disabled_if_not_logged_in ? 'disabled' : ''}"
0
   end
0
 end
...
44
45
46
 
 
 
 
47
48
...
44
45
46
47
48
49
50
51
52
0
@@ -44,5 +44,9 @@ module UsersHelper
0
     link_to((is_favorite ? 'remove from favorites' : 'add to favorites'), toggle_favorite_user_path(current_user, :asset_id => asset.id),
0
       :class => 'add_to_favorites '+(is_favorite ? 'favorited' : ''))
0
   end
0
+
0
+ def new_to_user?(thing)
0
+ logged_in? and current_user.last_session_at < thing.created_at
0
+ end
0
 
0
 end
...
1
2
3
4
 
5
6
7
...
1
2
3
 
4
5
6
7
0
@@ -1,7 +1,7 @@
0
 <div id="footer">
0
 
0
   <div id="update">Latest News:
0
- <%= link_to "#{truncate(@latest_update.title, 50)}", updates_path, :id=>'updates_link' %>
0
+ <%= link_to "#{truncate(@latest_update.title, 50)}", updates_path, :id=>'updates_link', :class=> (new_to_user?(@latest_update) ? 'new' : '') %>
0
   </div>
0
 
0
   <div id="footer_right">
...
116
117
118
 
 
119
120
121
...
116
117
118
119
120
121
122
123
0
@@ -116,6 +116,8 @@ html[xmlns] .clearfix
0
     :position absolute
0
     :left 50px
0
     :top 13px
0
+ #updates_link.new
0
+ :color = !red
0
   #footer_right
0
     :position absolute
0
     :left 520px

Comments

    No one has commented yet.