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/dashboard/genericselect.html | 30 ++++ .../base/dashboard/host_profile_detail.html | 70 +++++++++ src/templates/base/dashboard/idf.yaml | 46 ++++++ src/templates/base/dashboard/lab_detail.html | 165 +++++++++++++++++++++ src/templates/base/dashboard/lab_list.html | 29 ++++ src/templates/base/dashboard/landing.html | 77 ++++++++++ src/templates/base/dashboard/login.html | 8 + .../dashboard/multiple_select_filter_widget.html | 54 +++++++ src/templates/base/dashboard/pdf.yaml | 92 ++++++++++++ src/templates/base/dashboard/resource.html | 57 +++++++ src/templates/base/dashboard/resource_all.html | 70 +++++++++ src/templates/base/dashboard/resource_detail.html | 151 +++++++++++++++++++ .../base/dashboard/searchable_select_multiple.html | 73 +++++++++ src/templates/base/dashboard/server_table.html | 30 ++++ src/templates/base/dashboard/table.html | 39 +++++ 15 files changed, 991 insertions(+) create mode 100644 src/templates/base/dashboard/genericselect.html create mode 100644 src/templates/base/dashboard/host_profile_detail.html create mode 100644 src/templates/base/dashboard/idf.yaml create mode 100644 src/templates/base/dashboard/lab_detail.html create mode 100644 src/templates/base/dashboard/lab_list.html create mode 100644 src/templates/base/dashboard/landing.html create mode 100644 src/templates/base/dashboard/login.html create mode 100644 src/templates/base/dashboard/multiple_select_filter_widget.html create mode 100644 src/templates/base/dashboard/pdf.yaml create mode 100644 src/templates/base/dashboard/resource.html create mode 100644 src/templates/base/dashboard/resource_all.html create mode 100644 src/templates/base/dashboard/resource_detail.html create mode 100644 src/templates/base/dashboard/searchable_select_multiple.html create mode 100644 src/templates/base/dashboard/server_table.html create mode 100644 src/templates/base/dashboard/table.html (limited to 'src/templates/base/dashboard') diff --git a/src/templates/base/dashboard/genericselect.html b/src/templates/base/dashboard/genericselect.html new file mode 100644 index 0000000..863d33f --- /dev/null +++ b/src/templates/base/dashboard/genericselect.html @@ -0,0 +1,30 @@ +{% extends "workflow/viewport-element.html" %} + +{% load bootstrap4 %} + +{% block content %} + +
+

Create a Resource + +

+
+

Or select from the list below:

