mirror of
https://github.com/Xevion/v1.xevion.dev.git
synced 2025-12-13 08:13:26 -06:00
hidden roles integration
This commit is contained in:
@@ -33,12 +33,12 @@ def unauthorized(e):
|
|||||||
@app.route('/dashboard')
|
@app.route('/dashboard')
|
||||||
@login_required
|
@login_required
|
||||||
def dashboard():
|
def dashboard():
|
||||||
render_template('dashboard.html')
|
return render_template('dashboard.html')
|
||||||
|
|
||||||
@app.route('/profile/')
|
@app.route('/profile/')
|
||||||
@login_required
|
@login_required
|
||||||
def profile():
|
def profile():
|
||||||
render_template('profile.html')
|
return render_template('profile.html')
|
||||||
|
|
||||||
@app.route('/userinfo/')
|
@app.route('/userinfo/')
|
||||||
def user_info():
|
def user_info():
|
||||||
|
|||||||
@@ -50,6 +50,15 @@ Color = Bulma Color Type of the Message Box
|
|||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
{% endblock head %}
|
{% endblock head %}
|
||||||
|
<style type="text/css">
|
||||||
|
.navbar-text {
|
||||||
|
font-size: 110%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.navbar-fa-icon {
|
||||||
|
margin-right: 0.35rem;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bulma-divider@2.0.1/dist/css/bulma-divider.min.css">
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bulma-divider@2.0.1/dist/css/bulma-divider.min.css">
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
@@ -92,22 +101,34 @@ Color = Bulma Color Type of the Message Box
|
|||||||
|
|
||||||
<div class="navbar-dropdown">
|
<div class="navbar-dropdown">
|
||||||
{% if current_user.is_authenticated %}
|
{% if current_user.is_authenticated %}
|
||||||
{# <a class="navbar-item" href="{{ url_for('profile') }}">
|
<a class="navbar-item" href="{{ url_for('profile') }}">
|
||||||
Profile
|
<span class="navbar-fa-icon fas fa-user"></span>
|
||||||
</a> #}
|
<div class="navbar-text">Profile</div>
|
||||||
|
</a>
|
||||||
|
<a class="navbar-item" href="{{ url_for('dashboard') }}">
|
||||||
|
<span class="navbar-fa-icon fas fa-user-cog"></span>
|
||||||
|
<div class="navbar-text">Dashboard</div>
|
||||||
|
</a>
|
||||||
|
<hr class="navbar-divider">
|
||||||
|
{% if current_user.has_roles(['Hidden']) %}
|
||||||
<a class="navbar-item" href="{{ get_hidden() }}">
|
<a class="navbar-item" href="{{ get_hidden() }}">
|
||||||
|
<span class="navbar-fa-icon fas fa-user-ninja"></span>
|
||||||
Hidden
|
Hidden
|
||||||
</a>
|
</a>
|
||||||
<hr class="navbar-divider">
|
<hr class="navbar-divider">
|
||||||
|
{% endif %}
|
||||||
<a class="navbar-item" href="{{ url_for('logout') }}">
|
<a class="navbar-item" href="{{ url_for('logout') }}">
|
||||||
Logout
|
<span class="navbar-fa-icon fas fa-power-off"></span>
|
||||||
|
<div class="navbar-text">Logout</div>
|
||||||
</a>
|
</a>
|
||||||
{% else %}
|
{% else %}
|
||||||
<a class="navbar-item" href="{{ url_for('login') }}">
|
<a class="navbar-item" href="{{ url_for('login') }}">
|
||||||
Login
|
<span class="navbar-fa-icon fas fa-arrow-circle-right"></span>
|
||||||
|
<div class="navbar-text">Login</div>
|
||||||
</a>
|
</a>
|
||||||
<a class="navbar-item" href="{{ url_for('register') }}">
|
<a class="navbar-item" href="{{ url_for('register') }}">
|
||||||
Register
|
<span class="navbar-fa-icon fas fa-clipboard-list"></span>
|
||||||
|
<div class="navbar-text">Register</div>
|
||||||
</a>
|
</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user