From 35d9837f24242ea4cdd966967e9fef93b57e150f Mon Sep 17 00:00:00 2001 From: David Cook Date: Wed, 14 Jun 2023 09:54:04 +1000 Subject: [PATCH] Show current version at bottom of admin dashboard With generic link to the releases page. We could provide a link to latest tag with `git describe --tags --abbrev=0`. But I thought it better to keep things simple. --- app/views/spree/admin/overview/_version.html.haml | 3 +++ .../spree/admin/overview/multi_enterprise_dashboard.html.haml | 2 ++ .../spree/admin/overview/single_enterprise_dashboard.html.haml | 2 ++ config/locales/en.yml | 2 ++ 4 files changed, 9 insertions(+) create mode 100644 app/views/spree/admin/overview/_version.html.haml diff --git a/app/views/spree/admin/overview/_version.html.haml b/app/views/spree/admin/overview/_version.html.haml new file mode 100644 index 0000000000..729d0a3fe8 --- /dev/null +++ b/app/views/spree/admin/overview/_version.html.haml @@ -0,0 +1,3 @@ +%a{href:"https://github.com/openfoodfoundation/openfoodnetwork/releases", target: "_blank", title: t('.view_all_releases')} + =# Show the latest tag. If there are commits since the tag, show number of commits and an identifier. If the working tree is dirty, show 'modified'. + = `git describe --tags --dirty=-modified` diff --git a/app/views/spree/admin/overview/multi_enterprise_dashboard.html.haml b/app/views/spree/admin/overview/multi_enterprise_dashboard.html.haml index 0840358a14..4f72a14f9f 100644 --- a/app/views/spree/admin/overview/multi_enterprise_dashboard.html.haml +++ b/app/views/spree/admin/overview/multi_enterprise_dashboard.html.haml @@ -22,3 +22,5 @@ = render partial: "order_cycles" = render partial: "enterprises" + + = render partial: "version" diff --git a/app/views/spree/admin/overview/single_enterprise_dashboard.html.haml b/app/views/spree/admin/overview/single_enterprise_dashboard.html.haml index ed0e976821..3dcca4df75 100644 --- a/app/views/spree/admin/overview/single_enterprise_dashboard.html.haml +++ b/app/views/spree/admin/overview/single_enterprise_dashboard.html.haml @@ -81,3 +81,5 @@ %a.button.bottom{href: main_app.admin_order_cycles_path} = t "manage_order_cycles" %span.icon-arrow-right + + = render partial: "version" diff --git a/config/locales/en.yml b/config/locales/en.yml index 8b3f9aec78..66f658e6c5 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -4096,6 +4096,8 @@ See the %{link} to find out more about %{sitename}'s features and to start using many: "You have %{count} active order cycles." other: "You have %{count} active order cycles." manage_order_cycles: "MANAGE ORDER CYCLES" + version: + view_all_releases: View all releases shipping_methods: index: shipping_methods: "Shipping Methods"