1 {% extends
"base.html" %}
9 <link rel=
"stylesheet" href=
"/static/bower_components/select2/dist/css/select2.min.css">
10 <link rel=
"stylesheet" href=
"/static/bower_components/datatables.net-bs/css/dataTables.bootstrap.min.css">
12 {% block title_header_big %}
15 {% block left_sidebar %}
16 {% include 'osm/osm_project_left_sidebar.html' %}
20 {% block breadcrumb_body %}
22 <li><a href=
"#">Users
</a></li>
25 {% block content_body %}
27 {% include 'modal/user_details.html' %}
28 {% include 'modal/user_create.html' %}
31 <div class=
"col-md-12">
34 <div class=
"box-header with-border">
35 <h3 class=
"box-title">Users
</h3>
36 <div class=
"box-tools">
37 <button type=
"button" class=
"btn btn-default" data-container=
"body"
38 onclick=
"javascript:openModalCreateUser({'projects_list_url': '{% url "projects:projects_list
" %}'})"
39 data-toggle=
"tooltip" data-placement=
"top" title=
"New User">
41 <i class=
"fa fa-plus"></i> Create User
</button>
45 <div class=
"box-body">
46 <table id=
"users_table" class=
"table table-bordered table-striped">
69 {% block resource_block %}
71 <script src=
"/static/bower_components/datatables.net/js/jquery.dataTables.min.js"></script>
72 <script src=
"/static/bower_components/datatables.net-bs/js/dataTables.bootstrap.min.js"></script>
73 <script src=
"/static/bower_components/select2/dist/js/select2.js"></script>
74 <script src=
"/static/src/userhandler/user_list.js"></script>
76 $(document).ready( function () {
77 var table = $('#users_table').DataTable({
80 "url":
"/admin/users/list",
81 "dataSrc": function (json) {
86 console.log(
"no auth");
87 moveToLogin(window.location.pathname);
90 "error": function (hxr, error, thrown) {
99 "render": function (data, type, row) {
100 return row[
"username"];
105 "render": function (data, type, row) {
106 return row['projects'];
111 "render": function (data, type, row) {
117 "render": function (data, type, row) {
118 return moment.unix(row[
"_admin"]['modified']).format('YYYY-MM-DD hh:mm:ss a');
123 "render": function (data, type, row) {
124 return moment.unix(row[
"_admin"]['created']).format('YYYY-MM-DD hh:mm:ss a');;
129 "render": function (data, type, row) {
130 return '
<div class=
"btn-group">' +
131 '
<button type=
"button" class=
"btn btn-default dropdown-toggle"' +
132 '
data-toggle=
"dropdown" aria-expanded=
"false">Actions ' +
133 '
<span class=
"fa fa-caret-down"></span></button> ' +
134 '
<ul class=
"dropdown-menu">' +
135 '
<li> <a href=
"#" onclick=
"javascript:deleteUser(\'' + row['_id'] + '\', \''+row['username']+'\')"' +
136 '
style=
"color:red"><i class=
"fa fa-trash"></i> Delete
</a></li> </ul></div>';
143 setInterval(function () {
153 {% include
"footer.html" %}