]> git.openstreetmap.org Git - rails.git/commitdiff
Fix display of raw HTML in flash message
authorTom Hughes <tom@compton.nu>
Mon, 30 Nov 2015 08:56:26 +0000 (08:56 +0000)
committerTom Hughes <tom@compton.nu>
Mon, 30 Nov 2015 08:56:26 +0000 (08:56 +0000)
Fixes #1095

app/assets/stylesheets/common.scss
app/controllers/user_controller.rb
app/views/user/_auth_association.html.erb [new file with mode: 0644]
config/locales/en.yml

index f22450cea5ce6c792302a9f55058bf11e360e248..83ae35680fd7c3213d36e3267a0925d1a37720f1 100644 (file)
@@ -1820,6 +1820,19 @@ tr.turn:hover {
     display: inline-block;
     margin-left: $lineheight / 2;
     vertical-align: middle;
+
+    p {
+      margin-top: $lineheight * 0.5;
+      margin-bottom: $lineheight * 0.5;
+
+      &:first-child {
+        margin-top: 0px;
+      }
+
+      &:last-child {
+        margin-bottom: 0px;
+      }
+    }
   }
 }
 
index 37f9cd7c204d0c73a8a24ac97d23e60f8267792c..fca0e3be7250f9290aa2f5c69136b1ddf152f4ff 100644 (file)
@@ -213,7 +213,7 @@ class UserController < ApplicationController
                        :auth_provider => params[:auth_provider],
                        :auth_uid => params[:auth_uid])
 
-      flash.now[:notice] = t "user.new.auth association"
+      flash.now[:notice] = render_to_string :partial => "auth_association"
     else
       check_signup_allowed
     end
diff --git a/app/views/user/_auth_association.html.erb b/app/views/user/_auth_association.html.erb
new file mode 100644 (file)
index 0000000..abddf19
--- /dev/null
@@ -0,0 +1,3 @@
+<p><%= t "user.auth_association.heading" %></p>
+<p><%= t "user.auth_association.option_1" %></p>
+<p><%= t "user.auth_association.option_2" %></p>
index 32f4649dac62b0619bd04c33757577c8f5d97518..9027252f7e2f571030a949a46fe7bec79c858efd 100644 (file)
@@ -1785,16 +1785,6 @@ en:
       confirm password: "Confirm Password:"
       use external auth: "Alternatively, use a third party to login"
       auth no password: "With third party authentication a password is not required, but some extra tools or server may still need one."
-      auth association: |
-        <p>Your ID is not associated with a OpenStreetMap account yet.</p>
-        <ul>
-          <li>If you are new to OpenStreetMap, please create a new account using the form below.</li>
-          <li>
-            If you already have an account, you can login to your account
-            using your username and password and then associate the account
-            with your ID in your user settings.
-          </li>
-        </ul>
       continue: Sign Up
       terms accepted: "Thanks for accepting the new contributor terms!"
       terms declined: "We are sorry that you have decided to not accept the new Contributor Terms. For more information, please see <a href=\"%{url}\">this wiki page</a>."
@@ -2009,6 +1999,15 @@ en:
       no_authorization_code: No authorization code
       unknown_signature_algorithm: Unknown signature algorithm
       invalid_scope: Invalid scope
+    auth_association:
+      heading: Your ID is not associated with a OpenStreetMap account yet.
+      option_1: |
+        If you are new to OpenStreetMap, please create a new account
+        using the form below.
+      option_2: |
+        If you already have an account, you can login to your account
+        using your username and password and then associate the account
+        with your ID in your user settings.
   user_role:
     filter:
       not_an_administrator: "Only administrators can perform user role management, and you are not an administrator."