Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
O
OHR Support
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
97
Issues
97
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
OHR Support
Commits
b646a731
Commit
b646a731
authored
Jul 08, 2011
by
Eric Davis
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'ticket/master/191-next-prev-search-results'
parents
4a3e32b0
38b7ec57
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
10 deletions
+27
-10
search_helper.rb
app/helpers/search_helper.rb
+10
-0
_pagination.html.erb
app/views/search/_pagination.html.erb
+10
-0
index.rhtml
app/views/search/index.rhtml
+4
-10
application.css
public/stylesheets/application.css
+3
-0
No files found.
app/helpers/search_helper.rb
View file @
b646a731
...
...
@@ -57,4 +57,14 @@ module SearchHelper
end
(
'<ul>'
+
links
.
map
{
|
link
|
content_tag
(
'li'
,
link
)}.
join
(
' '
)
+
'</ul>'
)
unless
links
.
empty?
end
def
link_to_previous_search_page
(
pagination_previous_date
)
link_to_content_update
(
'« '
+
l
(
:label_previous
),
params
.
merge
(
:previous
=>
1
,
:offset
=>
pagination_previous_date
.
strftime
(
"%Y%m%d%H%M%S"
)))
end
def
link_to_next_search_page
(
pagination_next_date
)
link_to_content_update
(
l
(
:label_next
)
+
' »'
,
params
.
merge
(
:previous
=>
nil
,
:offset
=>
pagination_next_date
.
strftime
(
"%Y%m%d%H%M%S"
)))
end
end
app/views/search/_pagination.html.erb
0 → 100644
View file @
b646a731
<div
class=
"search-pagination"
>
<p>
<%
if
pagination_previous_date
%>
<%=
link_to_previous_search_page
(
pagination_previous_date
)
%>
<%
end
%>
<%
if
pagination_next_date
%>
<%=
link_to_next_search_page
(
pagination_next_date
)
%>
<%
end
%>
</p>
</div>
app/views/search/index.rhtml
View file @
b646a731
...
...
@@ -24,6 +24,9 @@
</div>
<h3>
<%=
l
(
:label_result_plural
)
%>
(
<%=
@results_by_type
.
values
.
sum
%>
)
</h3>
<%=
render
:partial
=>
'pagination'
,
:locals
=>
{
:pagination_previous_date
=>
@pagination_previous_date
,
:pagination_next_date
=>
@pagination_next_date
}
%>
<dl
id=
"search-results"
>
<%
@results
.
each
do
|
e
|
%>
<dt
class=
"
<%=
e
.
event_type
%>
"
>
...
...
@@ -36,15 +39,6 @@
</dl>
<%
end
%>
<p><center>
<%
if
@pagination_previous_date
%>
<%=
link_to_content_update
(
'« '
+
l
(
:label_previous
),
params
.
merge
(
:previous
=>
1
,
:offset
=>
@pagination_previous_date
.
strftime
(
"%Y%m%d%H%M%S"
)))
%>
<%
end
%>
<%
if
@pagination_next_date
%>
<%=
link_to_content_update
(
l
(
:label_next
)
+
' »'
,
params
.
merge
(
:previous
=>
nil
,
:offset
=>
@pagination_next_date
.
strftime
(
"%Y%m%d%H%M%S"
)))
%>
<%
end
%>
</center></p>
<%=
render
:partial
=>
'pagination'
,
:locals
=>
{
:pagination_previous_date
=>
@pagination_previous_date
,
:pagination_next_date
=>
@pagination_next_date
}
%>
<%
html_title
(
l
(
:label_search
))
-%>
public/stylesheets/application.css
View file @
b646a731
...
...
@@ -331,6 +331,9 @@ dt.time-entry { background-image: url(../images/time.png); }
#search-results
dt
.issue.closed
{
background-image
:
url(../images/ticket_checked.png)
;
}
.search-pagination
{
text-align
:
center
;
}
.search-pagination
a
{
padding
:
0
5px
;
}
div
#roadmap
.related-issues
{
margin-bottom
:
1em
;
}
div
#roadmap
.related-issues
td
.checkbox
{
display
:
none
;
}
div
#roadmap
.wiki
h1
:first-child
{
display
:
none
;
}
...
...
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