From 27f7abcf9a60acae7554f958a93970f3e5f9c552 Mon Sep 17 00:00:00 2001 From: ishikawa999 Date: Fri, 20 Dec 2024 07:22:33 +0000 Subject: [PATCH] Replace legacy icons on search results pages with svg icons --- app/assets/images/icons.svg | 16 ++++++++++++++++ app/assets/stylesheets/application.css | 2 +- app/views/search/index.html.erb | 3 ++- config/icon_source.yml | 4 ++++ 4 files changed, 23 insertions(+), 2 deletions(-) diff --git a/app/assets/images/icons.svg b/app/assets/images/icons.svg index 3bd8ae53b..87d0ee6e8 100644 --- a/app/assets/images/icons.svg +++ b/app/assets/images/icons.svg @@ -275,6 +275,11 @@ + + + + + @@ -295,6 +300,17 @@ + + + + + + + + + + + diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index 4e4b171fd..bdd571e8c 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -1847,7 +1847,7 @@ span.icon-label { .open .icon-folder:not(:has(svg)) { background-image: url(/folder_open.png); } .icon-package:not(:has(svg)) { background-image: url(/package.png); } .icon-user:not(:has(svg)) { background-image: url(/user.png); } -.icon-project, .icon-projects:not(:has(svg)) { background-image: url(/projects.png); } +.icon-project:not(:has(svg)), .icon-projects:not(:has(svg)) { background-image: url(/projects.png); } .icon-help:not(:has(svg)) { background-image: url(/help.png); } .icon-attachment:not(:has(svg)) { background-image: url(/attachment.png); } .icon-history:not(:has(svg)) { background-image: url(/history.png); } diff --git a/app/views/search/index.html.erb b/app/views/search/index.html.erb index ce7887a9d..7b5fc4f36 100644 --- a/app/views/search/index.html.erb +++ b/app/views/search/index.html.erb @@ -51,12 +51,13 @@

<%= l(:label_result_plural) %> (<%= @result_count %>)

<% if @result_count_by_type['issues'].to_i > 0 && @search_attachments == '0' %>

- <%= link_to l(:button_apply_issues_filter), issues_filter_path(@question, projects_scope: params[:scope], all_words: @all_words, titles_only: @titles_only, open_issues: @open_issues), :class => 'icon icon-list' %> + <%= link_to sprite_icon('list', l(:button_apply_issues_filter)), issues_filter_path(@question, projects_scope: params[:scope], all_words: @all_words, titles_only: @titles_only, open_issues: @open_issues), :class => 'icon icon-list' %>

<% end %>
<% @results.each do |e| %>
+ <%= sprite_icon(e.event_type) %> <%= content_tag('span', e.project, :class => 'project') unless @project == e.project %> <%= link_to(highlight_tokens(e.event_title.truncate(255), @tokens), e.event_url) %>
diff --git a/config/icon_source.yml b/config/icon_source.yml index 92ea716b1..bb61da387 100644 --- a/config/icon_source.yml +++ b/config/icon_source.yml @@ -115,6 +115,8 @@ svg: refresh - name: projects svg: packages +- name: project + svg: packages - name: package svg: package - name: custom-fields @@ -131,6 +133,8 @@ svg: message - name: comment svg: message +- name: message + svg: message - name: arrow-right svg: arrow-big-right - name: wiki-page -- 2.47.1