From 078273eb7db5a481a4131d44a943f3c9e34b6b88 Mon Sep 17 00:00:00 2001 From: Parker Berberian Date: Thu, 30 Jan 2020 13:33:35 -0500 Subject: Adds Template Overrides Changes the structure of the template directories to allow a new project to define their own set of override templates that inherit from a common base. I have slightly modified landing.html here as an example. In comming changes we will try to move all the "laas" specific content into the laas directory Change-Id: I46151be182de901f870debb247b305ea34ae77ba Signed-off-by: Parker Berberian --- src/templates/base/booking/booking_calendar.html | 207 ++++++++++++++ src/templates/base/booking/booking_delete.html | 11 + src/templates/base/booking/booking_detail.html | 303 +++++++++++++++++++++ src/templates/base/booking/booking_grid_item.html | 11 + src/templates/base/booking/booking_list.html | 44 +++ src/templates/base/booking/booking_table.html | 37 +++ src/templates/base/booking/quick_deploy.html | 140 ++++++++++ src/templates/base/booking/stats.html | 71 +++++ src/templates/base/booking/steps/booking_meta.html | 38 +++ 9 files changed, 862 insertions(+) create mode 100644 src/templates/base/booking/booking_calendar.html create mode 100644 src/templates/base/booking/booking_delete.html create mode 100644 src/templates/base/booking/booking_detail.html create mode 100644 src/templates/base/booking/booking_grid_item.html create mode 100644 src/templates/base/booking/booking_list.html create mode 100644 src/templates/base/booking/booking_table.html create mode 100644 src/templates/base/booking/quick_deploy.html create mode 100644 src/templates/base/booking/stats.html create mode 100644 src/templates/base/booking/steps/booking_meta.html (limited to 'src/templates/base/booking') diff --git a/src/templates/base/booking/booking_calendar.html b/src/templates/base/booking/booking_calendar.html new file mode 100644 index 0000000..450c97f --- /dev/null +++ b/src/templates/base/booking/booking_calendar.html @@ -0,0 +1,207 @@ +{% extends "base.html" %} +{% load staticfiles %} + +{% load bootstrap4 %} + +{% block extrahead %} + {{ block.super }} + + + +{% endblock extrahead %} + +{% block content %} +
+
+
+
+ Calendar +
+
+
+
+
+
+
+
+ +
+
+
+ Booking +
+
+ {% if user.is_authenticated %} +
+ {% bootstrap_form_errors form type='non_fields' %} +
+ {% csrf_token %} + +
+ {% bootstrap_field form.start addon_after='' %} +
+
+ {% bootstrap_field form.end addon_after='' %} +
+ {% bootstrap_field form.opsys %} + {% bootstrap_field form.purpose %} + {% bootstrap_field form.installer %} + {% bootstrap_field form.scenario %} + {% buttons %} + +

+
By continuing, you agree to our + Acceptable Usage Policy +

+ {% endbuttons %} +
+
+
+ {% bootstrap_form_errors form type='non_fields' %} +
+ {% csrf_token %} +
+
+ {% bootstrap_field form.start addon_after='' %} +
+
+ {% bootstrap_field form.end addon_after='' %} +
+
+ + {% bootstrap_field form.opsys %} + {% bootstrap_field form.purpose %} + {% bootstrap_field form.installer %} + {% bootstrap_field form.scenario %} + {% bootstrap_field form.reset %} + {% buttons %} + + {% endbuttons %} +
+
+ + {% else %} +

Please + + login with Jira + to book this Pod

+ {% endif %} +
+
+
+ + +{% endblock content %} + +{% block extrajs %} + + + + + + + + +{% endblock extrajs %} diff --git a/src/templates/base/booking/booking_delete.html b/src/templates/base/booking/booking_delete.html new file mode 100644 index 0000000..b89eb15 --- /dev/null +++ b/src/templates/base/booking/booking_delete.html @@ -0,0 +1,11 @@ +{% load jira_filters %} +{% load bootstrap4 %} + +

