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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Jérome Perrin
gitlab-ce
Commits
646fbe92
Commit
646fbe92
authored
May 08, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bring more usability to issues filtering. Block issues area on loading filtered results
parent
188a74c3
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
670 additions
and
60 deletions
+670
-60
app/assets/javascripts/application.js
app/assets/javascripts/application.js
+1
-0
app/assets/javascripts/issues.js.coffee
app/assets/javascripts/issues.js.coffee
+10
-8
app/controllers/issues_controller.rb
app/controllers/issues_controller.rb
+6
-0
app/views/issues/_filter.html.haml
app/views/issues/_filter.html.haml
+1
-1
app/views/issues/_issues.html.haml
app/views/issues/_issues.html.haml
+62
-51
vendor/assets/javascripts/jquery.blockUI.js
vendor/assets/javascripts/jquery.blockUI.js
+590
-0
No files found.
app/assets/javascripts/application.js
View file @
646fbe92
...
@@ -14,6 +14,7 @@
...
@@ -14,6 +14,7 @@
//= require jquery.waitforimages
//= require jquery.waitforimages
//= require jquery.atwho
//= require jquery.atwho
//= require jquery.scrollto
//= require jquery.scrollto
//= require jquery.blockUI
//= require turbolinks
//= require turbolinks
//= require jquery.turbolinks
//= require jquery.turbolinks
//= require bootstrap
//= require bootstrap
...
...
app/assets/javascripts/issues.js.coffee
View file @
646fbe92
...
@@ -15,8 +15,14 @@
...
@@ -15,8 +15,14 @@
$
(
this
).
html
totalIssues
+
1
$
(
this
).
html
totalIssues
+
1
else
else
$
(
this
).
html
totalIssues
-
1
$
(
this
).
html
totalIssues
-
1
$
(
"body"
).
on
"click"
,
".issues-filters .dropdown-menu a"
,
->
$
(
'.issues-list'
).
block
(
message
:
null
,
overlayCSS
:
backgroundColor
:
'#DDD'
opacity
:
.
4
)
reload
:
->
reload
:
->
Issues
.
initSelects
()
Issues
.
initSelects
()
Issues
.
initChecks
()
Issues
.
initChecks
()
...
@@ -48,10 +54,6 @@
...
@@ -48,10 +54,6 @@
unless
terms
is
last_terms
unless
terms
is
last_terms
last_terms
=
terms
last_terms
=
terms
if
terms
.
length
>=
2
or
terms
.
length
is
0
if
terms
.
length
>=
2
or
terms
.
length
is
0
$
(
'#search_status'
).
val
(
$
(
'#status'
).
val
())
$
(
'#search_assignee_id'
).
val
(
$
(
'#assignee_id'
).
val
())
$
(
'#search_milestone_id'
).
val
(
$
(
'#milestone_id'
).
val
())
$
(
'#search_label_name'
).
val
(
$
(
'#label_name'
).
val
())
form
.
submit
()
form
.
submit
()
checkChanged
:
->
checkChanged
:
->
...
@@ -62,9 +64,9 @@
...
@@ -62,9 +64,9 @@
ids
.
push
$
(
value
).
attr
(
"data-id"
)
ids
.
push
$
(
value
).
attr
(
"data-id"
)
$
(
"#update_issues_ids"
).
val
ids
$
(
"#update_issues_ids"
).
val
ids
$
(
".issues
_
filters"
).
hide
()
$
(
".issues
-
filters"
).
hide
()
$
(
".issues_bulk_update"
).
show
()
$
(
".issues_bulk_update"
).
show
()
else
else
$
(
"#update_issues_ids"
).
val
[]
$
(
"#update_issues_ids"
).
val
[]
$
(
".issues_bulk_update"
).
hide
()
$
(
".issues_bulk_update"
).
hide
()
$
(
".issues
_
filters"
).
show
()
$
(
".issues
-
filters"
).
show
()
app/controllers/issues_controller.rb
View file @
646fbe92
...
@@ -20,6 +20,12 @@ class IssuesController < ProjectResourceController
...
@@ -20,6 +20,12 @@ class IssuesController < ProjectResourceController
@issues
=
@issues
.
where
(
"title LIKE ?"
,
"%
#{
terms
}
%"
)
if
terms
.
present?
@issues
=
@issues
.
where
(
"title LIKE ?"
,
"%
#{
terms
}
%"
)
if
terms
.
present?
@issues
=
@issues
.
page
(
params
[
:page
]).
per
(
20
)
@issues
=
@issues
.
page
(
params
[
:page
]).
per
(
20
)
assignee_id
,
milestone_id
=
params
[
:assignee_id
],
params
[
:milestone_id
]
@assignee
=
@project
.
users
.
find
(
assignee_id
)
if
assignee_id
.
present?
&&
!
assignee_id
.
to_i
.
zero?
@milestone
=
@project
.
milestones
.
find
(
milestone_id
)
if
milestone_id
.
present?
&&
!
milestone_id
.
to_i
.
zero?
respond_to
do
|
format
|
respond_to
do
|
format
|
format
.
html
# index.html.erb
format
.
html
# index.html.erb
format
.
js
format
.
js
...
...
app/views/issues/_filter.html.haml
View file @
646fbe92
=
form_tag
project_issues_path
(
@project
),
method:
'get'
do
=
form_tag
project_issues_path
(
@project
),
method:
'get'
do
%fieldset
%fieldset
%ul
.nav.nav-pills.nav-stacked
%ul
.nav.nav-pills.nav-stacked
%li
{
class:
(
"active"
if
!
params
[
:status
])}
%li
{
class:
(
"active"
if
!
params
[
:status
]
||
params
[
:status
].
blank?
)}
=
link_to
project_issues_path
(
@project
,
status:
nil
)
do
=
link_to
project_issues_path
(
@project
,
status:
nil
)
do
Open
Open
%li
{
class:
(
"active"
if
params
[
:status
]
==
'assigned-to-me'
)}
%li
{
class:
(
"active"
if
params
[
:status
]
==
'assigned-to-me'
)}
...
...
app/views/issues/_issues.html.haml
View file @
646fbe92
...
@@ -12,62 +12,73 @@
...
@@ -12,62 +12,73 @@
=
hidden_field_tag
'update[issues_ids]'
,
[]
=
hidden_field_tag
'update[issues_ids]'
,
[]
=
hidden_field_tag
:status
,
params
[
:status
]
=
hidden_field_tag
:status
,
params
[
:status
]
=
button_tag
"Save"
,
class:
"btn update_selected_issues btn-small btn-save"
=
button_tag
"Save"
,
class:
"btn update_selected_issues btn-small btn-save"
.issues_filters
.issues-filters
=
form_tag
project_issues_path
(
@project
),
method: :get
,
remote:
true
do
%span
Filter by
%span
Filter by
.dropdown.inline.prepend-left-10
.dropdown.inline.prepend-left-10
%a
.dropdown-toggle.btn.btn-small
{
href:
'#'
,
"data-toggle"
=>
"dropdown"
}
%a
.dropdown-toggle.btn.btn-small
{
href:
'#'
,
"data-toggle"
=>
"dropdown"
}
%i
.icon-tags
%i
.icon-tags
%span
.light
labels:
%span
.light
labels:
-
if
params
[
:label_name
].
present?
-
if
params
[
:label_name
].
present?
%strong
=
params
[
:label_name
]
%strong
=
params
[
:label_name
]
-
else
-
else
Any
%b
.caret
%ul
.dropdown-menu
%li
=
link_to
project_issues_with_filter_path
(
@project
,
label_name:
nil
)
do
Any
Any
%b
.caret
-
issue_label_names
.
each
do
|
label_name
|
%ul
.dropdown-menu
%li
-
issue_label_names
.
each
do
|
label_name
|
=
link_to
project_issues_with_filter_path
(
@project
,
label_name:
label_name
)
do
%li
%span
{
class:
"label #{label_css_class(label_name)}"
}
=
link_to
project_issues_with_filter_path
(
@project
,
label_name:
label_name
)
do
%i
.icon-tag
%span
{
class:
"label #{label_css_class(label_name)}"
}
=
label_name
%i
.icon-tag
.dropdown.inline.prepend-left-10
=
label_name
%a
.dropdown-toggle.btn.btn-small
{
href:
'#'
,
"data-toggle"
=>
"dropdown"
}
.dropdown.inline.prepend-left-10
%i
.icon-user
%a
.dropdown-toggle.btn.btn-small
{
href:
'#'
,
"data-toggle"
=>
"dropdown"
}
%span
.light
assignee:
%i
.icon-user
-
if
@assignee
.
present?
%span
.light
assignee:
%strong
=
@assignee
.
name
-
if
params
[
:assignee_id
].
present?
-
elsif
params
[
:assignee_id
]
==
"0"
%strong
=
User
.
find
(
params
[
:assignee_id
]).
name
Unassigned
-
else
-
else
Any
%b
.caret
%ul
.dropdown-menu
%li
=
link_to
project_issues_with_filter_path
(
@project
,
assignee_id:
nil
)
do
Any
Any
%b
.caret
=
link_to
project_issues_with_filter_path
(
@project
,
assignee_id:
0
)
do
%ul
.dropdown-menu
Unassigned
-
@project
.
users
.
sort_by
(
&
:name
).
each
do
|
user
|
-
@project
.
users
.
sort_by
(
&
:name
).
each
do
|
user
|
%li
%li
=
link_to
project_issues_with_filter_path
(
@project
,
assignee_id:
user
.
id
)
do
=
link_to
project_issues_with_filter_path
(
@project
,
assignee_id:
user
.
id
)
do
=
image_tag
gravatar_icon
(
user
.
email
),
class:
"avatar s16"
=
image_tag
gravatar_icon
(
user
.
email
),
class:
"avatar s16"
=
user
.
name
=
user
.
name
.dropdown.inline.prepend-left-10
.dropdown.inline.prepend-left-10
%a
.dropdown-toggle.btn.btn-small
{
href:
'#'
,
"data-toggle"
=>
"dropdown"
}
%a
.dropdown-toggle.btn.btn-small
{
href:
'#'
,
"data-toggle"
=>
"dropdown"
}
%i
.icon-time
%i
.icon-time
%span
.light
milestone:
%span
.light
milestone:
-
if
params
[
:milestone_id
].
present?
-
if
@milestone
.
present?
%strong
=
Milestone
.
find
(
params
[
:milestone_id
]).
title
%strong
=
@milestone
.
title
-
else
-
elsif
params
[
:milestone_id
]
==
"0"
Unspecified
-
else
Any
%b
.caret
%ul
.dropdown-menu
%li
=
link_to
project_issues_with_filter_path
(
@project
,
milestone_id:
nil
)
do
Any
Any
%b
.caret
=
link_to
project_issues_with_filter_path
(
@project
,
milestone_id:
0
)
do
%ul
.dropdown-menu
Unspecified
-
issues_active_milestones
.
each
do
|
milestone
|
-
issues_active_milestones
.
each
do
|
milestone
|
%li
%li
=
link_to
project_issues_with_filter_path
(
@project
,
milestone_id:
milestone
.
id
)
do
=
link_to
project_issues_with_filter_path
(
@project
,
milestone_id:
milestone
.
id
)
do
%strong
=
milestone
.
title
%strong
=
milestone
.
title
%small
.light
=
milestone
.
expires_at
%small
.light
=
milestone
.
expires_at
-#= select_tag(:label_name, options_for_select(issue_tags, params[:label_name]), prompt: "Labels")
-#= select_tag(:assignee_id, options_from_collection_for_select([unassigned_filter] + @project.users.all, "id", "name", params[:assignee_id]), prompt: "Assignee")
-#= select_tag(:milestone_id, options_from_collection_for_select([unassigned_filter] + issues_active_milestones, "id", "title", params[:milestone_id]), prompt: "Milestone")
=
hidden_field_tag
:status
,
params
[
:status
]
=
hidden_field_tag
:issue_search
,
params
[
:status
],
id:
'filter_issue_search'
%ul
.well-list.issues-list
%ul
.well-list.issues-list
=
render
@issues
=
render
@issues
...
...
vendor/assets/javascripts/jquery.blockUI.js
0 → 100644
View file @
646fbe92
This diff is collapsed.
Click to expand it.
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