summaryrefslogtreecommitdiffstats
path: root/ogcp/templates/actions/setup.html
blob: 6856ed18f557700c646c43522c3c5e41f8b180ea (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
{% extends 'commands.html' %}

{% block content %}

<h1 class="m-5">{{_('Partition and Format')}}</h1>

<table class="table">
    <thead class="text-center">
        <tr>
            <th>Type</th>
            <th>Filesytem</th>
            <th>Size (KB)</th>
            <th>Format?</th>
            <th colspan="2"></th>
        </tr>
    </thead>

    <tbody>
        {% for form in forms %}
            <form class="form-inline" method="POST">
                <tr>
                    {{ form.hidden_tag() }}
                    <td>{{ form.part_type(class_="form-control") }}</td>
                    <td>{{ form.fs(class_="form-control") }}</td>
                    <td>{{ form.size(class_="form-control") }}</td>
                    <td>{{ form.format_partition(class_="form-control") }}</td>
                    <td>{{ form.modify(class_="form-control btn-primary") }}</td>
                    <td>{{ form.delete(class_="form-control btn-danger") }}</td>
                </tr>
            </form>
        {% endfor %}
    </tbody>
</table>

<button class="btn btn-primary" data-toggle="modal" data-target="#newPartitionModal">
    {{ _('Add a new Partition') }}
</button>

<!-- Modal -->
<div class="modal fade" id="newPartitionModal" tabindex="-1" aria-hidden="true">
  <div class="modal-dialog">
    <div class="modal-content">
      <form class="form" method="POST">
          <div class="modal-header">
            <h5 class="modal-title" id="exampleModalLabel">{{ _('Create a new partition') }}</h5>
            <button type="button" class="close" data-dismiss="modal" aria-label="Close">
              <span aria-hidden="true">&times;</span>
            </button>
          </div>
          <div class="modal-body">
                {{ new_partition_form.hidden_tag() }}

                <div class="form-group">
                    <label for="{{ new_partition_form.part_type.id }}">{{ new_partition_form.part_type.label }}</label>
                    {{ new_partition_form.part_type(class_="form-control") }}
                </div>
                <div class="form-group">
                    <label for="{{ new_partition_form.fs.id }}">{{ new_partition_form.fs.label }}</label>
                    {{ new_partition_form.fs(class_="form-control") }}
                </div>
                <div class="form-group">
                    <label for="{{ new_partition_form.size.id }}">{{ new_partition_form.size.label }}</label>
                    {% if new_partition_form.size.errors %}
                        {{ new_partition_form.size(class_="form-control is-invalid") }}
                    {% else %}
                        {{ new_partition_form.size(class_="form-control") }}
                    {% endif %}
                    {% for error in new_partition_form.size.errors %}
                        <div class="invalid-feedback">{{ error }}</div>
                    {% endfor %}
                </div>
          </div>
          <div class="modal-footer">
            {{ new_partition_form.create(class_="btn btn-primary") }}
            <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
          </div>
        </div>
    </form>
  </div>
</div>

{% endblock %}