Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
nopaque
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SFB 1288 - INF
nopaque
Commits
77759541
Commit
77759541
authored
5 years ago
by
Stephan Porada
Browse files
Options
Downloads
Patches
Plain Diff
Make admin user list sortable.
parent
dc975935
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
app/static/css/opaque.css
+40
-0
40 additions, 0 deletions
app/static/css/opaque.css
app/tables.py
+17
-7
17 additions, 7 deletions
app/tables.py
app/templates/admin/admin.html.j2
+41
-3
41 additions, 3 deletions
app/templates/admin/admin.html.j2
with
98 additions
and
10 deletions
app/static/css/opaque.css
+
40
−
0
View file @
77759541
...
...
@@ -33,3 +33,43 @@ main {
}
}
/* ### End sidenav-fixed offset ### */
/* CSS for clickable th elements in tables. Needed for sortable table data with
list js. On click on th header elements will be sorted accordingly. Also a caret
indicator will show up how the column is sorted right now.; */
.sort
{
cursor
:
pointer
;
}
.sort
:after
{
width
:
0
;
height
:
0
;
border-left
:
5px
solid
transparent
;
border-right
:
5px
solid
transparent
;
border-bottom
:
5px
solid
transparent
;
content
:
""
;
position
:
relative
;
top
:
-10px
;
right
:
-5px
;
}
.sort.asc
:after
{
width
:
0
;
height
:
0
;
border-left
:
5px
solid
transparent
;
border-right
:
5px
solid
transparent
;
border-top
:
5px
solid
#000000
;
content
:
""
;
position
:
relative
;
top
:
13px
;
right
:
-5px
;
}
.sort.desc
:after
{
width
:
0
;
height
:
0
;
border-left
:
5px
solid
transparent
;
border-right
:
5px
solid
transparent
;
border-bottom
:
5px
solid
#000000
;
content
:
""
;
position
:
relative
;
top
:
-10px
;
right
:
-5px
;
}
This diff is collapsed.
Click to expand it.
app/tables.py
+
17
−
7
View file @
77759541
...
...
@@ -6,14 +6,24 @@ class AdminUserTable(Table):
Declares the table describing colum by column.
"""
classes
=
[
'
highlight
'
,
'
responsive-table
'
]
username
=
Col
(
'
Username
'
,
column_html_attrs
=
{
'
class
'
:
'
username
'
})
email
=
Col
(
'
Email
'
,
column_html_attrs
=
{
'
class
'
:
'
email
'
})
role_id
=
Col
(
'
Role
'
,
column_html_attrs
=
{
'
class
'
:
'
role
'
})
confirmed
=
Col
(
'
Confrimed Status
'
,
column_html_attrs
=
{
'
class
'
:
'
confirmed
'
})
id
=
Col
(
'
User Id
'
,
column_html_attrs
=
{
'
class
'
:
'
id
'
})
username
=
Col
(
'
Username
'
,
column_html_attrs
=
{
'
class
'
:
'
username
'
},
th_html_attrs
=
{
'
class
'
:
'
sort
'
,
'
data-sort
'
:
'
username
'
})
email
=
Col
(
'
Email
'
,
column_html_attrs
=
{
'
class
'
:
'
email
'
},
th_html_attrs
=
{
'
class
'
:
'
sort
'
,
'
data-sort
'
:
'
email
'
})
role_id
=
Col
(
'
Role
'
,
column_html_attrs
=
{
'
class
'
:
'
role
'
},
th_html_attrs
=
{
'
class
'
:
'
sort
'
,
'
data-sort
'
:
'
role
'
})
confirmed
=
Col
(
'
Confrimed Status
'
,
column_html_attrs
=
{
'
class
'
:
'
confirmed
'
},
th_html_attrs
=
{
'
class
'
:
'
sort
'
,
'
data-sort
'
:
'
confirmed
'
})
id
=
Col
(
'
User Id
'
,
column_html_attrs
=
{
'
class
'
:
'
id
'
},
th_html_attrs
=
{
'
class
'
:
'
sort
'
,
'
data-sort
'
:
'
id
'
})
url
=
LinkCol
(
'
Profile
'
,
'
admin.admin_user_page
'
,
url_kwargs
=
dict
(
user_id
=
'
id
'
),
anchor_attrs
=
{
'
class
'
:
'
waves-effect waves-light btn-small
'
})
url_kwargs
=
dict
(
user_id
=
'
id
'
),
anchor_attrs
=
{
'
class
'
:
'
waves-effect waves-light btn-small
'
})
class
AdminUserItem
(
object
):
...
...
This diff is collapsed.
Click to expand it.
app/templates/admin/admin.html.j2
+
41
−
3
View file @
77759541
{% extends "base.html.j2" %}
{% block page_content %}
<style media="screen">
.sort {
cursor: pointer;
}
.sort:after {
width: 0;
height: 0;
border-left: 5px solid transparent;
border-right: 5px solid transparent;
border-bottom: 5px solid transparent;
content:"";
position: relative;
top:-10px;
right:-5px;
}
.sort.asc:after {
width: 0;
height: 0;
border-left: 5px solid transparent;
border-right: 5px solid transparent;
border-top: 5px solid #000000;
content:"";
position: relative;
top:13px;
right:-5px;
}
.sort.desc:after {
width: 0;
height: 0;
border-left: 5px solid transparent;
border-right: 5px solid transparent;
border-bottom: 5px solid #000000;
content:"";
position: relative;
top:-10px;
right:-5px;
}
</style>
<div class="col s12">
<div class="card
large
">
<div class="card">
<div class="card-content">
<span class="card-title">User list</span>
<div id="users">
...
...
@@ -19,8 +57,8 @@
</div>
<script type="text/javascript">
var options = {
valueNames: ['username', 'email', 'role', 'confirmed'],
page:
3
,
valueNames: ['username', 'email', 'role', 'confirmed'
, 'id'
],
page:
10
,
pagination: true
};
var userList = new List('users', options);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment