From f85354c2b6a56771d1c294c56ac62d8328da381a Mon Sep 17 00:00:00 2001 From: Spen Date: Fri, 4 Oct 2013 11:43:33 +0800 Subject: [PATCH] fix new ui link and archive frontend and widget index --- .../front_end/archive_files_controller.rb | 18 +++++++++--------- .../archive/widget/archive_files_controller.rb | 17 +++++++++-------- .../widget/archive_files/_index.html.erb | 10 ++++++---- .../front_end/web_links/index.html.erb | 2 ++ .../widget/web_links/_index.html.erb | 2 +- 5 files changed, 27 insertions(+), 22 deletions(-) diff --git a/vendor/built_in_modules/archive/app/controllers/panel/archive/front_end/archive_files_controller.rb b/vendor/built_in_modules/archive/app/controllers/panel/archive/front_end/archive_files_controller.rb index 64cf054e..09ee68bb 100644 --- a/vendor/built_in_modules/archive/app/controllers/panel/archive/front_end/archive_files_controller.rb +++ b/vendor/built_in_modules/archive/app/controllers/panel/archive/front_end/archive_files_controller.rb @@ -21,7 +21,7 @@ class Panel::Archive::FrontEnd::ArchiveFilesController < OrbitWidgetController def index @item = Page.find(params[:page_id]) @title = @item.title - @frontend_style = @item.frontend_style + @frontend_style = !@item.frontend_style.blank? ? @item.frontend_style : "1" if !@item.frontend_data_count.blank? @page_num = @item.frontend_data_count else @@ -43,15 +43,15 @@ class Panel::Archive::FrontEnd::ArchiveFilesController < OrbitWidgetController if @frontend_style == "1" if !params[:category_id].blank? && !params[:tag_id].blank? - @archive_files = ArchiveFile.can_display.where(:category_id.in => @archive_file_category_ids, :tagged_ids.in => params[:tag_id]).desc( :is_top ).default_sort(params[:sort]).page( params[:page_main] ).per(@page_num) + @archive_files = ArchiveFile.can_display.where(:category_id.in => @archive_file_category_ids, :tagged_ids.in => params[:tag_id], :title.nin=>[""]).desc( :is_top ).default_sort(params[:sort]).page( params[:page_main] ).per(@page_num) # @current_category = ArchiveFileCategory.from_id(params[:category_id]) rescue nil elsif !params[:category_id].blank? - @archive_files = ArchiveFile.can_display.where(:category_id.in => @archive_file_category_ids).desc( :is_top ).default_sort(params[:sort]).page( params[:page_main] ).per(@page_num) + @archive_files = ArchiveFile.can_display.where(:category_id.in => @archive_file_category_ids, :title.nin=>[""]).desc( :is_top ).default_sort(params[:sort]).page( params[:page_main] ).per(@page_num) # @current_category = ArchiveFileCategory.from_id(params[:category_id]) rescue nil elsif !params[:tag_id].blank? - @archive_files = ArchiveFile.can_display.where(:category_id.in => @archive_file_category_ids,:tagged_ids.in => params[:tag_id]).desc( :is_top ).default_sort(params[:sort]).page( params[:page_main] ).per(@page_num) + @archive_files = ArchiveFile.can_display.where(:category_id.in => @archive_file_category_ids,:tagged_ids.in => params[:tag_id], :title.nin=>[""]).desc( :is_top ).default_sort(params[:sort]).page( params[:page_main] ).per(@page_num) else - @archive_files = ArchiveFile.can_display.where(:category_id.in => @archive_file_category_ids).desc( :is_top ).default_sort(params[:sort]).page( params[:page_main] ).per(@page_num) + @archive_files = ArchiveFile.can_display.where(:category_id.in => @archive_file_category_ids, :title.nin=>[""]).desc( :is_top ).default_sort(params[:sort]).page( params[:page_main] ).per(@page_num) end elsif @frontend_style == "2" @@ -61,13 +61,13 @@ class Panel::Archive::FrontEnd::ArchiveFilesController < OrbitWidgetController @archive_file_categorys.each do |afcg| if !params[:category_id].blank? && !params[:tag_id].blank? - @archive_files = ArchiveFile.can_display.where(:category_id.in => [afcg.id], :tagged_ids.in => params[:tag_id]).desc( :is_top ).default_sort(params[:sort]) + @archive_files = ArchiveFile.can_display.where(:category_id.in => [afcg.id], :tagged_ids.in => params[:tag_id], :title.nin=>[""]).desc( :is_top ).default_sort(params[:sort]) elsif !params[:category_id].blank? - @archive_files = ArchiveFile.can_display.where(:category_id.in => [afcg.id]).desc( :is_top ).default_sort(params[:sort]) + @archive_files = ArchiveFile.can_display.where(:category_id.in => [afcg.id], :title.nin=>[""]).desc( :is_top ).default_sort(params[:sort]) elsif !params[:tag_id].blank? - @archive_files = ArchiveFile.can_display.where(:category_id => afcg.id, :tagged_ids.in => params[:tag_id]).desc( :is_top ).default_sort(params[:sort]) + @archive_files = ArchiveFile.can_display.where(:category_id => afcg.id, :tagged_ids.in => params[:tag_id], :title.nin=>[""]).desc( :is_top ).default_sort(params[:sort]) else - @archive_files = ArchiveFile.can_display.where(:category_id => afcg.id).desc( :is_top ).default_sort(params[:sort]) + @archive_files = ArchiveFile.can_display.where(:category_id => afcg.id, :title.nin=>[""]).desc( :is_top ).default_sort(params[:sort]) end archive_file_datas = Array.new diff --git a/vendor/built_in_modules/archive/app/controllers/panel/archive/widget/archive_files_controller.rb b/vendor/built_in_modules/archive/app/controllers/panel/archive/widget/archive_files_controller.rb index 426ce383..34265cdb 100644 --- a/vendor/built_in_modules/archive/app/controllers/panel/archive/widget/archive_files_controller.rb +++ b/vendor/built_in_modules/archive/app/controllers/panel/archive/widget/archive_files_controller.rb @@ -23,6 +23,7 @@ class Panel::Archive::Widget::ArchiveFilesController < OrbitWidgetController end @widget_style = @part.widget_style + @widget_style = !@part.widget_style.blank? ? @part.widget_style : "1" @category_id = @part.category @@ -64,13 +65,13 @@ class Panel::Archive::Widget::ArchiveFilesController < OrbitWidgetController if @widget_style == "1" if !params[:category_id].blank? && !params[:tag_id].blank? - @archive_files = ArchiveFile.can_display.where(:category_id.in => @archive_file_category_ids, :tagged_ids.in => params[:tag_id]).desc( :is_top ).default_sort(params[:sort]).page( params[:page_main] ).per(@page_num) + @archive_files = ArchiveFile.can_display.where(:category_id.in => @archive_file_category_ids, :tagged_ids.in => params[:tag_id], :title.nin=>[""]).desc( :is_top ).default_sort(params[:sort]).page( params[:page_main] ).per(@page_num) elsif !params[:category_id].blank? - @archive_files = ArchiveFile.can_display.where(:category_id.in => @archive_file_category_ids).desc( :is_top ).default_sort(params[:sort]).page( params[:page_main] ).per(@page_num) + @archive_files = ArchiveFile.can_display.where(:category_id.in => @archive_file_category_ids, :title.nin=>[""]).desc( :is_top ).default_sort(params[:sort]).page( params[:page_main] ).per(@page_num) elsif !params[:tag_id].blank? - @archive_files = ArchiveFile.can_display.where(:category_id.in => @archive_file_category_ids,:tagged_ids.in => params[:tag_id]).desc( :is_top ).default_sort(params[:sort]).page( params[:page_main] ).per(@page_num) + @archive_files = ArchiveFile.can_display.where(:category_id.in => @archive_file_category_ids,:tagged_ids.in => params[:tag_id], :title.nin=>[""]).desc( :is_top ).default_sort(params[:sort]).page( params[:page_main] ).per(@page_num) else - @archive_files = ArchiveFile.can_display.where(:category_id.in => @archive_file_category_ids).desc( :is_top ).default_sort(params[:sort]).page( params[:page_main] ).per(@page_num) + @archive_files = ArchiveFile.can_display.where(:category_id.in => @archive_file_category_ids, :title.nin=>[""]).desc( :is_top ).default_sort(params[:sort]).page( params[:page_main] ).per(@page_num) end elsif @widget_style == "2" @@ -80,13 +81,13 @@ class Panel::Archive::Widget::ArchiveFilesController < OrbitWidgetController @archive_file_categorys.each do |afcg| if !params[:category_id].blank? && !params[:tag_id].blank? - @archive_files = ArchiveFile.can_display.where(:category_id.in => [afcg.id], :tagged_ids.in => params[:tag_id]).desc( :is_top ).default_sort(params[:sort]).limit(@page_num) + @archive_files = ArchiveFile.can_display.where(:category_id.in => [afcg.id], :tagged_ids.in => params[:tag_id], :title.nin=>[""]).desc( :is_top ).default_sort(params[:sort]).limit(@page_num) elsif !params[:category_id].blank? - @archive_files = ArchiveFile.can_display.where(:category_id.in => [afcg.id]).desc( :is_top ).default_sort(params[:sort]).limit(@page_num) + @archive_files = ArchiveFile.can_display.where(:category_id.in => [afcg.id], :title.nin=>[""]).desc( :is_top ).default_sort(params[:sort]).limit(@page_num) elsif !params[:tag_id].blank? - @archive_files = ArchiveFile.can_display.where(:category_id => afcg.id, :tagged_ids.in => params[:tag_id]).desc( :is_top ).default_sort(params[:sort]).limit(@page_num) + @archive_files = ArchiveFile.can_display.where(:category_id => afcg.id, :tagged_ids.in => params[:tag_id], :title.nin=>[""]).desc( :is_top ).default_sort(params[:sort]).limit(@page_num) else - @archive_files = ArchiveFile.can_display.where(:category_id => afcg.id).desc( :is_top ).default_sort(params[:sort]).limit(@page_num) + @archive_files = ArchiveFile.can_display.where(:category_id => afcg.id, :title.nin=>[""]).desc( :is_top ).default_sort(params[:sort]).limit(@page_num) end archive_file_datas = Array.new diff --git a/vendor/built_in_modules/archive/app/views/panel/archive/widget/archive_files/_index.html.erb b/vendor/built_in_modules/archive/app/views/panel/archive/widget/archive_files/_index.html.erb index afd39417..a4fa8bdf 100644 --- a/vendor/built_in_modules/archive/app/views/panel/archive/widget/archive_files/_index.html.erb +++ b/vendor/built_in_modules/archive/app/views/panel/archive/widget/archive_files/_index.html.erb @@ -87,9 +87,11 @@ <% end %>
-<% if !params[:category_id].blank? %> - <%= link_to t(:more_plus), panel_archive_front_end_archive_files_path(:category_id => @part.category) %> -<% else %> - <%= link_to t(:more_plus), panel_archive_front_end_archive_files_path %> +<% if !@archive_files.blank? or !@archive_file_datas.blank? %> + <% if !params[:category_id].blank? %> + <%= link_to t(:more_plus), panel_archive_front_end_archive_files_path(:category_id => @part.category) %> + <% else %> + <%= link_to t(:more_plus), panel_archive_front_end_archive_files_path %> <% end %> +<% end %>
diff --git a/vendor/built_in_modules/web_resource/app/views/panel/web_resource/front_end/web_links/index.html.erb b/vendor/built_in_modules/web_resource/app/views/panel/web_resource/front_end/web_links/index.html.erb index e9a7551c..b05e24fc 100644 --- a/vendor/built_in_modules/web_resource/app/views/panel/web_resource/front_end/web_links/index.html.erb +++ b/vendor/built_in_modules/web_resource/app/views/panel/web_resource/front_end/web_links/index.html.erb @@ -12,12 +12,14 @@ diff --git a/vendor/built_in_modules/web_resource/app/views/panel/web_resource/widget/web_links/_index.html.erb b/vendor/built_in_modules/web_resource/app/views/panel/web_resource/widget/web_links/_index.html.erb index 013718b5..f2ffc883 100644 --- a/vendor/built_in_modules/web_resource/app/views/panel/web_resource/widget/web_links/_index.html.erb +++ b/vendor/built_in_modules/web_resource/app/views/panel/web_resource/widget/web_links/_index.html.erb @@ -10,7 +10,7 @@