Permalink
Browse files

Merge branch '1.9.3' of https://github.com/brodock/altered_beast

  • Loading branch information...
2 parents 04bf048 + 649451b commit c5345fb6d25828bcc7462082ec498c57a688064a @stiff committed Dec 23, 2011
View
1 .rvmrc
@@ -0,0 +1 @@
+rvm use 1.9.3
View
@@ -1,6 +1,6 @@
source "http://rubygems.org"
-gem 'rails', '3.0.7'
+gem 'rails', '~>3.0.7'
gem 'ruby-openid', '>= 2.0.4', :require => "openid"
gem 'rack-openid'
gem 'will_paginate', :git => "http://github.com/mislav/will_paginate.git", :branch => "rails3"
@@ -9,7 +9,7 @@ gem 'RedCloth', :require => "redcloth"
gem 'acts_as_list'
gem 'acts_as_state_machine'
-gem 'permalink_fu'
+gem 'friendly_id', '~>4.0.0.rc2'
group :development, :test do
gem 'rspec-rails'
View
@@ -8,81 +8,85 @@ GIT
GEM
remote: http://rubygems.org/
specs:
- RedCloth (4.2.7)
+ RedCloth (4.2.9)
ZenTest (4.5.0)
abstract (1.0.0)
- actionmailer (3.0.7)
- actionpack (= 3.0.7)
- mail (~> 2.2.15)
- actionpack (3.0.7)
- activemodel (= 3.0.7)
- activesupport (= 3.0.7)
+ actionmailer (3.0.11)
+ actionpack (= 3.0.11)
+ mail (~> 2.2.19)
+ actionpack (3.0.11)
+ activemodel (= 3.0.11)
+ activesupport (= 3.0.11)
builder (~> 2.1.2)
erubis (~> 2.6.6)
i18n (~> 0.5.0)
rack (~> 1.2.1)
rack-mount (~> 0.6.14)
rack-test (~> 0.5.7)
tzinfo (~> 0.3.23)
- activemodel (3.0.7)
- activesupport (= 3.0.7)
+ activemodel (3.0.11)
+ activesupport (= 3.0.11)
builder (~> 2.1.2)
i18n (~> 0.5.0)
- activerecord (3.0.7)
- activemodel (= 3.0.7)
- activesupport (= 3.0.7)
- arel (~> 2.0.2)
+ activerecord (3.0.11)
+ activemodel (= 3.0.11)
+ activesupport (= 3.0.11)
+ arel (~> 2.0.10)
tzinfo (~> 0.3.23)
- activeresource (3.0.7)
- activemodel (= 3.0.7)
- activesupport (= 3.0.7)
- activesupport (3.0.7)
+ activeresource (3.0.11)
+ activemodel (= 3.0.11)
+ activesupport (= 3.0.11)
+ activesupport (3.0.11)
acts_as_list (0.1.2)
acts_as_state_machine (2.2.0)
activerecord (>= 2.1)
- arel (2.0.9)
+ arel (2.0.10)
autotest (4.4.6)
ZenTest (>= 4.4.1)
bluecloth (2.1.0)
builder (2.1.2)
diff-lcs (1.1.2)
erubis (2.6.6)
abstract (>= 1.0.0)
+ friendly_id (4.0.0.rc2)
highline (1.6.1)
i18n (0.5.0)
+ json (1.6.3)
mail (2.2.19)
activesupport (>= 2.3.6)
i18n (>= 0.4.0)
mime-types (~> 1.16)
treetop (~> 1.4.8)
- mime-types (1.16)
+ mime-types (1.17.2)
mysql2 (0.2.7)
- permalink_fu (1.0.0)
- polyglot (0.3.1)
- rack (1.2.2)
+ polyglot (0.3.3)
+ rack (1.2.4)
rack-mount (0.6.14)
rack (>= 1.0.0)
rack-openid (1.3.1)
rack (>= 1.1.0)
ruby-openid (>= 2.1.8)
rack-test (0.5.7)
rack (>= 1.0)
- rails (3.0.7)
- actionmailer (= 3.0.7)
- actionpack (= 3.0.7)
- activerecord (= 3.0.7)
- activeresource (= 3.0.7)
- activesupport (= 3.0.7)
+ rails (3.0.11)
+ actionmailer (= 3.0.11)
+ actionpack (= 3.0.11)
+ activerecord (= 3.0.11)
+ activeresource (= 3.0.11)
+ activesupport (= 3.0.11)
bundler (~> 1.0)
- railties (= 3.0.7)
+ railties (= 3.0.11)
rails3-generators (0.17.4)
railties (>= 3.0.0)
- railties (3.0.7)
- actionpack (= 3.0.7)
- activesupport (= 3.0.7)
+ railties (3.0.11)
+ actionpack (= 3.0.11)
+ activesupport (= 3.0.11)
rake (>= 0.8.7)
+ rdoc (~> 3.4)
thor (~> 0.14.4)
- rake (0.8.7)
+ rake (0.9.2.2)
+ rdoc (3.12)
+ json (~> 1.4)
rspec (2.5.0)
rspec-core (~> 2.5.0)
rspec-expectations (~> 2.5.0)
@@ -101,9 +105,10 @@ GEM
sqlite3-ruby (1.3.3)
sqlite3 (>= 1.3.3)
thor (0.14.6)
- treetop (1.4.9)
+ treetop (1.4.10)
+ polyglot
polyglot (>= 0.3.1)
- tzinfo (0.3.27)
+ tzinfo (0.3.31)
PLATFORMS
ruby
@@ -114,11 +119,11 @@ DEPENDENCIES
acts_as_state_machine
autotest
bluecloth
+ friendly_id (~> 4.0.0.rc2)
highline
mysql2 (~> 0.2.7)
- permalink_fu
rack-openid
- rails (= 3.0.7)
+ rails (~> 3.0.7)
rails3-generators
rspec-rails
ruby-openid (>= 2.0.4)
View
@@ -3,7 +3,7 @@
The popular rails-based Beast forum, rewritten from the ground up with the same database and views.
* updated for Rails 3
-* full i18n (with German and English support)
+* full i18n (with German, English and Portuguese (Brazil) support)
* using rspec/model_stubbing
* added a state machine for user logins
* built-in multi-site support
@@ -16,12 +16,12 @@ The popular rails-based Beast forum, rewritten from the ground up with the same
Check out the code via git:
- git clone git://github.com/stiff/altered_beast.git
+ git clone git://github.com/brodock/altered_beast.git
=== INSTALLATION
- $ git clone git://github.com/stiff/altered_beast.git
+ $ git clone git://github.com/brodock/altered_beast.git
$ cd altered_beast
$ bundle install
$ rake app:bootstrap
@@ -92,7 +92,7 @@ def destroy
protected
def find_forum
- @forum = current_site.forums.find_by_permalink!(params[:id])
+ @forum = current_site.forums.find(params[:id])
end
end
@@ -78,8 +78,8 @@ def find_parents
if params[:user_id]
@parent = @user = User.find(params[:user_id])
elsif params[:forum_id]
- @parent = @forum = Forum.find_by_permalink(params[:forum_id])
- @parent = @topic = @forum.topics.find_by_permalink(params[:topic_id]) if params[:topic_id]
+ @parent = @forum = Forum.find(params[:forum_id])
+ @parent = @topic = @forum.topics.find(params[:topic_id]) if params[:topic_id]
end
end
@@ -80,10 +80,10 @@ def destroy
protected
def find_forum
- @forum = current_site.forums.find_by_permalink!(params[:forum_id])
+ @forum = current_site.forums.find(params[:forum_id])
end
def find_topic
- @topic = @forum.topics.find_by_permalink!(params[:id])
+ @topic = @forum.topics.find(params[:id])
end
end
@@ -2,7 +2,7 @@
module ApplicationHelper
def feed_icon_tag(title, url)
(@feed_icons ||= []) << { :url => url, :title => title }
- link_to image_tag('feed-icon.png', :size => '14x14', :alt => "Subscribe to #{title}"), url
+ link_to image_tag('feed-icon.png', :size => '14x14', :alt => I18n.t('txt.subscribe_to_feed', :default => "Subscribe to %{title}", :title => title)), url
end
def flash_messages
View
@@ -7,7 +7,8 @@ class Forum < ActiveRecord::Base
belongs_to :site
- has_permalink :name
+ extend FriendlyId
+ friendly_id :name, :use => :slugged, :slug_column => :permalink
attr_readonly :posts_count, :topics_count
View
@@ -36,7 +36,8 @@ class Topic < ActiveRecord::Base
attr_readonly :posts_count, :hits
- has_permalink :title, :scope => :forum_id
+ extend FriendlyId
+ friendly_id :title, :use => :scoped, :slug_column => :permalink, :scope => :forum
def to_s
title
View
@@ -18,7 +18,8 @@ def moderatable
has_many :monitorships, :dependent => :delete_all
has_many :monitored_topics, :through => :monitorships, :source => :topic, :conditions => {"#{Monitorship.table_name}.active" => true}
- has_permalink :login, :scope => :site_id
+ extend FriendlyId
+ friendly_id :login, :use => :scoped, :slug_column => :permalink, :scope => :site
attr_readonly :posts_count, :last_seen_at
@@ -1,5 +1,5 @@
<div class="crumbs">
- <%= link_to I18n.t('txt.forums', :default => 'Forums'), root_path %> <span class="arrow">&rarr;</span>
+ <%= link_to t('txt.forums', :default => 'Forums'), root_path %> <span class="arrow">&rarr;</span>
</div>
<h1><%= I18n.t('txt.views_forums.edit', :default => 'Edit Forum') %></h1>
@@ -1,50 +1,35 @@
-<% content_for :right do %>
-
-<h5><%= I18n.t 'txt.sidebar.beast_title', :default => 'What is Beast?' %></h5>
-
-<p>
- <%= I18n.t 'txt.sidebar.beast_desc', :default => "A small, light-weight forum in Rails with a scary name and a goal of around 500 lines of code when we're done." %>
-</p>
-
-<% if admin? %>
-<h6><%= I18n.t 'txt.admin.title', :default => 'Admin' %></h6>
-<p><%= link_to I18n.t('txt.admin.create_new_forum', :default => 'Create New Forum'), new_forum_path, :class => "utility" %></p>
-<% end %>
-
-<% end %>
-
-<h1 style="margin-top:0;"><%= I18n.t 'txt.forums', :default => 'Forums' %></h1>
+<h1 style="margin-top:0;"><%= t 'txt.forums', :default => 'Forums' %></h1>
<p class="subtitle">
-<%= feed_icon_tag I18n.t('txt.recent_posts', :default => "Recent Posts"), posts_path(:format => 'atom') %>
-<%= I18n.t 'txt.count_topics', :count => current_site.topics.size, :num => number_with_delimiter(current_site.topics.size) %>,
-<%= I18n.t 'txt.count_posts', :count => current_site.posts.size, :num => number_with_delimiter(current_site.posts.size) %>
+ <%= feed_icon_tag t('txt.recent_posts', :default => "Recent Posts"), posts_path(:format => 'atom') %>
+ <%= t 'txt.count_topics', :count => current_site.topics.size, :num => number_with_delimiter(current_site.topics.size) %>,
+ <%= t 'txt.count_posts', :count => current_site.posts.size, :num => number_with_delimiter(current_site.posts.size) %>
</p>
<table border="0" cellspacing="0" cellpadding="0" class="wide forums">
<tr>
- <th class="la" width="70%" colspan="3"><%= I18n.t 'txt.forum', :default => 'Forum' %></th>
- <th class="la" width="30%" colspan="1"><%= I18n.t 'txt.latest_post', :default => 'Last Post' %></th>
+ <th class="la" width="70%" colspan="3"><%= t 'txt.forum', :default => 'Forum' %></th>
+ <th class="la" width="30%" colspan="1"><%= t 'txt.latest_post', :default => 'Last Post' %></th>
</tr>
<% for forum in @forums do %>
<tr class="forum" id="forum_<%= forum.id %>_row">
<td class="vat c1">
<% if recent_forum_activity(forum) %>
- <%= image_tag "clearbits/comment.gif", :class => "icon green", :title => I18n.t('txt.recent_activity', :default => 'Recent activity') %>
+ <%= image_tag "clearbits/comment.gif", :class => "icon green", :title => t('txt.recent_activity', :default => 'Recent activity') %>
<% else %>
- <%= image_tag "clearbits/comment.gif", :class => "icon grey", :title => I18n.t('txt.no_recent_activity', :default => 'No recent activity') %>
+ <%= image_tag "clearbits/comment.gif", :class => "icon grey", :title => t('txt.no_recent_activity', :default => 'No recent activity') %>
<% end %>
</td>
<td class="c2 vat">
<%= link_to forum.name, forum_path(forum), :class => "title" %>
<div class="posts">
- <%= I18n.t 'txt.count_topics', :count => forum.topics.size, :num => number_with_delimiter(forum.topics.size) %>,
- <%= I18n.t 'txt.count_posts', :count => forum.posts.size, :num => number_with_delimiter(forum.posts.size) %>
+ <%= t 'txt.count_topics', :count => forum.topics.size, :num => number_with_delimiter(forum.topics.size) %>,
+ <%= t 'txt.count_posts', :count => forum.posts.size, :num => number_with_delimiter(forum.posts.size) %>
</div>
<p class="desc"><%= forum.description_html.html_safe %></p>
</td>
<td class="c3">
- <%= link_to I18n.t('txt.edit', :default => 'Edit'), edit_forum_path(forum), :class => "tiny", :rel => "directory", :style => "float:right" if admin? %>
+ <%= link_to t('txt.edit', :default => 'Edit'), edit_forum_path(forum), :class => "tiny", :rel => "directory", :style => "float:right" if admin? %>
</td>
<td class="inv lp">
@@ -59,7 +44,7 @@
</table>
<p>
- <%= link_to I18n.t('txt.show_recent_posts', :default => 'Show recent posts'), posts_path %>
+ <%= link_to t('txt.show_recent_posts', :default => 'Show recent posts'), posts_path %>
</p>
<% if (online_users = User.online).length > 0 %>
@@ -69,3 +54,18 @@
</div>
</div>
<% end %>
+
+<% content_for :right do %>
+
+ <h5><%= t 'txt.sidebar.beast_title', :default => 'What is Beast?' %></h5>
+
+ <p>
+ <%= t 'txt.sidebar.beast_desc', :default => "A small, light-weight forum in Rails with a scary name and a goal of around 500 lines of code when we're done." %>
+ </p>
+
+ <% if admin? %>
+ <h6><%= t 'txt.admin.title', :default => 'Admin' %></h6>
+ <p><%= link_to t('txt.admin.create_new_forum', :default => 'Create New Forum'), new_forum_path, :class => "utility" %></p>
+ <% end %>
+
+<% end %>
Oops, something went wrong.

0 comments on commit c5345fb

Please sign in to comment.