Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
94
Merge Requests
10
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
2d0244f9
authored
Apr 12, 2021
by
Máhonfai Bálint
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Success message on group import and other UI adjustments
parent
12282eb8
Pipeline
#1437
passed with stage
in 0 seconds
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
5 deletions
+15
-5
circle/dashboard/templates/dashboard/group-import.html
+4
-0
circle/dashboard/templates/dashboard/index-groups.html
+4
-4
circle/dashboard/views/group.py
+7
-1
No files found.
circle/dashboard/templates/dashboard/group-import.html
View file @
2d0244f9
{% load crispy_forms_tags %}
{% load crispy_forms_tags %}
{% load i18n %}
{% load i18n %}
<p
class=
"text-muted"
>
{% trans "Import a previously exported group from the user store." %}
</p>
<form
method=
"POST"
action=
"{% url "
dashboard
.
views
.
group-import
"
%}"
>
<form
method=
"POST"
action=
"{% url "
dashboard
.
views
.
group-import
"
%}"
>
{% csrf_token %}
{% csrf_token %}
{% crispy form %}
{% crispy form %}
...
...
circle/dashboard/templates/dashboard/index-groups.html
View file @
2d0244f9
...
@@ -17,7 +17,7 @@
...
@@ -17,7 +17,7 @@
</div>
</div>
<div
class=
"list-group-item list-group-footer text-right"
>
<div
class=
"list-group-item list-group-footer text-right"
>
<div
class=
"row"
>
<div
class=
"row"
>
<div
class=
"col-xs-
5
"
>
<div
class=
"col-xs-
6
"
>
<form
action=
"{% url "
dashboard
.
views
.
group-list
"
%}"
method=
"GET"
id=
"dashboard-group-search-form"
>
<form
action=
"{% url "
dashboard
.
views
.
group-list
"
%}"
method=
"GET"
id=
"dashboard-group-search-form"
>
<div
class=
"input-group input-group-sm"
>
<div
class=
"input-group input-group-sm"
>
<input
name=
"s"
type=
"text"
class=
"form-control"
placeholder=
"{% trans "
Search
..."
%}"
/>
<input
name=
"s"
type=
"text"
class=
"form-control"
placeholder=
"{% trans "
Search
..."
%}"
/>
...
@@ -27,7 +27,7 @@
...
@@ -27,7 +27,7 @@
</div>
</div>
</form>
</form>
</div>
</div>
<div
class=
"col-xs-
7
text-right"
>
<div
class=
"col-xs-
6
text-right"
>
<a
class=
"btn btn-primary btn-xs"
href=
"{% url "
dashboard
.
views
.
group-list
"
%}"
>
<a
class=
"btn btn-primary btn-xs"
href=
"{% url "
dashboard
.
views
.
group-list
"
%}"
>
<i
class=
"fa fa-chevron-circle-right"
></i>
<i
class=
"fa fa-chevron-circle-right"
></i>
{% if more_groups > 0 %}
{% if more_groups > 0 %}
...
@@ -40,8 +40,8 @@
...
@@ -40,8 +40,8 @@
{% trans "list" %}
{% trans "list" %}
{% endif %}
{% endif %}
</a>
</a>
<a
class=
"btn btn-success btn-xs group-create"
href=
"{% url "
dashboard
.
views
.
group-create
"
%}"
><i
class=
"fa fa-plus-circle"
></i>
{% trans "new" %}
</a>
<a
class=
"btn btn-success btn-xs group-create"
href=
"{% url "
dashboard
.
views
.
group-create
"
%}"
title=
"{% trans "
new
"
%}"
><i
class=
"fa fa-plus-circle"
></i>
</a>
<a
class=
"btn btn-success btn-xs group-import"
href=
"{% url "
dashboard
.
views
.
group-import
"
%}"
><i
class=
"fa fa-upload"
></i>
{% trans "import" %}
</a>
<a
class=
"btn btn-success btn-xs group-import"
href=
"{% url "
dashboard
.
views
.
group-import
"
%}"
title=
"{% trans "
import
"
%}"
><i
class=
"fa fa-download"
></i>
</a>
</div>
</div>
</div>
</div>
</div>
</div>
...
...
circle/dashboard/views/group.py
View file @
2d0244f9
...
@@ -417,12 +417,18 @@ class GroupImportView(LoginRequiredMixin, TemplateView):
...
@@ -417,12 +417,18 @@ class GroupImportView(LoginRequiredMixin, TemplateView):
if
profile
is
None
:
if
profile
is
None
:
raise
SuspiciousOperation
()
raise
SuspiciousOperation
()
success_message
=
_
(
"Group successfully imported."
)
if
request
.
is_ajax
():
if
request
.
is_ajax
():
response
=
{
'message'
:
success_message
,
'redirect'
:
profile
.
get_absolute_url
()
}
return
HttpResponse
(
return
HttpResponse
(
json
.
dumps
(
{
'redirect'
:
profile
.
get_absolute_url
()}
),
json
.
dumps
(
response
),
content_type
=
"application/json"
content_type
=
"application/json"
)
)
else
:
else
:
messages
.
success
(
request
,
success_message
)
return
redirect
(
profile
.
get_absolute_url
())
return
redirect
(
profile
.
get_absolute_url
())
else
:
else
:
return
self
.
get
(
request
,
form
,
*
args
,
**
kwargs
)
return
self
.
get
(
request
,
form
,
*
args
,
**
kwargs
)
...
...
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