app/components/signum/notification_body/component.html.slim in signum-0.5.1 vs app/components/signum/notification_body/component.html.slim in signum-0.6.0

- old
+ new

@@ -9,15 +9,15 @@ p.signum-notification-body__mb__bc__mc__ti = sanitize signal.title - if signal.text.present? p.signum-notification-body__mb__bc__mc__tx = sanitize signal.text - - if signal.metadata.present? && signal.metadata["links"].present? + - if signal.links.present? .signum-notification-body__mb__bc__mc__lkc - - signal.metadata["links"].each do | link | + - signal.links.each do | link | - next unless link.is_a?(Hash) - a.signum-notification-body__mb__bc__mc__lkc__lk*{href: link.fetch('url', '#'), target:link.fetch("target", "_blank") }.merge(link.fetch("link_attributes", {})) + a.signum-notification-body__mb__bc__mc__lkc__lk*{href: link.fetch('url', '#'), target:link.fetch("target", "_blank"), 'data-action': button["close"] ? "click->signum-notification-body#close" : "" }.merge(link.fetch("link_attributes", {})) i.fas.fa-link =< link["title"] || link["url"] || '(...)' - if signal.attachments.attached? .signum-notification-body__mb__bc__mc__attc - signal.attachments.each do | attachment | @@ -28,15 +28,15 @@ a.signum-notification-body__mb__bc__bcc__b[data-action="signum-notification-body#close"] span.sr-only | Close svg.h-5.w-5[xmlns="http://www.w3.org/2000/svg" viewbox="0 0 20 20" fill="currentColor" aria-hidden="true"] path[d="M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z"] - - if signal.metadata.present? && signal.metadata["buttons"].present? + - if signal.buttons.present? .signum-notification-body__mb__bmc - - signal.metadata["buttons"].each do | button | + - signal.buttons.each do | button | - next unless button.is_a?(Hash) .signum-notification-body__mb__bmc__bc - a.signum-notification-body__mb__bmc__bc__b*{href: button.fetch('url', '#'), target:button.fetch("target", "_blank")}.merge(button.fetch("link_attributes", {})) + a.signum-notification-body__mb__bmc__bc__b*{href: button.fetch('url', '#'), target: button.fetch("target", "_blank"), 'data-action': button["close"] ? "click->signum-notification-body#close" : "" }.merge(button.fetch("link_attributes", {})) = button["title"] - if signal.count.present? - percentage = signal.total.present? ? signal.count.fdiv(signal.total) * 100 : signal.count .signum-notification-body__pbc = sts.progress_bar percentage, size: :small, label: false