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/notifier/email_ended.txt | 25 +++++++ src/templates/base/notifier/email_expiring.txt | 25 +++++++ src/templates/base/notifier/email_fulfilled.txt | 21 ++++++ src/templates/base/notifier/end_booking.html | 36 ++++++++++ src/templates/base/notifier/expiring_booking.html | 35 +++++++++ src/templates/base/notifier/inbox.html | 87 +++++++++++++++++++++++ src/templates/base/notifier/new_booking.html | 34 +++++++++ src/templates/base/notifier/notification.html | 50 +++++++++++++ 8 files changed, 313 insertions(+) create mode 100644 src/templates/base/notifier/email_ended.txt create mode 100644 src/templates/base/notifier/email_expiring.txt create mode 100644 src/templates/base/notifier/email_fulfilled.txt create mode 100644 src/templates/base/notifier/end_booking.html create mode 100644 src/templates/base/notifier/expiring_booking.html create mode 100644 src/templates/base/notifier/inbox.html create mode 100644 src/templates/base/notifier/new_booking.html create mode 100644 src/templates/base/notifier/notification.html (limited to 'src/templates/base/notifier') diff --git a/src/templates/base/notifier/email_ended.txt b/src/templates/base/notifier/email_ended.txt new file mode 100644 index 0000000..1788e00 --- /dev/null +++ b/src/templates/base/notifier/email_ended.txt @@ -0,0 +1,25 @@ +{{user_name|default:"Developer"}}, + +{% if owner %} +The booking you requested from the OPNFV Lab as a Service has ended. +{% else %} +The booking you collaborated on at the OPNFV Lab as a Service has ended. +{% endif %} + +booking information: + start: {{booking.start}} + end: {{booking.end}} + machines: + {% for host in hosts %} + - {{host}} + {% endfor %} + purpose: {{booking.purpose}} + +You may visit the following link for more information: +{{booking_url}} + +Feel free to create another booking with us! + +Thank you for contributing to the OPNFV platform! + + - The Lab-as-a-Service team diff --git a/src/templates/base/notifier/email_expiring.txt b/src/templates/base/notifier/email_expiring.txt new file mode 100644 index 0000000..72c9a83 --- /dev/null +++ b/src/templates/base/notifier/email_expiring.txt @@ -0,0 +1,25 @@ +{{user_name|default:"Developer"}}, + +{% if owner %} +The booking you requested from the OPNFV Lab as a Service is about to expire. +{% else %} +The booking you collaborate on at the OPNFV Lab as a Service is about to expire. +{% endif %} + +booking information: + start: {{booking.start}} + end: {{booking.end}} + machines: + {% for host in hosts %} + - {{host}} + {% endfor %} + purpose: {{booking.purpose}} + +You may visit the following link for more information: +{{booking_url}} + +Please take the time to backup all data or extend the booking if needed. + +Thank you for contributing to the OPNFV platform! + + - The Lab-as-a-Service team diff --git a/src/templates/base/notifier/email_fulfilled.txt b/src/templates/base/notifier/email_fulfilled.txt new file mode 100644 index 0000000..90d294a --- /dev/null +++ b/src/templates/base/notifier/email_fulfilled.txt @@ -0,0 +1,21 @@ +{{user_name|default:"Developer"}}, + +{% if owner %} +The booking you requested of the OPNFV Lab as a Service has finished deploying and is ready for you to use. +{% else %} +A booking you collaborate on is ready for you to use +{% endif %} + +The lab that fulfilled your booking request has sent you the following messages: + {% for email_message in messages %} + {{ email_message.title }} + {{ email_message.content }} + -------------------- + {% endfor %} + +You may visit the following link for more information: +{{booking_url}} + +Thank you for contributing to the OPNFV platform! + + - The Lab-as-a-Service team diff --git a/src/templates/base/notifier/end_booking.html b/src/templates/base/notifier/end_booking.html new file mode 100644 index 0000000..a2981c1 --- /dev/null +++ b/src/templates/base/notifier/end_booking.html @@ -0,0 +1,36 @@ + + +
+ {% if owner %} +

Your booking has expired

+

Your booking has ended and the machines have been cleaned up.

+

Thank you for working on OPNFV, and feel free to book more machines if you need them.

+ {% else %} +

A booking that you collaborated on has expired

+

The booking owned by {{booking.owner.username}} that you worked on has ended

+

Thank you for contributing to OPNFV!

+ {% endif %} +

