Skip to content

Commit

Permalink
fixed gear list and blogs
Browse files Browse the repository at this point in the history
  • Loading branch information
chrismatthieu committed May 29, 2011
1 parent f16ea70 commit 053f4e1
Show file tree
Hide file tree
Showing 7 changed files with 4,364 additions and 18 deletions.
2 changes: 1 addition & 1 deletion app/controllers/accounts_controller.rb
Expand Up @@ -5,7 +5,7 @@
class AccountsController < ApplicationController
skip_before_filter :login_required, :except => :logout
skip_after_filter :store_location
layout 'plain'
# layout 'plain'



Expand Down
3 changes: 2 additions & 1 deletion app/controllers/home_controller.rb
Expand Up @@ -33,7 +33,8 @@ def index
@hambrief ||= Hambrief.find(:all, :order => 'updated_at DESC', :limit => 1)
@qst ||= Review.find(:first, :order => 'timestamp DESC', :limit => 1)
# @gear ||= Product.find(:all, :order => 'created_at DESC', :limit => 3)
@gear ||= Gear.find(:all, :order => 'created_at DESC', :limit => 3)
@gear ||= List.find(:all, :order => 'created_at DESC', :limit => 3)
# @gear ||= Gear.find(:all, :order => 'created_at DESC', :limit => 3)

render
}
Expand Down
24 changes: 12 additions & 12 deletions app/helpers/blogs_helper.rb
Expand Up @@ -13,17 +13,17 @@ def blogs_li blogs

def blog_body_content blog

# youtube_videos = blog.body.scan(/\[youtube:+.+\]/)
# b = blog.body.dup.gsub(/\[youtube:+.+\]/, '')
# out = sanitize textilize(b)
# unless youtube_videos.empty?
# out << <<-EOB
# <strong>#{pluralize youtube_videos.size, 'video'}:</strong><br/>
# EOB
# youtube_videos.each do |o|
# out << tb_video_link(o.gsub!(/\[youtube\:|\]/, ''))
# end
# end
# out
youtube_videos = blog.body.scan(/\[youtube:+.+\]/)
b = blog.body.dup.gsub(/\[youtube:+.+\]/, '')
out = sanitize textilize(b)
unless youtube_videos.empty?
out << <<-EOB
<strong>#{pluralize youtube_videos.size, 'video'}:</strong><br/>
EOB
youtube_videos.each do |o|
out << tb_video_link(o.gsub!(/\[youtube\:|\]/, ''))
end
end
out
end
end
2 changes: 1 addition & 1 deletion app/models/list.rb
@@ -1,5 +1,5 @@
class List < ActiveRecord::Base
has_many :products
belongs_to :product
belongs_to :profile

def after_save
Expand Down
7 changes: 4 additions & 3 deletions app/views/home/_gear.html.erb
Expand Up @@ -17,15 +17,16 @@ truncate = truncate.nil? ? true : truncate
</tr>
<tr>
<td valign="top" style="padding-left: 8px; width: 89px;">
<%= link_to image_tag(gear.profile.gravatar_url, :width => "50"), gear%>
<% @profile = Profile.find(gear.user_id) %>
<%= link_to image_tag(@profile.gravatar_url, :width => "50"), '/' + @profile.user.login%> <%= link_to @profile.user.login, '/' + @profile.user.login %>

</td>
<td class="feature_summary" valign="top" style="padding-left: 8px; width: 306px;">
<strong><a href="<%= '/products/' + gear.id.to_s %>"><%= sanitize gear.title %></a></strong>
<strong><a href="<%= '/products/' + gear.product_id.to_s %>"><%= sanitize gear.product.name %></a></strong>

<!p>
<div class="comment_message jstruncate">
<%= sanitize textilize(gear.desc) %>
<%= sanitize textilize(gear.product.description) %>
</div>
<!/p>
</td>
Expand Down
4,343 changes: 4,343 additions & 0 deletions log/development.log

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions push_201105281053.dat
@@ -0,0 +1 @@
{"local_tables_info":{"feeds":195257,"messages":963,"users":2208,"clubs":93,"gears":32,"reviews":53,"adverts":2,"forum_posts":368,"photos":1177,"companies":122,"group_rosters":0,"schema_migrations":46,"aprsupdates":1,"forum_topics":156,"products":573,"contacts":165595,"groupers":209,"sessions":5621956,"articles":0,"comments":1380,"forums":751,"profiles":2268,"tags":86,"events":66,"hambriefs":68,"statuses":8363,"blogs":477,"forums_users":0,"ratings":307,"feed_items":18590,"groups":24,"lists":3056,"taggings":159,"categories":0,"friends":2524,"repeaters":14223},"session_uri":"/sessions/2844788305","stream_state":{},"table_filter":null,"completed_tables":["groups","feed_items","adverts","friends","profiles","messages","feeds","comments","forum_topics","lists","schema_migrations","photos","forum_posts","repeaters","ratings","statuses","hambriefs","forums_users","events","tags","companies","products","aprsupdates","forums","groupers","reviews","clubs","categories","contacts","gears","users","articles"],"database_url":"mysql://root@127.0.0.1/73slove_development?encoding=utf8","remote_url":"http://heroku:osui59a24am79x@taps3.heroku.com","klass":"Taps::Push"}

0 comments on commit 053f4e1

Please sign in to comment.