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
1e29781e
authored
Feb 12, 2013
by
Dányi Bence
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
school: group owners displayed
parent
20f132f9
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
70 additions
and
6 deletions
+70
-6
one/static/box.less
+3
-3
one/static/cloud.js
+23
-0
school/templates/show-group.html
+43
-3
school/views.py
+1
-0
No files found.
one/static/box.less
View file @
1e29781e
...
@@ -537,19 +537,19 @@ table {
...
@@ -537,19 +537,19 @@ table {
}
}
}
}
#group-members {
#group-members
, #group-owners
{
.summary .name {
.summary .name {
background-image: url(icons/user.png);
background-image: url(icons/user.png);
float: left;
float: left;
}
}
}
}
#new-member {
#new-member
, #new-owner
{
.name {
.name {
background-image: url(icons/user--plus.png) !important;
background-image: url(icons/user--plus.png) !important;
float: left;
float: left;
}
}
#new-member-form {
#new-member-form
, #new-owner-form
{
float: right;
float: right;
margin-left: 5px;
margin-left: 5px;
display: none;
display: none;
...
...
one/static/cloud.js
View file @
1e29781e
...
@@ -279,6 +279,29 @@ $(function() {
...
@@ -279,6 +279,29 @@ $(function() {
alert
(
JSON
.
parse
(
data
.
responseText
).
status
);
alert
(
JSON
.
parse
(
data
.
responseText
).
status
);
})
})
});
});
$
(
'#new-owner'
).
click
(
function
()
{
$
(
'#new-owner-form'
).
toggle
();
});
$
(
'#new-owner-form input'
).
click
(
function
(
e
)
{
e
.
stopPropagation
();
});
$
(
'#new-owner-form input[type=submit]'
).
click
(
function
()
{
var
neptun
=
$
(
this
).
prev
().
val
();
$
.
ajax
({
type
:
'POST'
,
url
:
'/ajax/group/'
+
$
(
this
).
data
(
'id'
)
+
'/add/'
,
data
:
'neptun='
+
neptun
,
dataType
:
'json'
,
success
:
function
(
data
)
{
window
.
location
.
reload
();
}
}).
error
(
function
(
data
)
{
//TODO: fancy modal alert
alert
(
JSON
.
parse
(
data
.
responseText
).
status
);
})
});
$
(
'#group-members .remove'
).
click
(
function
(
e
)
{
$
(
'#group-members .remove'
).
click
(
function
(
e
)
{
e
.
preventDefault
();
e
.
preventDefault
();
e
.
stopPropagation
();
e
.
stopPropagation
();
...
...
school/templates/show-group.html
View file @
1e29781e
...
@@ -3,9 +3,6 @@
...
@@ -3,9 +3,6 @@
{% get_current_language as LANGUAGE_CODE %}
{% get_current_language as LANGUAGE_CODE %}
{% block content %}
{% block content %}
<div
class=
"boxes"
>
<div
class=
"boxes"
>
<!-- <div class="contentblock">
<h2>Summary</h2>
</div> -->
<div
class=
"contentblock"
id=
"group-members"
>
<div
class=
"contentblock"
id=
"group-members"
>
<h2>
{% trans "Members of" %}: {{group.name}}
</h2>
<h2>
{% trans "Members of" %}: {{group.name}}
</h2>
<ul
class=
"wm-list"
>
<ul
class=
"wm-list"
>
...
@@ -49,6 +46,49 @@
...
@@ -49,6 +46,49 @@
</li>
</li>
</ul>
</ul>
</div>
</div>
<div
class=
"contentblock"
id=
"group-owners"
>
<h2>
{% trans "Owners of" %}: {{group.name}}
</h2>
<ul
class=
"wm-list"
>
{% for owner in owners %}
<li
class=
"wm small-row"
>
<div
class=
"summary"
>
<div
class=
"name"
>
{% if not owner.user %}
{{owner.code}}
{% else %}
{{owner}} ({{owner.code}})
{% endif %}
</div>
<div
class=
"actions"
>
<a
href=
"#"
class=
"remove"
data-gid=
"{{group.id}}"
data-neptun=
"{{owner.code}}"
>
<img
src=
"/static/icons/minus-circle.png"
alt=
"{% trans 'Remove' %}"
/>
</a>
</div>
<div
class=
"clear"
></div>
</div>
<div
class=
"details"
>
<div
class=
"container"
>
{% if not owner.user %}
{% trans "This user never logged in, no data available" %}
{% else %}
{{owner}} ({{owner.code}})
<a
href=
"mailto:{{owner.user.email}}"
>
E-mail
</a>
{% endif %}
</div>
</div>
</li>
{% endfor %}
<li
class=
"wm small-row"
>
<div
class=
"summary"
id=
"new-owner"
>
<div
class=
"name"
>
{% trans "Add owner" %}
</div>
<div
id=
"new-owner-form"
>
<input
type=
"text"
placeholder=
"{% trans "
Owner
name
/
NEPTUN
"
%}"
/>
<input
type=
"submit"
value=
"{% trans "
Add
owner
"
%}"
data-id=
"{{group.id}}"
/>
</div>
<div
class=
"clear"
></div>
</div>
</li>
</ul>
</div>
</div>
</div>
<div
class=
"boxes"
>
<div
class=
"boxes"
>
{% if noshare %}
{% if noshare %}
...
...
school/views.py
View file @
1e29781e
...
@@ -173,6 +173,7 @@ def group_show(request, gid):
...
@@ -173,6 +173,7 @@ def group_show(request, gid):
'publictemplates'
:
publictemplates
,
'publictemplates'
:
publictemplates
,
'noshare'
:
noshare
,
'noshare'
:
noshare
,
'userdetails'
:
UserCloudDetails
.
objects
.
get
(
user
=
request
.
user
),
'userdetails'
:
UserCloudDetails
.
objects
.
get
(
user
=
request
.
user
),
'owners'
:
group
.
owners
.
all
(),
}))
}))
@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