| lombardofr | 10b52d1 | 2018-07-17 23:42:28 +0200 | [diff] [blame] | 1 | {% extends "base.html" %} |
| 2 | {% load get %} |
| 3 | {% load date_tag %} |
| 4 | {% load staticfiles %} |
| 5 | |
| 6 | |
| 7 | {% block head_block %} |
| 8 | {{ block.super }} |
| 9 | <link rel="stylesheet" href="/static/bower_components/select2/dist/css/select2.min.css"> |
| lombardofr | 45e33ee | 2018-07-18 19:22:37 +0200 | [diff] [blame^] | 10 | <link rel="stylesheet" href="/static/bower_components/datatables.net-bs/css/dataTables.bootstrap.min.css"> |
| lombardofr | 10b52d1 | 2018-07-17 23:42:28 +0200 | [diff] [blame] | 11 | {% endblock %} |
| 12 | {% block title_header_big %} |
| 13 | {{ block.super }} |
| 14 | {% endblock %} |
| 15 | {% block left_sidebar %} |
| 16 | {% include 'osm/osm_project_left_sidebar.html' %} |
| 17 | {% endblock %} |
| 18 | |
| 19 | |
| 20 | {% block breadcrumb_body %} |
| 21 | {{ block.super }} |
| 22 | <li><a href="#">Users</a></li> |
| 23 | {% endblock %} |
| 24 | |
| 25 | {% block content_body %} |
| 26 | {{ block.super }} |
| 27 | {% include 'modal/user_details.html' %} |
| 28 | {% include 'modal/user_create.html' %} |
| 29 | {% csrf_token %} |
| 30 | <div class="row"> |
| 31 | <div class="col-md-12"> |
| 32 | |
| 33 | <div class="box"> |
| 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"> |
| 40 | |
| 41 | <i class="fa fa-plus"></i> Create User</button> |
| 42 | |
| 43 | </div> |
| 44 | </div> |
| 45 | <div class="box-body"> |
| 46 | <table id="users_table" class="table table-bordered table-striped"> |
| 47 | <thead> |
| 48 | <tr> |
| 49 | <th>Name</th> |
| 50 | <th>Projects</th> |
| 51 | <th>Identifier</th> |
| 52 | <th>Modified</th> |
| 53 | <th>Created</th> |
| 54 | <th>Actions</th> |
| 55 | |
| 56 | </tr> |
| 57 | </thead> |
| 58 | <tbody> |
| 59 | {% for s in users %} |
| 60 | <tr> |
| 61 | |
| 62 | <td>{{ s|get:"username" }}</td> |
| 63 | <td>{{ s|get:"projects" }}</td> |
| 64 | <td>{{ s|get:"_id" }}</td> |
| 65 | <td>{{ s|get_sub:"_admin,modified"|get_date}}</td> |
| 66 | <td>{{ s|get_sub:"_admin,created"|get_date}}</td> |
| 67 | |
| 68 | <td> |
| lombardofr | 10b52d1 | 2018-07-17 23:42:28 +0200 | [diff] [blame] | 69 | |
| lombardofr | bced6e6 | 2018-07-18 17:02:16 +0200 | [diff] [blame] | 70 | <div class="btn-group"> |
| 71 | <button type="button" class="btn btn-default dropdown-toggle" |
| 72 | data-toggle="dropdown" aria-expanded="false">Actions |
| 73 | <span class="fa fa-caret-down"></span></button> |
| 74 | <ul class="dropdown-menu"> |
| 75 | |
| 76 | <li> |
| 77 | <a href="#" onclick="javascript:deleteUser('{% url "users:delete" user_id=s|get:"_id" %}')" style="color:red"> |
| 78 | <i class="fa fa-trash" ></i> Delete</a> |
| 79 | |
| 80 | </li> |
| 81 | </ul> |
| 82 | </div> |
| lombardofr | 10b52d1 | 2018-07-17 23:42:28 +0200 | [diff] [blame] | 83 | </td> |
| 84 | |
| 85 | </tr> |
| 86 | {% endfor %} |
| 87 | </tbody> |
| 88 | </table> |
| 89 | </div> |
| 90 | </div> |
| 91 | </div> |
| 92 | |
| 93 | </div> |
| 94 | {% endblock %} |
| 95 | |
| 96 | {% block resource_block %} |
| 97 | {{ block.super }} |
| lombardofr | 45e33ee | 2018-07-18 19:22:37 +0200 | [diff] [blame^] | 98 | <script src="/static/bower_components/datatables.net/js/jquery.dataTables.min.js"></script> |
| 99 | <script src="/static/bower_components/datatables.net-bs/js/dataTables.bootstrap.min.js"></script> |
| lombardofr | 10b52d1 | 2018-07-17 23:42:28 +0200 | [diff] [blame] | 100 | <script src="/static/bower_components/select2/dist/js/select2.js"></script> |
| 101 | <script src="/static/src/userhandler/user_list.js"></script> |
| lombardofr | 45e33ee | 2018-07-18 19:22:37 +0200 | [diff] [blame^] | 102 | <script> |
| 103 | $(document).ready( function () { |
| 104 | $('#users_table').DataTable(); |
| 105 | } ); |
| 106 | </script> |
| lombardofr | 10b52d1 | 2018-07-17 23:42:28 +0200 | [diff] [blame] | 107 | |
| 108 | |
| 109 | {% endblock %} |
| 110 | |
| 111 | {% block footer %} |
| 112 | {% include "footer.html" %} |
| 113 | {% endblock %} |