2019-05-28 15:54:32 +00:00
|
|
|
module EPaper
|
|
|
|
class Engine < ::Rails::Engine
|
2020-03-08 12:32:05 +00:00
|
|
|
initializer "e_paper" do
|
2024-02-28 11:19:32 +00:00
|
|
|
Rails.application.config.to_prepare do
|
|
|
|
env_pwd = ENV['PWD']
|
|
|
|
begin
|
|
|
|
require File.expand_path('app/models/sub_part.rb', env_pwd)
|
|
|
|
if defined? SubPart
|
|
|
|
SubPart.where(:module => 'e_paper',:widget_method.ne => 'widget').each do |sub_part|
|
|
|
|
sub_part.widget_method = 'widget'
|
|
|
|
sub_part.save
|
|
|
|
end
|
2020-03-08 12:32:05 +00:00
|
|
|
end
|
2024-02-28 11:19:32 +00:00
|
|
|
rescue => e
|
|
|
|
puts ["can't find subpart",e]
|
2020-03-08 12:32:05 +00:00
|
|
|
end
|
2024-02-28 11:19:32 +00:00
|
|
|
OrbitApp.registration "EPaper", :type => "ModuleApp" do
|
|
|
|
module_label "e_paper.e_paper"
|
|
|
|
base_url File.expand_path File.dirname(__FILE__)
|
|
|
|
#widget_methods ["criteria_list","category_wise_articles","latest_criteria", "latest_slider", "subscribe"]
|
|
|
|
widget_methods ["widget"]
|
|
|
|
widget_settings [{"data_count"=>30, "enable_custom_widget_data"=>true}]
|
|
|
|
taggable "EPaperCriteria"
|
|
|
|
categorizable
|
|
|
|
authorizable
|
|
|
|
frontend_enabled
|
|
|
|
data_count 1..30
|
2019-05-28 15:54:32 +00:00
|
|
|
|
2024-02-28 11:19:32 +00:00
|
|
|
side_bar do
|
|
|
|
head_label_i18n 'e_paper.e_paper', icon_class: "icons-book"
|
|
|
|
available_for "users"
|
|
|
|
active_for_controllers (['admin/e_papers', 'admin/e_paper_criterias'])
|
|
|
|
head_link_path "admin_e_papers_path"
|
2019-05-28 15:54:32 +00:00
|
|
|
|
2024-02-28 11:19:32 +00:00
|
|
|
context_link 'e_paper.all_articles',
|
|
|
|
:link_path=>"admin_e_papers_path" ,
|
|
|
|
:priority=>1,
|
|
|
|
:active_for_action=>{'admin/e_papers'=>'index'},
|
|
|
|
:available_for => 'users'
|
2024-11-15 10:20:00 +00:00
|
|
|
context_link 'new_',
|
2024-02-28 11:19:32 +00:00
|
|
|
:link_path=>"new_admin_e_paper_path" ,
|
|
|
|
:priority=>2,
|
|
|
|
:active_for_action=>{'admin/e_papers'=>'new'},
|
|
|
|
:available_for => 'sub_managers'
|
|
|
|
context_link 'categories',
|
|
|
|
:link_path=>"admin_module_app_categories_path" ,
|
|
|
|
:link_arg=>"{:module_app_id=>ModuleApp.find_by(:key=>'e_paper').id}",
|
|
|
|
:priority=>3,
|
|
|
|
:active_for_action=>{'admin/e_papers'=>'categories'},
|
|
|
|
:active_for_category => 'EPaper',
|
|
|
|
:available_for => 'managers'
|
|
|
|
context_link 'tags',
|
|
|
|
:link_path=>"admin_module_app_tags_path" ,
|
|
|
|
:link_arg=>"{:module_app_id=>ModuleApp.find_by(:key=>'e_paper').id}",
|
|
|
|
:priority=>4,
|
|
|
|
:active_for_action=>{'admin/e_papers'=>'tags'},
|
|
|
|
:active_for_tag => 'e_paper',
|
|
|
|
:available_for => 'managers'
|
|
|
|
context_link 'e_paper.paper_criteria',
|
|
|
|
:link_path=>"admin_e_paper_criterias_path" ,
|
|
|
|
:priority=>5,
|
|
|
|
:active_for_action=>{'admin/e_paper_criterias'=>'index'},
|
|
|
|
:available_for => 'managers'
|
|
|
|
context_link 'e_paper.subscribers',
|
|
|
|
:link_path=>"admin_e_paper_subscribers_path" ,
|
|
|
|
:priority=>6,
|
|
|
|
:active_for_action=>{'admin/e_paper_subscribers'=>'index'},
|
|
|
|
:available_for => 'managers'
|
|
|
|
context_link 'e_paper.batch_delete_subscribers',
|
|
|
|
:link_path=>"admin_e_paper_subscribers_batch_delete_subscribers_path" ,
|
|
|
|
:priority=>7,
|
|
|
|
:active_for_action=>{'admin/e_paper_subscribers'=>'batch_delete_subscribers'},
|
|
|
|
:available_for => 'managers'
|
|
|
|
context_link 'e_paper.instructions',
|
|
|
|
:link_path=>"instructions_admin_e_papers_path" ,
|
|
|
|
:priority=>8,
|
|
|
|
:active_for_action=>{'admin/e_paper'=>'instructions'},
|
|
|
|
:available_for => 'users'
|
2024-11-15 10:20:00 +00:00
|
|
|
context_link 'e_paper.banner_images',
|
|
|
|
:link_path=>"admin_e_paper_images_path" ,
|
|
|
|
:priority=>9,
|
|
|
|
:active_for_action=>{'admin/e_paper_images'=>'index'},
|
|
|
|
:available_for => 'managers'
|
2024-02-28 11:19:32 +00:00
|
|
|
end
|
2019-05-28 15:54:32 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|