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

admin:user applications view added

parent 9f40a9a2
{% extends 'logged_layout.html' %}
{% block title %} User Applications - HPC&A IoT {% endblock %}
{% block location %}
<a class="h4 mb-0 text-white text-uppercase d-none d-lg-inline-block" href="/administration">Administration</a>
<p class="h4 mb-0 text-white text-uppercase d-none d-lg-inline-block"> &nbsp;-&nbsp; </p>
<a class="h4 mb-0 text-white text-uppercase d-none d-lg-inline-block" href="/administration/users">Users</a>
<p class="h4 mb-0 text-white text-uppercase d-none d-lg-inline-block"> &nbsp;-&nbsp; </p>
<a class="h4 mb-0 text-white text-uppercase d-none d-lg-inline-block" href="/administration/users/{{ user }}">{{ user }}</a>
<p class="h4 mb-0 text-white text-uppercase d-none d-lg-inline-block"> &nbsp;-&nbsp; </p>
<a class="h4 mb-0 text-white text-uppercase d-none d-lg-inline-block" href="/administration/users/{{ user }}/applications">Applications</a>
{% endblock %}
{% block body %}
<!-- Page content -->
<div class="container-fluid mt--7">
<!-- Table -->
<div class="row">
<div class="col">
<div class="card shadow">
<div class="card-header bg-transparent">
<h3 class="mb-0">Applications</h3>
</div>
<div class="card-body">
<div class="row">
{% if apps %}
{% for a in apps %}
<div class="col-lg-6 col-md-6" style="margin-bottom : 30px;">
<div class="card">
<div class="card-body">
<h5 class="card-title">{{ a[0] }}</h5>
<p class="card-text">{{ a[3] }}</p>
<a href="./application/{{ a[1] }}" class="btn btn-primary">Details</a>
</div>
</div>
</div>
{% endfor %}
{% else %}
<div class="col-lg-12">
<center><p> There are no created applications. </p></center>
</div>
{% endif %}
</div>
<!--
<div class="row" style="margin-top: 30px;">
<div class="col-lg-4">
<a href="../new-application"><button type="submit" class="btn btn-primary btn-block">New application</button></a>
</div>
</div>
-->
</div>
</div>
</div>
{% endblock %}
...@@ -164,6 +164,17 @@ ...@@ -164,6 +164,17 @@
</div> </div>
</div> </div>
</div> </div>
<div class="row" style="margin-top: 30px;">
<div class="col-lg-3">
<a href="/administration/users/{{ user }}/applications"><button type="submit" class="btn btn-primary btn-block">Applications</button></a>
</div>
<div class="col-lg-3">
</div>
<div class="col-lg-3">
</div>
<div class="col-lg-3">
<a href="/administration/users/{{ user }}/settings"><button type="submit" class="btn btn-primary btn-block">Settings</button></a>
</div>
{% endblock %} {% endblock %}
{% block script %} {% block script %}
......
...@@ -102,8 +102,6 @@ def applications(): ...@@ -102,8 +102,6 @@ def applications():
if 'name' in session: if 'name' in session:
apps = ad.get_list(session['name']) apps = ad.get_list(session['name'])
session.pop('appkey', None)
return render_template('new/public/applications.html', apps=apps[1]) return render_template('new/public/applications.html', apps=apps[1])
else: else:
return redirect(url_for('login')) return redirect(url_for('login'))
......
...@@ -67,6 +67,13 @@ def administration_users_user(name): ...@@ -67,6 +67,13 @@ def administration_users_user(name):
return render_template('new/admin/user-dashboard.html', info=info, user=name) return render_template('new/admin/user-dashboard.html', info=info, user=name)
@app.route('/administration/users/<name>/applications')
@restricted(access_level='admin')
def administration_users_user_applications(name):
apps = ad.get_list(name)[1]
return render_template('new/admin/user-applications.html', apps=apps, user=name)
@app.route('/administration/users/<name>/chart-update') @app.route('/administration/users/<name>/chart-update')
@restricted(access_level='admin') @restricted(access_level='admin')
def administration_users_user_chart_update(name): def administration_users_user_chart_update(name):
......
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