Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved search results page front end #234

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 13 additions & 12 deletions app/views/search/_result.html.slim
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
li[class="#{cycle('odd', 'even')}"]
.search-filename
= file_type_to_icon(result[:type], result[:path])
= link_to h(result[:title]), path2uri(result[:path])
.search-location
small = path2location(result[:path])
|  — 
em = number_to_human_size(result[:size])
| ,
em = h(result[:owner])
|   
= link_to theme_image_tag("icons/open-folder.png"), path2uri(File.dirname result[:path]), :title => t('open'), :class => 'file-icon'
tr class=cycle( "even", "odd")
td
.search-filename
= file_type_to_icon(result[:type], result[:path])
= link_to h(result[:title]), path2uri(result[:path])
.search-location
= path2location(result[:path])
|  — 
em = number_to_human_size(result[:size])
| ,
em = h(result[:owner])
|   
= link_to theme_image_tag("icons/open-folder.png"), path2uri(File.dirname result[:path]), :title => t('open'), :class => 'file-icon'
91 changes: 47 additions & 44 deletions app/views/search/hda.html.slim
Original file line number Diff line number Diff line change
@@ -1,51 +1,54 @@
#search-page
#search-types
ul#search-menu
li[class="#{active 'hda'}"]
= action_name == "hda" ? t('files') : link_to(t('files'), :action => :hda, :query => @query, per_page: @rpp)
li[class="#{active 'images'}"]
= action_name == "images" ? t('images') : link_to(t('images'), :action => :images, :query => @query, per_page: @rpp)
li[class="#{active 'audio'}"]
= action_name == "audio" ? t('audio') : link_to(t('audio'), :action => :audio, :query => @query, per_page: @rpp)
li[class="#{active 'video'}"]
= action_name == "video" ? t('video') : link_to(t('video'), :action => :video, :query => @query, per_page: @rpp)
li.results
= t('results_displayed', :count => @results.size)
'
' |
=link_to 50, query: @query, per_page: 50
'
' |
=link_to 100, query: @query, per_page: 100
#search-results
.results_list
.settings-table#disks-table
table.settings.table style="margin-bottom: 0px;"
thead
tr
#search-types
ul#search-menu
li[class="#{active 'hda'}"]
= action_name == "hda" ? t('files') : link_to(t('files'), :action => :hda, :query => @query, per_page: @rpp)
li[class="#{active 'images'}"]
= action_name == "images" ? t('images') : link_to(t('images'), :action => :images, :query => @query, per_page: @rpp)
li[class="#{active 'audio'}"]
= action_name == "audio" ? t('audio') : link_to(t('audio'), :action => :audio, :query => @query, per_page: @rpp)
li[class="#{active 'video'}"]
= action_name == "video" ? t('video') : link_to(t('video'), :action => :video, :query => @query, per_page: @rpp)
li.results
= t('results_displayed', :count => @results.size)
'
' |
=link_to 50, query: @query, per_page: 50
'
' |
=link_to 100, query: @query, per_page: 100

tbody class="search-table-body"
- if @results.size > 0
ul
= render :partial => 'result', :collection => @results
= render :partial => 'result', :collection => @results
- else
.myhda_empty
= t 'no_documents_found'

#search-pagination
.pagination
- if @page != 1
span.previous_page =link_to t('previous'), query: @query, page: @page-1, per_page: @rpp
'
- if @page > 5
=link_to "1", query: @query, page: 1, per_page: @rpp
'
=link_to "2", query: @query, page: 2, per_page: @rpp

#search-pagination
.pagination
- if @page != 1
span.previous_page =link_to t('previous'), query: @query, page: @page-1, per_page: @rpp
'
- if @page > 5
=link_to "1", query: @query, page: 1, per_page: @rpp
'
=link_to "2", query: @query, page: 2, per_page: @rpp
'
' ..
-(1..4).each do |p|
- page = @page-(5-p)
- unless page < 1
=link_to page, query: @query, page: page, per_page: @rpp
'
' ..
-(1..4).each do |p|
- page = @page-(5-p)
- unless page < 1
=link_to page, query: @query, page: page, per_page: @rpp
'
em.current = @page
- unless @results.size < @rpp
em.current = @page
- unless @results.size < @rpp
'
-(1..6).each do |p|
=link_to @page+p, query: @query, rel: "next", page: @page+p, per_page: @rpp
'
-(1..6).each do |p|
=link_to @page+p, query: @query, rel: "next", page: @page+p, per_page: @rpp
'
span.next_page =link_to t('next'), query: @query, page: @page+1, per_page: @rpp
span.next_page =link_to t('next'), query: @query, page: @page+1, per_page: @rpp
2 changes: 0 additions & 2 deletions public/themes/default/src/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -1215,10 +1215,8 @@ td {
// --------------------------------------------------

#search-types {
border-top: 1px solid #506480;
background-color: #f8f8f8;
padding: 10px;
margin: 10px 0 20px;
}

#search-menu {
Expand Down
21 changes: 18 additions & 3 deletions public/themes/default/stylesheets/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -1284,10 +1284,18 @@ td.align-top {
margin-top: 5px; }

#search-types {
border-top: 1px solid #506480;
background-color: #f8f8f8;
padding: 10px;
margin: 10px 0 20px; }
}

.search-table-body tr.even{
background: #b3b3b352;
}

div.search-filename a{
margin-left: 10px;
font-size: 13px;
}

#search-menu {
list-style: none;
Expand Down Expand Up @@ -1344,6 +1352,10 @@ td.align-top {
#search-results .even {
background-color: #f8f8f8; }

#search-pagination{
margin-top: 15px;
}

#search-pagination .pagination {
text-align: center;
width: 100%; }
Expand Down Expand Up @@ -1564,7 +1576,10 @@ span.server_status i.running {
font-weight: bold; }

.search-location {
color: #009000; }
color: #009000;
font-size: 12px;
padding-left: 28px;
}

/* firewall settings in network tab */
.fw-box {
Expand Down