Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Fukász Rómeó Ervin
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
876c5bf8
authored
Aug 22, 2014
by
Csók Tamás
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
views.py: ClientCheck class that handles the Connect button information stage (with or without js)
parent
f8366ce7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
0 deletions
+27
-0
circle/dashboard/views.py
+27
-0
No files found.
circle/dashboard/views.py
View file @
876c5bf8
...
...
@@ -346,6 +346,9 @@ class VmDetailView(CheckedDetailView):
context
[
'can_change_resources'
]
=
self
.
request
.
user
.
has_perm
(
"vm.change_resources"
)
# client info
context
[
'client_download'
]
=
self
.
request
.
COOKIES
.
get
(
'downloaded_client'
)
return
context
def
post
(
self
,
request
,
*
args
,
**
kwargs
):
...
...
@@ -1323,6 +1326,30 @@ class GroupAclUpdateView(AclUpdateView):
return
super
(
GroupAclUpdateView
,
self
)
.
get_object
()
.
profile
class
ClientCheck
(
LoginRequiredMixin
,
TemplateView
):
def
get_template_names
(
self
):
if
self
.
request
.
is_ajax
():
return
[
'dashboard/_modal.html'
]
else
:
return
[
'dashboard/nojs-wrapper.html'
]
def
get_context_data
(
self
,
*
args
,
**
kwargs
):
context
=
super
(
ClientCheck
,
self
)
.
get_context_data
(
*
args
,
**
kwargs
)
context
.
update
({
'box_title'
:
_
(
'About CIRCLE Client'
),
'ajax_title'
:
False
,
'template'
:
"dashboard/_client-check.html"
,
'instance'
:
get_object_or_404
(
Instance
,
pk
=
self
.
request
.
GET
.
get
(
'vm'
)),
})
return
context
def
post
(
self
,
request
,
*
args
,
**
kwargs
):
instance
=
get_object_or_404
(
Instance
,
pk
=
request
.
POST
.
get
(
'vm'
))
response
=
HttpResponseRedirect
(
reverse
(
'dashboard.views.detail'
,
args
=
[
instance
.
pk
]))
response
.
set_cookie
(
'downloaded_client'
,
'True'
,
365
*
24
*
60
*
60
)
return
response
class
TemplateChoose
(
LoginRequiredMixin
,
TemplateView
):
def
get_template_names
(
self
):
...
...
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