diff --git a/app/controllers/admin/e_papers_controller.rb b/app/controllers/admin/e_papers_controller.rb index cc55557..5d26389 100644 --- a/app/controllers/admin/e_papers_controller.rb +++ b/app/controllers/admin/e_papers_controller.rb @@ -7,6 +7,7 @@ class Admin::EPapersController < OrbitAdminController @filter_fields.delete(:status) @papers = EPaperTopic.order_by(sort) .with_categories(filters("category")) + .with_tags(filters("tag")) @papers = search_data(@papers,[:title]).page(params[:page]).per(10) diff --git a/app/controllers/e_papers_controller.rb b/app/controllers/e_papers_controller.rb index 5fa3d62..f9b93c8 100644 --- a/app/controllers/e_papers_controller.rb +++ b/app/controllers/e_papers_controller.rb @@ -1,10 +1,11 @@ class EPapersController < ApplicationController def index - topics = EPaperTopic.filter_by_categories.desc(:period) + topics = EPaperTopic.filter_by_categories.filter_by_tags.desc(:period) data = topics.collect do |topic| { "title" => topic.title, + "criteria_title" => topic.criteria_title, "link_to_show" => OrbitHelper.url_to_show(topic.to_param), "description" => topic.description, "img_url" => topic.image.url, @@ -144,7 +145,7 @@ class EPapersController < ApplicationController end def category_wise_articles - topics = EPaperTopic.filter_by_widget_categories.desc(:period) + topics = EPaperTopic.filter_by_widget_categories.filter_by_tags(OrbitHelper.widget_tags).desc(:period) data = Array(topics).compact.collect do |topic| { "title" => topic.title,