From: Tom Hughes Date: Sun, 31 May 2009 15:22:59 +0000 (+0000) Subject: Add a simple edit control for the user's preferred languages. X-Git-Tag: live~7335^2~12 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/168036d3a20157702eb9b4f964ddf56366086c82 Add a simple edit control for the user's preferred languages. --- diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb index 2050ffdb4..9c2787cc8 100644 --- a/app/controllers/user_controller.rb +++ b/app/controllers/user_controller.rb @@ -50,10 +50,13 @@ class UserController < ApplicationController end @user.description = params[:user][:description] + @user.languages = params[:user][:languages].split(",") @user.home_lat = params[:user][:home_lat] @user.home_lon = params[:user][:home_lon] if @user.save + set_locale + if params[:user][:email] == @user.new_email flash[:notice] = I18n.t('user.account.flash update success confirm needed') Notifier.deliver_email_confirm(@user, @user.tokens.create) diff --git a/app/views/user/account.rhtml b/app/views/user/account.rhtml index 4552c22a1..1df79c789 100644 --- a/app/views/user/account.rhtml +++ b/app/views/user/account.rhtml @@ -20,6 +20,8 @@ <%= t 'user.account.profile description' %><%= f.text_area :description, :rows => '5', :cols => '60' %>

+ <%= t 'user.account.preferred languages' %><%= f.text_field :languages %>

+ class="nohome" <%end%> ><%= t 'user.account.home location' %><%= t 'user.account.no home location' %><%= t 'user.account.latitude' %> <%= f.text_field :home_lat, :size => 20, :id => "home_lat" %><%= t 'user.account.longitude' %><%= f.text_field :home_lon, :size => 20, :id => "home_lon" %> diff --git a/config/locales/en.yml b/config/locales/en.yml index bbd4f2d1b..c3662c220 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -401,6 +401,7 @@ en: disabled: "Disabled and cannot edit data, all previous edits are anonymous." disabled link text: "why can't I edit?" profile description: "Profile Description: " + preferred languages: "Preferred Languages: " home location: "Home Location: " no home location: "You have not entered your home location." latitude: "Latitude: "