"hide my email address" preference added, so that it's not displayed on account/show

git-svn-id: http://redmine.rubyforge.org/svn/trunk@63 e93f8b46-1217-0410-a6f0-8f06a7374b81
pull/351/head
Jean-Philippe Lang 18 years ago
parent 362633d486
commit 948e2190f8
  1. 5
      redmine/app/controllers/my_controller.rb
  2. 2
      redmine/app/views/account/show.rhtml
  3. 3
      redmine/app/views/my/account.rhtml
  4. 9
      redmine/db/migrate/009_add_hide_mail_pref.rb
  5. 1
      redmine/lang/de.yml
  6. 1
      redmine/lang/en.yml
  7. 1
      redmine/lang/es.yml
  8. 1
      redmine/lang/fr.yml

@ -44,7 +44,10 @@ class MyController < ApplicationController
# 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

@ -1,7 +1,7 @@
<h2><%= @user.display_name %></h2>
<p>
<%= mail_to @user.mail %>
<%= mail_to @user.mail unless @user.pref.hide_mail %>
<ul>
<li><%=l(:label_registered_on)%>: <%= format_date(@user.created_on) %></li>
<% for custom_value in @custom_values %>

@ -28,6 +28,9 @@
<p><label for="user_mail_notification"><%=l(:field_mail_notification)%></label>
<%= check_box 'user', 'mail_notification' %></p>
<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 %>
</div>

@ -0,0 +1,9 @@
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

@ -134,6 +134,7 @@ field_attr_mail: Emailattribut
field_onthefly: On-the-fly Benutzerkreation
field_start_date: Beginn
field_done_ratio: %% Getan
field_hide_mail: Mein email address verstecken
label_user: Benutzer
label_user_plural: Benutzer

@ -134,6 +134,7 @@ field_attr_mail: Email attribute
field_onthefly: On-the-fly user creation
field_start_date: Start
field_done_ratio: %% Done
field_hide_mail: Hide my email address
label_user: User
label_user_plural: Users

@ -134,6 +134,7 @@ field_attr_mail: Cualidad del Email
field_onthefly: Creación del usuario On-the-fly
field_start_date: Comienzo
field_done_ratio: %% Realizado
field_hide_mail: Ocultar mi email address
label_user: Usuario
label_user_plural: Usuarios

@ -135,6 +135,7 @@ field_onthefly: Création des utilisateurs à la volée
field_start_date: Début
field_done_ratio: %% Réalisé
field_auth_source: Mode d'authentification
field_hide_mail: Cacher mon adresse mail
label_user: Utilisateur
label_user_plural: Utilisateurs

Loading…
Cancel
Save