From f992df684fe4db936ee56c1e7d334eebfae40329 Mon Sep 17 00:00:00 2001 From: Go MAEDA Date: Sun, 19 May 2019 22:27:41 +0000 Subject: Small refactorization of avatar methods (#31391). * move existing methods from ApplicationHelper to a new helper file (AvatarsHelper) * change default avatar size from 50 to 24 because most of the avatars are using the size 24 * class 'gravatar' is always added and all custom classes are appended * added user name as default title for avatar images * added two new methods: @assignee_avatar@ and @author_avatar@ Patch by Marius BALTEANU. git-svn-id: http://svn.redmine.org/redmine/trunk@18175 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/views/activities/_activities.html.erb | 2 +- app/views/issues/_history.html.erb | 2 +- app/views/issues/show.html.erb | 4 ++-- app/views/messages/edit.html.erb | 2 +- app/views/messages/show.html.erb | 4 ++-- app/views/news/index.html.erb | 2 +- app/views/news/show.html.erb | 4 ++-- app/views/repositories/_changeset.html.erb | 2 +- 8 files changed, 11 insertions(+), 11 deletions(-) (limited to 'app/views') diff --git a/app/views/activities/_activities.html.erb b/app/views/activities/_activities.html.erb index 2a1f46cd7..aaeea76bc 100644 --- a/app/views/activities/_activities.html.erb +++ b/app/views/activities/_activities.html.erb @@ -4,7 +4,7 @@
<% sort_activity_events(events_by_day[day]).each do |e, in_group| -%>
<%= User.current.logged? && e.respond_to?(:event_author) && User.current == e.event_author ? 'me' : nil %>"> - <%= avatar(e.event_author, :size => "24") if e.respond_to?(:event_author) %> + <%= avatar(e.event_author) if e.respond_to?(:event_author) %> <%= format_time(e.event_datetime, false) %> <%= content_tag('span', e.project, :class => 'project') if @project.nil? || @project != e.project %> <%= link_to format_activity_title(e.event_title), e.event_url %> diff --git a/app/views/issues/_history.html.erb b/app/views/issues/_history.html.erb index aa8ecbf80..297771d7d 100644 --- a/app/views/issues/_history.html.erb +++ b/app/views/issues/_history.html.erb @@ -7,7 +7,7 @@ #<%= journal.indice %>

- <%= avatar(journal.user, :size => "24") %> + <%= avatar(journal.user) %> <%= authoring journal.created_on, journal.user, :label => :label_updated_time_by %> <%= render_private_notes_indicator(journal) %>

diff --git a/app/views/issues/show.html.erb b/app/views/issues/show.html.erb index 5a1cc8599..fc93afd9d 100644 --- a/app/views/issues/show.html.erb +++ b/app/views/issues/show.html.erb @@ -26,8 +26,8 @@ <% end %>
- <%= avatar(@issue.author, :size => "50", :title => l(:field_author)) %> - <%= avatar(@issue.assigned_to, :size => "22", :class => "gravatar gravatar-child", :title => l(:field_assigned_to)) if @issue.assigned_to %> + <%= author_avatar(@issue.author, :size => "50") %> + <%= assignee_avatar(@issue.assigned_to, :size => "22", :class => "gravatar-child") if @issue.assigned_to %>
diff --git a/app/views/messages/edit.html.erb b/app/views/messages/edit.html.erb index 063676197..559afc6bc 100644 --- a/app/views/messages/edit.html.erb +++ b/app/views/messages/edit.html.erb @@ -1,6 +1,6 @@ <%= board_breadcrumb(@message) %> -

<%= avatar(@topic.author, :size => "24") %><%= @topic.subject %>

+

<%= avatar(@topic.author) %><%= @topic.subject %>

<%= form_for @message, { :as => :message, diff --git a/app/views/messages/show.html.erb b/app/views/messages/show.html.erb index 5756a9267..893659d6f 100644 --- a/app/views/messages/show.html.erb +++ b/app/views/messages/show.html.erb @@ -22,7 +22,7 @@ ) if @message.destroyable_by?(User.current) %>
-

<%= avatar(@topic.author, :size => "24") %><%= @topic.subject %>

+

<%= avatar(@topic.author) %><%= @topic.subject %>

<%= authoring @topic.created_on, @topic.author %>

@@ -66,7 +66,7 @@ ) if message.destroyable_by?(User.current) %>

- <%= avatar(message.author, :size => "24") %> + <%= avatar(message.author) %> <%= link_to message.subject, { :controller => 'messages', :action => 'show', :board_id => @board, :id => @topic, :r => message, :anchor => "message-#{message.id}" } %> - <%= authoring message.created_on, message.author %> diff --git a/app/views/news/index.html.erb b/app/views/news/index.html.erb index cd51aa950..073099f56 100644 --- a/app/views/news/index.html.erb +++ b/app/views/news/index.html.erb @@ -24,7 +24,7 @@ <% @newss.each do |news| %>
-

<%= avatar(news.author, :size => "24") %><%= link_to_project(news.project) + ': ' unless news.project == @project %> +

<%= avatar(news.author) %><%= link_to_project(news.project) + ': ' unless news.project == @project %> <%= link_to h(news.title), news_path(news) %> <%= "(#{l(:label_x_comments, :count => news.comments_count)})" if news.comments_count > 0 %>

<%= authoring news.created_on, news.author %>

diff --git a/app/views/news/show.html.erb b/app/views/news/show.html.erb index d8d098cce..932bf0083 100644 --- a/app/views/news/show.html.erb +++ b/app/views/news/show.html.erb @@ -8,7 +8,7 @@ <%= delete_link news_path(@news) if User.current.allowed_to?(:manage_news, @project) %> -

<%= avatar(@news.author, :size => "24") %> <%=h @news.title %>

+

<%= avatar(@news.author) %> <%=h @news.title %>

<% if authorize_for('news', 'edit') %> -

<%= avatar(comment.author, :size => "24") %><%= authoring comment.created_on, comment.author %>

+

<%= avatar(comment.author) %><%= authoring comment.created_on, comment.author %>

<%= textilizable(comment.comments) %>
diff --git a/app/views/repositories/_changeset.html.erb b/app/views/repositories/_changeset.html.erb index 5809be241..393e03e56 100644 --- a/app/views/repositories/_changeset.html.erb +++ b/app/views/repositories/_changeset.html.erb @@ -2,7 +2,7 @@

- <%= avatar(@changeset.user, :size => "24") %> + <%= avatar(@changeset.user) %> <%= authoring(@changeset.committed_on, @changeset.author) %>

<% if @changeset.scmid.present? || @changeset.parents.present? || @changeset.children.present? %> -- cgit v1.2.3