From 9bc94cba283d1999b6ed9b31194be7a986d56809 Mon Sep 17 00:00:00 2001 From: tohosaku Date: Sat, 15 Jan 2022 12:59:30 +0000 Subject: [PATCH 5/5] Replace tags with helper --- app/views/activities/_activities.html.erb | 12 ++++++------ app/views/admin/info.html.erb | 2 +- app/views/attachments/edit_all.html.erb | 2 +- app/views/boards/show.html.erb | 2 +- app/views/common/_calendar.html.erb | 4 ++-- app/views/custom_field_enumerations/index.html.erb | 2 +- app/views/issue_statuses/index.html.erb | 4 ++-- app/views/issues/_attributes.html.erb | 2 +- app/views/issues/index.html.erb | 4 ++-- app/views/messages/show.html.erb | 2 +- app/views/projects/_members_box.html.erb | 2 +- app/views/projects/index.html.erb | 4 ++-- app/views/projects/settings/_members.html.erb | 2 +- app/views/projects/settings/_versions.html.erb | 2 +- app/views/projects/show.html.erb | 12 ++++++------ app/views/roles/index.html.erb | 4 ++-- app/views/search/index.html.erb | 4 ++-- app/views/settings/_repositories.html.erb | 2 +- app/views/trackers/index.html.erb | 4 ++-- app/views/versions/index.html.erb | 4 +++- .../app/views/example/say_goodbye.html.erb | 2 +- .../app/views/example/say_hello.html.erb | 2 +- 22 files changed, 41 insertions(+), 39 deletions(-) diff --git a/app/views/activities/_activities.html.erb b/app/views/activities/_activities.html.erb index aaeea76bc..9eacf6d27 100644 --- a/app/views/activities/_activities.html.erb +++ b/app/views/activities/_activities.html.erb @@ -3,12 +3,12 @@

<%= format_activity_day(day) %>

<% 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) 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 %> -
+ <%= tag.dt class: [e.event_type, :icon, "icon-#{e.event_type}", ("grouped" if in_group), (User.current.logged? && e.respond_to?(:event_author) && User.current == e.event_author) ? 'me' : nil] do %> + <%= 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 %> + <% end %>
"><%= format_activity_description(e.event_description) %> <%= link_to_user(e.event_author) if e.respond_to?(:event_author) %>
<% end -%> diff --git a/app/views/admin/info.html.erb b/app/views/admin/info.html.erb index 2ff8de50d..2a342e643 100644 --- a/app/views/admin/info.html.erb +++ b/app/views/admin/info.html.erb @@ -6,7 +6,7 @@ <% @checklist.each do |label, result| %> <%= label.is_a?(Symbol) ? l(label) : label %> - + <%= tag.span class: ['icon-only', result ? 'icon-ok' : 'icon-error' ] %> <% end %> diff --git a/app/views/attachments/edit_all.html.erb b/app/views/attachments/edit_all.html.erb index 47ecc6a02..c2cfe132c 100644 --- a/app/views/attachments/edit_all.html.erb +++ b/app/views/attachments/edit_all.html.erb @@ -11,7 +11,7 @@ <% @attachments.each do |attachment| %> - <%= attachment.filename_was %> + <%= tag.span attachment.filename_was, class: 'icon icon-attachment' %> (<%= number_to_human_size attachment.filesize %>) <%= attachment.author %>, <%= format_time(attachment.created_on) %> diff --git a/app/views/boards/show.html.erb b/app/views/boards/show.html.erb index bc8c24c3d..f0e6db163 100644 --- a/app/views/boards/show.html.erb +++ b/app/views/boards/show.html.erb @@ -38,7 +38,7 @@ <% @topics.each do |topic| %> - <%= link_to topic.subject, board_message_path(@board, topic) %> + <%= tag.td link_to(topic.subject, board_message_path(@board, topic)), class: ['subject', 'icon', ('icon-sticky' if topic.sticky?), ('icon-locked' if topic.locked?)] %> <%= link_to_user(topic.author) %> <%= format_time(topic.created_on) %> <%= topic.replies_count %> diff --git a/app/views/common/_calendar.html.erb b/app/views/common/_calendar.html.erb index 63cb43c97..61f475f25 100644 --- a/app/views/common/_calendar.html.erb +++ b/app/views/common/_calendar.html.erb @@ -29,10 +29,10 @@ <%= check_box_tag 'ids[]', i.id, false, :style => 'display:none;', :id => nil %> <% else %> - + <%= tag.span(class: 'icon icon-package') do %> <%= "#{i.project} -" unless @project && @project == i.project %> <%= link_to_version i %> - + <% end %> <% end %> <% end %> diff --git a/app/views/custom_field_enumerations/index.html.erb b/app/views/custom_field_enumerations/index.html.erb index 83e9d59c9..fb942ded5 100644 --- a/app/views/custom_field_enumerations/index.html.erb +++ b/app/views/custom_field_enumerations/index.html.erb @@ -6,7 +6,7 @@