##// END OF EJS Templates
"hide my email address" preference added, so that it's not displayed on account/show...
Jean-Philippe Lang -
r61:948e2190f877
parent child
Show More
@@ -0,0 +1,9
1 class AddHideMailPref < ActiveRecord::Migration
2 def self.up
3 add_column :user_preferences, :hide_mail, :boolean, :default => false
4 end
5
6 def self.down
7 remove_column :user_preferences, :hide_mail
8 end
9 end
@@ -44,7 +44,10 class MyController < ApplicationController
44 # Edit user's account
44 # Edit user's account
45 def account
45 def account
46 @user = self.logged_in_user
46 @user = self.logged_in_user
47 if request.post? and @user.update_attributes(@params[:user])
47 @pref = @user.pref
48 @user.attributes = params[:user]
49 @user.pref.attributes = params[:pref]
50 if request.post? and @user.save
48 set_localization
51 set_localization
49 flash.now[:notice] = l(:notice_account_updated)
52 flash.now[:notice] = l(:notice_account_updated)
50 self.logged_in_user.reload
53 self.logged_in_user.reload
@@ -1,7 +1,7
1 <h2><%= @user.display_name %></h2>
1 <h2><%= @user.display_name %></h2>
2
2
3 <p>
3 <p>
4 <%= mail_to @user.mail %>
4 <%= mail_to @user.mail unless @user.pref.hide_mail %>
5 <ul>
5 <ul>
6 <li><%=l(:label_registered_on)%>: <%= format_date(@user.created_on) %></li>
6 <li><%=l(:label_registered_on)%>: <%= format_date(@user.created_on) %></li>
7 <% for custom_value in @custom_values %>
7 <% for custom_value in @custom_values %>
@@ -28,6 +28,9
28 <p><label for="user_mail_notification"><%=l(:field_mail_notification)%></label>
28 <p><label for="user_mail_notification"><%=l(:field_mail_notification)%></label>
29 <%= check_box 'user', 'mail_notification' %></p>
29 <%= check_box 'user', 'mail_notification' %></p>
30
30
31 <p><label for="pref_hide_mail"><%=l(:field_hide_mail)%></label>
32 <%= check_box 'pref', 'hide_mail' %></p>
33
31 <center><%= submit_tag l(:button_save) %></center>
34 <center><%= submit_tag l(:button_save) %></center>
32 <%= end_form_tag %>
35 <%= end_form_tag %>
33 </div>
36 </div>
@@ -134,6 +134,7 field_attr_mail: Emailattribut
134 field_onthefly: On-the-fly Benutzerkreation
134 field_onthefly: On-the-fly Benutzerkreation
135 field_start_date: Beginn
135 field_start_date: Beginn
136 field_done_ratio: %% Getan
136 field_done_ratio: %% Getan
137 field_hide_mail: Mein email address verstecken
137
138
138 label_user: Benutzer
139 label_user: Benutzer
139 label_user_plural: Benutzer
140 label_user_plural: Benutzer
@@ -134,6 +134,7 field_attr_mail: Email attribute
134 field_onthefly: On-the-fly user creation
134 field_onthefly: On-the-fly user creation
135 field_start_date: Start
135 field_start_date: Start
136 field_done_ratio: %% Done
136 field_done_ratio: %% Done
137 field_hide_mail: Hide my email address
137
138
138 label_user: User
139 label_user: User
139 label_user_plural: Users
140 label_user_plural: Users
@@ -134,6 +134,7 field_attr_mail: Cualidad del Email
134 field_onthefly: Creación del usuario On-the-fly
134 field_onthefly: Creación del usuario On-the-fly
135 field_start_date: Comienzo
135 field_start_date: Comienzo
136 field_done_ratio: %% Realizado
136 field_done_ratio: %% Realizado
137 field_hide_mail: Ocultar mi email address
137
138
138 label_user: Usuario
139 label_user: Usuario
139 label_user_plural: Usuarios
140 label_user_plural: Usuarios
@@ -135,6 +135,7 field_onthefly: Création des utilisateurs à la volée
135 field_start_date: Début
135 field_start_date: Début
136 field_done_ratio: %% Réalisé
136 field_done_ratio: %% Réalisé
137 field_auth_source: Mode d'authentification
137 field_auth_source: Mode d'authentification
138 field_hide_mail: Cacher mon adresse mail
138
139
139 label_user: Utilisateur
140 label_user: Utilisateur
140 label_user_plural: Utilisateurs
141 label_user_plural: Utilisateurs
General Comments 0
You need to be logged in to leave comments. Login now