From 8cdd6b6a1cd9d8c521fac1305bc42faab48bd08c Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Wed, 17 Oct 2012 13:05:05 +0100 Subject: [PATCH] Improve the user image selection UI --- app/assets/stylesheets/common.css.scss | 15 +++++++++++++-- app/views/user/account.html.erb | 17 ++++++++++------- 2 files changed, 23 insertions(+), 9 deletions(-) diff --git a/app/assets/stylesheets/common.css.scss b/app/assets/stylesheets/common.css.scss index bc5601113..a1099a153 100644 --- a/app/assets/stylesheets/common.css.scss +++ b/app/assets/stylesheets/common.css.scss @@ -928,8 +928,19 @@ p#contributorGuidance { border: 1px solid #ccc; } -#accountImage td { - padding-bottom: 0px; +#accountForm td.accountImage { + img { + vertical-align: top; + margin-top: 3px; + } + + table { + display: inline-block; + + td { + padding-bottom: 0px; + } + } } .nohome .location { diff --git a/app/views/user/account.html.erb b/app/views/user/account.html.erb index 7adea7c2c..179e1b2f6 100644 --- a/app/views/user/account.html.erb +++ b/app/views/user/account.html.erb @@ -84,27 +84,30 @@ <%= t 'user.account.image' %> - - +
+ <%= user_image @user %> + <% if @user.image.file? %> - + <% end %> + <% if @user.image.file? || @user.image_use_gravatar? %> + <% end %> + <% if @user.image.file? %> - + <% else %> - - - + + <% end %> -- 2.43.2
<%= user_image @user %> <%= radio_button_tag "image_action", "keep", !@user.image_use_gravatar %> <%= t 'user.account.keep image' %>
<%= radio_button_tag "image_action", "delete" %> <%= t 'user.account.delete image' %>
<%= radio_button_tag "image_action", "new" %><%= t 'user.account.replace image' %>
<%= f.file_field :image, :onchange => "$('image_action_new').prop('checked', true)" %>
<%= t 'user.account.image size hint' %>
<%= t 'user.account.replace image' %>
<%= f.file_field :image, :onchange => "$('#image_action_new').prop('checked', true)" %>
<%= t 'user.account.image size hint' %>
<%= user_image @user %><%= radio_button_tag "image_action", "new", !@user.image_use_gravatar %><%= t 'user.account.new image' %> <%= f.file_field :image %>
<%= t 'user.account.image size hint' %>
<%= radio_button_tag "image_action", "new" %><%= t 'user.account.new image' %>
<%= f.file_field :image, :onchange => "$('#image_action_new').prop('checked', true)" %>
<%= t 'user.account.image size hint' %>