# Edit user's account
def account
@user = self.logged_in_user
- if request.post? and @user.update_attributes(@params[:user])
+ @pref = @user.pref
+ @user.attributes = params[:user]
+ @user.pref.attributes = params[:pref]
+ if request.post? and @user.save
set_localization
flash.now[:notice] = l(:notice_account_updated)
self.logged_in_user.reload
<h2><%= @user.display_name %></h2>\r
\r
<p>\r
-<%= mail_to @user.mail %>\r
+<%= mail_to @user.mail unless @user.pref.hide_mail %>\r
<ul>\r
<li><%=l(:label_registered_on)%>: <%= format_date(@user.created_on) %></li>\r
<% for custom_value in @custom_values %>\r
<p><label for="user_mail_notification"><%=l(:field_mail_notification)%></label>
<%= check_box 'user', 'mail_notification' %></p>\r
+ <p><label for="pref_hide_mail"><%=l(:field_hide_mail)%></label>
+ <%= check_box 'pref', 'hide_mail' %></p>
+
<center><%= submit_tag l(:button_save) %></center>
<%= end_form_tag %>\r
</div>\r
--- /dev/null
+class AddHideMailPref < ActiveRecord::Migration
+ def self.up
+ add_column :user_preferences, :hide_mail, :boolean, :default => false
+ end
+
+ def self.down
+ remove_column :user_preferences, :hide_mail
+ end
+end
field_onthefly: On-the-fly Benutzerkreation\r
field_start_date: Beginn\r
field_done_ratio: %% Getan\r
+field_hide_mail: Mein email address verstecken\r
\r
label_user: Benutzer\r
label_user_plural: Benutzer\r
field_onthefly: On-the-fly user creation\r
field_start_date: Start\r
field_done_ratio: %% Done\r
+field_hide_mail: Hide my email address\r
\r
label_user: User\r
label_user_plural: Users\r
field_onthefly: Creación del usuario On-the-fly\r
field_start_date: Comienzo\r
field_done_ratio: %% Realizado\r
+field_hide_mail: Ocultar mi email address\r
\r
label_user: Usuario\r
label_user_plural: Usuarios\r
field_start_date: Début\r
field_done_ratio: %% Réalisé\r
field_auth_source: Mode d'authentification\r
+field_hide_mail: Cacher mon adresse mail\r
\r
label_user: Utilisateur\r
label_user_plural: Utilisateurs\r