+
+
+ {% csrf_token %} + {{ form|default:"

no form loaded

" }} +
+
+
+ + + +{% endblock content %} diff --git a/src/templates/base/dashboard/host_profile_detail.html b/src/templates/base/dashboard/host_profile_detail.html new file mode 100644 index 0000000..f65d4fe --- /dev/null +++ b/src/templates/base/dashboard/host_profile_detail.html @@ -0,0 +1,70 @@ +{% extends "base.html" %} +{% load staticfiles %} + +{% block extrahead %} + {{block.super}} + + + +{% endblock %} + +{% block content %} + + + +
+ +
+ {% for host in hosts %} +
+

stub for current PR

+
+ {% endfor %} +
+
+ +{% endblock content %} diff --git a/src/templates/base/dashboard/idf.yaml b/src/templates/base/dashboard/idf.yaml new file mode 100644 index 0000000..9e0cc26 --- /dev/null +++ b/src/templates/base/dashboard/idf.yaml @@ -0,0 +1,46 @@ +--- +idf: + version: {{version|default:"0.1"}} + net_config: + oob: + ip-range: {{net_config.oob.ip_range}} + vlan: {{net_config.oob.vlan}} + admin: + interface: {{net_config.admin.interface}} + vlan: {{net_config.admin.vlan}} + network: {{net_config.admin.network}} + mask: {{net_config.admin.mask}} + mgmt: + interface: {{net_config.mgmt.interface}} + vlan: {{net_config.mgmt.vlan}} + network: {{net_config.mgmt.network}} + mask: {{net_config.mgmt.mask}} + private: + interface: {{net_config.private.interface}} + vlan: {{net_config.private.vlan}} + network: {{net_config.private.network}} + mask: {{net_config.private.mask}} + public: + interface: {{net_config.public.interface}} + vlan: {{net_config.public.vlan}} + network: {{net_config.public.network}} + mask: {{net_config.public.mask}} + ip-range: {{net_config.public.ip_range}} + mask: {{net_config.public.mask}} + gateway: {{net_config.public.gateway}} + dns: {% for serv in net_config.public.dns %} + - {{serv}}{% endfor %} + fuel: + jumphost: + bridges: + admin: {{fuel.jumphost.bridges.admin}} + mgmt: {{fuel.jumphost.bridges.mgmt}} + private: {{fuel.jumphost.bridges.private}} + public: {{fuel.jumphost.bridges.public}} + network: {% for node in fuel.network.nodes %} + node: + - interfaces: {% for iface in node.interfaces %} + - {{ iface }}{% endfor %} + - busaddr: {% for addr in node.bus_addrs %} + - {{addr}}{% endfor %} + {% endfor %} diff --git a/src/templates/base/dashboard/lab_detail.html b/src/templates/base/dashboard/lab_detail.html new file mode 100644 index 0000000..a12c5da --- /dev/null +++ b/src/templates/base/dashboard/lab_detail.html @@ -0,0 +1,165 @@ +{% extends "base.html" %} +{% load staticfiles %} + +{% block extrahead %} + {{block.super}} + +{% endblock %} + +{% block content %} +
+
+
+
+

Lab Profile

+ +
+
+
+ + + + + + + + + + + + + + {% if lab.contact_phone %} + + + + + {% endif %} + + + {% if lab.status < 100 %} + + {% elif lab.status < 200 %} + + {% else %} + + {% endif %} + +
Lab Name: {{lab.name}}
Lab Location: {{lab.location}}
Lab Email: {{lab.contact_email}}
Lab Phone: {{lab.contact_phone}}
Lab Status: +
+ Up +
+
+ Temporarily Offline +
+
+ Offline Indefinitely +
+
+
+
+
+
+

Host Profiles

+ +
+
+
+ + {% for profile in hostprofiles %} + + + + + + {% endfor %} +
{{profile.name}}{{profile.description}}Profile
+
+
+
+ +
+
+

Networking Capabilities

+ +
+ +
+ + + + + + + + +
Block Size: (number of VLANs allowed per deployment){{lab.vlan_manager.block_size}}
Overlapping Vlans Allowed (user can pick which VLANs they wish to use): {{lab.vlan_manager.allow_overlapping|yesno:"Yes,No"}}
+
+
+
+
+

Images

+ +
+
+
+ + + + + + + + {% for image in images %} + + + + + + + {% endfor %} +
NameOwnerFor Host TypeDescription
{{image.name}}{{image.owner}}{{image.host_type}}{{image.description}}
+
+
+
+ +
+
+
+
+

Lab Hosts

+ +
+ +
+ + + + + + + + + {% for host in lab.host_set.all %} + + + + + {% if host.working %} + + {% else %} + + {% endif %} + + + {% endfor %} +
NameProfileBookedWorkingVendor
{{host.labid}}{{host.profile}}{{host.booked|yesno:"Yes,No"}}YesNo{{host.vendor}}
+
+
+
+ +
+ + +{% endblock content %} + diff --git a/src/templates/base/dashboard/lab_list.html b/src/templates/base/dashboard/lab_list.html new file mode 100644 index 0000000..ba627bc --- /dev/null +++ b/src/templates/base/dashboard/lab_list.html @@ -0,0 +1,29 @@ +{% extends "base.html" %} +{% block content %} +
+ {% for lab in labs %} +
+
+
+

{{lab.name}}

+
+
    +
  • name: {{lab.name}}
  • +
  • description: {{lab.description}}
  • +
  • location: {{lab.location}}
  • + {% if lab.status == 0 %} +
  • status: Up
  • + {% elif lab.status == 100 %} +
  • status: Down for Maintenance
  • + {% elif lab.status == 200 %} +
  • status: Down
  • + {% endif %} +
+ +
+
+ {% endfor %} +
+{% endblock %} \ No newline at end of file diff --git a/src/templates/base/dashboard/landing.html b/src/templates/base/dashboard/landing.html new file mode 100644 index 0000000..9e45b09 --- /dev/null +++ b/src/templates/base/dashboard/landing.html @@ -0,0 +1,77 @@ +{% extends "base.html" %} +{% load staticfiles %} + +{% block content %} +
+ {% if not request.user.is_anonymous %} + {% if not request.user.userprofile.ssh_public_key %} + + {% endif %} + {% else %} + {% endif %} +
+{% csrf_token %} + +
+ +
+

About Us

+ {% block about_us %} +

Here is some information about us!

+ {% endblock about_us %} +
+ + +
+

Get Started

+ {% if request.user.is_anonymous %} +

+ To get started, please log in with your Linux Foundation Jira account +

+ {% else %} +

To get started, book a server below:

+ + Book a Server + +

PTLs can use our advanced options to book multi-node pods. If you are a PTL, you may use the options + below: +

+
+ + + +
+ {% endif %} +
+ + + {% if not request.user.is_anonymous %} +
+

Returning Users

+

If you're a returning user, some of the following options may be of interest:

+
+ + + My Bookings + + {% if manager == True %} + + {% endif %} +
+
+ {% endif %} +
+ +
+
+ {% csrf_token %} +
+
+ +{% endblock content %} diff --git a/src/templates/base/dashboard/login.html b/src/templates/base/dashboard/login.html new file mode 100644 index 0000000..d3aa4ad --- /dev/null +++ b/src/templates/base/dashboard/login.html @@ -0,0 +1,8 @@ +{% extends "base.html" %} + +{% block content %} +

You Must Login To Do That

+ +Login Here + +{% endblock %} diff --git a/src/templates/base/dashboard/multiple_select_filter_widget.html b/src/templates/base/dashboard/multiple_select_filter_widget.html new file mode 100644 index 0000000..92aa1ba --- /dev/null +++ b/src/templates/base/dashboard/multiple_select_filter_widget.html @@ -0,0 +1,54 @@ + +
+ {% for object_class, object_list in display_objects %} +
+
+
+

{{object_class}}

+
+
+ {% for obj in object_list %} +
+
+
+

{{obj.name}}

+
+
+

{{obj.description}}

+
+ +
+
+ {% endfor %} +
+
+
+ {% endfor %} +
+ + + diff --git a/src/templates/base/dashboard/pdf.yaml b/src/templates/base/dashboard/pdf.yaml new file mode 100644 index 0000000..c893919 --- /dev/null +++ b/src/templates/base/dashboard/pdf.yaml @@ -0,0 +1,92 @@ +--- +version: {{version|default:"1.0"}} +details: + contact: {{details.contact}} + lab: {{details.lab}} + link: {{details.link}} + location: {{details.location}} + pod_owner: {{details.owner}} + type: {{details.type}} +jumphost: + disks: + {% for disk in jumphost.disks %} + - disk_capacity: {{disk.capacity}} + disk_interface: {{disk.interface}} + disk_rotation: {{disk.rotation}} + disk_type: {{disk.type}} + name: {{disk.name}} + {% endfor %} + interfaces: + {% for interface in jumphost.interfaces %} + - features: {{interface.features}} + mac_address: {{interface.mac_address}} + name: {{interface.name}} + speed: {{interface.speed}} + {% endfor %} + name: {{jumphost.name}} + node: + arch: {{jumphost.node.arch}} + cores: {{jumphost.node.cores}} + cpu_cflags: {{jumphost.node.cpu_cflags}} + cpus: {{jumphost.node.cpus}} + memory: {{jumphost.node.memory}} + model: {{jumphost.node.model}} + type: {{jumphost.node.type}} + vendor: {{jumphost.node.vendor}} + os: {{jumphost.os}} + remote_management: + address: {{jumphost.remote.address}} + mac_address: {{jumphost.remote.mac_address}} + pass: {{jumphost.remote.pass}} + type: {{jumphost.remote.type}} + user: {{jumphost.remote.user}} + versions: + {% for version in jumphost.remote.versions %} + - {{version}} + {% endfor %} + remote_params: + pass: {{jumphost.remote.pass}} + type: {{jumphost.remote.type}} + user: {{jumphost.remote.user}} + versions: + {% for version in jumphost.remote.versions %} + - {{version}} + {% endfor %} +nodes: +{% for node in nodes %} +- disks: + {% for disk in node.disks %} + - disk_capacity: {{disk.capacity}} + disk_interface: {{disk.interface}} + disk_rotation: {{disk.rotation}} + disk_type: {{disk.type}} + name: {{disk.name}} + {% endfor %} + interfaces: + {% for interface in node.interfaces %} + - features: {{interface.features}} + mac_address: {{interface.mac_address}} + name: {{interface.name}} + speed: {{interface.speed}} + {% endfor %} + name: {{node.name}} + node: + arch: {{node.node.arch}} + cores: {{node.node.cores}} + cpu_cflags: {{node.node.cpu_cflags}} + cpus: {{node.node.cpus}} + memory: {{node.node.memory}} + model: {{node.node.model}} + type: {{node.node.type}} + vendor: {{node.node.vendor}} + remote_management: + address: {{node.remote.address}} + mac_address: {{node.remote.mac_address}} + pass: {{node.remote.pass}} + type: {{node.remote.type}} + user: {{node.remote.user}} + versions: + {% for version in node.remote.versions %} + - {{version}} + {% endfor %} +{% endfor %} diff --git a/src/templates/base/dashboard/resource.html b/src/templates/base/dashboard/resource.html new file mode 100644 index 0000000..f36ee7b --- /dev/null +++ b/src/templates/base/dashboard/resource.html @@ -0,0 +1,57 @@ +{% extends "base.html" %} +{% load staticfiles %} + +{% block extrahead %} + {{ block.super }} + + + + + + + + +{% endblock extrahead %} + + +{% block content %} + {% include "dashboard/resource_detail.html" %} +{% endblock content %} + + +{% block extrajs %} + + + + + + + + + + + + + + + + + + + +{% endblock extrajs %} \ No newline at end of file diff --git a/src/templates/base/dashboard/resource_all.html b/src/templates/base/dashboard/resource_all.html new file mode 100644 index 0000000..fb8cc7e --- /dev/null +++ b/src/templates/base/dashboard/resource_all.html @@ -0,0 +1,70 @@ +{% extends "base.html" %} +{% load staticfiles %} + +{% block extrahead %} + {{ block.super }} + + + + + + + + +{% endblock extrahead %} + + +{% block content %} + {% for resource, utilization, bookings in pods %} +
+
+
+
+ {{ resource.name }} +
+
+ {% include "dashboard/resource_detail.html" %} +
+
+
+
+ {% endfor %} +{% endblock content %} + + +{% block extrajs %} + + + + + + + + + + + + + + + + < + + +{% endblock extrajs %} \ No newline at end of file diff --git a/src/templates/base/dashboard/resource_detail.html b/src/templates/base/dashboard/resource_detail.html new file mode 100644 index 0000000..0a443d9 --- /dev/null +++ b/src/templates/base/dashboard/resource_detail.html @@ -0,0 +1,151 @@ +
+
+
+
+ Status +
+
+
+ {% for status in resource.resourcestatus_set.all %} + + {{ status.title }} + + {{ status.timestamp }} + + + {% endfor %} +
+
+
+
+
+
+
+ Servers +
+
+
+ + {% include "dashboard/server_table.html" %} +
+
+
+
+
+
+
+
+
+
+ Booking Utilization +
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+ Bookings +
+
+
+ + {% include "booking/booking_table.html" %} +
+
+
+
+
+
+
+
+
+
+ Contact +
+
+

+ Lab Owner: + {{ resource.owner.username }} +

+

+ Email: + {{ resource.owner.email }} +

+

+ + Booking + + + OPNFV Wiki + +

+
+
+
+
+
+
+ VPN Users +
+
+
+ + + + + + + + + + {% for user in resource.vpn_users.all %} + + + + + + {% endfor %} +
UserEmailCompany
+ {{ user.username }} + + {{ user.email }} + + {{ user.userprofile.company }} +
+ +
+
+
+
+
diff --git a/src/templates/base/dashboard/searchable_select_multiple.html b/src/templates/base/dashboard/searchable_select_multiple.html new file mode 100644 index 0000000..f7fd189 --- /dev/null +++ b/src/templates/base/dashboard/searchable_select_multiple.html @@ -0,0 +1,73 @@ +
+ {% if incompatible == "true" %} + + {% endif %} +
+ 0 + / {% if selectable_limit > -1 %} {{ selectable_limit }} {% else %} ∞ {% endif %}added +
+ +
+ +
+ + + + + +
+
+
+
+ + diff --git a/src/templates/base/dashboard/server_table.html b/src/templates/base/dashboard/server_table.html new file mode 100644 index 0000000..f01bd60 --- /dev/null +++ b/src/templates/base/dashboard/server_table.html @@ -0,0 +1,30 @@ + + + Server + Model + CPU + RAM + Storage + + + +{% for server in resource.server_set.all %} + + + {{ server.name }} + + + {{ server.model }} + + + {{ server.cpu }} + + + {{ server.ram }} + + + {{ server.storage }} + + +{% endfor %} + \ No newline at end of file diff --git a/src/templates/base/dashboard/table.html b/src/templates/base/dashboard/table.html new file mode 100644 index 0000000..2b4628e --- /dev/null +++ b/src/templates/base/dashboard/table.html @@ -0,0 +1,39 @@ +{% extends "base.html" %} +{% load staticfiles %} + +{% block extrahead %} + {{ block.super }} + + + + + +{% endblock extrahead %} + +{% block content %} +
+
+
+ + {% block table %} + {% endblock table %} +
+
+
+
+{% endblock content %} + +{% block extrajs %} + + + + + + + + {% block tablejs %} + {% endblock tablejs %} +{% endblock extrajs %} -- cgit 1.2.3-korg