diff --git a/app/main/views.py b/app/main/views.py index b8476d040a96aae7013f258250550213518ed0ef..3dfd3132611c6cfb59ce60cf0e0dd8d4f6976846 100644 --- a/app/main/views.py +++ b/app/main/views.py @@ -95,7 +95,7 @@ def create_item(): return render_template('create_item.html', form=form) -@bp.route('/view/<ics_id>') +@bp.route('/items/view/<ics_id>') @login_required def view_item(ics_id): item = models.Item.query.filter_by(ics_id=ics_id).first_or_404() diff --git a/app/static/js/items.js b/app/static/js/items.js index 68f95b9a230066012ad7854f892c0baa910c80e8..70c310f4f21f44b249851832914b33edf42d8c08 100644 --- a/app/static/js/items.js +++ b/app/static/js/items.js @@ -25,7 +25,7 @@ $(document).ready(function() { if ( data === null ) { return data; } - var url = $SCRIPT_ROOT + "/view/" + data; + var url = $SCRIPT_ROOT + "/items/view/" + data; return '<a href="'+ url + '">' + data + '</a>'; } } diff --git a/app/templates/view_item.html b/app/templates/view_item.html index 7eed7149ab3ee138d03ec52ceba2482eca7cb203..355bfc4cad4af765cbc414960046643c00b1900c 100644 --- a/app/templates/view_item.html +++ b/app/templates/view_item.html @@ -4,7 +4,19 @@ {% block title %}View Item - CSEntry{% endblock %} {% block main %} - <h2>Item {{ item['ics_id'] }}</h2> + <ul class="nav nav-tabs"> + <li class="nav-item"> + <a class="nav-link" href="{{ url_for('main.list_items') }}">List items</a> + </li> + <li class="nav-item"> + <a class="nav-link" href="{{ url_for('main.create_item') }}">Register new item</a> + </li> + <li class="nav-item"> + <a class="nav-link active" href="{{ url_for('main.view_item', ics_id=item['ics_id']) }}">View item</a> + </li> + </ul> + + <br> <dl class="row"> <dt class="col-sm-3">ICS id</dt>