From: Anton Khorev Date: Wed, 10 Jul 2024 14:20:30 +0000 (+0300) Subject: Merge branch 'pull/4957' X-Git-Tag: live~620 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/aad7dc3d24393a2575712dd1f1113774f427de85?hp=f2ca25b75c57ab772a8f9063bea82a6bc43fed78 Merge branch 'pull/4957' --- diff --git a/app/assets/images/banners/StateoftheMapEurope_2024.png b/app/assets/images/banners/StateoftheMapEurope_2024.png index d0d1cee62..2f35f7b98 100644 Binary files a/app/assets/images/banners/StateoftheMapEurope_2024.png and b/app/assets/images/banners/StateoftheMapEurope_2024.png differ diff --git a/app/helpers/user_helper.rb b/app/helpers/user_helper.rb index 3e779a00c..26ba2c528 100644 --- a/app/helpers/user_helper.rb +++ b/app/helpers/user_helper.rb @@ -64,7 +64,7 @@ module UserHelper :size => "36"), auth_path(options.merge(:provider => provider)), :method => :post, - :class => "auth_button btn btn-light p-2 d-block", + :class => "auth_button btn btn-light p-2", :title => t("application.auth_providers.#{name}.title") ) end diff --git a/app/views/application/_auth_providers.html.erb b/app/views/application/_auth_providers.html.erb index e3e5123cc..d2ff6865f 100644 --- a/app/views/application/_auth_providers.html.erb +++ b/app/views/application/_auth_providers.html.erb @@ -1,5 +1,5 @@
-
+
<% prefered_auth_button_available = false %> <% %w[google facebook microsoft github wikipedia].each do |provider| %> @@ -11,7 +11,7 @@ <% end -%> <% if prefered_auth_button_available %> -
+
<% %w[google facebook microsoft github wikipedia].each do |provider| %> <% if Settings.key?("#{provider}_auth_id".to_sym) -%> <% if @preferred_auth_provider == provider %> @@ -20,9 +20,9 @@ <% end -%> <% end -%>
-
+
<% else %> -
+
<% end %> <%= link_to image_tag("openid.svg", @@ -31,7 +31,7 @@ "#", :id => "openid_open_url", :title => t("application.auth_providers.openid.title"), - :class => "btn btn-light p-2 d-block" %> + :class => "btn btn-light p-2" %> <% %w[google facebook microsoft github wikipedia].each do |provider| %> <% unless @preferred_auth_provider == provider %> @@ -48,7 +48,7 @@
<%= hidden_field_tag("referer", params[:referer], :autocomplete => "off") %> - <%= text_field_tag("openid_url", "", :tabindex => 20, :autocomplete => "on", :class => "openid_url form-control") %> + <%= text_field_tag("openid_url", "", :tabindex => 20, :autocomplete => "on", :class => "form-control") %> (" target="_new"><%= t "accounts.edit.openid.link text" %>)
diff --git a/app/views/sessions/new.html.erb b/app/views/sessions/new.html.erb index 52e014442..9d05d4af8 100644 --- a/app/views/sessions/new.html.erb +++ b/app/views/sessions/new.html.erb @@ -22,35 +22,33 @@
<% end %> -
- <% if @preferred_auth_provider %> - <%= render :partial => "auth_providers" %> - <%= render :partial => "shared/section_divider", :locals => { :text => t(".or") } %> +<% if @preferred_auth_provider %> + <%= render :partial => "auth_providers" %> + <%= render :partial => "shared/section_divider", :locals => { :text => t(".or") } %> <% end %> - <%= bootstrap_form_tag(:action => "login", :html => { :id => "login_form" }) do |f| %> - <%= hidden_field_tag("referer", h(params[:referer]), :autocomplete => "off") %> +<%= bootstrap_form_tag(:action => "login", :html => { :id => "login_form" }) do |f| %> + <%= hidden_field_tag("referer", h(params[:referer]), :autocomplete => "off") %> - <%= f.text_field :username, :label => t(".email or username"), :autofocus => true, :tabindex => 1, :value => params[:username] %> + <%= f.text_field :username, :label => t(".email or username"), :autofocus => true, :tabindex => 1, :value => params[:username] %> -
- <%= f.label :password, t(".password") %> - <%= link_to(t(".lost password link"), user_forgot_password_path) %> -
- - <%= f.password_field :password, :autocomplete => "on", :tabindex => 2, :value => "", :skip_label => true %> +
+ <%= f.label :password, t(".password") %> + <%= link_to(t(".lost password link"), user_forgot_password_path) %> +
- <%= f.form_group do %> - <%= f.check_box :remember_me, { :label => t(".remember"), :tabindex => 3, :checked => (params[:remember_me] == "yes") }, "yes" %> - <% end %> + <%= f.password_field :password, :autocomplete => "on", :tabindex => 2, :value => "", :skip_label => true %> -
- <%= f.primary t(".login_button"), :tabindex => 4 %> -
+ <%= f.form_group do %> + <%= f.check_box :remember_me, { :label => t(".remember"), :tabindex => 3, :checked => (params[:remember_me] == "yes") }, "yes" %> <% end %> - <% unless @preferred_auth_provider %> - <%= render :partial => "shared/section_divider", :locals => { :text => t(".with external") } %> - <%= render :partial => "auth_providers" %> - <% end %> -
+
+ <%= f.primary t(".login_button"), :tabindex => 4 %> +
+<% end %> + +<% unless @preferred_auth_provider %> + <%= render :partial => "shared/section_divider", :locals => { :text => t(".with external") } %> + <%= render :partial => "auth_providers" %> +<% end %> diff --git a/app/views/users/blocked.html.erb b/app/views/users/blocked.html.erb index a3ef3429b..a5fb08a34 100644 --- a/app/views/users/blocked.html.erb +++ b/app/views/users/blocked.html.erb @@ -12,7 +12,5 @@
<% end %> -
-

<%= t "users.new.no_auto_account_create" %>

-

<%= t "users.new.please_contact_support_html", :support_link => mail_to(Settings.support_email, t("users.new.support")) %>

-
+

<%= t "users.new.no_auto_account_create" %>

+

<%= t "users.new.please_contact_support_html", :support_link => mail_to(Settings.support_email, t("users.new.support")) %>

diff --git a/app/views/users/new.html.erb b/app/views/users/new.html.erb index d2f1d27de..37493418a 100644 --- a/app/views/users/new.html.erb +++ b/app/views/users/new.html.erb @@ -22,79 +22,77 @@
<% end %> -
- <% if current_user.auth_uid.nil? %> -
-

<%= t ".about.header" %> <%= t ".about.paragraph_1" %>

-

<%= t ".about.paragraph_2" %>

-
+<% if current_user.auth_uid.nil? %> +
+

<%= t ".about.header" %> <%= t ".about.paragraph_1" %>

+

<%= t ".about.paragraph_2" %>

+
- <% unless @preferred_auth_provider.nil? %> - <%= render :partial => "auth_providers" %> - <%= render :partial => "shared/section_divider", :locals => { :text => t(".or") } %> -<% end %> - <% else %> -

<%= t ".about.welcome" %>

+ <% unless @preferred_auth_provider.nil? %> + <%= render :partial => "auth_providers" %> + <%= render :partial => "shared/section_divider", :locals => { :text => t(".or") } %> <% end %> +<% else %> +

<%= t ".about.welcome" %>

+<% end %> - <%= bootstrap_form_for current_user, :url => { :action => "create" } do |f| %> - <%= hidden_field_tag("referer", h(@referer)) unless @referer.nil? %> - <%= hidden_field_tag("email_hmac", h(@email_hmac)) unless @email_hmac.nil? %> - <%= f.hidden_field :auth_provider unless current_user.auth_provider.nil? %> - <%= f.hidden_field :auth_uid unless current_user.auth_uid.nil? %> +<%= bootstrap_form_for current_user, :url => { :action => "create" } do |f| %> + <%= hidden_field_tag("referer", h(@referer)) unless @referer.nil? %> + <%= hidden_field_tag("email_hmac", h(@email_hmac)) unless @email_hmac.nil? %> + <%= f.hidden_field :auth_provider unless current_user.auth_provider.nil? %> + <%= f.hidden_field :auth_uid unless current_user.auth_uid.nil? %> - <% if current_user.auth_uid.nil? or @email_hmac.nil? or not current_user.errors[:email].empty? %> - <%= f.email_field :email, :help => t(".email_help.html", - :privacy_policy_link => link_to(t(".email_help.privacy_policy"), - t(".email_help.privacy_policy_url"), - :title => t(".email_help.privacy_policy_title"), - :target => :new)), - :autofocus => true, - :tabindex => 1 %> - <% else %> - <%= f.hidden_field :email %> - <% end %> + <% if current_user.auth_uid.nil? or @email_hmac.nil? or not current_user.errors[:email].empty? %> + <%= f.email_field :email, :help => t(".email_help.html", + :privacy_policy_link => link_to(t(".email_help.privacy_policy"), + t(".email_help.privacy_policy_url"), + :title => t(".email_help.privacy_policy_title"), + :target => :new)), + :autofocus => true, + :tabindex => 1 %> + <% else %> + <%= f.hidden_field :email %> + <% end %> - <%= f.text_field :display_name, :help => t(".display name description"), :tabindex => 2 %> + <%= f.text_field :display_name, :help => t(".display name description"), :tabindex => 2 %> - <% if current_user.auth_uid.nil? %> -
-
- <%= f.password_field :pass_crypt, :tabindex => 3 %> -
-
- <%= f.password_field :pass_crypt_confirmation, :tabindex => 4 %> -
+ <% if current_user.auth_uid.nil? %> +
+
+ <%= f.password_field :pass_crypt, :tabindex => 3 %> +
+
+ <%= f.password_field :pass_crypt_confirmation, :tabindex => 4 %>
- <% end %> - -

<%= t(".by_signing_up.html", - :tou_link => link_to(t("layouts.tou"), - "https://wiki.osmfoundation.org/wiki/Terms_of_Use", - :target => :new), - :privacy_policy_link => link_to(t(".by_signing_up.privacy_policy"), - t(".by_signing_up.privacy_policy_url"), - :title => t(".by_signing_up.privacy_policy_title"), - :target => :new), - :contributor_terms_link => link_to(t(".by_signing_up.contributor_terms"), - t(".by_signing_up.contributor_terms_url"), - :target => :new)) %>

- <%= f.form_group do %> - <%= f.check_box :consider_pd, - :tabindex => 5, - :label => t(".consider_pd_html", - :consider_pd_link => link_to(t(".consider_pd"), - t(".consider_pd_url"), - :target => :new)) %> - <% end %> - -
- <%= submit_tag(t(".continue"), :name => "continue", :id => "continue", :class => "btn btn-primary", :tabindex => 6) %>
<% end %> - <% if current_user.auth_uid.nil? and @preferred_auth_provider.nil? %> - <%= render :partial => "shared/section_divider", :locals => { :text => t(".use external auth") } %> - <%= render :partial => "auth_providers" %> +

<%= t(".by_signing_up.html", + :tou_link => link_to(t("layouts.tou"), + "https://wiki.osmfoundation.org/wiki/Terms_of_Use", + :target => :new), + :privacy_policy_link => link_to(t(".by_signing_up.privacy_policy"), + t(".by_signing_up.privacy_policy_url"), + :title => t(".by_signing_up.privacy_policy_title"), + :target => :new), + :contributor_terms_link => link_to(t(".by_signing_up.contributor_terms"), + t(".by_signing_up.contributor_terms_url"), + :target => :new)) %>

+ <%= f.form_group do %> + <%= f.check_box :consider_pd, + :tabindex => 5, + :label => t(".consider_pd_html", + :consider_pd_link => link_to(t(".consider_pd"), + t(".consider_pd_url"), + :target => :new)) %> <% end %> -
+ +
+ <%= submit_tag(t(".continue"), :name => "continue", :id => "continue", :class => "btn btn-primary", :tabindex => 6) %> +
+<% end %> + +<% if current_user.auth_uid.nil? and @preferred_auth_provider.nil? %> + <%= render :partial => "shared/section_divider", :locals => { :text => t(".use external auth") } %> + <%= render :partial => "auth_providers" %> +<% end %> diff --git a/config/banners.yml b/config/banners.yml index bc5497a4c..2c8e1338a 100644 --- a/config/banners.yml +++ b/config/banners.yml @@ -11,7 +11,7 @@ donate_2023: sotmeu_2024: id: sotmeu_2024 alt: State of the Map Europe 2024 - link: https://stateofthemap.eu/ + link: https://openstreetmap.org.pl/2024/sotm-eu-2024-community-tickets-70/ img: banners/StateoftheMapEurope_2024.png enddate: 2024-jul-18 sotmasia_2023: diff --git a/test/helpers/user_helper_test.rb b/test/helpers/user_helper_test.rb index a415bd029..eaf406a06 100644 --- a/test/helpers/user_helper_test.rb +++ b/test/helpers/user_helper_test.rb @@ -117,7 +117,7 @@ class UserHelperTest < ActionView::TestCase def test_auth_button button = auth_button("google", "google") img_tag = "\"Google" - assert_equal("#{img_tag}", button) + assert_equal("#{img_tag}", button) end private