From c6680509fe63a3d6fffe46d66017818b1ea95e25 Mon Sep 17 00:00:00 2001 From: Christopher Vollick <0@psycoti.ca> Date: Wed, 16 Mar 2022 16:12:49 -0400 Subject: [PATCH] Telephone Link Sometimes I need to go there to look something up or change a setting, and every time I do I have to navigate through the UI to a number I already know. This should make that faster. --- forms/admin_info.rb | 8 ++++++++ lib/customer_info.rb | 9 +++++++++ 2 files changed, 17 insertions(+) diff --git a/forms/admin_info.rb b/forms/admin_info.rb index bff2ca15f7fed9c8c66216baecae977a54ee92f8..1da597a6efb4b17c9ed2a36a3870ce1707aa6935 100644 --- a/forms/admin_info.rb +++ b/forms/admin_info.rb @@ -23,6 +23,14 @@ field( value: @admin_info.customer_id ) +if @admin_info.info.tel + field( + var: "tel_link", + label: "Phone Number Info", + value: @admin_info.tel_link + ) +end + if @admin_info.fwd.uri field( var: "fwd", diff --git a/lib/customer_info.rb b/lib/customer_info.rb index a6167bbaf4ce99eb64d5bea67a676658575bd1f1..29f0fbd9707f0df6621ee05e99a54f3807f18433 100644 --- a/lib/customer_info.rb +++ b/lib/customer_info.rb @@ -118,4 +118,13 @@ class AdminInfo def form FormTemplate.render("admin_info", admin_info: self) end + + def tel_link + [ + "https://dashboard.bandwidth.com/portal/r/a", + CONFIG[:creds][:account], + "numbers/details", + info.tel.gsub(/\A\+1/, "") + ].join("/") + end end