From 9953ee2af581fc676a7ea7d308b691186aea6638 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Fri, 1 Jun 2018 20:43:49 +0100 Subject: Support selecting a data snapshot on the services page --- app/models/backends/terraform_libvirt.rb | 4 +++ app/views/mini_environments/services.html.erb | 43 +++++++++++++++++++++++++++ 2 files changed, 47 insertions(+) diff --git a/app/models/backends/terraform_libvirt.rb b/app/models/backends/terraform_libvirt.rb index 4344801..4a37a3b 100644 --- a/app/models/backends/terraform_libvirt.rb +++ b/app/models/backends/terraform_libvirt.rb @@ -103,6 +103,10 @@ class Backends::TerraformLibvirt < ApplicationRecord end end + def available_data_snapshots + GovukGuix::DataSnapshot.where(backend: nil) + end + def terraform_state_id "backend/terraform_libvirt/#{id}" end diff --git a/app/views/mini_environments/services.html.erb b/app/views/mini_environments/services.html.erb index 78cdeff..89c3f7c 100644 --- a/app/views/mini_environments/services.html.erb +++ b/app/views/mini_environments/services.html.erb @@ -74,6 +74,49 @@ License along with the GOV.UK Mini Environment Admin. If not, see +
+
+
+

Data for the services

+
+
+

+ If you want to use the applications with data, select a data + snapshot below. +

+
+ +
+ <% ( @mini_environment.govuk_guix_revision.available_services || [] ).each do |group| %> -- cgit v1.2.3