+ Really delete Booking from {{ booking.start}} to {{ booking.end }}? +

+

+

+

\ No newline at end of file diff --git a/src/templates/base/booking/booking_detail.html b/src/templates/base/booking/booking_detail.html new file mode 100644 index 0000000..fea2bb6 --- /dev/null +++ b/src/templates/base/booking/booking_detail.html @@ -0,0 +1,303 @@ +{% extends "base.html" %} +{% load staticfiles %} +{% load bootstrap4 %} + +{% block extrahead %} + {{block.super}} + +{% endblock %} + +{% block content %} +
+
+
+
+

Overview

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Purpose{{ booking.purpose }}
Project{{ booking.project }}
Start Time{{ booking.start }}
End Time{{ booking.end }}
Pod Definition{{ booking.resource.template }}
Pod Configuration{{ booking.config_bundle }}
Lab Deployed At{{ booking.lab }}
+
+
+
+
+

Pod

+ +
+
+
+ {% for host in booking.resource.hosts.all %} +

{{host.template.resource.name}}

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Hostname:{{host.template.resource.name}}
Machine:{{host.name}}
Role:{{host.config.opnfvRole}}
Image: + {{host.config.image}} +
RAM:{{host.profile.ramprofile.first.amount}}G, + {{host.profile.ramprofile.first.channels}} channels
CPU: + + + + + + + + + + + + + +
Arch:{{host.profile.cpuprofile.first.architecture}}
Cores:{{host.profile.cpuprofile.first.cores}}
Sockets:{{host.profile.cpuprofile.first.cpus}}
+
DISK: + + + + + + + + + + + + + +
Size:{{host.profile.storageprofile.first.size}} GiB
Type:{{host.profile.storageprofile.first.media_type}}
Mount Point:{{host.profile.storageprofile.first.name}}
+
Interfaces: + + {% for intprof in host.profile.interfaceprofile.all %} + + + + {% endfor %} +
+ + + + + + + + + +
Name:{{intprof.name}}
Speed:{{intprof.speed}}
+
+
+
+ {% endfor %} +
+
+
+
+
+
+
+

Deployment Progress

+

These are the different tasks that have to be completed before your deployment is ready

+ +
+
+ + + + + + + + {% for task in booking.job.get_tasklist %} + + + + + + + {% endfor %} +
StatusLab ResponseType
+ {% if task.status < 100 %} +
+ {% elif task.status < 200 %} +
+ {% else %} +
+ {% endif %} +
+ {% if task.status < 100 %} + PENDING + {% elif task.status < 200 %} + IN PROGRESS + {% else %} + DONE + {% endif %} + + {% if task.message %} + {% if task.type_str == "Access Task" and user_id != task.config.user.id %} + Message from Lab:
--secret--
+ {% else %} + Message from Lab:
{{ task.message }}
+ {% endif %} + {% else %} + No response provided (yet) + {% endif %} +
+ {{ task.type_str }} +
+
+
+
+
+

PDF

+ +
+
+
+
+{{pdf}}
+                    
+
+
+
+
+
+ + + + + +{% endblock content %} diff --git a/src/templates/base/booking/booking_grid_item.html b/src/templates/base/booking/booking_grid_item.html new file mode 100644 index 0000000..3c72fd2 --- /dev/null +++ b/src/templates/base/booking/booking_grid_item.html @@ -0,0 +1,11 @@ +

{{ id|default:"id" }}

+

{{ lab|default:"lab" }}

+

{{ resource_name|default:"resource name" }}

+

{{ start|default:"start" }}

+

{{ end|default:"end" }}

+

Collaborators:

