Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Clean up some merge errors, stupid fails, and fix some missing i18n s…

…trings
  • Loading branch information...
commit 901d87247143c6f840f1d2c6faa68fb953aa221e 1 parent 9828f9e
@courtenay courtenay authored
View
6 README.rdoc
@@ -2,6 +2,7 @@
The popular rails-based Beast forum, rewritten from the ground up with the same database and views.
+* full i18n (with German and English support)
* updated for Rails 2.3.3
* using rspec/model_stubbing
* added a state machine for user logins
@@ -17,11 +18,6 @@ Check out the code via git:
git clone git://github.com/courtenay/altered_beast.git
-Looking for a fully internationalized forum? After checking out the code,
-switch to the 'i18n' branch like so
-
- git branch --track i18n origin/i18n
- git checkout i18n
=== INSTALLATION
View
3  app/controllers/sessions_controller.rb
@@ -14,7 +14,6 @@ def create
else
cookies[:use_open_id] = {:value => '0', :expires => 1.year.ago.utc}
password_authentication params[:login].downcase, params[:password]
- flash[:error] = "Invalid login"
end
end
@@ -55,7 +54,7 @@ def open_id_authentication(openid_url)
failed_login I18n.t('txt.invalid_openid', :default => "Sorry, no user by the identity URL #{openid_url} exists")
end
else
- failed_login result.message
+ failed_login result.message if openid_url
end
end
end
View
4 app/controllers/users_controller.rb
@@ -4,8 +4,8 @@ class UsersController < ApplicationController
before_filter :login_required, :only => [:settings, :update]
# Brainbuster Captcha
- before_filter :create_brain_buster, :only => [:new]
- before_filter :validate_brain_buster, :only => [:create]
+ # before_filter :create_brain_buster, :only => [:new]
+ # before_filter :validate_brain_buster, :only => [:create]
def index
users_scope = admin? ? :all_users : :users
View
6 app/models/user/validation.rb
@@ -58,9 +58,9 @@ def set_first_user_as_admin
end
def normalize_login_and_email
- login.downcase!
- login.strip!
- email.downcase!
+ login.downcase! if login
+ login.strip! if login
+ email.downcase! if email
return true
end
end
View
14 app/views/sessions/new.html.erb
@@ -3,7 +3,7 @@
<% form_tag session_path do -%>
<div id="openid_fields" style="display:none">
<p>
- <label for="openid_url">Login with OpenID</label>
+ <label for="openid_url"><%= I18n.t "txt.views_users.login_with_openid", :default => "Login with OpenID" %></label>
<br />
<%= text_field_tag 'openid_url', params[:openid_url], :class => "openid_url" %>
</p>
@@ -21,24 +21,22 @@
<%= check_box_tag 'remember_me', '1', @remember_me %></p>
<p><%= submit_tag I18n.t('txt.log_in', :default => 'Log in') %>
- <%= link_to_function(I18n.t('reset password', :default => "reset password"), "$('reset-password').toggle();") %>
+ <%= link_to_function(I18n.t('txt.views_users.reset_password', :default => "reset password"), "$('reset-password').toggle();") %>
<a href="#" onclick="LoginForm.setToOpenID()"><%= I18n.t('txt.or_login_with_openid', :default => 'or login with OpenID') %></a>
</p>
</div>
-<p><%= submit_tag 'Log in' %></p>
-
<% end -%>
<% form_tag users_path, :id => 'reset-password', :style => 'display:none' do -%>
<hr />
- <h5><%= 'Reset Password'[] %></h5>
+ <h5><%= I18n.t 'txt.views_users.reset_password', :default => "Reset Password" %></h5>
- <p><%= 'Enter your email, and a brand new login key will be sent to you. Click the link in the email to log in, and then change your password.'[:email_directions] %></p>
+ <p><%= I18n.t 'txt.views_users.email_directions' %></p>
<p><%= text_field_tag :email, "", :size => 30 %></p>
- <p><%= submit_tag 'E-mail me the link'[:email_submit] %>
- or <%= link_to_function('cancel'[], "$('reset-password').hide()") %></p>
+ <p><%= submit_tag I18n.t("txt.views_users.send_email", :default => "E-mail me the link") %>
+ or <%= link_to_function(I18n.t("txt.cancel", :default => "cancel"), "$('reset-password').hide()") %></p>
<% end -%>
View
13 app/views/users/_captcha.html.erb
@@ -0,0 +1,13 @@
+<% unless captcha_passed? %>
+ <span id="brain_buster_captcha" class="<%= if last_captcha_attempt_failed? then 'captcha_failed' end %>">
+
+ <%= hidden_field_tag :captcha_id, @captcha.id %>
+
+ <label for="captcha_answer">
+ Spam protection: <%= @captcha.question %>
+ </label>
+
+ <%= text_field_tag :captcha_answer, params[:captcha_answer], :size => 10, :maxlength => 40 %>
+
+ </span>
+<% end %>
View
4 app/views/users/new.rhtml
@@ -12,11 +12,11 @@
<p><label for="password_confirmation"><%= I18n.t 'txt.password_confirm', :default => 'Confirm Password' %></label><br/>
<%= f.password_field :password_confirmation %></p>
-<p><label for="user_openid_url"><%= I18n.t 'txt.openid_url', :default => "OpenID URL" %></label><br />
+<p><label for="user_openid_url"><%= I18n.t 'txt.openid_url', :default => "OpenID URL (optional)" %></label><br />
<%= f.text_field :openid_url %>
</p>
-<%= render :partial => '/captcha' %>
+<%#= render :partial => 'captcha' # enable for brainbuster %>
<p><%= submit_tag I18n.t('txt.sign_up', :default => 'Sign up') %></p>
View
6 config/locales/en.yml
@@ -132,3 +132,9 @@
zero: "no posts found"
one: "1 post found"
other: "{{count}} posts found"
+
+ views_users:
+ email_directions: Enter your email, and a brand new login key will be sent to you. Click the link in the email to log in, and then change your password.
+ reset_password: Reset password
+
+
Please sign in to comment.
Something went wrong with that request. Please try again.