Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gelencsér Szabolcs
/
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
44b50a55
authored
Feb 08, 2013
by
Dányi Bence
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
school: group listing
parent
ce24f234
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
90 additions
and
4 deletions
+90
-4
one/static/box.less
+15
-0
school/templates/show-group.html
+69
-1
school/views.py
+6
-3
No files found.
one/static/box.less
View file @
44b50a55
...
...
@@ -463,3 +463,18 @@ table {
}
}
}
#group-members {
.summary .name {
background-image: url(icons/user.png);
}
}
#new-member {
.name {
background-image: url(icons/user--plus.png) !important;
}
#new-member-form {
display: none;
}
}
school/templates/show-group.html
View file @
44b50a55
...
...
@@ -2,5 +2,73 @@
{% load i18n %}
{% get_current_language as LANGUAGE_CODE %}
{% block content %}
Figyelem emberek!
<div
class=
"boxes"
>
<div
class=
"contentblock"
>
<h2>
Summary
</h2>
</div>
<div
class=
"contentblock"
id=
"group-members"
>
<h2>
{% trans "Members" %}
</h2>
<ul
class=
"wm-list"
>
{% for member in members %}
<li
class=
"wm small-row"
>
<div
class=
"summary"
>
<div
class=
"name"
>
{% if not member.user %}
{{member.code}}
{% else %}
{{member}} ({{member.code}})
{% endif %}
</div>
<div
class=
"clear"
></div>
</div>
<div
class=
"details"
>
<div
class=
"container"
>
{% if not member.user %}
{% trans "This user never logged in, no data available" %}
{% else %}
{{member}} ({{member.code}})
{% endif %}
</div>
</div>
</li>
{% endfor %}
<li
class=
"wm small-row"
>
<div
class=
"summary"
id=
"new-member"
>
<div
class=
"name"
>
{% trans "Add user" %}
</div>
<div
id=
"new-member-form"
>
<input
type=
"text"
placeholder=
"{% trans "
User
NEPTUN
code
"
%}"
/>
<input
type=
"submit"
value=
"{% trans "
Add
user
"
%}"
/>
</div>
<div
class=
"clear"
></div>
</div>
</li>
</ul>
</div>
</div>
<div
class=
"boxes"
>
<div
class=
"contentblock"
>
<h2>
{% trans "Templates" %}
</h2>
<ul
class=
"wm-list"
>
<div
id=
"new-wm-tooltip"
>
<div
id=
"new-wm-tooltip-container"
>
<p>
{% trans "This group has no shared templates." %}
</p>
<p>
{% trans "Share one, and the group members can start their own virtual machine." %}
</p>
<div
id=
"new-wm-tooltip-tail"
></div>
</div>
</div>
<li
class=
"wm"
>
<div
class=
"summary"
>
<div
class=
"name"
>
{% trans "Sablon megosztása" %}
</div>
<div
class=
"clear"
></div>
</div>
</li>
</ul>
</div>
</div>
{% endblock %}
school/views.py
View file @
44b50a55
...
...
@@ -142,7 +142,10 @@ def language(request, lang):
def
group_show
(
request
,
gid
):
user
=
request
.
user
group
=
get_object_or_404
(
Group
,
id
=
gid
)
return
render_to_response
(
"show-group.html"
,
RequestContext
(
request
,{}))
return
render_to_response
(
"show-group.html"
,
RequestContext
(
request
,{
'group'
:
group
,
'members'
:
group
.
members
.
all
()
}))
def
group_new
(
request
):
name
=
request
.
POST
[
'name'
]
...
...
@@ -153,7 +156,7 @@ def group_new(request):
if
re
.
match
(
'^[a-zA-Z][a-zA-Z0-9]{5}$'
,
member
)
==
None
:
messages
.
error
(
request
,
_
(
'Invalid NEPTUN code found.'
))
return
redirect
(
'/'
)
person
=
Person
.
objects
.
get_or_create
(
code
=
member
)
person
,
created
=
Person
.
objects
.
get_or_create
(
code
=
member
)
members
.
append
(
person
)
owner
=
request
.
user
.
person_set
.
all
()[
0
]
group
=
Group
()
...
...
@@ -161,7 +164,7 @@ def group_new(request):
group
.
semester
=
semester
group
.
save
()
for
member
in
members
:
group
.
members
.
add
(
person
)
group
.
members
.
add
(
member
)
group
.
owners
.
add
(
owner
)
group
.
save
()
return
redirect
(
'/group/show/
%
s'
%
group
.
id
)
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