]> git.openstreetmap.org Git - rails.git/commitdiff
Add an explicit "default editor" option to the user settings
authorTom Hughes <tom@compton.nu>
Tue, 16 Nov 2010 21:13:29 +0000 (21:13 +0000)
committerTom Hughes <tom@compton.nu>
Mon, 29 Nov 2010 12:20:23 +0000 (12:20 +0000)
app/controllers/user_controller.rb
app/views/layouts/site.html.erb
app/views/user/account.html.erb
config/locales/en.yml

index d73d38a17f9ee5da31669feff665fe522c1f1602..6935af3bca5f3508fa7d2222a2f142975ebdc5b8 100644 (file)
@@ -109,7 +109,11 @@ class UserController < ApplicationController
       @user.home_lat = params[:user][:home_lat]
       @user.home_lon = params[:user][:home_lon]
 
       @user.home_lat = params[:user][:home_lat]
       @user.home_lon = params[:user][:home_lon]
 
-      @user.preferred_editor = params[:user][:preferred_editor]
+      if params[:user][:preferred_editor] == "default"
+        @user.preferred_editor = nil
+      else
+        @user.preferred_editor = params[:user][:preferred_editor]
+      end
 
       if @user.save
         set_locale
 
       if @user.save
         set_locale
index f10b08949b0a23d784238f4eae0f885c53eefb76..2eae3963a49f859632528dfd5f13c0b68a93327c 100644 (file)
@@ -77,7 +77,7 @@
     <div id="editmenu">
       <ul>
         <% Editors::ALL_EDITORS.each do |editor| %>
     <div id="editmenu">
       <ul>
         <% Editors::ALL_EDITORS.each do |editor| %>
-          <li><%= link_to t('layouts.edit_with', :editor => t('user.account.editor.' + editor)), {:controller => 'site', :action => 'edit', :editor => editor}, {:id => editor + 'anchor'} %></li>
+          <li><%= link_to t('layouts.edit_with', :editor => t("editor.#{editor}.description")), {:controller => 'site', :action => 'edit', :editor => editor}, {:id => editor + 'anchor'} %></li>
         <% end %>
       </ul>
     </div>
         <% end %>
       </ul>
     </div>
index f4523c577c51db3452e5b8b900e589a084374635..7047b5b8213e47cfa92b7b4047a6696b5f038b4a 100644 (file)
@@ -68,7 +68,7 @@
 
   <tr>
     <td class="fieldName" valign="top"><%= t 'user.account.preferred editor' %></td>
 
   <tr>
     <td class="fieldName" valign="top"><%= t 'user.account.preferred editor' %></td>
-    <td><%= f.select :preferred_editor, Editors::ALL_EDITORS.collect { |e| [t('user.account.editor.'+e), e] } %></td>
+    <td><%= f.select :preferred_editor, [[t("editor.default", :name => t("editor.#{DEFAULT_EDITOR}.name")), 'default']] + Editors::ALL_EDITORS.collect { |e| [t("editor.#{e}.description"), e] } %></td>
   </tr>
 
   <tr>
   </tr>
 
   <tr>
index a717e839d690b0a7e57d5a731b1837dc3bfd7ea8..beccc22faa55228f7605a2b52667979f85588d23 100644 (file)
@@ -79,6 +79,17 @@ en:
     with_id: "{{id}}"
     with_version: "{{id}}, v{{version}}"
     with_name: "{{name}} ({{id}})"
     with_id: "{{id}}"
     with_version: "{{id}}, v{{version}}"
     with_name: "{{name}} ({{id}})"
+  editor:
+    default: "Default (currently {{name}})"
+    potlatch:
+      name: "Potlatch 1"
+      description: "Potlatch 1 (in-browser editor)"
+    potlatch2:
+      name: "Potlatch 2"
+      description: "Potlatch 2 (in-browser editor)"
+    josm:
+      name: "JOSM"
+      description: "JOSM (via remote-control plugin)"
   browse:
     changeset:
       title: "Changeset"
   browse:
     changeset:
       title: "Changeset"
@@ -1660,10 +1671,6 @@ en:
       return to profile: Return to profile
       flash update success confirm needed: "User information updated successfully. Check your email for a note to confirm your new email address."
       flash update success: "User information updated successfully."
       return to profile: Return to profile
       flash update success confirm needed: "User information updated successfully. Check your email for a note to confirm your new email address."
       flash update success: "User information updated successfully."
-      editor:
-        potlatch: "Potlatch 1 (in-browser editor)"
-        potlatch2: "Potlatch 2 (in-browser editor)"
-        josm: "JOSM (via remote-control plugin)"
     confirm:
       heading: Confirm a user account
       press confirm button: "Press the confirm button below to activate your account."
     confirm:
       heading: Confirm a user account
       press confirm button: "Press the confirm button below to activate your account."