]> git.openstreetmap.org Git - rails.git/commitdiff
Merge remote-tracking branch 'upstream/pull/2257'
authorTom Hughes <tom@compton.nu>
Wed, 12 Jun 2019 18:50:52 +0000 (19:50 +0100)
committerTom Hughes <tom@compton.nu>
Wed, 12 Jun 2019 18:50:52 +0000 (19:50 +0100)
14 files changed:
app/views/diary_entries/show.html.erb
app/views/issues/_comments.html.erb
app/views/messages/new.html.erb
app/views/oauth_clients/edit.html.erb
app/views/oauth_clients/new.html.erb
app/views/redactions/edit.html.erb
app/views/redactions/new.html.erb
app/views/traces/edit.html.erb
app/views/traces/new.html.erb
app/views/user_blocks/edit.html.erb
app/views/user_blocks/new.html.erb
config/locales/en.yml
test/application_system_test_case.rb
test/system/issues_test.rb

index a56613b490121e3f1f042b037c092deaa3b0875b..cc761b15d3b03829997cd75a92d14a8238d804ae 100644 (file)
@@ -19,9 +19,9 @@
 
     <%= error_messages_for "diary_comment" %>
 
-    <%= form_for :diary_comment, :url => { :action => "comment" } do |f| %>
+    <%= form_for @entry.comments.new, :url => { :action => "comment" } do |f| %>
       <%= richtext_area :diary_comment, :body, :cols => 80, :rows => 15 %>
-      <%= submit_tag t(".save_button") %>
+      <%= f.submit %>
     <% end %>
     <% if @entry.subscribers.exists?(current_user.id) %>
       <div class="diary-subscribe-buttons"><%= link_to t("javascripts.changesets.show.unsubscribe"), diary_entry_unsubscribe_path(:display_name => @entry.user.display_name, :id => @entry.id), :method => :post, :class => :button %></div>
index 13f5bb1925d83c9321266df2a1722bcd718162e9..7ff0948db5e961fa53379ebea39e50c166aeb901 100644 (file)
@@ -20,6 +20,6 @@
   <%= label_tag :reassign, t(".reassign_param") %> <%= check_box_tag :reassign, true %>
   <br />
   <br />
-  <%= submit_tag "Submit" %>
+  <%= f.submit %>
   <% end %>
 </div>
index 532f3d71ee335558f36dce2004ad04d23193d233..2429feb52b9f255e5828d94ade93e8b4a19d37e3 100644 (file)
@@ -16,7 +16,7 @@
       <%= richtext_area :message, :body, :cols => 80, :rows => 20 %>
     </div>
     <div class='buttons'>
-      <%= submit_tag t(".send_button") %>
+      <%= f.submit %>
       <%= link_to t(".back_to_inbox"), inbox_messages_path, :class => "deemphasize button" %>
     </div>
   </fieldset>
index d6211778babec739bca6d21d0a76beb90cdc3c7f..d696baae3e336b07c21e31020a661319fb953078 100644 (file)
@@ -4,5 +4,5 @@
 
 <%= form_for @client_application, :url => oauth_client_path(@client_application.user.display_name, @client_application), :html => { :method => :put } do |f| %>
   <%= render :partial => "form", :locals => { :f => f } %>
-  <%= submit_tag t ".submit" %>
+  <%= f.submit %>
 <% end %>
index 0a49f48f88150946550cd7c8142181457a5aa08e..d9cc05d0224f9922143e055710f8b75531099f76 100644 (file)
@@ -3,8 +3,8 @@
 <% end %>
 
 <div class='standard-form'>
-  <%= form_for :client_application, :url => { :action => :create } do |f| %>
+  <%= form_for @client_application, :url => { :action => :create } do |f| %>
     <%= render :partial => "form", :locals => { :f => f } %>
-    <%= submit_tag t(".submit") %>
+    <%= f.submit %>
   <% end %>
 </div>
