aboutsummaryrefslogtreecommitdiffstats
path: root/src/templates/resource
diff options
context:
space:
mode:
authorJeremy Plsek <jeremyplsek@gmail.com>2019-12-19 12:58:33 -0500
committerJeremy Plsek <jeremyplsek@gmail.com>2019-12-19 12:58:33 -0500
commit30a535d7e9bdc0e3cf637207c0c100a16db81586 (patch)
tree2a7c3a968d95c29a661620095d889f6484169fec /src/templates/resource
parentedf4d6729b94258f8b404684703984b724c45c8f (diff)
style: make more consistent styles
- Fix indentation in places - User settings have better labels - Lab info title now the same as others - Add "empty" sections to be more helpful to the user. They are not using links, since most of the "workflow" is handled by javascript. - Update padding in places to better line up with other elements - Add padding to bootstrap notifications (add check for messages to not just have random padding on the top of the page) - Remove unnecessary text in a form - Remove card-body from table-only or list-only cards (lists and tables are now flush with cards) - Add bg-danger to not-working hosts - Replace True/False text shown to the user with Yes/No - Remove ":" from some headers - Vertical buttons are now in a button group - Add pre-wrap class to avoid pre from breaking box sizing on the booking detail page - Reduce table indent in pod card and add table overflow scrollbar Signed-off-by: Jeremy Plsek <jeremyplsek@gmail.com> Change-Id: If09dca2f2b7386c44eeeb817ef76e8f748e456da
Diffstat (limited to 'src/templates/resource')
-rw-r--r--src/templates/resource/hostprofile_detail.html106
-rw-r--r--src/templates/resource/hosts.html4
-rw-r--r--src/templates/resource/steps/define_hardware.html2
-rw-r--r--src/templates/resource/steps/meta_info.html2
-rw-r--r--src/templates/resource/steps/pod_definition.html105
5 files changed, 105 insertions, 114 deletions
diff --git a/src/templates/resource/hostprofile_detail.html b/src/templates/resource/hostprofile_detail.html
index c26d774..0b3262c 100644
--- a/src/templates/resource/hostprofile_detail.html
+++ b/src/templates/resource/hostprofile_detail.html
@@ -10,13 +10,11 @@
<button data-toggle="collapse" data-target="#availableAt" class="btn ml-auto btn-outline-secondary">Expand</button>
</div>
<div class="collapse show" id="availableAt">
- <div class="card-body">
- <ul class="list-group">
- {% for lab in hostprofile.labs.all %}
- <li class="list-group-item">{{lab.name}}</li>
- {% endfor %}
- </ul>
- </div>
+ <ul class="list-group list-group-flush">
+ {% for lab in hostprofile.labs.all %}
+ <li class="list-group-item">{{lab.name}}</li>
+ {% endfor %}
+ </ul>
</div>
</div>
<div class="card mb-4">
@@ -37,22 +35,20 @@
<button data-toggle="collapse" data-target="#cpuPanel" class="btn ml-auto btn-outline-secondary">Expand</button>
</div>
<div class="collapse show" id="cpuPanel">
- <div class="card-body">
- <table class="table">
- <tr>
- <td>Arch:</td>
- <td>{{hostprofile.cpuprofile.first.architecture}}</td>
- </tr>
- <tr>
- <td>Cores:</td>
- <td>{{hostprofile.cpuprofile.first.cores}}</td>
- </tr>
- <tr>
- <td>Sockets:</td>
- <td>{{hostprofile.cpuprofile.first.cpus}}</td>
- </tr>
- </table>
- </div>
+ <table class="table">
+ <tr>
+ <td>Arch:</td>
+ <td>{{hostprofile.cpuprofile.first.architecture}}</td>
+ </tr>
+ <tr>
+ <td>Cores:</td>
+ <td>{{hostprofile.cpuprofile.first.cores}}</td>
+ </tr>
+ <tr>
+ <td>Sockets:</td>
+ <td>{{hostprofile.cpuprofile.first.cpus}}</td>
+ </tr>
+ </table>
</div>
</div>
<div class="card mb-4">
@@ -61,22 +57,20 @@
<button data-toggle="collapse" data-target="#diskPanel" class="btn ml-auto btn-outline-secondary">Expand</button>
</div>
<div class="collapse show" id="diskPanel">
- <div class="card-body">
- <table class="table">
- <tr>
- <td>Size:</td>
- <td>{{hostprofile.storageprofile.first.size}} GiB</td>
- </tr>
- <tr>
- <td>Type:</td>
- <td>{{hostprofile.storageprofile.first.media_type}}</td>
- </tr>
- <tr>
- <td>Mount Point:</td>
- <td>{{hostprofile.storageprofile.first.name}}</td>
- </tr>
- </table>
- </div>
+ <table class="table">
+ <tr>
+ <td>Size:</td>
+ <td>{{hostprofile.storageprofile.first.size}} GiB</td>
+ </tr>
+ <tr>
+ <td>Type:</td>
+ <td>{{hostprofile.storageprofile.first.media_type}}</td>
+ </tr>
+ <tr>
+ <td>Mount Point:</td>
+ <td>{{hostprofile.storageprofile.first.name}}</td>
+ </tr>
+ </table>
</div>
</div>
</div>
@@ -87,24 +81,22 @@
<button data-toggle="collapse" data-target="#interfacePanel" class="btn ml-auto btn-outline-secondary">Expand</button>
</div>
<div class="collapse show" id="interfacePanel">
- <div class="card-body">
- <table class="table">
- <thead>
- <tr>
- <th>Name</th>
- <th>Speed</th>
- </tr>
- </thead>
- <tbody>
- {% for intprof in hostprofile.interfaceprofile.all %}
- <tr>
- <td>{{intprof.name}}</td>
- <td>{{intprof.speed}}</td>
- </tr>
- {% endfor %}
- </tbody>
- </table>
- </div>
+ <table class="table">
+ <thead>
+ <tr>
+ <th>Name</th>
+ <th>Speed</th>
+ </tr>
+ </thead>
+ <tbody>
+ {% for intprof in hostprofile.interfaceprofile.all %}
+ <tr>
+ <td>{{intprof.name}}</td>
+ <td>{{intprof.speed}}</td>
+ </tr>
+ {% endfor %}
+ </tbody>
+ </table>
</div>
</div>
</div>
diff --git a/src/templates/resource/hosts.html b/src/templates/resource/hosts.html
index 69b7231..9fc50ce 100644
--- a/src/templates/resource/hosts.html
+++ b/src/templates/resource/hosts.html
@@ -20,10 +20,10 @@
<a href="profiles/{{ host.profile.id }}">{{ host.profile }}</a>
</td>
<td>
- {{ host.booked }}
+ {{ host.booked|yesno:"Yes,No" }}
</td>
<td>
- {{ host.working }}
+ {{ host.working|yesno:"Yes,No" }}
</td>
</tr>
{% endfor %}
diff --git a/src/templates/resource/steps/define_hardware.html b/src/templates/resource/steps/define_hardware.html
index efd8a09..573b996 100644
--- a/src/templates/resource/steps/define_hardware.html
+++ b/src/templates/resource/steps/define_hardware.html
@@ -10,7 +10,7 @@ with your current configuration will become unavailable.</p>
<h4>NOTE: Only PTL's are able to create multi-node PODs. See
<a href="https://wiki.opnfv.org/display/INF/Lab-as-a-Service+at+the+UNH-IOL">here</a>
for more details</h4>
-<form id="step_form" method="post" class="px-3">
+<form id="step_form" method="post">
{% csrf_token %}
{{form.filter_field|default:"<p>No Form</p>"}}
</form>
diff --git a/src/templates/resource/steps/meta_info.html b/src/templates/resource/steps/meta_info.html
index b6a17a9..6fef065 100644
--- a/src/templates/resource/steps/meta_info.html
+++ b/src/templates/resource/steps/meta_info.html
@@ -8,7 +8,7 @@
<form id="step_form" method="post">
{% csrf_token %}
<table class="px-4">
- {% bootstrap_form form field_class="px-4" label_class="px-4 mt-2" %}
+ {% bootstrap_form form %}
</table>
</form>
{% endblock content %}
diff --git a/src/templates/resource/steps/pod_definition.html b/src/templates/resource/steps/pod_definition.html
index d0a28ed..a6810de 100644
--- a/src/templates/resource/steps/pod_definition.html
+++ b/src/templates/resource/steps/pod_definition.html
@@ -11,71 +11,70 @@
<!-- Calls the main function after the page has loaded. Container is dynamically created. -->
{% block content %}
- <div class="row p-0 w-100 mx-0 position-absolute overflow-hidden topToBottom">
- <div id="graphParent" class="col px-0">
- <div class="row">
- <div class="col pr-0">
- <div id="toolbarContainer" class="bg-light pl-4"></div>
+<div class="h-100 w-100 position-relative">
+ <div class="h-100 w-100 position-absolute overflow-hidden">
+ <div class="row h-100">
+ <div id="graphParent" class="col h-100">
+ <div class="d-flex bg-light border">
+ <div id="toolbarContainer"></div>
+ <div class="ml-4 text-info">Hold right click to drag</div>
</div>
+ <!-- Creates a container for the sidebar -->
+ <div id="graphContainer" class="border h-100"></div>
</div>
- <!-- Creates a container for the sidebar -->
- <div id="graphContainer"></div>
- </div>
- <div id="network_select" class="p-0 w-25 ml-auto col-2">
- <div class="px-0 mb-2">
+ <div id="network_select" class="col-2">
<!-- Creates a container for the outline -->
- <div id="outlineContainer" class="border"></div>
- </div>
- <div>
- <button id="btn_add_network" type="button" class="btn btn-primary w-100" onclick="network_step.newNetworkWindow();">Add Network</button>
+ <div id="outlineContainer" class="border mb-2"></div>
+ <button id="btn_add_network" type="button" class="btn btn-primary w-100 mb-2" onclick="network_step.newNetworkWindow();">Add Network</button>
+ <ul id="network_list" class="list-group">
+ </ul>
+ <button type="button" class="d-none" onclick="network_step.submitForm();">Submit</button>
</div>
- <ul id="network_list" class="list-group">
- </ul>
- <button type="button" class="d-none" onclick="network_step.submitForm();">Submit</button>
</div>
</div>
- <form id="step_form" method="post">
- {% csrf_token %}
- <input type="hidden" id="hidden_xml_input" name="xml" />
- </form>
- <script>
- //gather context data
- let debug = false;
- {% if debug %}
- debug = true;
- {% endif %}
+</div>
+<form id="step_form" method="post">
+ {% csrf_token %}
+ <input type="hidden" id="hidden_xml_input" name="xml">
+</form>
+<script>
+ //gather context data
+ let debug = false;
+ {% if debug %}
+ debug = true;
+ {% endif %}
- let xml = '';
- {% if xml %}
- xml = '{{xml|safe}}';
- {% endif %}
+ let xml = '';
+ {% if xml %}
+ xml = '{{xml|safe}}';
+ {% endif %}
- let hosts = [];
- {% for host in hosts %}
- hosts.push({{host|safe}});
- {% endfor %}
+ let hosts = [];
+ {% for host in hosts %}
+ hosts.push({{host|safe}});
+ {% endfor %}
- let added_hosts = [];
- {% for host in added_hosts %}
- added_hosts.push({{host|safe}});
- {% endfor %}
+ let added_hosts = [];
+ {% for host in added_hosts %}
+ added_hosts.push({{host|safe}});
+ {% endfor %}
- let removed_host_ids = {{removed_hosts|safe}};
+ let removed_host_ids = {{removed_hosts|safe}};
- network_step = new NetworkStep(
- debug,
- xml,
- hosts,
- added_hosts,
- removed_host_ids,
- document.getElementById('graphContainer'),
- document.getElementById('outlineContainer'),
- document.getElementById('toolbarContainer'),
- document.getElementById('sidebarContainer')
- );
- form_submission_callbacks.push(() => network_step.prepareForm());
- </script>
+ network_step = new NetworkStep(
+ debug,
+ xml,
+ hosts,
+ added_hosts,
+ removed_host_ids,
+ document.getElementById('graphContainer'),
+ document.getElementById('outlineContainer'),
+ document.getElementById('toolbarContainer'),
+ document.getElementById('sidebarContainer')
+ );
+ form_submission_callbacks.push(() => network_step.prepareForm());
+</script>
{% endblock content %}
{% block onleave %}
network_step.submitForm();