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
A prog2-höz tartozó friss repo anyagok itt elérhetőek:
https://git.iit.bme.hu/
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
Show 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 @@
<ul>
{% for i in t.myshares %}
<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>
{% endfor %}
{% endif %}
...
...
@@ -72,7 +72,7 @@
<ul>
{% for i in t.myshares %}
<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>
{% endfor %}
{% endif %}
...
...
school/templates/show-group.html
View file @
a67bb6a1
...
...
@@ -51,7 +51,7 @@
</div>
</div>
<div
class=
"boxes"
>
{% if noshare %}
<div
id=
"new-wm-tooltip"
style=
"position:absolute"
>
<div
id=
"new-wm-tooltip-container"
>
<p>
...
...
@@ -63,6 +63,7 @@
<div
id=
"new-wm-tooltip-tail"
></div>
</div>
</div>
{% endif %}
{% include "box-templatelist.html" %}
</div>
{% endblock %}
school/views.py
View file @
a67bb6a1
...
...
@@ -154,18 +154,24 @@ def group_show(request, gid):
user
=
request
.
user
group
=
get_object_or_404
(
Group
,
id
=
gid
)
mytemplates
=
[
t
for
t
in
Template
.
objects
.
filter
(
owner
=
request
.
user
)
.
all
()]
noshare
=
True
for
i
,
t
in
enumerate
(
mytemplates
):
t
.
myshares
=
t
.
share_set
.
filter
(
group
=
group
)
if
t
.
myshares
.
exists
():
noshare
=
False
mytemplates
[
i
]
=
t
publictemplates
=
[
t
for
t
in
Template
.
objects
.
filter
(
public
=
True
,
state
=
'READY'
)
.
all
()]
for
i
,
t
in
enumerate
(
publictemplates
):
t
.
myshares
=
t
.
share_set
.
filter
(
group
=
group
)
if
t
.
myshares
.
exists
():
noshare
=
False
publictemplates
[
i
]
=
t
return
render_to_response
(
"show-group.html"
,
RequestContext
(
request
,{
'group'
:
group
,
'members'
:
group
.
members
.
all
(),
'mytemplates'
:
mytemplates
,
'publictemplates'
:
publictemplates
,
'noshare'
:
noshare
,
}))
@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