aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2018-02-04 12:09:04 +0100
committerChristopher Baines <mail@cbaines.net>2018-03-29 07:28:09 +0100
commit064d6ee52c4f056c4f1d07c4aa0031baa87da552 (patch)
tree26c6faa55f05d19e92ac2ea3c53e6a0bade17c4f
parent2cfcbfb378028c3a3ba76f8e61bd70c54b121c49 (diff)
downloadgovuk-mini-environment-admin-064d6ee52c4f056c4f1d07c4aa0031baa87da552.tar
govuk-mini-environment-admin-064d6ee52c4f056c4f1d07c4aa0031baa87da552.tar.gz
Add form for creating a mini environment
-rw-r--r--.envrc12
-rw-r--r--app/controllers/mini_environments_controller.rb2
-rw-r--r--app/views/mini_environments/index.html.erb8
-rw-r--r--app/views/mini_environments/new.html.erb24
4 files changed, 40 insertions, 6 deletions
diff --git a/.envrc b/.envrc
index 945a943..821aa7e 100644
--- a/.envrc
+++ b/.envrc
@@ -1 +1,13 @@
+
+# To avoid $XDG_CONFIG_HOME/guix/latest from being used
+export GUIX_UNINSTALLED="true"
+
+GOVUK_GUIX_PATH="$(readlink -f "$PWD/../govuk-guix-wip-ruby/.guix-package-path")"
+GNU_GUIX_PATH="$(readlink -f "$PWD/../../../Guix/guix-wip-rails")"
+
+export GUILE_LOAD_PATH="$GOVUK_GUIX_PATH:$GNU_GUIX_PATH"
+export GUILE_LOAD_COMPILED_PATH="$GNU_GUIX_PATH"
+
+export GUIX_PACKAGE_PATH="$GUILE_LOAD_PATH"
+
use guix -l guix.scm
diff --git a/app/controllers/mini_environments_controller.rb b/app/controllers/mini_environments_controller.rb
index c45ed4a..7e5134a 100644
--- a/app/controllers/mini_environments_controller.rb
+++ b/app/controllers/mini_environments_controller.rb
@@ -13,7 +13,7 @@ class MiniEnvironmentsController < ApplicationController
params.require(:mini_environment).permit(:name)
)
- SetupJob.enqueue(@mini_environment.id)
+ # SetupJob.enqueue(@mini_environment.id)
end
redirect_to @mini_environment
diff --git a/app/views/mini_environments/index.html.erb b/app/views/mini_environments/index.html.erb
index 11d5a79..5e131c6 100644
--- a/app/views/mini_environments/index.html.erb
+++ b/app/views/mini_environments/index.html.erb
@@ -1,5 +1,11 @@
-<a href="<%= new_mini_environment_path %>">Create new mini environment</a>
+<a class="btn btn-lg btn-success pull-right"
+ role="button"
+ href="<%= new_mini_environment_path %>">
+ Create a new mini environment
+</a>
+
+
<% MiniEnvironment.all.each do |mini_environment| %>
<a href="<%= mini_environment_path mini_environment %>">
diff --git a/app/views/mini_environments/new.html.erb b/app/views/mini_environments/new.html.erb
index 4a4712e..84d2316 100644
--- a/app/views/mini_environments/new.html.erb
+++ b/app/views/mini_environments/new.html.erb
@@ -1,5 +1,21 @@
+<div class="row">
+ <div class="col-md-8">
+ <%= form_for @mini_environment,
+ url: { action: "create" },
+ html: { class: 'form-horizontal' } do |f| %>
-<%= form_for @mini_environment, url: {action: "create"} do |f| %>
- <%= f.text_field :name %>
- <%= f.submit "Create" %>
-<% end %>
+ <div class="form-group">
+ <%= f.label :name, class: 'col-sm-2 control-label' %>
+ <div class="col-sm-10">
+ <%= f.text_field :name, class: 'form-control' %>
+ </div>
+ </div>
+
+ <div class="form-group">
+ <div class="col-sm-offset-2 col-sm-10">
+ <%= f.submit "Create", class: 'btn btn-lg btn-success' %>
+ </div>
+ </div>
+ <% end %>
+ </div>
+</div>