From: Andy Allan Date: Thu, 12 Aug 2021 14:59:07 +0000 (+0100) Subject: Refactor the profile page to move the profile information out of the header X-Git-Tag: live~1933^2~7 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/3f8cf322723750aa4c8d062d4a727f9107ceccb4 Refactor the profile page to move the profile information out of the header This makes it look like other normal pages, along with removing the unusual full-width class. --- diff --git a/app/assets/stylesheets/common.scss b/app/assets/stylesheets/common.scss index 42090e733..16624dda1 100644 --- a/app/assets/stylesheets/common.scss +++ b/app/assets/stylesheets/common.scss @@ -1096,17 +1096,6 @@ tr.turn:hover { /* Rules for the user profile page */ -#userinformation { - min-height: 100px; - .userinformation-inner { - float: left; - } - .user-description { - width: 100%; - clear: both; - } -} - .admin-user-info small { margin-bottom: $lineheight/2; display: inline; diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index 95abbdc3c..0ea411811 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -1,7 +1,9 @@ <% content_for :heading do %> -
- <%= user_image @user %> -
+
+
+ <%= user_image @user, :class => "" %> +
+

<%= @user.display_name %> <%= role_icons(@user) %>

<% if current_user and @user.id == current_user.id %> @@ -108,45 +110,8 @@ <% end %> - <% end %> - <% if can?(:set_status, User) || can?(:destroy, User) %> - -
    - <% if can? :set_status, User %> - <% if ["active", "confirmed"].include? @user.status %> -
  • - <%= link_to t(".deactivate_user"), set_status_user_path(:status => "pending", :display_name => @user.display_name), :method => :post, :data => { :confirm => t(".confirm") } %> -
  • - <% elsif ["pending"].include? @user.status %> -
  • - <%= link_to t(".activate_user"), set_status_user_path(:status => "active", :display_name => @user.display_name), :method => :post, :data => { :confirm => t(".confirm") } %> -
  • - <% end %> - - <% if ["active", "suspended"].include? @user.status %> -
  • - <%= link_to t(".confirm_user"), set_status_user_path(:status => "confirmed", :display_name => @user.display_name), :method => :post, :data => { :confirm => t(".confirm") } %> -
  • - <% end %> -
  • - <% if ["pending", "active", "confirmed", "suspended"].include? @user.status %> - <%= link_to t(".hide_user"), set_status_user_path(:status => "deleted", :display_name => @user.display_name), :method => :post, :data => { :confirm => t(".confirm") } %> - <% else %> - <%= link_to t(".unhide_user"), set_status_user_path(:status => "active", :display_name => @user.display_name), :method => :post, :data => { :confirm => t(".confirm") } %> -
  • - <% end %> - <% end %> - <% if can? :destroy, User %> -
  • - <%= link_to t(".delete_user"), user_path(:display_name => @user.display_name), :method => :delete, :data => { :confirm => t(".confirm") } %> -
  • - <% end %> -
- - <% end %> -

<%= t ".mapper since" %> <%= l @user.creation_time.to_date, :format => :long %> @@ -162,16 +127,41 @@

+
-
<%= @user.description.to_html %>
- - <% if current_user and @user.id == current_user.id %> -
- <%= link_to t(".edit_profile"), edit_profile_path, :class => "btn btn-outline-primary" %> -
- <% end %> + <% if can?(:set_status, User) || can?(:destroy, User) %> +
    + <% if can? :set_status, User %> + <% if ["active", "confirmed"].include? @user.status %> +
  • + <%= link_to t(".deactivate_user"), set_status_user_path(:status => "pending", :display_name => @user.display_name), :method => :post, :data => { :confirm => t(".confirm") } %> +
  • + <% elsif ["pending"].include? @user.status %> +
  • + <%= link_to t(".activate_user"), set_status_user_path(:status => "active", :display_name => @user.display_name), :method => :post, :data => { :confirm => t(".confirm") } %> +
  • + <% end %> -
+ <% if ["active", "suspended"].include? @user.status %> +
  • + <%= link_to t(".confirm_user"), set_status_user_path(:status => "confirmed", :display_name => @user.display_name), :method => :post, :data => { :confirm => t(".confirm") } %> +
  • + <% end %> +
  • + <% if ["pending", "active", "confirmed", "suspended"].include? @user.status %> + <%= link_to t(".hide_user"), set_status_user_path(:status => "deleted", :display_name => @user.display_name), :method => :post, :data => { :confirm => t(".confirm") } %> + <% else %> + <%= link_to t(".unhide_user"), set_status_user_path(:status => "active", :display_name => @user.display_name), :method => :post, :data => { :confirm => t(".confirm") } %> +
  • + <% end %> + <% end %> + <% if can? :destroy, User %> +
  • + <%= link_to t(".delete_user"), user_path(:display_name => @user.display_name), :method => :delete, :data => { :confirm => t(".confirm") } %> +
  • + <% end %> + + <% end %> <% if current_user and current_user.administrator? -%> <% end -%> +<% end %> +
    <%= @user.description.to_html %>
    + +<% if current_user and @user.id == current_user.id %> +
    + <%= link_to t(".edit_profile"), edit_profile_path, :class => "btn btn-outline-primary" %> +
    <% end %>