aboutsummaryrefslogtreecommitdiff
path: root/app/views/setup/show.html.erb
blob: c3ed3b89154f0ec5b246811f07a788b18cad7591 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
<%#

GOV.UK Mini Environment Admin
Copyright © 2018  Christopher Baines <mail@cbaines.net>

This file is part of the GOV.UK Mini Environment Admin.

The GOV.UK Mini Environment Admin is free software: you can
redistribute it and/or modify it under the terms of the GNU Affero
General Public License as published by the Free Software Foundation,
either version 3 of the License, or (at your option) any later
version.

The GOV.UK Mini Environment Admin is distributed in the hope that it
will be useful, but WITHOUT ANY WARRANTY; without even the implied
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public
License along with the GOV.UK Mini Environment Admin.  If not, see
<http://www.gnu.org/licenses/>.

%>

<h1>Backends</h1>

<% Backends.classes.each do |backend_class| %>
  <div class="panel panel-default">
    <!-- Default panel contents -->
    <div class="panel-heading">
      <h2><%= backend_class.label %></h2>
    </div>
    <ul class="list-group">
      <% backend_class.all.each do |backend| %>
        <a class="list-group-item" href="<%= show_backend_path(backend) %>">
          <%= backend.label %>
        </a>
      <% end %>
      <a class="list-group-item text-center"
         href="<%= new_backend_path(backend_class) %>">
        New <%= backend_class.label %> backend
      </a>
    </ul>
  </div>
<% end %>

<h1>Revisions</h1>

<%= form_with(url: enqueue_fetch_govuk_guix_revision_path,
              method: "post") do %>
  <div class="input-group input-group-lg">
    <%= text_field_tag(
      :revision,
      'origin/master',
      class: 'form-control',
      placeholder: 'Git revision'
    ) %>
    <span class="input-group-btn">
      <%= submit_tag("Fetch Revision",
                     role: 'button',
                     class: 'btn btn-lg btn-success')
      %>
    </span>
  </div>

  <span class="help-block">
    govuk-guix will be fetched from
    <%= GovukGuix::FetchRevisionJob.repository_remote_location %>
  </span>
<% end %>

<br>
<div class="list-group">
  <% if fetch_revision_jobs.count %>
    <% fetch_revision_jobs.each do |job| %>
      <a href="#" class="list-group-item disabled">
        Fetching
        <span style="font-family: monospace;">
          <%= job[:args].first %>
        </span>

        <div class="progress pull-right" style="width: 21.2em">
          <div class="progress-bar progress-bar-striped active" role="progressbar" style="width: 100%">
            <span class="sr-only">Fetching revision in progress</span>
          </div>
        </div>
      </a>
    <% end %>
  <% end %>

  <% GovukGuix::Revision.all.each do |revision| %>
    <a href="<%= govuk_guix_revision_path(revision) %>" class="list-group-item">
      <span class="badge" style="font-family: monospace;">
        <%= revision.commit_hash %>
      </span>

      <%= revision.created_at %>
    </a>
  <% end %>
</div>