Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
94
Merge Requests
10
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
6d6ece03
authored
Feb 18, 2013
by
Dányi Bence
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
webui: hide_group functionality added
parent
607ec44e
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
0 deletions
+43
-0
one/static/cloud.js
+42
-0
one/templates/base.html
+1
-0
No files found.
one/static/cloud.js
View file @
6d6ece03
...
@@ -308,6 +308,48 @@ $(function() {
...
@@ -308,6 +308,48 @@ $(function() {
})
})
}
}
function
hide_group
(
id
){
var
hidden_groups
=
JSON
.
parse
(
window
.
localStorage
.
getItem
(
'hidden_groups'
))
||
{};
var
hidden_groups_for_user
=
hidden_groups
[
current_user
]
||
[];
for
(
var
i
in
hidden_groups_for_user
){
var
hide
=
hidden_groups_for_user
[
i
];
if
(
hide
==
id
)
return
false
;
}
hidden_groups_for_user
.
push
(
id
);
hidden_groups
[
current_user
]
=
hidden_groups_for_user
;
window
.
localStorage
.
setItem
(
'hidden_groups'
,
JSON
.
stringify
(
hidden_groups
));
$
(
'#group-'
+
id
).
hide
();
}
function
hide_groups
(){
var
hidden_groups
=
JSON
.
parse
(
window
.
localStorage
.
getItem
(
'hidden_groups'
))
||
{};
var
hidden_groups_for_user
=
hidden_groups
[
current_user
]
||
[];
for
(
var
i
in
hidden_groups_for_user
){
var
hide
=
hidden_groups_for_user
[
i
];
$
(
'#group-'
+
hide
).
hide
();
}
}
function
show_hidden_groups
(){
var
hidden_groups
=
JSON
.
parse
(
window
.
localStorage
.
getItem
(
'hidden_groups'
))
||
{};
hidden_groups
[
current_user
]
=
[];
window
.
localStorage
.
setItem
(
'hidden_groups'
,
JSON
.
stringify
(
hidden_groups
));
}
hide_groups
();
$
(
'.hide-group'
).
click
(
function
(
e
){
e
.
preventDefault
();
e
.
stopPropagation
();
hide_group
(
$
(
this
).
data
(
'id'
));
return
false
;
});
$
(
'#show-hidden-groups'
).
click
(
function
(
e
){
e
.
preventDefault
();
e
.
stopPropagation
();
show_hidden_groups
();
$
(
'#groups > li'
).
each
(
function
(){
$
(
this
).
show
();
})
})
$
(
'#new-member'
).
click
(
function
()
{
$
(
'#new-member'
).
click
(
function
()
{
$
(
'#new-member-form'
).
toggle
();
$
(
'#new-member-form'
).
toggle
();
});
});
...
...
one/templates/base.html
View file @
6d6ece03
...
@@ -12,6 +12,7 @@
...
@@ -12,6 +12,7 @@
<script
type=
"text/javascript"
src=
"{% url django.views.i18n.javascript_catalog %}"
></script>
<script
type=
"text/javascript"
src=
"{% url django.views.i18n.javascript_catalog %}"
></script>
<script
type=
"text/javascript"
>
<script
type=
"text/javascript"
>
window
.
localStorage
.
clear
();
window
.
localStorage
.
clear
();
var
current_user
=
{{
user
.
id
}};
</script>
</script>
<script
src=
"/static/less.min.js"
></script>
<script
src=
"/static/less.min.js"
></script>
<script
src=
"/static/knockout.min.js"
></script>
<script
src=
"/static/knockout.min.js"
></script>
...
...
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