Add user images to diary view.
This commit is contained in:
parent
44fdad8478
commit
3e8d809250
5 changed files with 25 additions and 10 deletions
|
@ -49,6 +49,26 @@ module ApplicationHelper
|
|||
end
|
||||
end
|
||||
|
||||
def user_image(user, options = {})
|
||||
options[:class] ||= "user_image"
|
||||
|
||||
if user.image
|
||||
image_tag url_for_file_column(user, "image"), options
|
||||
else
|
||||
image_tag "anon_large.png", options
|
||||
end
|
||||
end
|
||||
|
||||
def user_thumbnail(user, options = {})
|
||||
options[:class] ||= "user_thumbnail"
|
||||
|
||||
if user.image
|
||||
image_tag url_for_file_column(user, "image"), options
|
||||
else
|
||||
image_tag "anon_small.png", options
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def javascript_strings_for_key(key)
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
<%= user_thumbnail diary_comment.user, :style => "float: right" %>
|
||||
<h4 id="comment<%= diary_comment.id %>"><%= t('diary_entry.diary_comment.comment_from', :link_user => (link_to h(diary_comment.user.display_name), :controller => 'user', :action => 'view', :display_name => diary_comment.user.display_name), :comment_created_at => l(diary_comment.created_at)) %></h4>
|
||||
<%= htmlize(diary_comment.body) %>
|
||||
<% if @user && @user.administrator? %>
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
<%= user_image @entry.user, :style => "float: right" %>
|
||||
|
||||
<h2><%= t 'diary_entry.view.user_title', :user => h(@entry.user.display_name) %></h2>
|
||||
|
||||
<%= render :partial => 'diary_entry', :object => @entry %>
|
||||
|
|
|
@ -1,10 +1,6 @@
|
|||
<tr>
|
||||
<td rowspan="2">
|
||||
<% if contact.image %>
|
||||
<%= image_tag url_for_file_column(contact, "image"), :class => "user_thumbnail" %>
|
||||
<% else %>
|
||||
<%= image_tag "anon_small.png", :class => "user_thumbnail" %>
|
||||
<% end %>
|
||||
<%= user_thumbnail contact %>
|
||||
</td>
|
||||
<td>
|
||||
<%= link_to h(contact.display_name), :controller => 'user', :action => 'view', :display_name => contact.display_name %>
|
||||
|
|
|
@ -1,8 +1,4 @@
|
|||
<% if @this_user.image %>
|
||||
<%= image_tag url_for_file_column(@this_user, "image"), :style => "float: right; margin-top: 19px", :class => "user_image" %>
|
||||
<% else %>
|
||||
<%= image_tag "anon_large.png", :style => "float: right; margin-top: 19px", :class => "user_image" %>
|
||||
<% end %>
|
||||
<%= user_image @this_user, :style => "float: right" %>
|
||||
|
||||
<h2><%= h(@this_user.display_name) %>
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue