Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
J
jumpserver
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ops
jumpserver
Commits
be99eb82
Commit
be99eb82
authored
Nov 23, 2016
by
ibuler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
udpate some bug
parent
5af97c96
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
6 deletions
+7
-6
_user_import_modal.html
apps/users/templates/users/_user_import_modal.html
+2
-4
user_list.html
apps/users/templates/users/user_list.html
+2
-2
views.py
apps/users/views.py
+3
-0
No files found.
apps/users/templates/users/_user_import_modal.html
View file @
be99eb82
...
...
@@ -3,13 +3,11 @@
{% block modal_id %}user_import_modal{% endblock %}
{% block modal_title%}{% trans "Import User" %}{% endblock %}
{% block modal_body %}
<p
class=
"text-success text-center"
>
{% trans "Hint: your excel should organized in the following format." %}
</p>
<p
class=
"text-success text-center"
>
{% trans "* You should have a very worksheet named `users`." %}
</p>
<p
class=
"text-success text-center"
>
{% trans "* Rows in this worksheet: username, email, enable_opt(0, 1), role(one of ['Admin', 'User'])" %}
</p>
<p
class=
"text-success"
>
{% trans " * CSV format should be same as export" %}
</p>
<form
method=
"post"
class=
"form-horizontal"
action=
"{% url 'users:user-import' %}"
id=
"fm_user_import"
enctype=
"multipart/form-data"
>
{% csrf_token %}
<div
class=
"form-group"
>
<label
class=
"control-label col-sm-2 col-lg-2 "
for=
"id_excel"
>
{% trans "
Excel
" %}
</label>
<label
class=
"control-label col-sm-2 col-lg-2 "
for=
"id_excel"
>
{% trans "
CSV
" %}
</label>
<div
class=
" col-sm-9 col-lg-9 "
>
<input
id=
"id_excel"
type=
"file"
name=
"excel"
/>
</div>
...
...
apps/users/templates/users/user_list.html
View file @
be99eb82
...
...
@@ -3,8 +3,8 @@
{% block table_search %}
<div
class=
"html5buttons"
>
<div
class=
"dt-buttons btn-group"
>
<a
class=
"btn btn-default buttons-pdf"
tabindex=
"0"
href=
"#"
>
<span>
PDF
</span></a>
{#
<a
class=
"btn btn-default buttons-pdf"
tabindex=
"0"
href=
"#"
>
#}
{#
<span>
PDF
</span></a>
#}
<a
class=
"btn btn-default buttons-csv"
tabindex=
"0"
href=
"#"
>
<span>
CSV
</span>
</a>
...
...
apps/users/views.py
View file @
be99eb82
...
...
@@ -3,7 +3,9 @@
from
__future__
import
unicode_literals
import
json
import
uuid
from
io
import
BytesIO
from
reportlab.pdfgen
import
canvas
import
unicodecsv
as
csv
from
django
import
forms
from
django.utils
import
timezone
...
...
@@ -570,3 +572,4 @@ class ExportUserCsvView(View):
cache
.
set
(
spm
,
users_id
,
300
)
url
=
reverse
(
'users:export-user-csv'
)
+
'?spm=
%
s'
%
spm
return
JsonResponse
({
'redirect'
:
url
})
Write
Preview
Markdown
is supported
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