Skip to content

Commit

Permalink
Fix user profile avatar on his page
Browse files Browse the repository at this point in the history
  • Loading branch information
Yannick Francois committed Oct 14, 2013
1 parent 8810556 commit 638b519
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 23 deletions.
28 changes: 14 additions & 14 deletions app/helpers/application_helper.rb
Expand Up @@ -82,22 +82,22 @@ def html(content, what = :all, deprecated = false)

def display_user_avatar(user, size='avatar', klass='alignleft')
if user.resource.present?
avatar = case size
when 'thumb'
user.resource.upload.thumb.url
when 'medium'
user.resource.upload.medium.url
when 'large'
user.resource.upload.large.url
else
user.resource.upload.avatar.url
end
avatar_path = case size
when 'thumb'
user.resource.upload.thumb.url
when 'medium'
user.resource.upload.medium.url
when 'large'
user.resource.upload.large.url
else
user.resource.upload.avatar.url
end
avatar_url = File.join(this_blog.base_url, avatar_path)
elsif user.twitter_profile_image.present?
avatar = user.twitter_profile_image.present?
avatar_url = user.twitter_profile_image
end

return unless avatar
image_tag(File.join(this_blog.base_url, avatar), :alt => user.nickname, :class => klass)
return unless avatar_url
image_tag(avatar_url, alt: user.nickname, class: klass)
end

def author_picture(status)
Expand Down
13 changes: 4 additions & 9 deletions app/views/admin/profiles/index.html.erb
@@ -1,12 +1,7 @@
<%- content_for :page_heading do %>
<i class="icon-large icon-profile"></i><h2 class="page-title"><%= _("Your profile") %></h2>
:q


:q


<i class="icon-large icon-profile"></i>
<h2 class="page-title"><%= _("Your profile") %></h2>
<% end %>
<%= form_tag({:action => 'index', :id => @user.id}, {:enctype => "multipart/form-data"}) %>
<%= render :partial => "admin/users/form" %>
<%= form_tag({action: 'index', id: @user.id}, {enctype: "multipart/form-data"}) %>
<%= render partial: "admin/users/form" %>

0 comments on commit 638b519

Please sign in to comment.