From 6d0231f9f6189a0ea87d9cab363b60abfb979bc4 Mon Sep 17 00:00:00 2001 From: Andreas Zweili Date: Mon, 25 Dec 2017 00:37:31 +0100 Subject: [PATCH] adding html templates --- docs/docs.org | 50 ++++++++++++++++++++++++ inventory/templates/inventory/base.html | 13 ++++++ inventory/templates/inventory/index.html | 15 +++++++ 3 files changed, 78 insertions(+) create mode 100644 inventory/templates/inventory/base.html create mode 100644 inventory/templates/inventory/index.html diff --git a/docs/docs.org b/docs/docs.org index 3d365ee..28fad72 100644 --- a/docs/docs.org +++ b/docs/docs.org @@ -375,4 +375,54 @@ admin.site.register(CronJob) #!/usr/bin/python3 from django.shortcuts import get_object_or_404, render + +* Templates + +Templates define the look of the application and where things get +positioned on the page. + +** base.html + +The base.html file is the basis for all other html files and gets +extended by them. + +#+BEGIN_SRC html :tangle ../inventory/templates/inventory/base.html + + + + +

{% block section_title %}Device Inventory{% endblock %}

+ {% block content %}{% endblock %} + + + +#+END_SRC + +** index.html + +index.html is the landing page of the project. It gives a list +overview over the active devices. In addition it shows some useful +information about the devices like IP addresses and similar +information. + +#+BEGIN_SRC html :tangle ../inventory/templates/inventory/index.html +{% extends "inventory/base.html" %} +{% block content %} + {% if device_list or computer_list %} + + {% else %} +

No devices are available.

+ {% endif %} +{% endblock %} #+END_SRC diff --git a/inventory/templates/inventory/base.html b/inventory/templates/inventory/base.html new file mode 100644 index 0000000..00a8b93 --- /dev/null +++ b/inventory/templates/inventory/base.html @@ -0,0 +1,13 @@ + + + + +

{% block section_title %}Device Inventory{% endblock %}

+ {% block content %}{% endblock %} + + + diff --git a/inventory/templates/inventory/index.html b/inventory/templates/inventory/index.html new file mode 100644 index 0000000..43780aa --- /dev/null +++ b/inventory/templates/inventory/index.html @@ -0,0 +1,15 @@ +{% extends "inventory/base.html" %} +{% block content %} + {% if device_list or computer_list %} + + {% else %} +

No devices are available.

+ {% endif %} +{% endblock %}