From ac5739982af584a98bd434a3271ae67bff9d2060 Mon Sep 17 00:00:00 2001 From: Marwin Hochfelsner <50826859+hlfan@users.noreply.github.com> Date: Mon, 26 May 2025 16:24:17 +0200 Subject: [PATCH] Store more icons separately --- app/assets/images/icons/company.svg | 3 +++ app/assets/images/icons/feed.svg | 4 ++++ app/assets/images/icons/gear.svg | 4 ++++ app/assets/images/icons/home_location.svg | 3 +++ app/assets/images/icons/language.svg | 3 +++ app/assets/images/icons/link.svg | 4 ++++ app/assets/images/icons/notice.svg | 3 +++ app/helpers/svg_helper.rb | 6 ------ app/views/accounts/deletions/show.html.erb | 2 +- app/views/changesets/show.html.erb | 7 +------ app/views/directions/show.html.erb | 6 +----- app/views/layouts/_flash.html.erb | 2 +- app/views/layouts/_select_language_button.html.erb | 11 ++++------- app/views/traces/index.html.erb | 9 +++------ app/views/users/show.html.erb | 10 ++-------- 15 files changed, 37 insertions(+), 40 deletions(-) create mode 100644 app/assets/images/icons/company.svg create mode 100644 app/assets/images/icons/feed.svg create mode 100644 app/assets/images/icons/gear.svg create mode 100644 app/assets/images/icons/home_location.svg create mode 100644 app/assets/images/icons/language.svg create mode 100644 app/assets/images/icons/link.svg create mode 100644 app/assets/images/icons/notice.svg diff --git a/app/assets/images/icons/company.svg b/app/assets/images/icons/company.svg new file mode 100644 index 000000000..a81a414db --- /dev/null +++ b/app/assets/images/icons/company.svg @@ -0,0 +1,3 @@ + + + diff --git a/app/assets/images/icons/feed.svg b/app/assets/images/icons/feed.svg new file mode 100644 index 000000000..6a8c70ed8 --- /dev/null +++ b/app/assets/images/icons/feed.svg @@ -0,0 +1,4 @@ + + + + diff --git a/app/assets/images/icons/gear.svg b/app/assets/images/icons/gear.svg new file mode 100644 index 000000000..c14fa7382 --- /dev/null +++ b/app/assets/images/icons/gear.svg @@ -0,0 +1,4 @@ + + + + diff --git a/app/assets/images/icons/home_location.svg b/app/assets/images/icons/home_location.svg new file mode 100644 index 000000000..19f6619c6 --- /dev/null +++ b/app/assets/images/icons/home_location.svg @@ -0,0 +1,3 @@ + + + diff --git a/app/assets/images/icons/language.svg b/app/assets/images/icons/language.svg new file mode 100644 index 000000000..eea81da58 --- /dev/null +++ b/app/assets/images/icons/language.svg @@ -0,0 +1,3 @@ + + + diff --git a/app/assets/images/icons/link.svg b/app/assets/images/icons/link.svg new file mode 100644 index 000000000..8692914d9 --- /dev/null +++ b/app/assets/images/icons/link.svg @@ -0,0 +1,4 @@ + + + + diff --git a/app/assets/images/icons/notice.svg b/app/assets/images/icons/notice.svg new file mode 100644 index 000000000..ed6afa11c --- /dev/null +++ b/app/assets/images/icons/notice.svg @@ -0,0 +1,3 @@ + + + diff --git a/app/helpers/svg_helper.rb b/app/helpers/svg_helper.rb index fe9e4727f..5daa176f7 100644 --- a/app/helpers/svg_helper.rb +++ b/app/helpers/svg_helper.rb @@ -1,10 +1,4 @@ module SvgHelper - def notice_svg_tag - path_data = "M 2 0 C 0.892 0 0 0.892 0 2 L 0 14 C 0 15.108 0.892 16 2 16 L 14 16 C 15.108 16 16 15.108 16 14 L 16 2 C 16 0.892 15.108 0 14 0 L 2 0 z M 7 3 L 9 3 L 9 8 L 7 8 L 7 3 z M 7 10 L 9 10 L 9 12 L 7 12 L 7 10 z" - path_tag = tag.path :d => path_data, :fill => "currentColor" - tag.svg path_tag, :width => 16, :height => 16 - end - def previous_page_svg_tag(**) adjacent_page_svg_tag(dir == "rtl" ? 1 : -1, **) end diff --git a/app/views/accounts/deletions/show.html.erb b/app/views/accounts/deletions/show.html.erb index 5a22aa67b..dd21894c0 100644 --- a/app/views/accounts/deletions/show.html.erb +++ b/app/views/accounts/deletions/show.html.erb @@ -6,7 +6,7 @@
- <%= notice_svg_tag %> + <%= inline_svg_tag "icons/notice.svg" %>

<%= t ".warning" %>

diff --git a/app/views/changesets/show.html.erb b/app/views/changesets/show.html.erb index 429ce55d2..a3d55b87a 100644 --- a/app/views/changesets/show.html.erb +++ b/app/views/changesets/show.html.erb @@ -50,12 +50,7 @@ :data => { :method => comment.visible ? "DELETE" : "POST", :url => api_changeset_comment_visibility_path(comment) } %> <% end %> - - - - - - + <%= link_to inline_svg_tag("icons/link.svg"), "#c#{comment.id}" %>
<%= comment.body.to_html %> diff --git a/app/views/directions/show.html.erb b/app/views/directions/show.html.erb index b460506cc..66a99d8de 100644 --- a/app/views/directions/show.html.erb +++ b/app/views/directions/show.html.erb @@ -55,11 +55,7 @@ diff --git a/app/views/layouts/_flash.html.erb b/app/views/layouts/_flash.html.erb index 3fb794856..50140b911 100644 --- a/app/views/layouts/_flash.html.erb +++ b/app/views/layouts/_flash.html.erb @@ -4,7 +4,7 @@ :data => { :turbo_temporary => true } do %>
- <%= notice_svg_tag %> + <%= inline_svg_tag "icons/notice.svg" %>
<%= render_flash flash[flash_type] %> diff --git a/app/views/layouts/_select_language_button.html.erb b/app/views/layouts/_select_language_button.html.erb index ccea4003b..4c656001e 100644 --- a/app/views/layouts/_select_language_button.html.erb +++ b/app/views/layouts/_select_language_button.html.erb @@ -1,8 +1,5 @@ -<%= tag.button :type => "button", +<%= tag.button (inline_svg_tag "icons/language.svg"), + :type => "button", :class => ["btn btn-outline-secondary px-2", *extra_classes], - :data => { :bs_toggle => "modal", :bs_target => "#select_language_dialog" } do %> - - <%= t ".title" %> - - -<% end %> + :title => t(".title"), + :data => { :bs_toggle => "modal", :bs_target => "#select_language_dialog" } %> diff --git a/app/views/traces/index.html.erb b/app/views/traces/index.html.erb index dfa5f03de..540e70d02 100644 --- a/app/views/traces/index.html.erb +++ b/app/views/traces/index.html.erb @@ -16,12 +16,9 @@
- <%= link_to traces_feed_path(:display_name => @target_user&.display_name, :tag => params[:tag]), - :class => "btn btn-secondary btn-sm" do %> - - - - <% end -%> + <%= link_to inline_svg_tag("icons/feed.svg", :class => "align-text-bottom"), + traces_feed_path(:display_name => @target_user&.display_name, :tag => params[:tag]), + :class => "btn btn-secondary btn-sm" %> <%= link_to t(".upload_trace"), new_trace_path, :class => "btn btn-secondary btn-sm" %>
diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index 24f86db9a..f9b0a61ed 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -250,10 +250,7 @@ :edit_title => t(".edit_location"), :edit_path => profile_location_path do %>