index 72676013ed3044ae8f7723a17a04655a7543b3b0..cef6188596d756f9c8709238725b7b6954edb640 100644 (file)
@@ -16,6 +16,6 @@
     <%= richtext_area :redaction, :description, :cols => 80, :rows => 20, :format => @redaction.description_format %>
   </p>
   <p>
-    <%= f.submit t(".submit") %>
+    <%= f.submit %>
   </p>
 <% end %>
index 9f2adac19adc483003807bb646af6f8f92fdd889..a76d8ec48d12e6f82650742c6d34a2fe5fe00dc1 100644 (file)
@@ -15,6 +15,6 @@
     <%= richtext_area :redaction, :description, :cols => 80, :rows => 20, :format => @redaction.description_format %>
   </p>
   <p>
-    <%= f.submit t(".submit") %>
+    <%= f.submit %>
   </p>
 <% end %>
index c17660db39757d40fbe11ab2dc3985bf843f9a87..2deae8ac2bbe82e1a1ca5ae27e8a5b528fd700e0 100644 (file)
@@ -50,6 +50,6 @@
 
 </div>
 
-<%= submit_tag t ".save_button" %>
+<%= f.submit %>
 
 <% end %>
index 51cd1630819b1d826e92c0e8d6763861ca7b203d..fc6a9f1a9aeda4bc56a16df61a2be40f3e778e7a 100644 (file)
@@ -27,7 +27,7 @@
       </div>
     </fieldset>
 
-    <%= submit_tag t(".upload_button") %>
+    <%= f.submit %>
     <span class="form-help deemphasize"><a href="<%= t ".help_url" %>"><%= t ".help" %></a></span>
   </div>
 <% end %>
index 6f0ea991bc49a41e7893a42e373cf153993939e0..88d7e4f23462feec3d75ab4954a6b6905f94ca97 100644 (file)
@@ -25,6 +25,6 @@
     <%= f.label :needs_view, t(".needs_view") %>
   </p>
   <p>
-    <%= f.submit t(".submit") %>
+    <%= f.submit %>
   </p>
 <% end %>
index aa4bf7132107f85253ca7ba5b027175caab2a4a2..bd492a354b00d38a736330899340cd02c565d329 100644 (file)
@@ -21,7 +21,7 @@
   </p>
   <p>
     <%= hidden_field_tag "display_name", @user.display_name %>
-    <%= f.submit t(".submit") %>
+    <%= f.submit %>
   </p>
 <% end %>
 
index 6426ee56bbac8c8d89908f6156f0c94f14ddf8b0..d7127a4e9321601fc9e25b4000624728de06c871 100644 (file)
@@ -7,9 +7,27 @@ en:
       blog: "%e %B %Y"
   helpers:
     submit:
+      diary_comment:
+        create: Save
       diary_entry:
         create: "Publish"
         update: "Update"
+      issue_comment:
+        create: Add Comment
+      message:
+        create: Send
+      client_application:
+        create: Register
+        update: Edit
+      redaction:
+        create: Create redaction
+        update: Save redaction
+      trace:
+        create: Upload
+        update: Save Changes
+      user_block:
+        create: Create block
+        update: Update block
   activerecord:
     errors:
       messages:
@@ -316,7 +334,6 @@ en:
       leave_a_comment: "Leave a comment"
       login_to_leave_a_comment: "%{login_link} to leave a comment"
       login: "Login"
-      save_button: "Save"
     no_such_entry:
       title: "No such diary entry"
       heading: "No entry with the id: %{id}"
@@ -1228,7 +1245,6 @@ en:
       send_message_to: "Send a new message to %{name}"
       subject: "Subject"
       body: "Body"
-      send_button: "Send"
       back_to_inbox: "Back to inbox"
     create:
       message_sent: "Message sent"
