diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index af79c4b80..4ceb92d12 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -2,4 +2,8 @@ module ApplicationHelper def page_title_tag tag.title @page_title || "Fizzy" end + + def icon_tag(name, aria: { hidden: true }, size: 24, **options) + image_tag "#{name}.svg", aria: aria, size: size, **options + end end diff --git a/app/views/accounts/users/_invite.html.erb b/app/views/accounts/users/_invite.html.erb index f18982dd4..37128deb4 100644 --- a/app/views/accounts/users/_invite.html.erb +++ b/app/views/accounts/users/_invite.html.erb @@ -20,7 +20,7 @@
diff --git a/app/views/accounts/users/_user.html.erb b/app/views/accounts/users/_user.html.erb index 2abb9b665..bf377bc33 100644 --- a/app/views/accounts/users/_user.html.erb +++ b/app/views/accounts/users/_user.html.erb @@ -17,7 +17,7 @@ <%= button_to account_user_path(user), method: :delete, class: "btn btn--small btn--negative flex-item-no-shrink", disabled: !Current.user.can_remove?(user), data: { turbo_confirm: "Are you sure you want to permanently remove this person from the account?" } do %> - <%= image_tag "minus.svg", aria: { hidden: true }, size: 24 %> + <%= icon_tag "minus" %> Remove <%= user.name %> from the account <% end %> diff --git a/app/views/accounts/users/index.html.erb b/app/views/accounts/users/index.html.erb index 07339321d..d49aebfff 100644 --- a/app/views/accounts/users/index.html.erb +++ b/app/views/accounts/users/index.html.erb @@ -3,7 +3,7 @@ <% content_for :header do %> diff --git a/app/views/boosts/_boosts.html.erb b/app/views/boosts/_boosts.html.erb index b9fcfae29..684ce110e 100644 --- a/app/views/boosts/_boosts.html.erb +++ b/app/views/boosts/_boosts.html.erb @@ -4,7 +4,7 @@ <%= bubble.boosts_count == 1 ? "boost" : "boosts" %> <%= tag.button class: "btn", type: :submit, style: "font-size: 0.5em" do %> - <%= image_tag "add.svg", aria: { hidden: true }, size: 24 %> + <%= icon_tag "add" %> Boost <% end %> <% end %> diff --git a/app/views/bubbles/_assignees.html.erb b/app/views/bubbles/_assignees.html.erb index d6af2a636..603c0ef7d 100644 --- a/app/views/bubbles/_assignees.html.erb +++ b/app/views/bubbles/_assignees.html.erb @@ -6,7 +6,7 @@
diff --git a/app/views/bubbles/_assignment.html.erb b/app/views/bubbles/_assignment.html.erb index 489d92a60..2d6914591 100644 --- a/app/views/bubbles/_assignment.html.erb +++ b/app/views/bubbles/_assignment.html.erb @@ -14,7 +14,7 @@ }, user.id %> <%= form.label "assignee_id[]", user.name, for: dom_id(user, :assign), class: "overflow-ellipsis" %> - <%= image_tag "check.svg", aria: { hidden: true }, size: 18, class: "checked flex-item-justify-end" %> + <%= icon_tag "check", size: 18, class: "checked flex-item-justify-end" %>
<% end %> <% end %> diff --git a/app/views/bubbles/_color.html.erb b/app/views/bubbles/_color.html.erb index 1921e14a1..b7228aebc 100644 --- a/app/views/bubbles/_color.html.erb +++ b/app/views/bubbles/_color.html.erb @@ -1,6 +1,6 @@
@@ -19,7 +19,7 @@
diff --git a/app/views/bubbles/_image.html.erb b/app/views/bubbles/_image.html.erb index 495600b01..6c5d4e84c 100644 --- a/app/views/bubbles/_image.html.erb +++ b/app/views/bubbles/_image.html.erb @@ -1,12 +1,12 @@ <% if bubble.image.attached? %> <%= button_to bucket_bubble_image_path(bubble.bucket, bubble), method: :delete, class: "btn" do %> - <%= image_tag "picture-remove.svg", aria: { hidden: true }, size: 24 %> + <%= icon_tag "picture-remove" %> Clear background image <% end %> <% else %> <%= form_with model: bubble, url: bucket_bubble_path(bubble.bucket, bubble), data: { controller: "form" } do |form| %>
<% end %> <% end %> diff --git a/app/views/bubbles/_tags.html.erb b/app/views/bubbles/_tags.html.erb index bfd05a235..9903f9af5 100644 --- a/app/views/bubbles/_tags.html.erb +++ b/app/views/bubbles/_tags.html.erb @@ -14,7 +14,7 @@
diff --git a/app/views/bubbles/index.html.erb b/app/views/bubbles/index.html.erb index 1439f6f32..cfdd9f554 100644 --- a/app/views/bubbles/index.html.erb +++ b/app/views/bubbles/index.html.erb @@ -6,7 +6,7 @@ <% content_for :header do %>
@@ -97,4 +97,4 @@ <%= link_to "Go back", "#", class: "btn", hidden: true, data: { controller: "back-navigation hotkey", action: "keydown.esc@document->hotkey#click", - back_navigation_fallback_destination_value: bubbles_path(bucket_id: @bubble.bucket) } %> \ No newline at end of file + back_navigation_fallback_destination_value: bubbles_path(bucket_id: @bubble.bucket) } %> diff --git a/app/views/buckets/_bucket.html.erb b/app/views/buckets/_bucket.html.erb index d6a589ac5..82149d71e 100644 --- a/app/views/buckets/_bucket.html.erb +++ b/app/views/buckets/_bucket.html.erb @@ -20,7 +20,7 @@ <% end %> <%= link_to edit_bucket_path(bucket), class: "btn txt-small bucket__button" do %> - <%= image_tag "settings.svg", aria: { hidden: true }, size: 24 %> + <%= icon_tag "settings" %> Settings for <%= bucket.name %> <% end %> diff --git a/app/views/buckets/edit.html.erb b/app/views/buckets/edit.html.erb index ab671d304..4fa78823a 100644 --- a/app/views/buckets/edit.html.erb +++ b/app/views/buckets/edit.html.erb @@ -3,13 +3,13 @@ <% content_for :header do %> @@ -38,7 +38,7 @@

Collections

<%= link_to new_bucket_path, class: "btn txt-xx-small flex-item-justify-end flex-item-no-shrink", style: "view-transition-name: new-bucket" do %> - <%= image_tag "add.svg", aria: { hidden: true }, size: 24 %> + <%= icon_tag "add" %> New <% end %>
diff --git a/app/views/filters/_assignees.html.erb b/app/views/filters/_assignees.html.erb index d03fe5ccf..500d5c720 100644 --- a/app/views/filters/_assignees.html.erb +++ b/app/views/filters/_assignees.html.erb @@ -32,7 +32,7 @@ }, "unassigned" %> <%= form.label :assignment_status, "No one", class: "overflow-ellipsis" %> - <%= image_tag "check.svg", aria: { hidden: true }, size: 18, class: "checked flex-item-justify-end" %> + <%= icon_tag "check", size: 18, class: "checked flex-item-justify-end" %> <% Current.account.users.active.order(:name).each do |user| %> @@ -44,10 +44,10 @@ }, user.id %> <%= form.label "assignee_ids[]", user.name, for: dom_id(user, :filter), class: "overflow-ellipsis" %> - <%= image_tag "check.svg", aria: { hidden: true }, size: 18, class: "checked flex-item-justify-end" %> + <%= icon_tag "check", size: 18, class: "checked flex-item-justify-end" %> <% end %> <% end %> -<% end %> \ No newline at end of file +<% end %> diff --git a/app/views/filters/_buckets.html.erb b/app/views/filters/_buckets.html.erb index a6ce05184..20449c917 100644 --- a/app/views/filters/_buckets.html.erb +++ b/app/views/filters/_buckets.html.erb @@ -26,9 +26,9 @@ }, bucket.id %> <%= form.label "bucket_ids[]", bucket.name, for: dom_id(bucket, :filter), class: "overflow-ellipsis" %> - <%= image_tag "check.svg", aria: { hidden: true }, size: 18, class: "checked flex-item-justify-end" %> + <%= icon_tag "check", size: 18, class: "checked flex-item-justify-end" %> <% end %> <% end %> - \ No newline at end of file + diff --git a/app/views/filters/_creators.html.erb b/app/views/filters/_creators.html.erb index 83fc7c69f..557778c09 100644 --- a/app/views/filters/_creators.html.erb +++ b/app/views/filters/_creators.html.erb @@ -34,7 +34,7 @@ }, Current.user.id %> <%= form.label :creator_ids, "Me", for: form.field_id(:creator_ids, Current.user.id), class: "overflow-ellipsis" %> - <%= image_tag "check.svg", aria: { hidden: true }, size: 18, class: "checked flex-item-justify-end" %> + <%= icon_tag "check", size: 18, class: "checked flex-item-justify-end" %> <% Current.account.users.active.without(Current.user).order(:name).each do |user| %> @@ -47,7 +47,7 @@ }, user.id %> <%= form.label :creator_ids, user.name, for: form.field_id(:creator_ids, user.id), class: "overflow-ellipsis" %> - <%= image_tag "check.svg", aria: { hidden: true }, size: 18, class: "checked flex-item-justify-end" %> + <%= icon_tag "check", size: 18, class: "checked flex-item-justify-end" %> <% end %> <% end %> diff --git a/app/views/filters/_dialog.html.erb b/app/views/filters/_dialog.html.erb index f55779b1a..ecf1c1b9a 100644 --- a/app/views/filters/_dialog.html.erb +++ b/app/views/filters/_dialog.html.erb @@ -4,13 +4,13 @@

- <%= image_tag "filter.svg", aria: { hidden: true }, size: 30 %> + <%= icon_tag "filter", size: 30 %> Filter

@@ -26,7 +26,7 @@ <% end %> @@ -51,7 +51,7 @@ <%= label_tag "bucket_ids_#{bucket.id}", class: "btn filter__button" do %> <%= check_box_tag "bucket_ids[]", bucket.id, filter.buckets.include?(bucket), id: "bucket_ids_#{bucket.id}", hidden: true %> <%= bucket.name %> - <%= image_tag "close.svg", aria: { hidden: true }, size: 24 %> + <%= icon_tag "close" %> <% end %> <% end %> @@ -63,7 +63,7 @@ <%= label_tag "indexed_by_#{filter.default_indexed_by}", class: "btn filter__button" do %> <%= radio_button_tag "indexed_by", filter.default_indexed_by, filter.default_indexed_by?, hidden: true %> Most active - <%= image_tag "close.svg", aria: { hidden: true }, size: 24 %> + <%= icon_tag "close" %> <% end %> @@ -72,7 +72,7 @@ <% end %> @@ -86,7 +86,7 @@ <%= label_tag "stage_ids_#{stage.id}", class: "btn filter__button" do %> <%= check_box_tag "stage_ids[]", stage.id, filter.stages.include?(stage), id: "stage_ids_#{stage.id}", hidden: true %> <%= stage.name %> - <%= image_tag "close.svg", aria: { hidden: true }, size: 24 %> + <%= icon_tag "close" %> <% end %> <% end %> @@ -96,13 +96,13 @@ <% if (tags = Current.account.tags.order(:title)).any? %>
Tagged
- + <% tags.each do |tag| %>
<% end %> @@ -119,7 +119,7 @@ action: "filter-form#clearCategory", filter_form_name_param: "assignee_ids[],assigner_ids[]" } %> No one - <%= image_tag "close.svg", aria: { hidden: true }, size: 24 %> + <%= icon_tag "close" %>
@@ -129,7 +129,7 @@ class: "visually-hidden", data: { action: "filter-form#clearCategory", filter_form_name_param: "assignment_status" } %> Me - <%= image_tag "close.svg", aria: { hidden: true }, size: 24 %> + <%= icon_tag "close" %> @@ -139,7 +139,7 @@ <%= check_box_tag "assignee_ids[]", user.id, filter.assignees.include?(user), class: "visually-hidden", data: { action: "filter-form#clearCategory", filter_form_name_param: "assignment_status" } %> <%= user.name %> - <%= image_tag "close.svg", aria: { hidden: true }, size: 24 %> + <%= icon_tag "close" %> <% end %> @@ -153,7 +153,7 @@ <%= check_box_tag "creator_ids[]", Current.user.id, filter.creators.include?(Current.user), class: "visually-hidden" %> Me - <%= image_tag "close.svg", aria: { hidden: true }, size: 24 %> + <%= icon_tag "close" %> @@ -162,7 +162,7 @@ <% end %> @@ -173,13 +173,13 @@
<%= tag.button class: "btn", form: :filter_form, formaction: filters_path, formmethod: :post do %> - <%= image_tag "bubbles.svg", aria: { hidden: true }, size: 24 %> + <%= icon_tag "bubbles" %> Save collection <% end %>
diff --git a/app/views/filters/_filter.html.erb b/app/views/filters/_filter.html.erb index d76e0a232..e058941fe 100644 --- a/app/views/filters/_filter.html.erb +++ b/app/views/filters/_filter.html.erb @@ -17,10 +17,10 @@
<%= link_to bubbles_path(**filter.as_params), class: "txt-ink" do %> - <%= image_tag "filter.svg", aria: { hidden: true }, size: 24, class: "flex-inline", style: "vertical-align: bottom" %> <%= filter.summary %> + <%= icon_tag "filter", class: "flex-inline", style: "vertical-align: bottom" %> <%= filter.summary %> <% end %> <%= button_to filter_path(filter), method: :delete, class: "btn txt-small btn--negative bucket__button", data: { turbo_confirm: "Are you sure you want to delete this filter?" } do %> - <%= image_tag "minus.svg", aria: { hidden: true }, size: 24 %> + <%= icon_tag "minus" %> Delete <% end %>
diff --git a/app/views/filters/_indexed_by.html.erb b/app/views/filters/_indexed_by.html.erb index 34401948a..79271b248 100644 --- a/app/views/filters/_indexed_by.html.erb +++ b/app/views/filters/_indexed_by.html.erb @@ -22,7 +22,7 @@ data: { action: "change->form#submit" } %> <%= form.label :indexed_by, "Most active", value: filter.default_indexed_by, class: "overflow-ellipsis" %> - <%= image_tag "check.svg", aria: { hidden: true }, size: 18, class: "checked flex-item-justify-end" %> + <%= icon_tag "check", size: 18, class: "checked flex-item-justify-end" %> <% Filter::INDEXES.each do |index| %> @@ -32,7 +32,7 @@ data: { action: "change->form#submit" } %> <%= form.label :indexed_by, index.humanize, value: index, class: "overflow-ellipsis" %> - <%= image_tag "check.svg", aria: { hidden: true }, size: 18, class: "checked flex-item-justify-end" %> + <%= icon_tag "check", size: 18, class: "checked flex-item-justify-end" %> <% end %> <% end %> diff --git a/app/views/filters/_settings.html.erb b/app/views/filters/_settings.html.erb index cb05c017e..a266f33e1 100644 --- a/app/views/filters/_settings.html.erb +++ b/app/views/filters/_settings.html.erb @@ -1,6 +1,6 @@
@@ -18,7 +18,7 @@ <% if any_filters?(filter) %> <%= link_to bubbles_path, class: "btn btn--remove txt-small" do %> - <%= image_tag "close.svg", aria: { hidden: true }, size: 24 %> + <%= icon_tag "close" %> Clear all <% end %> <% end %> diff --git a/app/views/filters/_stages.html.erb b/app/views/filters/_stages.html.erb index 3798a53d0..01ea278b5 100644 --- a/app/views/filters/_stages.html.erb +++ b/app/views/filters/_stages.html.erb @@ -31,7 +31,7 @@ }, stage.id %> <%= form.label :stage_ids, stage.name, for: form.field_id(:stage_ids, stage.id), class: "overflow-ellipsis" %> - <%= image_tag "check.svg", aria: { hidden: true }, size: 18, class: "checked flex-item-justify-end" %> + <%= icon_tag "check", size: 18, class: "checked flex-item-justify-end" %>
<% end %> <% end %> diff --git a/app/views/filters/_tags.html.erb b/app/views/filters/_tags.html.erb index fa35e8a8c..178f62098 100644 --- a/app/views/filters/_tags.html.erb +++ b/app/views/filters/_tags.html.erb @@ -31,10 +31,10 @@ }, tag.id %> <%= form.label "tag_ids[]", tag.hashtag, for: dom_id(tag, :filter), class: "overflow-ellipsis" %> - <%= image_tag "check.svg", aria: { hidden: true }, size: 18, class: "checked flex-item-justify-end" %> + <%= icon_tag "check", size: 18, class: "checked flex-item-justify-end" %> <% end %> <% end %> -<% end %> \ No newline at end of file +<% end %> diff --git a/app/views/first_runs/show.html.erb b/app/views/first_runs/show.html.erb index 476fbe987..16409b528 100644 --- a/app/views/first_runs/show.html.erb +++ b/app/views/first_runs/show.html.erb @@ -28,7 +28,7 @@ <% end %> diff --git a/app/views/notifications/_tray.html.erb b/app/views/notifications/_tray.html.erb index 5ec51494a..8e12e58f4 100644 --- a/app/views/notifications/_tray.html.erb +++ b/app/views/notifications/_tray.html.erb @@ -20,7 +20,7 @@ <%= button_to notifications_mark_all_read_path, class: "notification-tray__read_action btn btn--reversed fill-transparent borderless flex-item-justify-start shadow txt-xx-small", data: { action: "click->dialog#close", turbo_frame: "notifications" } do %> - <%= image_tag "check.svg", aria: { hidden: true }, size: 24 %> + <%= icon_tag "check" %> Mark all read <% end %> diff --git a/app/views/notifications/index.html.erb b/app/views/notifications/index.html.erb index c35e37f5b..3eb51f2bb 100644 --- a/app/views/notifications/index.html.erb +++ b/app/views/notifications/index.html.erb @@ -3,7 +3,7 @@ <% content_for :header do %>