From ee106c5fb0943b7b6e112328b19c61b9a1205e62 Mon Sep 17 00:00:00 2001 From: Suzanne Aitchison Date: Fri, 23 Apr 2021 19:42:36 +0100 Subject: [PATCH] add skip link to settings page (#13488) --- app/views/users/edit.html.erb | 174 +++++++++++++++++----------------- 1 file changed, 88 insertions(+), 86 deletions(-) diff --git a/app/views/users/edit.html.erb b/app/views/users/edit.html.erb index f13e0e668..ead1b4731 100644 --- a/app/views/users/edit.html.erb +++ b/app/views/users/edit.html.erb @@ -1,96 +1,98 @@ <% title "Settings" %> -<% if flash[:settings_notice] %> -
- <%= flash[:settings_notice] %> -
-<% end %> - -<% if flash[:error].present? %> - -<% end %> - -<% if params[:state] == "previous-registration" %> - -<% end %> - -
- <% if @tab == "organization" && @organizations.present? %> -

Settings for - -

- <% else %> -

- Settings for ">@<%= @user.username.truncate(User::USERNAME_MAX_LENGTH) %> -

+
+ <% if flash[:settings_notice] %> +
+ <%= flash[:settings_notice] %> +
<% end %> -
-
-
- -
- + <% options = @organizations.pluck(:slug, :id).each do |arr| %> + <% arr[0] = "@#{arr[0]}" %> + <% arr[1] = "/settings/organization/#{arr[1]}" %> + <% end.to_h.merge("New Organization" => "/settings/organization/new") %> + <%= options_for_select(options, "/settings/organization/#{params[:org_id]}") %> + <%# For example: %> + <%# %> + + + <% else %> +

+ Settings for ">@<%= @user.username.truncate(User::USERNAME_MAX_LENGTH) %> +

+ <% end %> +
+ +
+
+ +
+ +
+
+ +
+ <% if current_user.email.blank? %> +
+

Confirm your email to complete your profile.

+

+ While you're at it, go ahead and fill everything out. + <% if @user.twitter_username.blank? %> + Connect your twitter account as well to complete your identity. + <% elsif @user.github_username.blank? %> + Connect your github account as well to complete your identity. + <% end %> +

+
+ <% end %> + + <% if @user.unconfirmed_email.present? %> + + <% end %> + + <% if @user.errors.any? %> + <%= render partial: "users/errors", locals: { errors: @user.errors, title_suffix: "prohibited your profile from being saved" } %> + <% end %> + + <% if @organization&.errors&.any? %> + <%= render partial: "users/errors", locals: { errors: @organization.errors, title_suffix: "prohibited your organization profile from being saved" } %> + <% end %> + + <%= render "users/#{@tab.tr('-', '_')}", tab: @tab %>
- -
- <% if current_user.email.blank? %> -
-

Confirm your email to complete your profile.

-

- While you're at it, go ahead and fill everything out. - <% if @user.twitter_username.blank? %> - Connect your twitter account as well to complete your identity. - <% elsif @user.github_username.blank? %> - Connect your github account as well to complete your identity. - <% end %> -

-
- <% end %> - - <% if @user.unconfirmed_email.present? %> - - <% end %> - - <% if @user.errors.any? %> - <%= render partial: "users/errors", locals: { errors: @user.errors, title_suffix: "prohibited your profile from being saved" } %> - <% end %> - - <% if @organization&.errors&.any? %> - <%= render partial: "users/errors", locals: { errors: @organization.errors, title_suffix: "prohibited your organization profile from being saved" } %> - <% end %> - - <%= render "users/#{@tab.tr('-', '_')}", tab: @tab %> -