+ diff --git a/src/templates/base/booking/booking_list.html b/src/templates/base/booking/booking_list.html new file mode 100644 index 0000000..591ecc9 --- /dev/null +++ b/src/templates/base/booking/booking_list.html @@ -0,0 +1,44 @@ +{% extends "base.html" %} +{% load staticfiles %} +{% load bootstrap4 %} + +{% block extrahead %} + {{ block.super }} + + + + + +{% endblock extrahead %} + +{% block content %} +
+
+
+
+ + {% include "booking/booking_table.html" %} +
+
+
+
+
+{% endblock content %} + +{% block extrajs %} + + + + + +{% endblock extrajs %} diff --git a/src/templates/base/booking/booking_table.html b/src/templates/base/booking/booking_table.html new file mode 100644 index 0000000..32a0146 --- /dev/null +++ b/src/templates/base/booking/booking_table.html @@ -0,0 +1,37 @@ +{% load jira_filters %} + + + + + Owner + Purpose + Project + Start + End + Operating System + + + +{% for booking in bookings %} + + + {{ booking.owner.username }} + + + {{ booking.purpose }} + + + {{ booking.project }} + + + {{ booking.start }} + + + {{ booking.end }} + + + {{ booking.resource.get_head_node.config.image.os.name }} + + +{% endfor %} + diff --git a/src/templates/base/booking/quick_deploy.html b/src/templates/base/booking/quick_deploy.html new file mode 100644 index 0000000..8570f25 --- /dev/null +++ b/src/templates/base/booking/quick_deploy.html @@ -0,0 +1,140 @@ +{% extends "base.html" %} +{% load staticfiles %} +{% load bootstrap4 %} +{% block content %} + +{% bootstrap_form_errors form type='non_fields' %} +
+ {% csrf_token %} +
+
+

Please select a host type you wish to book. Only available types are shown.

+ {% bootstrap_field form.filter_field show_label=False %} +
+
+
+
+
+ {% bootstrap_field form.purpose %} + {% bootstrap_field form.project %} + {% bootstrap_field form.length %} + Days: 0 + +
+
+
+
+ + {{ form.users }} +
+
+
+
+ {% bootstrap_field form.hostname %} + {% bootstrap_field form.image %} +
+
+
+
+ OPNFV: (Optional) + {% bootstrap_field form.installer %} + {% bootstrap_field form.scenario %} +
+
+
+ +
+
+
+ + +{% endblock %} diff --git a/src/templates/base/booking/stats.html b/src/templates/base/booking/stats.html new file mode 100644 index 0000000..94239f9 --- /dev/null +++ b/src/templates/base/booking/stats.html @@ -0,0 +1,71 @@ +{% extends "base.html" %} +{% load staticfiles %} + +{% block extrahead %} +{{ block.super }} + + +{% endblock %} + +{% block content %} +
+
+

Number of days to plot:

+
+ + +
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+ +{% endblock content %} diff --git a/src/templates/base/booking/steps/booking_meta.html b/src/templates/base/booking/steps/booking_meta.html new file mode 100644 index 0000000..f12496e --- /dev/null +++ b/src/templates/base/booking/steps/booking_meta.html @@ -0,0 +1,38 @@ +{% extends "workflow/viewport-element.html" %} +{% load staticfiles %} + +{% load bootstrap4 %} + +{% block content %} + +{% bootstrap_form_errors form type='non_fields' %} +
+{% csrf_token %} +
+
+
+ {% bootstrap_field form.purpose %} + {% bootstrap_field form.project %} + {% bootstrap_field form.length %} + Days: 0 + + {% bootstrap_field form.info_file %} +

You must provide a url to your project's INFO.yaml file if you are a PTL and you are trying to book a POD with multiple servers in it.

+ {% bootstrap_field form.deploy_opnfv %} +
+
+

You may add collaborators on your booking to share resources with coworkers.

+ {% bootstrap_field form.users label="Collaborators" %} +
+
+
+ {% buttons %} + + {% endbuttons %} +
+
+
+{% endblock content %} -- cgit 1.2.3-korg