- <% if @user.image.nil? %>
- <%= hidden_field_tag "image_action", "new" %>
- <%= t 'user.account.new image' %><br /><%= file_column_field "user", "image" %><br /><span class="minorNote"><%= t 'user.account.image size hint' %></span>
- <% else %>
- <table id="accountImage">
- <tr>
- <td rowspan="3" valign="top"><%= image_tag url_for_file_column(@user, "image"), :class => "user_image" %></td>
- <td><%= radio_button_tag "image_action", "keep", true %></td>
- <td><%= t 'user.account.keep image' %></td>
- </tr>
- <tr>
- <td><%= radio_button_tag "image_action", "delete" %></td>
- <td><%= t 'user.account.delete image' %></td>
- </tr>
- <tr>
- <td><%= radio_button_tag "image_action", "new" %></td>
- <td><%= t 'user.account.replace image' %><br /><%= file_column_field "user", "image", :onchange => "$('image_action_new').checked = true" %><br /><span class="minorNote"><%= t 'user.account.image size hint' %></span></td>
- </tr>
- </table>
- <% end %>
+ <table id="accountImage">
+ <% if @user.image.file? %>
+ <tr>
+ <td rowspan="4" valign="top"><%= user_image @user %></td>
+ <td><%= radio_button_tag "image_action", "keep", !@user.image_use_gravatar %></td>
+ <td><%= t 'user.account.keep image' %></td>
+ </tr>
+ <tr>
+ <td><%= radio_button_tag "image_action", "delete" %></td>
+ <td><%= t 'user.account.delete image' %></td>
+ </tr>
+ <tr>
+ <td><%= radio_button_tag "image_action", "new" %></td>
+ <td><%= t 'user.account.replace image' %><br /><%= f.file_field :image, :onchange => "$('image_action_new').prop('checked', true)" %><br /><span class="minorNote"><%= t 'user.account.image size hint' %></span></td>
+ </tr>
+ <% else %>
+ <tr>
+ <td rowspan="2" valign="top"><%= user_image @user %></td>
+ <td><%= radio_button_tag "image_action", "new", !@user.image_use_gravatar %></td>
+ <td><%= t 'user.account.new image' %> <%= f.file_field :image %><br /><span class="minorNote"><%= t 'user.account.image size hint' %></span></td>
+ </tr>
+ <% end %>
+ <tr>
+ <td><%= radio_button_tag "image_action", "gravatar", @user.image_use_gravatar %></td>
+ <td><%= t 'user.account.gravatar.gravatar' %> <span class="minorNote">(<a href="<%= t 'user.account.gravatar.link' %>" target="_new"><%= t 'user.account.gravatar.link text' %></a>)</span></td>
+ </tr>
+ </table>