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)
+<%= 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? %>
+<%= 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 %>
<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 %>
-<% 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) %>