diff --git a/app/assets/stylesheets/_layout.sass b/app/assets/stylesheets/_layout.sass index 173d1916..2cb57740 100644 --- a/app/assets/stylesheets/_layout.sass +++ b/app/assets/stylesheets/_layout.sass @@ -101,7 +101,7 @@ a.button, input[type=submit], button &.loud +loud-awesome-button .icon - margin-right: .375em + margin-right: .25em vertical-align: middle ul.buttons diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 4fa2b261..01cd3d9c 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -25,6 +25,7 @@ module ApplicationHelper klass = options.fetch(:class, "") + " button" link_to url, class: klass, **options do concat icon + concat " " concat content end end @@ -77,6 +78,13 @@ module ApplicationHelper end end + # SVG icon source from Font Awesome 6! (https://creativecommons.org/licenses/by/4.0/) + CART_ICON_SVG_SOURCE = ''.html_safe + def cart_icon(alt: "Cart") + content_tag :svg, CART_ICON_SVG_SOURCE, alt:, class: "icon", + viewBox: "0 0 576 512", style: "height: 1em" + end + def contact_email "matchu@openneo.net" end diff --git a/app/views/items/sources.html.haml b/app/views/items/sources.html.haml index c82826b1..73bf2ed7 100644 --- a/app/views/items/sources.html.haml +++ b/app/views/items/sources.html.haml @@ -20,6 +20,7 @@ %td.actions-cell %button{onclick: "alert('Todo!')"} + = cart_icon alt: "" Buy all in NC Mall %tbody - @nc_mall_items.each do |item| @@ -28,6 +29,7 @@ %td= item.name %td.actions-cell %button{onclick: "alert('Todo!')"} + = cart_icon alt: "" Buy (#{item.current_nc_price} NC) - if @np_items.present?