fix new ui link and archive frontend and widget index

This commit is contained in:
Spen 2013-10-04 11:43:33 +08:00 committed by saurabhbhatia
parent 06c48524fd
commit f85354c2b6
5 changed files with 27 additions and 22 deletions

View File

@ -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

View File

@ -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

View File

@ -87,9 +87,11 @@
<% end %>
<div class="pull_right">
<% if !params[:category_id].blank? %>
<% 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 %>
<% else %>
<%= link_to t(:more_plus), panel_archive_front_end_archive_files_path %>
<% end %>
<% end %>
</div>

View File

@ -12,12 +12,14 @@
<ul>
<% wlcg["web_links"].each do |post| %>
<% if !post["title"].blank? %>
<li>
<%= link_to post["title"], post["url"], {:target => '_blank', :title => post["title"], :class=>"o-links-title"} %>
<% if !post["is_hot"].blank? %><span class="o-links-hot"><%= t('hot')%></span><% end %>
<div class="o-links-description"><%= post["context"] %></div>
</li>
<% end %>
<% end %>
</ul>
</div>

View File

@ -10,7 +10,7 @@
<ul>
<% wlcg["web_links"].each do |post| %>
<% if !web_link.title.empty? %>
<% if !post["title"].blank? %>
<li>
<%= link_to post["title"], post["url"], {:target => '_blank', :title => post["title"], :class=>"o-links-title"} %>
<% if !post["is_hot"].blank? %><span class="o-links-hot"><%= t('hot')%></span><% end %>