Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Vladislav Rykov
THSO.server
Commits
c9f44294
Commit
c9f44294
authored
Jun 02, 2020
by
Vladislav Rykov
Browse files
admin:user applications view added
parent
9f40a9a2
Changes
6
Show whitespace changes
Inline
Side-by-side
app/app/__pycache__/views.cpython-37.pyc
View file @
c9f44294
No preview for this file type
app/app/__pycache__/views_admin.cpython-37.pyc
View file @
c9f44294
No preview for this file type
app/app/templates/new/admin/user-applications.html
0 → 100644
View file @
c9f44294
{% 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"
>
-
</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"
>
-
</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"
>
-
</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 %}
app/app/templates/new/admin/user-dashboard.html
View file @
c9f44294
...
...
@@ -164,6 +164,17 @@
</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 %}
{% block script %}
...
...
app/app/views.py
View file @
c9f44294
...
...
@@ -102,8 +102,6 @@ def applications():
if
'name'
in
session
:
apps
=
ad
.
get_list
(
session
[
'name'
])
session
.
pop
(
'appkey'
,
None
)
return
render_template
(
'new/public/applications.html'
,
apps
=
apps
[
1
])
else
:
return
redirect
(
url_for
(
'login'
))
...
...
app/app/views_admin.py
View file @
c9f44294
...
...
@@ -67,6 +67,13 @@ def administration_users_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'
)
@
restricted
(
access_level
=
'admin'
)
def
administration_users_user_chart_update
(
name
):
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment