Skip to content

Commit

Permalink
added new stuff to localization-files. also made german mailer templa…
Browse files Browse the repository at this point in the history
…tes.
  • Loading branch information
bakkdoor committed Sep 7, 2008
1 parent a954ac7 commit 31e3831
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 24 deletions.
8 changes: 4 additions & 4 deletions src/app/controllers/users_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ def show
def create
logout_keeping_session!
@user = User.new(params[:user])
@user.language = current_language.to_s
@user.register! if @user && @user.valid?
success = @user && @user.valid?
if success && @user.errors.empty?
redirect_back_or_default('/')
flash[:notice] = "Thanks for signing up! We're sending you an email with your activation code."
#flash[:notice] = (l :signup_successful_notice)
flash[:notice] = (l :signup_successful_notice)
else
flash[:error] = "We couldn't set up that account, sorry. Please try again, or contact an admin (link is above)."
flash[:error] = "We couldn't set up that account, sorry. Please try again, or contact an admin (link is above)."
render :action => 'new'
end
end
Expand All @@ -43,7 +43,7 @@ def activate
flash[:notice] = "Signup complete! Please sign in to continue."
redirect_to '/login'
when params[:activation_code].blank?
flash[:error] = "The activation code was missing. Please follow the URL from your email."
flash[:error] = "The activation code was missing. Please follow the URL from your email."
redirect_back_or_default('/')
else
flash[:error] = "We couldn't find a user with that activation code -- check your email? Or maybe you've already activated -- try signing in."
Expand Down
8 changes: 4 additions & 4 deletions src/app/models/user_mailer.rb
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
class UserMailer < ActionMailer::Base
def signup_notification(user)
setup_email(user)
@subject += 'Please activate your new account'
@subject += (l :please_activate_your_account)

@body[:url] = "http://#{YARPS_CONFIG['mailer']['domain']}/activate/#{user.activation_code}"

end

def activation(user)
setup_email(user)
@subject += 'Your account has been activated!'
@subject += (l :your_account_has_been_activated)
@body[:url] = "http://#{YARPS_CONFIG['mailer']['domain']}/"
end

def forgot_password(user)
setup_email(user)
@subject += 'You have requested to change your password'
@subject += (l :you_have_requested_to_change_your_password)
@body[:url] = "http://#{YARPS_CONFIG['mailer']['domain']}/reset_password/#{user.password_reset_code}"
end

def reset_password(user)
setup_email(user)
@subject += 'Your password has been reset.'
@subject += (l :your_password_has_been_reset)
end

protected
Expand Down
3 changes: 3 additions & 0 deletions src/app/views/user_mailer/activation_de.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<%=h @user.login %>, dein Profil wurde aktiviert. Willkommen an Bord!

<%=h @url %>
8 changes: 8 additions & 0 deletions src/app/views/user_mailer/signup_notification_de.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Dein Profil wurde erstellt.

Benutzername: <%=h @user.login %>
Passwort: <%=h @user.password %>

Besuche diese Seite, um dein Profil zu aktivieren:

<%=h @url %>
17 changes: 5 additions & 12 deletions src/config/routes.rb
Original file line number Diff line number Diff line change
@@ -1,13 +1,4 @@
ActionController::Routing::Routes.draw do |map|
map.logout '/logout', :controller => 'sessions', :action => 'destroy'
map.login '/login', :controller => 'sessions', :action => 'new'
map.register '/register', :controller => 'users', :action => 'create'
map.signup '/signup', :controller => 'users', :action => 'new'
map.resources :users

map.resource :session


ActionController::Routing::Routes.draw do |map|
# The priority is based upon order of creation: first created -> highest priority.

# Sample of regular route:
Expand Down Expand Up @@ -50,6 +41,8 @@
:inbox => :get,
:sent => :get,
:auto_complete_for_receiver_login => :get,
},
:member => {
:reply => :get
}

Expand All @@ -60,15 +53,15 @@
:list => :get,
:tags => :get
}

map.resources 'project_memberships'

map.resources :users, :member => { :suspend => :put, :unsuspend => :put, :purge => :delete }, :collection => {:auto_complete_for_user_login => :get }
map.resource :session

map.signup '/signup', :controller => 'users', :action => 'new'
map.login '/login', :controller => 'sessions', :action => 'new'
map.logout '/logout', :controller => 'sessions', :action => 'destroy'
map.activate '/activate/:activation_code', :controller => 'users', :action => 'activate', :activation_code => nil
map.register '/register', :controller => 'users', :action => 'create'

map.connect '/de', :controller => 'home', :action => 'index', :language => 'de'
map.connect '/en', :controller => 'home', :action => 'index', :language => 'en'
Expand Down
7 changes: 5 additions & 2 deletions src/lang/de.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ are_you_sure?: "Sind Sie sicher?"
author: Absender
back: "Zurück"
confirm_password: "Passwort bestätigen"
confirm_password: Passwort bestätigen
contact: Kontakt
create: Erstellen
created_at: "Erstellt am"
Expand Down Expand Up @@ -54,6 +53,7 @@ no_users_found: Keine Benutzer gefunden
not_sufficient_rights: "Sie haben nicht die benötigten Rechte für diese Operation."
password: Passwort
personal_menu: Persönliches Menü
please_activate_your_account: "Bitte aktiviere dein neues Profil."
please_enter_a_name: Bitte geben Sie einen Namen an
please_enter_your_login_data: Bitte geben Sie ihre Logindaten ein
profile: Profil
Expand Down Expand Up @@ -83,7 +83,7 @@ seperated_by_comma: durch Komma getrennt
set_language: Deutsch
show: Anzeigen
sign_up: Anmelden
signup_successful_notice: "Danke für deine Anmeldung!"
signup_successful_notice: "Danke für deine Anmeldung! Wir schicken dir eine Email mit deinem Aktivierungscode."
tag_search: Tag suche
tags: Tags
this_is_the_profile_of: Das hier ist das Profil von
Expand All @@ -97,5 +97,8 @@ users: Benutzer
website: Webseite
welcome_message: Willkommen bei yarps!
you_currently_have_a_user_status_of: Du hast derzeit einen User-Status als
you_have_requested_to_change_your_password: "Du hast beantragt, dein Passwort zu ändern."
your_account_has_been_activated: "Dein Profil wurde aktiviert!"
your_options: Deine Optionen
your_password_has_been_reset: "Dein Passwort wurde zurückgesetzt."
your_profile_page: Deine Profilseite
7 changes: 5 additions & 2 deletions src/lang/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ are_you_sure?: "Are you sure?"
author: Author
back: Back
confirm_password: "Confirm password"
confirm_password: Confirm Password
contact: Contact
create: Create
created_at: "Created at"
Expand Down Expand Up @@ -54,6 +53,7 @@ no_users_found: No users found
not_sufficient_rights: "You don't have sufficient rights for this operation."
password: Password
personal_menu: Personal menu
please_activate_your_account: "Please activate your new account."
please_enter_a_name: Please enter a name
please_enter_your_login_data: Please enter your login data
profile: profile
Expand Down Expand Up @@ -83,7 +83,7 @@ seperated_by_comma: seperated by comma
set_language: English
show: Show
sign_up: Sign up
signup_successful_notice: "Thanks for signing up!"
signup_successful_notice: "Thanks for signing up! We're sending you an email with your activation code."
tag_search: Tag search
tags: Tags
this_is_the_profile_of: This is the profile of
Expand All @@ -97,5 +97,8 @@ users: Users
website: Website
welcome_message: Welcome to yarps!
you_currently_have_a_user_status_of: You currently have a user status of
you_have_requested_to_change_your_password: "You have requested to change your password."
your_account_has_been_activated: "Your account has been activated!"
your_options: Your options
your_password_has_been_reset: "Your password has been reset."
your_profile_page: Your profile page

0 comments on commit 31e3831

Please sign in to comment.