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
using concerned_with to separate concerns, adding comments to blog entries
sudara (author)
Wed Jun 04 15:33:44 -0700 2008
commit  d2cc7db9600f710c16eff4fc529111df254c8516
tree    1bf5bc731f8a90c85be2f0d444222c7f60c7a807
parent  fcd1033b1b32ee58ccc09b6913e6020cdb57f8b7
...
7
8
9
10
11
12
13
14
15
 
 
 
 
 
 
 
 
 
16
17
18
...
20
21
22
23
24
 
25
26
27
...
7
8
9
 
 
 
 
 
 
10
11
12
13
14
15
16
17
18
19
20
21
...
23
24
25
 
 
26
27
28
29
0
@@ -7,12 +7,15 @@ class CommentsController < ApplicationController
0
       wants.js do
0
         return head(:bad_request) unless params[:comment] && params[:comment][:body] && !params[:comment][:body].empty?
0
         case params[:comment][:commentable_type]
0
- when 'asset'
0
- find_asset
0
- @comment = @asset.comments.build(shared_attributes.merge(:user => @asset.user))
0
- when 'feature'
0
- @feature = Feature.find(params[:comment][:commentable_id])
0
- @comment = @feature.comments.build(shared_attributes)
0
+ when 'asset'
0
+ find_asset
0
+ @comment = @asset.comments.build(shared_attributes.merge(:user => @asset.user))
0
+ when 'feature'
0
+ @feature = Feature.find(params[:comment][:commentable_id])
0
+ @comment = @feature.comments.build(shared_attributes)
0
+ when 'update'
0
+ @update = Update.find(params[:comment][:commentable_id])
0
+ @comment = @update.comments.build(shared_attributesrespond_to do |wants|
0
         end
0
         @comment.env = request.env
0
         return head(:bad_request) unless @comment.save
0
@@ -20,8 +23,7 @@ class CommentsController < ApplicationController
0
         render :nothing => true
0
       end
0
     end
0
- end
0
-
0
+ end
0
   
0
   def destroy
0
     @comment = Comment.find(params[:id], :include => [:commenter, :user])
...
1
2
 
3
4
5
6
7
 
 
 
8
9
10
...
14
15
16
17
18
 
 
 
 
19
20
21
...
35
36
37
38
 
39
40
41
...
46
47
48
49
 
50
51
52
...
58
59
60
61
 
62
63
64
65
66
 
67
68
69
...
75
76
77
78
 
79
80
81
...
1
 
2
3
4
5
 
 
6
7
8
9
10
11
...
15
16
17
 
 
18
19
20
21
22
23
24
...
38
39
40
 
41
42
43
44
...
49
50
51
 
52
53
54
55
...
61
62
63
 
64
65
66
67
68
 
69
70
71
72
...
78
79
80
 
81
82
83
84
0
@@ -1,10 +1,11 @@
0
 class UpdatesController < ApplicationController
0
- before_filter :login_required, :except => :index
0
+ before_filter :login_required, :except => [:index, :show]
0
   # GET /updates
0
   # GET /updates.xml
0
   def index
0
- @updates = Update.paginate(:all, :order => 'created_at DESC', :per_page => 5, :page => params[:page])
0
- @page_title = "Latest News about alonetone, the kick ass musician's home"
0
+ @updates = Update.paginate(:all, :order => 'created_at DESC', :per_page => 5, :page => params[:page], :include => [:comments => [:commenter => :pic]])
0
+ @page_title = "Latest News and Updates"
0
+ @recent_updates = Update.find(:all, :limit => 10)
0
     respond_to do |format|
0
       format.html # index.html.erb
0
       format.xml { render :xml => @updates }
0
@@ -14,8 +15,10 @@ class UpdatesController < ApplicationController
0
   # GET /updates/1
0
   # GET /updates/1.xml
0
   def show
0
- @update = Update.find(params[:id])
0
-
0
+ @update = Update.find_by_permalink(params[:id])
0
+ @comments = @update.comments.find(:all, :include => :commenter)
0
+ @page_title = @update.title
0
+ @recent_updates = Update.find(:all, :limit => 10)
0
     respond_to do |format|
0
       format.html # show.html.erb
0
       format.xml { render :xml => @update }
0
@@ -35,7 +38,7 @@ class UpdatesController < ApplicationController
0
 
0
   # GET /updates/1/edit
0
   def edit
0
- @update = Update.find(params[:id])
0
+ @update = Update.find_by_permalink(params[:id])
0
   end
0
 
0
   # POST /updates
0
@@ -46,7 +49,7 @@ class UpdatesController < ApplicationController
0
     respond_to do |format|
0
       if @update.save
0
         flash[:notice] = 'Update was successfully created.'
0
- format.html { redirect_to updates_path }
0
+ format.html { redirect_to blog_path }
0
         format.xml { render :xml => @update, :status => :created, :location => @update }
0
       else
0
         format.html { render :action => "new" }
0
@@ -58,12 +61,12 @@ class UpdatesController < ApplicationController
0
   # PUT /updates/1
0
   # PUT /updates/1.xml
0
   def update
0
- @update = Update.find(params[:id])
0
+ @update = Update.find_by_permalink(params[:id])
0
 
0
     respond_to do |format|
0
       if @update.update_attributes(params[:update])
0
         flash[:notice] = 'Update was successfully updated.'
0
- format.html { redirect_to updates_path }
0
+ format.html { redirect_to blog_path }
0
         format.xml { head :ok }
0
       else
0
         format.html { render :action => "edit" }
0
@@ -75,7 +78,7 @@ class UpdatesController < ApplicationController
0
   # DELETE /updates/1
0
   # DELETE /updates/1.xml
0
   def destroy
0
- @update = Update.find(params[:id])
0
+ @update = Update.find_by_permalink(params[:id])
0
     @update.destroy
0
 
0
     respond_to do |format|
...
1
 
 
 
 
 
 
 
 
 
 
 
2
...
1
2
3
4
5
6
7
8
9
10
11
12
13
0
@@ -1,2 +1,13 @@
0
 module CommentsHelper
0
+
0
+ def link_for_comment(comment)
0
+ case comment.commentable_type.downcase
0
+ when 'asset'
0
+ link_to h(comment.commentable.name), user_track_path(comment.commentable.user,comment.commentable)
0
+ when 'feature'
0
+ link_to h(comment.commentable.name), feature_path(comment.commentable.user.login)
0
+ when 'update' # aka blog
0
+ link_to h(comment.commentable.name), update_path(comment.commentable.permalink)
0
+ end
0
+ end
0
 end
...
4
5
6
 
7
8
9
...
4
5
6
7
8
9
10
0
@@ -4,6 +4,7 @@ class Comment < ActiveRecord::Base
0
   named_scope :include_private, {:conditions =>{:spam => false}, :order => 'created_at DESC', :include => [:commenter => :pic]}
0
   
0
   belongs_to :commentable, :polymorphic => true
0
+ has_many :replies, :as => :commentable, :class_name => 'Comment'
0
 
0
   # optional user who made the comment
0
   belongs_to :commenter, :class_name => 'User'
...
3
4
5
 
 
 
 
6
7
8
9
10
 
 
 
 
 
 
11
...
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
0
@@ -3,9 +3,19 @@ class Update < ActiveRecord::Base
0
   
0
   formats_attributes :content
0
   
0
+ has_permalink :title
0
+ before_save :create_unique_permalink
0
+
0
+ has_many :comments, :as => :commentable, :dependent => :destroy, :order => 'created_at ASC'
0
   
0
   def print
0
     self.content_html || BlueCloth::new(self.content).to_html
0
   end
0
   
0
+ # The following methods help us keep dry w/ comments
0
+ def name
0
+ "blog: #{self.title}"
0
+ end
0
+
0
+ alias :unique_id :id
0
 end
...
1
2
3
4
5
 
6
7
8
...
21
22
23
24
25
26
27
28
...
40
41
42
43
44
45
46
 
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
...
 
1
 
 
 
2
3
4
5
...
18
19
20
 
 
21
22
23
...
35
36
37
 
 
 
 
38
39
40
41
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
42
43
 
 
 
 
 
 
 
 
 
 
 
 
 
 
44
45
46
47
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
48
49
50
51
52
53
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
54
 
 
 
 
 
 
 
 
55
56
57
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
58
0
@@ -1,8 +1,5 @@
0
-require 'digest/sha1'
0
 class User < ActiveRecord::Base
0
-
0
- # has a bunch of prefs
0
- serialize :settings
0
+ concerned_with :validation, :findability, :profile, :statistics
0
   
0
   named_scope :musicians, {:conditions => ['assets_count > ?',0], :order => 'assets_count DESC', :include => :pic}
0
   named_scope :activated, {:conditions => {:activation_code => nil}, :order => 'created_at DESC', :include => :pic}
0
@@ -21,8 +18,6 @@ class User < ActiveRecord::Base
0
   belongs_to :facebook_account
0
   has_many :tracks
0
   
0
-
0
- formats_attributes :bio
0
   acts_as_mappable
0
   before_validation :geocode_address
0
   
0
@@ -40,272 +35,24 @@ class User < ActiveRecord::Base
0
   # top tracks
0
   has_many :top_tracks, :class_name => 'Asset', :limit => 10, :order => 'listens_count DESC'
0
 
0
- # Virtual attribute for the unencrypted password
0
- attr_accessor :password
0
-
0
- # These attributes can be changed via mass assignment
0
+ # The following attributes can be changed via mass assignment
0
   attr_accessible :login, :email, :password, :password_confirmation, :website, :myspace,
0
                   :bio, :display_name, :itunes, :settings, :city, :country
0
   
0
- # Validations
0
- validates_presence_of :email
0
- validates_format_of :email, :with => Format::EMAIL
0
- validates_presence_of :password, :if => :password_required?
0
- validates_presence_of :password_confirmation, :if => :password_required?
0
- validates_length_of :password, :within => 5..40, :if => :password_required?
0
- validates_confirmation_of :password, :if => :password_required?
0
- validates_length_of :email, :within => 3..40
0
- validates_uniqueness_of :email, :case_sensitive => false
0
- validates_uniqueness_of :login
0
- validates_format_of :login, :with => Format::STRING, :message => ' must be lowercase and only made from numbers and letters'
0
- validates_length_of :login, :within => 3..40
0
- validates_length_of :display_name, :within => 3..50, :allow_blank => true
0
- validates_length_of :bio, :within => 0..500, :message => "can't be empty (or longer than 600 characters)", :on => :update
0
-
0
- validates_format_of :identity_url, :with => /^https?:\/\//i, :allow_nil => true
0
- validates_format_of :itunes, :with => /^phobos.apple.com\/WebObjects\/MZStore.woa\/wa\/viewPodcast\?id=/i, :allow_blank => true, :message => 'link must be a link to the itunes store'
0
-
0
- # Methods related to validation
0
- before_save { |u| u.display_name = u.login if u.display_name.blank? }
0
- before_validation { |u| u.identity_url = nil if u.identity_url.blank? }
0
- before_save :encrypt_password
0
   before_create :make_first_user_admin, :make_activation_code
0
     
0
- def self.currently_online
0
- User.find(:all, :conditions => ["last_seen_at > ?", Time.now-5.hours])
0
- end
0
-
0
- # Generates magic %LIKE% sql statements for all columns
0
- def self.conditions_by_like(value, *columns)
0
- columns = self.content_columns if columns.size==0
0
- columns = columns[0] if columns[0].kind_of?(Array)
0
- conditions = columns.map {|c|
0
- c = c.name if c.kind_of? ActiveRecord::ConnectionAdapters::Column
0
- "#{c} LIKE " + ActiveRecord::Base.connection.quote("%#{value}%")
0
- }.join(" OR ")
0
- end
0
-
0
   def to_param
0
     "#{self.login}"
0
   end
0
   
0
- def has_public_playlists?
0
- playlists.public.size >= 1
0
- end
0
-
0
- def has_tracks?
0
- self.assets_count > 0
0
- end
0
-
0
- def has_as_favorite?(asset)
0
- favorite_asset_ids.include?(asset.id)
0
- end
0
-
0
- def favorite_asset_ids
0
- Track.find(:all, :conditions => {:playlist_id => favorites}).collect(&:asset_id)
0
- end
0
-
0
- def favorites
0
- @favorites ||= self.playlists.favorites.find(:first)
0
- end
0
-
0
- def has_pic?
0
- pic && !pic.new_record?
0
- end
0
-
0
- # graphing
0
-
0
- def track_plays_graph
0
- Gchart.line(:size => '420x150',:title => 'listens', :data => track_play_history, :axis_with_labels => 'r,x', :axis_labels => ["0|#{(track_play_history.max.to_f/2).round}|#{track_play_history.max}","30 days ago|15 days ago|Today"], :line_colors =>'cc3300', :background => '313327', :custom => 'chm=B,3d4030,0,0,0&chls=3,1,0&chg=25,50,1,0')
0
- end
0
-
0
- def track_play_history
0
- track_plays.count(:all, :conditions => ['listens.created_at > ?',30.days.ago.at_midnight], :group => 'DATE(listens.created_at)').collect{|tp| tp[1]}
0
- end
0
-
0
- def site
0
- "alonetone.com/#{login}"
0
- end
0
-
0
- def printable_bio
0
- self.bio_html || BlueCloth::new(self.bio).to_html
0
- end
0
-
0
- def website
0
- self[:website] || site
0
- end
0
-
0
- def name
0
- self[:display_name] || login
0
- end
0
-
0
- def self.dummy_pic(size)
0
- find(:first).dummy_pic(size)
0
- end
0
-
0
- def listens_average
0
- (self.listens_count.to_f / ((((Time.now - self.assets.find(:all, :limit => 1, :order => 'created_at').first.created_at) / 60 / 60 / 24 )).ceil)).ceil
0
- end
0
-
0
- def number_of_tracks_listened_to
0
- Listen.count(:all, :order => 'count_all DESC', :conditions => {:listener_id => self})
0
- end
0
-
0
- def mostly_listens_to
0
- User.find(most_listened_to_user_ids(10), :include => :pic)
0
- end
0
-
0
- def dummy_pic(size)
0
- case size
0
- when :album then 'no-pic-200.png'
0
- when :large then 'no-pic-125.png'
0
- when :small then 'no-pic-50.png'
0
- when :tiny then 'no-pic-25.png'
0
- when nil then 'no-pic-200.jpg'
0
- end
0
- end
0
-
0
- def avatar(size = nil)
0
- return dummy_pic(size) unless self.has_pic?
0
- self.pic.public_filename(size)
0
- end
0
-
0
- def self.paginate_by_params(params)
0
- case params[:sort]
0
- when 'recently_joined'
0
- self.activated.paginate(:all, :per_page => 15, :page => params[:page])
0
- when 'monster_uploaders'
0
- self.musicians.paginate(:all,:per_page => 15, :page => params[:page])
0
- when 'dedicated_listeners'
0
- @entries = WillPaginate::Collection.create((params[:page] || 1), 15) do |pager|
0
- # returns an array, like so: [User, number_of_listens]
0
- result = Listen.count(:all, :order => 'count_all DESC', :conditions => 'listener_id != ""', :group => :listener, :limit => pager.per_page, :offset => pager.offset)
0
-
0
- # inject the result array into the paginated collection:
0
- pager.replace(result)
0
-
0
- unless pager.total_entries
0
- # the pager didn't manage to guess the total count, do it manually
0
- pager.total_entries = Listen.count(:listener_id, :conditions => 'listens.listener_id != ""')
0
- end
0
- end
0
- when 'last_uploaded'
0
- @entries = WillPaginate::Collection.create((params[:page] || 1), 15) do |pager|
0
- distinct_users = Asset.find(:all, :select => 'DISTINCT user_id', :include => [:user => :pic], :order => 'assets.created_at DESC', :limit => pager.per_page, :offset => pager.offset)
0
-
0
- pager.replace(distinct_users.collect(&:user)) # only send back the users
0
-
0
- unless pager.total_entries
0
- # the pager didn't manage to guess the total count, do it manually
0
- pager.total_entries = User.musicians.count(:all, :conditions => 'assets_count > 0')
0
- end
0
- end
0
- else # last_seen
0
- self.recently_seen.paginate(:all, :page => params[:page], :per_page => 15)
0
- end
0
- end
0
-
0
-
0
- ###### login related shit
0
- # Authenticates a user by their login name and unencrypted password. Returns the user or nil.
0
- def self.authenticate(login, password)
0
- u = find :first, :conditions => ['login = ? and activated_at IS NOT NULL', login] # need to get the salt
0
- u && u.authenticated?(password) ? u : nil
0
- end
0
-
0
- # Activates the user in the database.
0
- def activate
0
- @activated = true
0
- self.activated_at = Time.now.utc
0
- self.activation_code = nil
0
- save(false)
0
- end
0
-
0
- def enable_plus
0
- self[:plus_enabled] = true
0
- self.save
0
- end
0
-
0
- def activated?
0
- activation_code.nil?
0
- end
0
-
0
- # Returns true if the user has just been activated.
0
- def pending?
0
- @activated
0
- end
0
-
0
- def authenticated?(password)
0
- crypted_password == encrypt(password)
0
- end
0
-
0
- def self.search(query, options = {})
0
- with_scope :find => { :conditions => build_search_conditions(query) } do
0
- find :all, options
0
- end
0
- end
0
-
0
- def self.build_search_conditions(query)
0
- query && ['LOWER(display_name) LIKE :q OR LOWER(login) LIKE :q', {:q => "%#{query}%"}]
0
- end
0
-
0
   def to_xml(options = {})
0
     options[:except] ||= []
0
     options[:except] << :email << :token << :token_expires_at << :crypted_password << :identity_url << :fb_user_id << :activation_code << :admin << :salt
0
     super
0
   end
0
   
0
- # Encrypts some data with the salt.
0
- def self.encrypt(password, salt)
0
- Digest::SHA1.hexdigest("--#{salt}--#{password}--")
0
- end
0
-
0
- # Encrypts the password with the user salt
0
- def encrypt(password)
0
- self.class.encrypt(password, salt)
0
- end
0
-
0
-
0
- def reset_login_key!
0
- self.token = Digest::SHA1.hexdigest(Time.now.to_s + crypted_password.to_s + rand(123456789).to_s).to_s
0
- # this is not currently honored
0
- self.token_expires_at = Time.now.utc+1.year
0
- save!
0
- token
0
- end
0
-
0
- alias_method :reset_token!, :reset_login_key!
0
-
0
- def geocode_address
0
- return unless city && country
0
- geo=GeoKit::Geocoders::MultiGeocoder.geocode([city, country].compact.join(', '))
0
- self.lat, self.lng = geo.lat,geo.lng if geo.success
0
- end
0
   protected
0
-
0
- def most_listened_to_user_ids(limit = 10)
0
- self.listens.count(:track_owner, :group => 'track_owner_id',
0
- :order => 'count_track_owner DESC',
0
- :limit => limit,
0
- :conditions => ['track_owner_id != ?',self.id]).collect(&:first)
0
- end
0
-
0
   def make_first_user_admin
0
     self.admin = true if User.count == 0
0
   end
0
-
0
- def encrypt_password
0
- return if password.blank?
0
- self.salt = Digest::SHA1.hexdigest("--#{Time.now.to_s}--#{login}--") if new_record?
0
- self.crypted_password = encrypt(password)
0
- end
0
-
0
- def password_required?
0
- crypted_password.blank? || !password.blank?
0
- end
0
-
0
-
0
- def make_activation_code
0
- self.activation_code = Digest::SHA1.hexdigest( Time.now.to_s.split(//).sort_by {rand}.join )
0
- end
0
 end
...
8
9
10
11
12
 
 
13
14
15
...
8
9
10
 
 
11
12
13
14
15
0
@@ -8,8 +8,8 @@
0
       = user_nav_item "What is alonetone?", {:controller => 'pages', :action => 'index' }
0
       = user_nav_item "How do I?...", {:controller => 'pages', :action => 'howto' }
0
       = user_nav_item "Stats", {:controller => 'pages', :action => 'stats'}, :added_class => 'contact'
0
- = user_nav_item "Latest News",{:controller => 'updates', :action => 'index' }, :added_class => 'contact'
0
- = user_nav_item "User Reports", {:controller => 'user_reports', :action => 'index'}, :added_class => 'contact'
0
+ = user_nav_item "Feedback", feedback_path, :added_class => 'contact'
0
+ = user_nav_item "Blog",blog_path, :added_class => 'contact'
0
     = yield :pagination
0
 - content_for :static do
0
   = yield
...
14
15
16
17
 
18
19
20
...
14
15
16
 
17
18
19
20
0
@@ -14,7 +14,7 @@ xml.urlset "xmlns" => "http://www.google.com/schemas/sitemap/0.84" do
0
       xml.priority 0.8
0
     end
0
   end
0
- ['users', 'updates','user_reports','stats', 'radio/latest', 'radio/favorites', 'top/40','features'].each do |static|
0
+ ['users', 'blog','feedback','stats', 'radio/latest', 'radio/favorites', 'top/40','features'].each do |static|
0
     xml.url do
0
       xml.loc "http://alonetone.com/#{static}"
0
       xml.lastmod w3c_date(Time.now)
...
12
13
14
15
 
16
17
18
...
12
13
14
 
15
16
17
18
0
@@ -12,7 +12,7 @@
0
       <% end %>
0
    
0
    <% if !@single_track %>
0
- <div class="comment_about">about <%= link_to h(comment.commentable.name), user_track_path(comment.commentable.user,comment.commentable) %></div>
0
+ <div class="comment_about">about <%= link_for_comment(comment) %></div>
0
    <% end %>
0
    <span class="comment_user_text">
0
       <%= comment.commenter ? (link_to (h comment.commenter.name), user_home_path(comment.commenter)) : 'Guest' %>
...
1
2
3
4
 
5
6
7
8
9
 
10
11
12
...
1
2
3
 
4
5
6
7
8
 
9
10
11
12
0
@@ -1,12 +1,12 @@
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)}", blog_path, :id=>'updates_link' %>
0
   </div>
0
 
0
   <div id="footer_right">
0
     <div id="bug_report">
0
- We LOVE <%= link_to 'your feedback', user_reports_path%>. <%= link_to "Say something!", "#", :id => 'creative', :class => 'feedback' %> <%= link_to(image_tag('icons/comment.png'), '#', :id => 'footer_comment_icon', :class => 'feedback') %>
0
+ We LOVE <%= link_to 'your feedback', feedback_path%>. <%= link_to "Say something!", "#", :id => 'creative', :class => 'feedback' %> <%= link_to(image_tag('icons/comment.png'), '#', :id => 'footer_comment_icon', :class => 'feedback') %>
0
     </div>
0
   </div>
0
 
...
2
3
4
5
 
6
7
8
9
10
11
 
 
 
 
 
 
 
12
13
...
2
3
4
 
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
0
@@ -2,12 +2,19 @@
0
   <div class="update_title_bar">
0
       <%= image_tag User.find(:first).avatar(:small) %>
0
       <div class="title">
0
- <h2 class="box_title"><%= "revision #{update.revision}:" if update.revision %> <%= update.title%></h2>
0
+ <h2 class="box_title"><%= link_to update.title, update_path(update.permalink)%></h2>
0
       </div>
0
       <div class="edit"><%= link_to 'edit', edit_update_path(update) if admin? %></div>
0
       <span class="about_details"><%= update.created_at.to_date.to_s(:long)%></span>
0
   </div>
0
 
0
   <div class="body"><div class="text"><%= update.print %></div></div>
0
+ <div class="indented_comments">
0
+ <h2 class="box small">Your Comments</h2>
0
+ <%= render :partial => 'shared/comment', :collection => update.comments %>
0
+ <div class="static_content">
0
+ <%= render :partial => 'comment', :object => update %>
0
+ </div>
0
+ </div>
0
 <% end %>
0
 
...
19
20
21
22
 
...
19
20
21
 
22
0
@@ -19,4 +19,4 @@
0
 <% end %>
0
 
0
 <%= link_to 'Show', @update %> |
0
-<%= link_to 'Back', updates_path %>
0
+<%= link_to 'Back', blog_path %>
...
2
3
4
5
 
6
7
8
...
2
3
4
 
5
6
7
8
0
@@ -2,7 +2,7 @@
0
   <% content_for :pagination do %>
0
     <%= will_paginate @updates %>
0
   <% end %>
0
- <h1>Latest grunts from the offices of alonetone</h1>
0
+ <h1>The alonetone blog: Latest news &amp; grunts from the offices of alonetone</h1>
0
   <%= link_to 'New update', new_update_path, :class => 'add button' if admin? %>
0
 
0
   <%= render :partial => @updates %>
...
19
20
21
22
 
...
19
20
21
 
22
0
@@ -19,4 +19,4 @@
0
   </p>
0
 <% end %>
0
 
0
-<%= link_to 'Back', updates_path %>
0
+<%= link_to 'Back', blog_path %>
...
1
2
3
4
5
6
7
8
9
10
11
12
13
 
 
 
14
...
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
0
@@ -1,13 +1,3 @@
0
-<p>
0
- <b>Title:</b>
0
- <%=h @update.title %>
0
-</p>
0
-
0
-<p>
0
- <b>Content:</b>
0
- <%=h @update.content %>
0
-</p>
0
-
0
-
0
-<%= link_to 'Edit', edit_update_path(@update) %> |
0
-<%= link_to 'Back', updates_path %>
0
+<% render :layout => 'pages/halp' do %>
0
+ <%= render :partial => @update %>
0
+<% end %>
0
\ No newline at end of file
...
1
2
3
4
 
 
 
 
5
6
7
...
16
17
18
19
20
 
21
22
23
...
1
2
 
3
4
5
6
7
8
9
10
...
19
20
21
 
 
22
23
24
25
0
@@ -1,7 +1,10 @@
0
 ActionController::Routing::Routes.draw do |map|
0
   
0
- map.resources :features, :sessions, :comments, :user_reports
0
   
0
+ map.blog 'blog', :controller => 'updates', :action => 'index'
0
+ map.feedback 'feedback', :controller => 'user_reports'
0
+ map.resources :features, :sessions, :comments, :user_reports, :updates
0
+
0
   # RESTFUL WORKAROUND FOR FACEBOOK
0
   map.facebook_home '', :controller => 'facebook_accounts', :conditions => {:canvas => true}
0
   map.resources 'facebook', :controller => 'facebook_accounts',
0
@@ -16,8 +19,7 @@ ActionController::Routing::Routes.draw do |map|
0
   
0
   map.search 'search', :controller => 'search', :action => 'index'
0
   map.search_query 'search/:query', :controller => 'search', :action => 'index'
0
- map.resources :updates
0
-
0
+
0
   map.logged_exceptions 'logged_exceptions/:action/:id', :controller => 'logged_exceptions'
0
    
0
   # You can have the root of your site routed by hooking up ''
...
4
5
6
7
8
9
 
 
 
10
11
12
13
...
4
5
6
 
 
 
7
8
9
10
11
12
13
0
@@ -4,9 +4,9 @@ module HtmlFormatting
0
   def format_attributes
<