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

Create specific items page

parent 06d773d0
No related branches found
No related tags found
No related merge requests found
...@@ -63,6 +63,12 @@ def index(): ...@@ -63,6 +63,12 @@ def index():
return render_template('index.html') return render_template('index.html')
@bp.route('/items')
@login_required
def items_index():
return render_template('items.html')
@bp.route('/view/<ics_id>') @bp.route('/view/<ics_id>')
@login_required @login_required
def view_item(ics_id): def view_item(ics_id):
......
File moved
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<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 in ("/", "/index", "/index/")) }}" href="{{ url_for('main.index') }}">Items</a> <a class="nav-item nav-link {{ is_active(path.startswith("/items")) }}" href="{{ url_for('main.items_index') }}">Items</a>
<a class="nav-item nav-link {{ is_active(path == "/hosts") }}" href="{{ url_for('main.hosts_index') }}">Hosts</a> <a class="nav-item nav-link {{ is_active(path == "/hosts") }}" href="{{ url_for('main.hosts_index') }}">Hosts</a>
<div class="dropdown {{ is_active(path.startswith("/qrcodes")) }}"> <div class="dropdown {{ is_active(path.startswith("/qrcodes")) }}">
<a class="nav-link dropdown-toggle" href="#" id="qrcodesDropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <a class="nav-link dropdown-toggle" href="#" id="qrcodesDropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
......
...@@ -3,25 +3,6 @@ ...@@ -3,25 +3,6 @@
{% block main %} {% block main %}
<div class="jumbotron"> <div class="jumbotron">
<h1 class="display-4">Welcome to CSEntry!</h1> <h1 class="display-4">Welcome to CSEntry!</h1>
<p class="lead">Control System Entry allows you to easily register items and network devices.</lead>
</div> </div>
<table id="items_table" class="table table-bordered table-hover table-sm">
<thead>
<tr>
<th>Id</th>
<th>ICS id</th>
<th>Created</th>
<th>Updated</th>
<th>Serial number</th>
<th>Manufacturer</th>
<th>Model</th>
<th>Location</th>
<th>Status</th>
<th>Parent</th>
</tr>
</thead>
</table>
{%- endblock %} {%- endblock %}
{% block csentry_scripts %}
<script src="{{ url_for('static', filename='js/csentry.js') }}"></script>
{% endblock %}
{%- extends "base.html" %}
{% block title %}Items - CSEntry{% endblock %}
{% block main %}
<div class="card">
<h4 class="card-header">Register new item</h4>
<div class="card-body">
</div>
</div>
<hr class="separator">
<table id="items_table" class="table table-bordered table-hover table-sm">
<thead>
<tr>
<th>Id</th>
<th>ICS id</th>
<th>Created</th>
<th>Updated</th>
<th>Serial number</th>
<th>Manufacturer</th>
<th>Model</th>
<th>Location</th>
<th>Status</th>
<th>Parent</th>
</tr>
</thead>
</table>
{%- endblock %}
{% block csentry_scripts %}
<script src="{{ url_for('static', filename='js/items.js') }}"></script>
{% endblock %}
...@@ -60,6 +60,7 @@ def test_index(logged_client): ...@@ -60,6 +60,7 @@ def test_index(logged_client):
@pytest.mark.parametrize('url', [ @pytest.mark.parametrize('url', [
'/', '/',
'/items',
'/qrcodes', '/qrcodes',
'_retrieve_items', '_retrieve_items',
]) ])
......
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