app/controllers/reader_activations_controller.rb in radiant-reader-extension-0.9.2 vs app/controllers/reader_activations_controller.rb in radiant-reader-extension-1.0.0
- old
+ new
@@ -5,11 +5,11 @@
before_filter :authenticate_reader, :only => [:update]
before_filter :check_reader_inactive
radiant_layout { |controller| Radiant::Config['reader.layout'] }
- # this is just fake REST: we're actually working on the reader, not an activation object, but in a usefully restricted way:
+ # this is just fake REST: we're actually working on the reader, not an activation object.
# .show sends out an activation message if we can identify the current reader
# .update activates the reader, if the token is correct
def show
render
@@ -17,25 +17,24 @@
def new
if current_reader
@reader = current_reader
@reader.send_activation_message
- flash[:notice] = "Account activation instructions have been emailed to you."
+ flash[:notice] = "activation_message_sent"
end
render :action => 'show'
end
def update
if @reader
@reader.activate!
self.current_reader = @reader
- flash[:notice] = "Thank you! Your account has been activated."
+ flash[:notice] = "thanks_activated"
redirect_back_or_to default_activated_url
-
else
- @error = "Sorry: something was wrong in that link. Please check your email message."
- flash[:error] = "Activation failed."
+ @error = "please_check_message"
+ flash[:error] = "activation_failed."
render :action => 'show'
end
end
protected
@@ -45,10 +44,10 @@
@reader = Reader.find_by_id_and_perishable_token(params[:id], params[:activation_code])
end
def check_reader_inactive
if @reader && @reader.activated?
- flash[:notice] = "Hello #{@reader.name}! Your account is already active."
+ flash[:notice] = t('hello').titlecase + " #{@reader.name}! " + t('already_active')
redirect_back_or_to default_activated_url
false
end
end