From 890f6c5875eda95f02b6b4d13299cc8ff4c041df Mon Sep 17 00:00:00 2001 From: Alicia Date: Wed, 18 Dec 2024 23:21:19 -0300 Subject: [PATCH] Add alert info in list --- app/decorators/alert_decorator.rb | 6 +++++- app/views/my_accounts/show.html.slim | 8 ++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/app/decorators/alert_decorator.rb b/app/decorators/alert_decorator.rb index 0ac281d88..be6beaf0c 100644 --- a/app/decorators/alert_decorator.rb +++ b/app/decorators/alert_decorator.rb @@ -2,6 +2,10 @@ class AlertDecorator < ApplicationDecorator delegate_all def title(index) - object.keyword.presence || "Alert #{index + 1}" + if object.keyword.present? + "Keyword: #{object.keyword}" + else + "Alert #{index + 1}" + end end end diff --git a/app/views/my_accounts/show.html.slim b/app/views/my_accounts/show.html.slim index b9c5d776e..a292e6b14 100644 --- a/app/views/my_accounts/show.html.slim +++ b/app/views/my_accounts/show.html.slim @@ -98,8 +98,12 @@ div class="w-full h-full bg-white" span class="text-lg font-bold text-black capitalize" | #{alert.decorate.title(index)} = link_to "Edit", edit_alert_path(alert), class: "text-blue-medium hover:text-blue-dark", data: { turbo_stream: true } - div class="flex flex-row text-sm font-normal text-gray-2" - | #{list_all_filters(alert).join(', ')} + div class="flex flex-col text-sm font-normal text-gray-2" + - if list_all_filters(alert).present? + p + | Filters: #{list_all_filters(alert).join(', ')} + p + | Frequency: #{alert.frequency.capitalize} - else div class="flex justify-center my-16 w-full" = inline_svg_tag 'empty_state_2.svg', size:'294*145'