Booking information:

+
    +
  • owner: {{booking.owner.username}}
  • +
  • id: {{booking.id}}
  • +
  • lab: {{booking.resource.template.lab.lab_user.username}}
  • +
  • resource: {{booking.resource.template.name}}
  • +
  • start: {{booking.start}}
  • +
  • end: {{booking.end}}
  • +
  • purpose: {{booking.purpose}}
  • +
  • collaborators: +
      + {% for user in booking.collaborators.all %} +
    • user.username
    • + {% empty %} +
    • No collaborators
    • + {% endfor %} +
    +
  • +
+ +

You can find more detailed information Here

+
+ + diff --git a/src/templates/base/notifier/expiring_booking.html b/src/templates/base/notifier/expiring_booking.html new file mode 100644 index 0000000..8bfa689 --- /dev/null +++ b/src/templates/base/notifier/expiring_booking.html @@ -0,0 +1,35 @@ + + +
+ {% if owner %} +

Your booking is about to expire

+

Your booking will expire within 48 hours ({{booking.end}}).

+ {% else %} +

A booking that you collaborate on is about to expire

+

The booking owned by {{booking.owner.username}} that you work on is about to expire

+ {% endif %} +

Please take the time to backup all data or extend the booking if needed.

+

Booking information:

+
    +
  • owner: {{booking.owner.username}}
  • +
  • id: {{booking.id}}
  • +
  • lab: {{booking.resource.template.lab.lab_user.username}}
  • +
  • resource: {{booking.resource.template.name}}
  • +
  • start: {{booking.start}}
  • +
  • end: {{booking.end}}
  • +
  • purpose: {{booking.purpose}}
  • +
  • collaborators: +
      + {% for user in booking.collaborators.all %} +
    • user.username
    • + {% empty %} +
    • No collaborators
    • + {% endfor %} +
    +
  • +
+ +

You can find more detailed information Here

+
+ + diff --git a/src/templates/base/notifier/inbox.html b/src/templates/base/notifier/inbox.html new file mode 100644 index 0000000..26b6d32 --- /dev/null +++ b/src/templates/base/notifier/inbox.html @@ -0,0 +1,87 @@ +{% extends "base.html" %} + + +{% load staticfiles %} + +{% block content %} + +
+
+
+
+ + + +
+
+
+
+ +
+ No messages available +
+ {% for notification in unread_notifications %} + + {{ notification }} + + {% endfor %} +
+
+ {% for notification in read_notifications %} + + {{ notification }} + + {% endfor %} +
+
+ +
+ +
+
+
+ + +{% endblock %} \ No newline at end of file diff --git a/src/templates/base/notifier/new_booking.html b/src/templates/base/notifier/new_booking.html new file mode 100644 index 0000000..64244e0 --- /dev/null +++ b/src/templates/base/notifier/new_booking.html @@ -0,0 +1,34 @@ + + +
+ {% if owner %} +

You have created a new booking

+

We have recieved your booking request and will start working on it right away.

+ {% else %} +

You have been added as a collaborator to a booking

+

{{booking.owner.username}} has given you access to their booking.

+ {% endif %} +

Booking information:

+
    +
  • owner: {{booking.owner.username}}
  • +
  • id: {{booking.id}}
  • +
  • lab: {{booking.resource.template.lab.lab_user.username}}
  • +
  • resource: {{booking.resource.template.name}}
  • +
  • start: {{booking.start}}
  • +
  • end: {{booking.end}}
  • +
  • purpose: {{booking.purpose}}
  • +
  • collaborators: +
      + {% for user in booking.collaborators.all %} +
    • user.username
    • + {% empty %} +
    • No collaborators
    • + {% endfor %} +
    +
  • +
+ +

You can find more detailed information Here

+
+ + diff --git a/src/templates/base/notifier/notification.html b/src/templates/base/notifier/notification.html new file mode 100644 index 0000000..603edea --- /dev/null +++ b/src/templates/base/notifier/notification.html @@ -0,0 +1,50 @@ +{% extends "layout.html" %} +{% block extrahead %} + +{% endblock %} + +{% block basecontent %} + + +
+ {{notification.title}} +
+ + +
+
+ +

+ +{% if not notification.is_html %} +
+{% endif %}
+    {{notification.content|safe}}
+{% if not notification.is_html %}
+
+{% endif %} +
+ {% csrf_token %} +
+{% endblock %} -- cgit 1.2.3-korg