Skip to content
Snippets Groups Projects
Commit 8255e8b7 authored by Benjamin Bertrand's avatar Benjamin Bertrand
Browse files

Split UI between inventory and networks

parent 923c2ff5
No related branches found
No related tags found
No related merge requests found
{% 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 %}
...@@ -24,10 +24,8 @@ ...@@ -24,10 +24,8 @@
<div class="collapse navbar-collapse" id="navbarSupportedContent"> <div class="collapse navbar-collapse" id="navbarSupportedContent">
<div class="navbar-nav mr-auto"> <div class="navbar-nav mr-auto">
{% set path = request.path %} {% 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("/inventory")) }}" href="{{ url_for('inventory.list_items') }}">Inventory</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("/networks")) }}" href="{{ url_for('networks.list_hosts') }}">Networks</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>
{% if current_user.is_authenticated and current_user.is_admin %} {% if current_user.is_authenticated and current_user.is_admin %}
<a class="nav-item nav-link" href="{{ url_for('admin.index') }}">Admin</a> <a class="nav-item nav-link" href="{{ url_for('admin.index') }}">Admin</a>
{% endif %} {% endif %}
...@@ -51,9 +49,9 @@ ...@@ -51,9 +49,9 @@
{% endblock %} {% endblock %}
{% block content %} {% block content %}
<div class="container" id="mainContent"> <div class="container">
{{utils.flashed_messages(messages, container=False, dismissible=True)}} {{utils.flashed_messages(messages, container=False, dismissible=True)}}
{% block main %}{% endblock %} {% block main %}{% endblock %}
</div> </div>
{% endblock %} {% endblock %}
......
{%- extends "base.html" %} {% extends "base-fluid.html" %}
{% from "_helpers.html" import render_field %} {% from "_helpers.html" import render_field %}
{% block title %}Attributes - CSEntry{% endblock %} {% block title %}Attributes - CSEntry{% endblock %}
......
{%- extends "base.html" %} {% extends "base-fluid.html" %}
{% from "_helpers.html" import render_field %} {% from "_helpers.html" import render_field %}
{% block title %}Register Item - CSEntry{% endblock %} {% block title %}Register Item - CSEntry{% endblock %}
......
{%- extends "base.html" %} {% extends "base-fluid.html" %}
{% from "_helpers.html" import render_field %} {% from "_helpers.html" import render_field %}
{% block title %}Edit Item - CSEntry{% endblock %} {% block title %}Edit Item - CSEntry{% endblock %}
......
{%- extends "base.html" %} {% extends "base-fluid.html" %}
{% block title %}Items - CSEntry{% endblock %} {% block title %}Items - CSEntry{% endblock %}
......
{%- extends "base.html" %} {% extends "base-fluid.html" %}
{% block title %}QR Codes - CSEntry{% endblock %} {% block title %}QR Codes - CSEntry{% endblock %}
......
{%- extends "base.html" %} {% extends "base-fluid.html" %}
{% from "_helpers.html" import link_to_item, link_to_items %} {% from "_helpers.html" import link_to_item, link_to_items %}
{% block title %}View Item - CSEntry{% endblock %} {% block title %}View Item - CSEntry{% endblock %}
......
{%- extends "base.html" %} {% extends "base-fluid.html" %}
{% from "_helpers.html" import render_field %} {% from "_helpers.html" import render_field %}
{% block title %}Hosts - CSEntry{% endblock %} {% block title %}Hosts - CSEntry{% endblock %}
......
{%- extends "base.html" %} {% extends "base-fluid.html" %}
{% block title %}Hosts - CSEntry{% endblock %} {% block title %}Hosts - CSEntry{% endblock %}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment