diff --git a/app/templates/base-fluid.html b/app/templates/base-fluid.html new file mode 100644 index 0000000000000000000000000000000000000000..66f6708d339e671c48aceb2cb70b685770978fbf --- /dev/null +++ b/app/templates/base-fluid.html @@ -0,0 +1,33 @@ +{% extends "base.html" %} +{% from "_helpers.html" import is_active %} + +{# overwrite the base content block to use container-fluid instead of container #} +{% block content %} +<div class="container-fluid"> + <div class="row"> + + <div class="col-12 col-md-2 col-xl-2"> + {% set path = request.path %} + <div class="list-group"> + {% if path.startswith("/inventory") %} + <a class="list-group-item list-group-item-action {{ is_active(path.startswith("/inventory/items")) }}" + href="{{ url_for('inventory.list_items') }}">Items</a> + <a class="list-group-item list-group-item-action {{ is_active(path.startswith("/inventory/attributes")) }}" + href="{{ url_for('inventory.attributes', kind='Manufacturer') }}">Attributes</a> + <a class="list-group-item list-group-item-action {{ is_active(path.startswith("/inventory/qrcodes")) }}" + href="{{ url_for('inventory.qrcodes', kind='Action') }}">QR Codes</a> + {% elif path.startswith("/networks") %} + <a class="list-group-item list-group-item-action {{ is_active(path.startswith("/networks/hosts")) }}" + href="{{ url_for('networks.list_hosts') }}">Hosts</a> + {% endif %} + </div> + </div> + + <div class="col-12 col-md-10 col-xl-10"> + {{utils.flashed_messages(messages, container=False, dismissible=True)}} + {% block main %}{% endblock %} + </div> + + </div> +</div> +{% endblock %} diff --git a/app/templates/base.html b/app/templates/base.html index 0f8c49115632288a3d333432689399b1f8671b8d..f398c2331d510d8841d534a02a356732ad501f00 100644 --- a/app/templates/base.html +++ b/app/templates/base.html @@ -24,10 +24,8 @@ <div class="collapse navbar-collapse" id="navbarSupportedContent"> <div class="navbar-nav mr-auto"> {% set path = request.path %} - <a class="nav-item nav-link {{ is_active(path.startswith("/inventory/items")) }}" href="{{ url_for('inventory.list_items') }}">Items</a> - <a class="nav-item nav-link {{ is_active(path.startswith("/networks/hosts")) }}" href="{{ url_for('networks.list_hosts') }}">Hosts</a> - <a class="nav-item nav-link {{ is_active(path.startswith("/inventory/attributes")) }}" href="{{ url_for('inventory.attributes', kind='Manufacturer') }}">Attributes</a> - <a class="nav-item nav-link {{ is_active(path.startswith("/inventory/qrcodes")) }}" href="{{ url_for('inventory.qrcodes', kind='Action') }}">QR Codes</a> + <a class="nav-item nav-link {{ is_active(path.startswith("/inventory")) }}" href="{{ url_for('inventory.list_items') }}">Inventory</a> + <a class="nav-item nav-link {{ is_active(path.startswith("/networks")) }}" href="{{ url_for('networks.list_hosts') }}">Networks</a> {% if current_user.is_authenticated and current_user.is_admin %} <a class="nav-item nav-link" href="{{ url_for('admin.index') }}">Admin</a> {% endif %} @@ -51,9 +49,9 @@ {% endblock %} {% block content %} - <div class="container" id="mainContent"> - {{utils.flashed_messages(messages, container=False, dismissible=True)}} - {% block main %}{% endblock %} + <div class="container"> + {{utils.flashed_messages(messages, container=False, dismissible=True)}} + {% block main %}{% endblock %} </div> {% endblock %} diff --git a/app/templates/inventory/attributes.html b/app/templates/inventory/attributes.html index cfff079f39a82313d76288774ec593ce086295a8..e5c5e2def296101ee82c074aff27c7388f412d89 100644 --- a/app/templates/inventory/attributes.html +++ b/app/templates/inventory/attributes.html @@ -1,4 +1,4 @@ -{%- extends "base.html" %} +{% extends "base-fluid.html" %} {% from "_helpers.html" import render_field %} {% block title %}Attributes - CSEntry{% endblock %} diff --git a/app/templates/inventory/create_item.html b/app/templates/inventory/create_item.html index 340d8474ebbddbe89e3e2754014da5e49c3f7e85..4a1979e1ae2c826496a2fac5743a53c94e9c1b6a 100644 --- a/app/templates/inventory/create_item.html +++ b/app/templates/inventory/create_item.html @@ -1,4 +1,4 @@ -{%- extends "base.html" %} +{% extends "base-fluid.html" %} {% from "_helpers.html" import render_field %} {% block title %}Register Item - CSEntry{% endblock %} diff --git a/app/templates/inventory/edit_item.html b/app/templates/inventory/edit_item.html index 743ecef05be4d805079e3b7e7c54ef5a2e919840..9ca6d2bb52ce3c842dc008ab74ebfa7e23943a37 100644 --- a/app/templates/inventory/edit_item.html +++ b/app/templates/inventory/edit_item.html @@ -1,4 +1,4 @@ -{%- extends "base.html" %} +{% extends "base-fluid.html" %} {% from "_helpers.html" import render_field %} {% block title %}Edit Item - CSEntry{% endblock %} diff --git a/app/templates/inventory/items.html b/app/templates/inventory/items.html index 43df6de9a2fdbc30af8afc08043075142808b7c7..9d46616d96b2e7933ae13b23e6a679241748c381 100644 --- a/app/templates/inventory/items.html +++ b/app/templates/inventory/items.html @@ -1,4 +1,4 @@ -{%- extends "base.html" %} +{% extends "base-fluid.html" %} {% block title %}Items - CSEntry{% endblock %} diff --git a/app/templates/inventory/qrcodes.html b/app/templates/inventory/qrcodes.html index eca4e461fb20f0a70aaa4c6d9b2f9f7be3b9a057..606f1350f04180e375836d897e097af166703260 100644 --- a/app/templates/inventory/qrcodes.html +++ b/app/templates/inventory/qrcodes.html @@ -1,4 +1,4 @@ -{%- extends "base.html" %} +{% extends "base-fluid.html" %} {% block title %}QR Codes - CSEntry{% endblock %} diff --git a/app/templates/inventory/view_item.html b/app/templates/inventory/view_item.html index 4c0c0d2efc150f4c47d66fb5a14fa4d5843dc288..39c979f8242c2edf13408440c1fe0758e3102b3a 100644 --- a/app/templates/inventory/view_item.html +++ b/app/templates/inventory/view_item.html @@ -1,4 +1,4 @@ -{%- extends "base.html" %} +{% extends "base-fluid.html" %} {% from "_helpers.html" import link_to_item, link_to_items %} {% block title %}View Item - CSEntry{% endblock %} diff --git a/app/templates/networks/create_host.html b/app/templates/networks/create_host.html index 6c4f8f9e2d1c855bbdb5e3fc32d007130a2d992a..b60774029ede2d0ec2b4af7a1d16d02624c5898d 100644 --- a/app/templates/networks/create_host.html +++ b/app/templates/networks/create_host.html @@ -1,4 +1,4 @@ -{%- extends "base.html" %} +{% extends "base-fluid.html" %} {% from "_helpers.html" import render_field %} {% block title %}Hosts - CSEntry{% endblock %} diff --git a/app/templates/networks/hosts.html b/app/templates/networks/hosts.html index 0d0f266ba417fbf702e02473c0e103c9d153a16e..e5447fa5a7c2494bbe2b64d1a5a5f4701d8b42dd 100644 --- a/app/templates/networks/hosts.html +++ b/app/templates/networks/hosts.html @@ -1,4 +1,4 @@ -{%- extends "base.html" %} +{% extends "base-fluid.html" %} {% block title %}Hosts - CSEntry{% endblock %}