diff options
| author | David Cabo <david@calibea.com> | 2012-03-21 00:48:25 +0100 |
|---|---|---|
| committer | David Cabo <david@calibea.com> | 2012-03-21 00:48:25 +0100 |
| commit | b49904d7a9e62e6610d65a0849ae27d9336c2d30 (patch) | |
| tree | 6d07ea41b41cf23266c224ede52b8f7160bac6a0 | |
| parent | c13207fbbb77ef0356db4abf174e7fe5f2fe2e10 (diff) | |
Add checkbox for TOC agreement on user signup
| -rw-r--r-- | app/controllers/user_controller.rb | 3 | ||||
| -rw-r--r-- | app/views/user/_signup.rhtml | 5 |
2 files changed, 7 insertions, 1 deletions
diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb index 403cb9684..4356b377f 100644 --- a/app/controllers/user_controller.rb +++ b/app/controllers/user_controller.rb @@ -154,7 +154,8 @@ class UserController < ApplicationController flash.now[:error] = _("There was an error with the words you entered, please try again.") error = true end - if error || !@user_signup.valid? + if error || !@user_signup.valid? || params[:toc]!='1' + @user_signup.errors.add(:toc, _("Por favor confirme que ha leído las Condiciones de Uso.")) if params[:toc]!='1' # Show the form render :action => 'sign' else diff --git a/app/views/user/_signup.rhtml b/app/views/user/_signup.rhtml index 9c0132f26..9c5d89b13 100644 --- a/app/views/user/_signup.rhtml +++ b/app/views/user/_signup.rhtml @@ -35,6 +35,11 @@ <label class="form_label" for="user_signup_password_confirmation"> <%= _('Password: (again)')%></label> <%= password_field 'user_signup', 'password_confirmation', { :size => 15 } %> </p> + + <p class="form_checkbox"> + <%= check_box_tag 'toc', "1" %> + <label for="toc"><%= _('He leído las <a href="%s">Condiciones de Uso</a> de la web.') %[help_terms_of_use_path] %></label> + </p> <% if @request_from_foreign_country %> <%= recaptcha_tags %> |
