app/components/signum/notification_body/component.html.slim in signum-0.5.0 vs app/components/signum/notification_body/component.html.slim in signum-0.5.1
- old
+ new
@@ -12,13 +12,14 @@
p.signum-notification-body__mb__bc__mc__tx
= sanitize signal.text
- if signal.metadata.present? && signal.metadata["links"].present?
.signum-notification-body__mb__bc__mc__lkc
- signal.metadata["links"].each do | link |
- a.signum-notification-body__mb__bc__mc__lkc__lk href="#{link["url"]}" target=link.fetch("target", "_blank") *link["link_attributes"]
+ - 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", {}))
i.fas.fa-link
- =< link["title"]
+ =< link["title"] || link["url"] || '(...)'
- if signal.attachments.attached?
.signum-notification-body__mb__bc__mc__attc
- signal.attachments.each do | attachment |
a.signum-notification-body__mb__bc__mc__attc__att href="#{Rails.application.routes.url_helpers.rails_blob_path(attachment, disposition: "attachment", only_path: true)}"
i.fas.fa-paperclip-vertical
@@ -30,12 +31,13 @@
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?
.signum-notification-body__mb__bmc
- signal.metadata["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["url"]}" target=button.fetch("target", "_blank") *button["link_attributes"]
+ a.signum-notification-body__mb__bmc__bc__b*{href: button.fetch('url', '#'), target:button.fetch("target", "_blank")}.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
\ No newline at end of file
+ = sts.progress_bar percentage, size: :small, label: false