@@ -1745,7 +1761,6 @@ en:
       visibility: "Visibility:"
       visibility_help: "what does this mean?"
       visibility_help_url: "https://wiki.openstreetmap.org/wiki/Visibility_of_GPS_traces"
-      upload_button: "Upload"
       help: "Help"
       help_url: "https://wiki.openstreetmap.org/wiki/Upload"
     create:
@@ -1769,7 +1784,6 @@ en:
       description: "Description:"
       tags: "Tags:"
       tags_help: "comma delimited"
-      save_button: "Save Changes"
       visibility: "Visibility:"
       visibility_help: "what does this mean?"
       visibility_help_url: "https://wiki.openstreetmap.org/wiki/Visibility_of_GPS_traces"
@@ -1881,10 +1895,8 @@ en:
   oauth_clients:
     new:
       title: "Register a new application"
-      submit: "Register"
     edit:
       title: "Edit your application"
-      submit: "Edit"
     show:
       title: "OAuth details for %{app_name}"
       key: "Consumer Key:"
@@ -2287,7 +2299,6 @@ en:
       heading: "Creating block on %{name}"
       reason: "The reason why %{name} is being blocked. Please be as calm and as reasonable as possible, giving as much detail as you can about the situation, remembering that the message will be publicly visible. Bear in mind that not all users understand the community jargon, so please try to use laymans terms."
       period: "How long, starting now, the user will be blocked from the API for."
-      submit: "Create block"
       tried_contacting: "I have contacted the user and asked them to stop."
       tried_waiting: "I have given a reasonable amount of time for the user to respond to those communications."
       needs_view: "User needs to log in before this block will be cleared"
@@ -2297,7 +2308,6 @@ en:
       heading: "Editing block on %{name}"
       reason: "The reason why %{name} is being blocked. Please be as calm and as reasonable as possible, giving as much detail as you can about the situation. Bear in mind that not all users understand the community jargon, so please try to use laymans terms."
       period: "How long, starting now, the user will be blocked from the API for."
-      submit: "Update block"
       show: "View this block"
       back: "View all blocks"
       needs_view: "Does the user need to log in before this block will be cleared?"
@@ -2572,7 +2582,6 @@ en:
     edit:
       description: "Description"
       heading: "Edit redaction"
-      submit: "Save redaction"
       title: "Edit redaction"
     index:
       empty: "No redactions to show."
@@ -2581,7 +2590,6 @@ en:
     new:
       description: "Description"
       heading: "Enter information for new redaction"
-      submit: "Create redaction"
       title: "Creating new redaction"
     show:
       description: "Description:"
index 0f46ad3ec3df946d66b18cbb23b8068b94d5c9f3..60322763e133b329d8cfb4e23a018ba05b75cabb 100644 (file)
@@ -18,4 +18,10 @@ class ApplicationSystemTestCase < ActionDispatch::SystemTestCase
       .to_return(:status => 404)
     super(*args)
   end
+
+  # Phantomjs can pick up browser Accept-Language preferences from your desktop environment.
+  # We don't want this to happen during the tests!
+  setup do
+    page.driver.add_headers("Accept-Language" => "en")
+  end
 end
index f2421599f9fc657f72aba5b90871623ef3f0e10c..08b1acb3460d1f7a7135d4bb0980771a2b887a15 100644 (file)
@@ -78,7 +78,7 @@ class IssuesTest < ApplicationSystemTestCase
     visit issue_path(issue)
 
     fill_in :issue_comment_body, :with => "test comment"
-    click_on "Submit"
+    click_on "Add Comment"
     assert page.has_content?(I18n.t("issue_comments.create.comment_created"))
     assert page.has_content?("test comment")
 
@@ -95,7 +95,7 @@ class IssuesTest < ApplicationSystemTestCase
 
     fill_in :issue_comment_body, :with => "reassigning to moderators"
     check :reassign
-    click_on "Submit"
+    click_on "Add Comment"
 
     issue.reload
     assert_equal "moderator", issue.assigned_role