From f9b49605e4603027a68891dd7ee0d8bcb4a8199a Mon Sep 17 00:00:00 2001 From: "xiaokong1937@gmail.com" <763691951@qq.com> Date: Wed, 28 Sep 2016 21:11:43 +0800 Subject: [PATCH] user-group detail page: users op --- apps/static/css/jumpserver.css | 110 ++++++++++++++-- apps/static/js/jumpserver.js | 12 ++ apps/templates/_modal.html | 2 +- apps/users/api.py | 12 +- apps/users/serializers.py | 4 +- .../templates/users/_select_user_modal.html | 23 ++++ apps/users/templates/users/user_detail.html | 4 +- .../templates/users/user_group_detail.html | 117 ++++++++++++------ .../templates/users/user_group_list.html | 2 +- apps/users/templates/users/user_list.html | 24 ++-- apps/users/urls.py | 10 +- 11 files changed, 248 insertions(+), 72 deletions(-) create mode 100644 apps/users/templates/users/_select_user_modal.html diff --git a/apps/static/css/jumpserver.css b/apps/static/css/jumpserver.css index c3459298f..6b2639daf 100644 --- a/apps/static/css/jumpserver.css +++ b/apps/static/css/jumpserver.css @@ -91,12 +91,108 @@ table.dataTable tbody td.selected td i.text-navy color: white; } - -div.dataTables_wrapper div.dataTables_filter, -.dataTables_length { - float: right !important; +.m-0 { + margin: 0px !important; } - -div.dataTables_wrapper div.dataTables_filter { - margin-left: 15px; +.m-t-0 { + margin-top: 0px !important; +} +.m-b-0 { + margin-bottom: 0px !important; +} +.m-l-0 { + margin-left: 0px !important; +} +.m-r-0 { + margin-right: 0px !important; +} +.m-5 { + margin: 5px !important; +} +.m-t-5 { + margin-top: 5px !important; +} +.m-b-5 { + margin-bottom: 5px !important; +} +.m-l-5 { + margin-left: 5px !important; +} +.m-r-5 { + margin-right: 5px !important; +} +.m-10 { + margin: 10px !important; +} +.m-t-10 { + margin-top: 10px !important; +} +.m-b-10 { + margin-bottom: 10px !important; +} +.m-l-10 { + margin-left: 10px !important; +} +.m-r-10 { + margin-right: 10px !important; +} +.m-15 { + margin: 15px !important; +} +.m-t-15 { + margin-top: 15px !important; +} +.m-b-15 { + margin-bottom: 15px !important; +} +.m-l-15 { + margin-left: 15px !important; +} +.m-r-15 { + margin-right: 15px !important; +} +.m-20 { + margin: 20px !important; +} +.m-t-20 { + margin-top: 20px !important; +} +.m-b-20 { + margin-bottom: 20px !important; +} +.m-l-20 { + margin-left: 20px !important; +} +.m-r-20 { + margin-right: 20px !important; +} +.m-25 { + margin: 25px !important; +} +.m-t-25 { + margin-top: 25px !important; +} +.m-b-25 { + margin-bottom: 25px !important; +} +.m-l-25 { + margin-left: 25px !important; +} +.m-r-25 { + margin-right: 25px !important; +} +.m-30 { + margin: 30px !important; +} +.m-t-30 { + margin-top: 30px !important; +} +.m-b-30 { + margin-bottom: 30px !important; +} +.m-l-30 { + margin-left: 30px !important; +} +.m-r-30 { + margin-right: 30px !important; } diff --git a/apps/static/js/jumpserver.js b/apps/static/js/jumpserver.js index 9a26a5607..26843397a 100644 --- a/apps/static/js/jumpserver.js +++ b/apps/static/js/jumpserver.js @@ -257,6 +257,7 @@ $.fn.serializeObject = function() return o; }; var jumpserver = {}; +jumpserver.checked = false; jumpserver.initDataTable = function (options) { // options = { // ele *: $('#dataTable_id'), @@ -331,5 +332,16 @@ jumpserver.initDataTable = function (options) { $('#op').html(options.op_html || ''); $('#uc').html(options.uc_html || ''); }); + $('.ipt_check_all').on('click', function() { + if (!jumpserver.checked) { + $(this).closest('table').find('.ipt_check').prop('checked', true); + jumpserver.checked = true; + table.rows().select(); + } else { + $(this).closest('table').find('.ipt_check').prop('checked', false); + jumpserver.checked = false; + table.rows().deselect(); + } + }) return table; } diff --git a/apps/templates/_modal.html b/apps/templates/_modal.html index 1cbe53fa5..ad7f21ccc 100644 --- a/apps/templates/_modal.html +++ b/apps/templates/_modal.html @@ -1,6 +1,6 @@ {% load i18n %}