Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
5b1634cd
Commit
5b1634cd
authored
Nov 08, 2011
by
Aleksei Kvitinskii
Browse files
Options
Browse Files
Download
Plain Diff
implemented cookie remember option for issue page filter
parents
49bced3a
3fe9f3eb
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
10 deletions
+21
-10
app/helpers/issues_helper.rb
app/helpers/issues_helper.rb
+10
-5
app/views/issues/index.html.haml
app/views/issues/index.html.haml
+10
-4
app/views/layouts/project.html.haml
app/views/layouts/project.html.haml
+1
-1
No files found.
app/helpers/issues_helper.rb
View file @
5b1634cd
module
IssuesHelper
module
IssuesHelper
def
sort_class
def
sort_class
if
can?
(
current_user
,
:admin_issue
,
@project
)
&&
(
!
params
[
:f
]
||
params
[
:f
]
==
"0"
)
if
can?
(
current_user
,
:admin_issue
,
@project
)
&&
(
!
params
[
:f
]
||
params
[
:f
]
==
"0"
)
"handle"
"handle"
end
end
end
end
def
project_issues_filter_path
project
,
params
=
{}
params
[
:f
]
||=
cookies
[
'issue_filter'
]
project_issues_path
project
,
params
end
end
end
app/views/issues/index.html.haml
View file @
5b1634cd
...
@@ -13,16 +13,16 @@
...
@@ -13,16 +13,16 @@
.right.issues_filter
.right.issues_filter
=
form_tag
project_issues_path
(
@project
),
:method
=>
:get
do
=
form_tag
project_issues_path
(
@project
),
:method
=>
:get
do
.left
.left
=
radio_button_tag
:f
,
0
,
(
params
[
:f
]
||
"0"
)
==
"0"
,
:onclick
=>
"
this.form.submit(
)"
,
:id
=>
"open_issues"
,
:class
=>
"status"
=
radio_button_tag
:f
,
0
,
(
params
[
:f
]
||
"0"
)
==
"0"
,
:onclick
=>
"
setIssueFilter(this.form, 0
)"
,
:id
=>
"open_issues"
,
:class
=>
"status"
=
label_tag
"open_issues"
,
"Open"
=
label_tag
"open_issues"
,
"Open"
.left
.left
=
radio_button_tag
:f
,
2
,
params
[
:f
]
==
"2"
,
:onclick
=>
"
this.form.submit(
)"
,
:id
=>
"closed_issues"
,
:class
=>
"status"
=
radio_button_tag
:f
,
2
,
params
[
:f
]
==
"2"
,
:onclick
=>
"
setIssueFilter(this.form, 2
)"
,
:id
=>
"closed_issues"
,
:class
=>
"status"
=
label_tag
"closed_issues"
,
"Closed"
=
label_tag
"closed_issues"
,
"Closed"
.left
.left
=
radio_button_tag
:f
,
3
,
params
[
:f
]
==
"3"
,
:onclick
=>
"
this.form.submit(
)"
,
:id
=>
"my_issues"
,
:class
=>
"status"
=
radio_button_tag
:f
,
3
,
params
[
:f
]
==
"3"
,
:onclick
=>
"
setIssueFilter(this.form, 3
)"
,
:id
=>
"my_issues"
,
:class
=>
"status"
=
label_tag
"my_issues"
,
"To Me"
=
label_tag
"my_issues"
,
"To Me"
.left
.left
=
radio_button_tag
:f
,
1
,
params
[
:f
]
==
"1"
,
:onclick
=>
"
this.form.submit(
)"
,
:id
=>
"all_issues"
,
:class
=>
"status"
=
radio_button_tag
:f
,
1
,
params
[
:f
]
==
"1"
,
:onclick
=>
"
setIssueFilter(this.form, 1
)"
,
:id
=>
"all_issues"
,
:class
=>
"status"
=
label_tag
"all_issues"
,
"All"
=
label_tag
"all_issues"
,
"All"
=
render
"issues"
=
render
"issues"
...
@@ -31,6 +31,12 @@
...
@@ -31,6 +31,12 @@
var
href
=
$
(
'
.issue_search
'
).
parent
().
attr
(
'
action
'
);
var
href
=
$
(
'
.issue_search
'
).
parent
().
attr
(
'
action
'
);
var
last_terms
=
''
;
var
last_terms
=
''
;
var
setIssueFilter
=
function
(
form
,
value
){
$
.
cookie
(
'
issue_filter
'
,
value
,
{
expires
:
140
});
form
.
submit
();
}
$
(
'
.issue_search
'
).
keyup
(
function
()
{
$
(
'
.issue_search
'
).
keyup
(
function
()
{
var
terms
=
$
(
this
).
val
();
var
terms
=
$
(
this
).
val
();
var
project_id
=
$
(
'
#project_id
'
).
val
();
var
project_id
=
$
(
'
#project_id
'
).
val
();
...
...
app/views/layouts/project.html.haml
View file @
5b1634cd
...
@@ -25,7 +25,7 @@
...
@@ -25,7 +25,7 @@
Team
Team
-
if
@project
.
users_projects
.
count
>
0
-
if
@project
.
users_projects
.
count
>
0
%span
{
:class
=>
"number"
}=
@project
.
users_projects
.
count
%span
{
:class
=>
"number"
}=
@project
.
users_projects
.
count
=
link_to
project_issues_path
(
@project
),
:class
=>
(
controller
.
controller_name
==
"issues"
)
?
"current"
:
nil
do
=
link_to
project_issues_
filter_
path
(
@project
),
:class
=>
(
controller
.
controller_name
==
"issues"
)
?
"current"
:
nil
do
Issues
Issues
-
if
@project
.
issues
.
opened
.
count
>
0
-
if
@project
.
issues
.
opened
.
count
>
0
%span
{
:class
=>
"number"
}=
@project
.
issues
.
opened
.
count
%span
{
:class
=>
"number"
}=
@project
.
issues
.
opened
.
count
...
...
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