From 1477dd4886f0152a978872582374fbe4b7fee09e Mon Sep 17 00:00:00 2001 From: sukhbir-singh Date: Mon, 10 Jun 2019 01:46:51 +0530 Subject: [PATCH 1/2] added bootstrap components --- app/views/search/hda.html.slim | 118 +++++++++++++++++++++------------ 1 file changed, 74 insertions(+), 44 deletions(-) diff --git a/app/views/search/hda.html.slim b/app/views/search/hda.html.slim index d7ba2be6..190956a7 100644 --- a/app/views/search/hda.html.slim +++ b/app/views/search/hda.html.slim @@ -1,51 +1,81 @@ -#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 + 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 - if @results.size > 0 - ul - = render :partial => 'result', :collection => @results + - @results.first(5).each do | result | + tr class=cycle("odd", "even") + td + .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' - 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 + +nav + ul.pagination + li.page-item + a.page-link href="#" Previous + li.page-item + a.page-link href="#" 1 + li.page-item + a.page-link href="#" 2 + li.page-item + a.page-link href="#" 3 + li.page-item + a.page-link href="#" Next From 4cd652cbc346fc4da5128094fa5c8a9ab5bdbe16 Mon Sep 17 00:00:00 2001 From: sukhbir-singh Date: Fri, 14 Jun 2019 06:47:02 +0530 Subject: [PATCH 2/2] search table styling fixed --- app/views/search/_result.html.slim | 25 ++++++++------- app/views/search/hda.html.slim | 35 +++------------------ public/themes/default/src/style.scss | 2 -- public/themes/default/stylesheets/style.css | 21 +++++++++++-- 4 files changed, 35 insertions(+), 48 deletions(-) diff --git a/app/views/search/_result.html.slim b/app/views/search/_result.html.slim index a5cdad6b..db4e7e9c 100644 --- a/app/views/search/_result.html.slim +++ b/app/views/search/_result.html.slim @@ -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' \ No newline at end of file diff --git a/app/views/search/hda.html.slim b/app/views/search/hda.html.slim index 190956a7..9f627e48 100644 --- a/app/views/search/hda.html.slim +++ b/app/views/search/hda.html.slim @@ -1,5 +1,5 @@ .settings-table#disks-table - table.settings.table + table.settings.table style="margin-bottom: 0px;" thead tr #search-types @@ -21,29 +21,15 @@ ' | =link_to 100, query: @query, per_page: 100 - - tbody + tbody class="search-table-body" - if @results.size > 0 - - @results.first(5).each do | result | - tr class=cycle("odd", "even") - td - .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' + = render :partial => 'result', :collection => @results - else .myhda_empty = t 'no_documents_found' -/ #search-pagination +#search-pagination .pagination - if @page != 1 span.previous_page =link_to t('previous'), query: @query, page: @page-1, per_page: @rpp @@ -66,16 +52,3 @@ =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 - -nav - ul.pagination - li.page-item - a.page-link href="#" Previous - li.page-item - a.page-link href="#" 1 - li.page-item - a.page-link href="#" 2 - li.page-item - a.page-link href="#" 3 - li.page-item - a.page-link href="#" Next diff --git a/public/themes/default/src/style.scss b/public/themes/default/src/style.scss index 7e5099a6..96b875d2 100755 --- a/public/themes/default/src/style.scss +++ b/public/themes/default/src/style.scss @@ -1215,10 +1215,8 @@ td { // -------------------------------------------------- #search-types { - border-top: 1px solid #506480; background-color: #f8f8f8; padding: 10px; - margin: 10px 0 20px; } #search-menu { diff --git a/public/themes/default/stylesheets/style.css b/public/themes/default/stylesheets/style.css index 86bec6fe..55405522 100644 --- a/public/themes/default/stylesheets/style.css +++ b/public/themes/default/stylesheets/style.css @@ -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; @@ -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%; } @@ -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 {