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
a67bb6a1
authored
Feb 11, 2013
by
Őry Máté
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
school: group show add csrf, etc
parent
3b466b6c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
3 deletions
+10
-3
one/templates/box-templatelist.html
+2
-2
school/templates/show-group.html
+2
-1
school/views.py
+6
-0
No files found.
one/templates/box-templatelist.html
View file @
a67bb6a1
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
<ul>
<ul>
{% for i in t.myshares %}
{% for i in t.myshares %}
<li>
{{i.name}} -
>
{{i.group}} ({{i.get_running}}/{{i.instance_limit}} = {{i.get_instance_pc}}%)
<li>
{{i.name}} -
>
{{i.group}} ({{i.get_running}}/{{i.instance_limit}} = {{i.get_instance_pc}}%)
<form
style=
"display:inline"
action=
"/vm/unshare/{{i.id}}/"
method=
"post"
><input
type=
"submit"
value=
"unshare"
/></form>
<form
style=
"display:inline"
action=
"/vm/unshare/{{i.id}}/"
method=
"post"
>
{% csrf_token %}
<input
type=
"submit"
value=
"unshare"
/></form>
</li>
</li>
{% endfor %}
{% endfor %}
{% endif %}
{% endif %}
...
@@ -72,7 +72,7 @@
...
@@ -72,7 +72,7 @@
<ul>
<ul>
{% for i in t.myshares %}
{% for i in t.myshares %}
<li>
{{i.name}} -
>
{{i.group}} ({{i.get_running}}/{{i.instance_limit}} = {{i.get_instance_pc}}%)
<li>
{{i.name}} -
>
{{i.group}} ({{i.get_running}}/{{i.instance_limit}} = {{i.get_instance_pc}}%)
<form
style=
"display:inline"
action=
"/vm/unshare/{{i.id}}/"
method=
"post"
><input
type=
"submit"
value=
"unshare"
/></form>
<form
style=
"display:inline"
action=
"/vm/unshare/{{i.id}}/"
method=
"post"
>
{% csrf_token %}
<input
type=
"submit"
value=
"unshare"
/></form>
</li>
</li>
{% endfor %}
{% endfor %}
{% endif %}
{% endif %}
...
...
school/templates/show-group.html
View file @
a67bb6a1
...
@@ -51,7 +51,7 @@
...
@@ -51,7 +51,7 @@
</div>
</div>
</div>
</div>
<div
class=
"boxes"
>
<div
class=
"boxes"
>
{% if noshare %}
<div
id=
"new-wm-tooltip"
style=
"position:absolute"
>
<div
id=
"new-wm-tooltip"
style=
"position:absolute"
>
<div
id=
"new-wm-tooltip-container"
>
<div
id=
"new-wm-tooltip-container"
>
<p>
<p>
...
@@ -63,6 +63,7 @@
...
@@ -63,6 +63,7 @@
<div
id=
"new-wm-tooltip-tail"
></div>
<div
id=
"new-wm-tooltip-tail"
></div>
</div>
</div>
</div>
</div>
{% endif %}
{% include "box-templatelist.html" %}
{% include "box-templatelist.html" %}
</div>
</div>
{% endblock %}
{% endblock %}
school/views.py
View file @
a67bb6a1
...
@@ -154,18 +154,24 @@ def group_show(request, gid):
...
@@ -154,18 +154,24 @@ def group_show(request, gid):
user
=
request
.
user
user
=
request
.
user
group
=
get_object_or_404
(
Group
,
id
=
gid
)
group
=
get_object_or_404
(
Group
,
id
=
gid
)
mytemplates
=
[
t
for
t
in
Template
.
objects
.
filter
(
owner
=
request
.
user
)
.
all
()]
mytemplates
=
[
t
for
t
in
Template
.
objects
.
filter
(
owner
=
request
.
user
)
.
all
()]
noshare
=
True
for
i
,
t
in
enumerate
(
mytemplates
):
for
i
,
t
in
enumerate
(
mytemplates
):
t
.
myshares
=
t
.
share_set
.
filter
(
group
=
group
)
t
.
myshares
=
t
.
share_set
.
filter
(
group
=
group
)
if
t
.
myshares
.
exists
():
noshare
=
False
mytemplates
[
i
]
=
t
mytemplates
[
i
]
=
t
publictemplates
=
[
t
for
t
in
Template
.
objects
.
filter
(
public
=
True
,
state
=
'READY'
)
.
all
()]
publictemplates
=
[
t
for
t
in
Template
.
objects
.
filter
(
public
=
True
,
state
=
'READY'
)
.
all
()]
for
i
,
t
in
enumerate
(
publictemplates
):
for
i
,
t
in
enumerate
(
publictemplates
):
t
.
myshares
=
t
.
share_set
.
filter
(
group
=
group
)
t
.
myshares
=
t
.
share_set
.
filter
(
group
=
group
)
if
t
.
myshares
.
exists
():
noshare
=
False
publictemplates
[
i
]
=
t
publictemplates
[
i
]
=
t
return
render_to_response
(
"show-group.html"
,
RequestContext
(
request
,{
return
render_to_response
(
"show-group.html"
,
RequestContext
(
request
,{
'group'
:
group
,
'group'
:
group
,
'members'
:
group
.
members
.
all
(),
'members'
:
group
.
members
.
all
(),
'mytemplates'
:
mytemplates
,
'mytemplates'
:
mytemplates
,
'publictemplates'
:
publictemplates
,
'publictemplates'
:
publictemplates
,
'noshare'
:
noshare
,
}))
}))
@login_required
@login_required
...
...
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