Skip to content

Commit

Permalink
Replace legacy icons on search results pages with SVG icons (#42023).
Browse files Browse the repository at this point in the history
Patch by Mizuki ISHIKAWA (user:ishikawa999).


git-svn-id: https://svn.redmine.org/redmine/trunk@23416 e93f8b46-1217-0410-a6f0-8f06a7374b81
  • Loading branch information
vividtone committed Dec 22, 2024
1 parent 3d51645 commit 69f86f8
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 2 deletions.
20 changes: 20 additions & 0 deletions app/assets/images/icons.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion app/assets/stylesheets/application.css
Original file line number Diff line number Diff line change
Expand Up @@ -1850,7 +1850,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); }
Expand Down
3 changes: 2 additions & 1 deletion app/views/search/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,13 @@
<h3><%= l(:label_result_plural) %> (<%= @result_count %>)</h3>
<% if @result_count_by_type['issues'].to_i > 0 && @search_attachments == '0' %>
<p class="buttons">
<%= 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' %>
</p>
<% end %>
<dl id="search-results">
<% @results.each do |e| %>
<dt class="<%= e.event_type %> icon icon-<%= e.event_type %>">
<%= 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) %>
</dt>
Expand Down
6 changes: 6 additions & 0 deletions config/icon_source.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@
svg: refresh
- name: projects
svg: packages
- name: project
svg: packages
- name: package
svg: package
- name: custom-fields
Expand All @@ -131,6 +133,10 @@
svg: message
- name: comment
svg: message
- name: message
svg: message
- name: reply
svg: messages
- name: arrow-right
svg: arrow-big-right
- name: wiki-page
Expand Down

0 comments on commit 69f86f8

Please sign in to comment.