Commit c2a377bb authored by Vladislav Rykov's avatar Vladislav Rykov
Browse files

dashboard links fixed

parent eae6de73
...@@ -168,7 +168,7 @@ ...@@ -168,7 +168,7 @@
<nav class="navbar navbar-top navbar-expand-md navbar-dark" id="navbar-main"> <nav class="navbar navbar-top navbar-expand-md navbar-dark" id="navbar-main">
<div class="container-fluid"> <div class="container-fluid">
<!-- Brand --> <!-- Brand -->
<a class="h4 mb-0 text-white text-uppercase d-none d-lg-inline-block" href="./index.html">Dashboard</a> {% block location %} {% endblock %}
<!-- User --> <!-- User -->
<ul class="navbar-nav align-items-center d-none d-md-flex"> <ul class="navbar-nav align-items-center d-none d-md-flex">
<li class="nav-item dropdown"> <li class="nav-item dropdown">
......
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
{% block title %} HPC&amp;A IoT - Dashboard {% endblock %} {% block title %} HPC&amp;A IoT - Dashboard {% endblock %}
{% block location %} <a class="h4 mb-0 text-white text-uppercase d-none d-lg-inline-block" href="./">Dashboard</a> {% endblock %}
{% block body %} {% block body %}
<!-- Header --> <!-- Header -->
<div class="header bg-gradient-primary pb-8 pt-5 pt-md-8"> <div class="header bg-gradient-primary pb-8 pt-5 pt-md-8">
......
...@@ -101,7 +101,7 @@ def register(): ...@@ -101,7 +101,7 @@ def register():
flash('User successfully created.', 'success') flash('User successfully created.', 'success')
if 'role' in session and session['role'] == 'admin': if 'role' in session and session['role'] == 'admin':
return redirect(url_for('dashboard')) return redirect(url_for('administration'))
else: else:
return redirect(url_for('index')) return redirect(url_for('index'))
else: else:
...@@ -383,8 +383,8 @@ def data_csv(): ...@@ -383,8 +383,8 @@ def data_csv():
return redirect(utl_for('index')) return redirect(utl_for('index'))
@app.route('/dashboard', methods=['GET', 'POST']) @app.route('/administration', methods=['GET', 'POST'])
def dashboard(): def administration():
if 'role' in session and session['role'] == 'admin': if 'role' in session and session['role'] == 'admin':
user_cnt = ud.get_count() user_cnt = ud.get_count()
apps_cnt = ad.get_count() apps_cnt = ad.get_count()
...@@ -417,7 +417,7 @@ def dashboard(): ...@@ -417,7 +417,7 @@ def dashboard():
def dashboard_clean_search(): def dashboard_clean_search():
if 'users_filter' in session: if 'users_filter' in session:
session.pop('users_filter', None) session.pop('users_filter', None)
return redirect(url_for('dashboard')) return redirect(url_for('administration'))
@app.route('/user') @app.route('/user')
...@@ -466,7 +466,7 @@ def user_delete(): ...@@ -466,7 +466,7 @@ def user_delete():
flash('Error: {}'.format(res[1]), 'danger') flash('Error: {}'.format(res[1]), 'danger')
return render_template('old/admin/user.html', username=user[1][0]) return render_template('old/admin/user.html', username=user[1][0])
else: else:
return redirect(url_for('dashboard')) return redirect(url_for('administraion'))
else: else:
flash('Warning: the user is admin or does not exist.' ,'warning') flash('Warning: the user is admin or does not exist.' ,'warning')
return redirect(url_for('index')) return redirect(url_for('index'))
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment