diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 18c180a90..0588ae5a2 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -5,7 +5,7 @@ class ApplicationController < ActionController::Base layout :layout_by_resource - helper :all + helper :admin before_filter :set_locale, :set_site def set_current_user diff --git a/app/helpers/admin/ad_banner_helper.rb b/app/helpers/admin/ad_banners_helper.rb similarity index 96% rename from app/helpers/admin/ad_banner_helper.rb rename to app/helpers/admin/ad_banners_helper.rb index ecba9b3b4..9c068621f 100644 --- a/app/helpers/admin/ad_banner_helper.rb +++ b/app/helpers/admin/ad_banners_helper.rb @@ -1,4 +1,4 @@ -module Admin::AdBannerHelper +module Admin::AdBannersHelper def preview_block_ad_images_helper(ad_banner) printable_ad_images = [] ad_banner.ad_images.each do |ad_image| diff --git a/app/helpers/admin/ad_images_helper.rb b/app/helpers/admin/ad_images_helper.rb deleted file mode 100644 index b09bd2633..000000000 --- a/app/helpers/admin/ad_images_helper.rb +++ /dev/null @@ -1,3 +0,0 @@ -module Admin::AdImagesHelper - -end diff --git a/app/helpers/admin/app_auth_helper.rb b/app/helpers/admin/app_auths_helper.rb similarity index 95% rename from app/helpers/admin/app_auth_helper.rb rename to app/helpers/admin/app_auths_helper.rb index 1a022e948..c679f338f 100644 --- a/app/helpers/admin/app_auth_helper.rb +++ b/app/helpers/admin/app_auths_helper.rb @@ -1,4 +1,4 @@ -module Admin::AppAuthHelper +module Admin::AppAuthsHelper def on_off_switch(attribute,attribute_type) link_to t(:enable), eval("admin_#{attribute_type}_path(attribute, :authenticity_token => form_authenticity_token, :#{attribute_type} => {:disabled => true})"), :remote => true, :method => :put, :id => "disable_#{attribute.id}", :style => "display:#{attribute.is_disabled? ? 'none' : ''}", :class => 'switch' link_to t(:disable), eval("admin_#{attribute_type}_path(attribute, :authenticity_token => form_authenticity_token, :#{attribute_type} => {:disabled => false})"), :remote => true, :method => :put, :id => "enable_#{attribute.id}", :style => "display:#{attribute.is_disabled? ? '' : 'none'}", :class => 'switch' diff --git a/app/helpers/admin/asset_helper.rb b/app/helpers/admin/assets_helper.rb similarity index 86% rename from app/helpers/admin/asset_helper.rb rename to app/helpers/admin/assets_helper.rb index 7ed6fa158..f6187d522 100644 --- a/app/helpers/admin/asset_helper.rb +++ b/app/helpers/admin/assets_helper.rb @@ -1,4 +1,4 @@ -module Admin::AssetHelper +module Admin::AssetsHelper def show_all_fields(asset, field) a = [] diff --git a/app/helpers/admin/dashboard_helper.rb b/app/helpers/admin/dashboards_helper.rb similarity index 95% rename from app/helpers/admin/dashboard_helper.rb rename to app/helpers/admin/dashboards_helper.rb index bbfde4483..8ee0e36e4 100644 --- a/app/helpers/admin/dashboard_helper.rb +++ b/app/helpers/admin/dashboards_helper.rb @@ -1,4 +1,4 @@ -module Admin::DashboardHelper +module Admin::DashboardsHelper def get_link(title) case title diff --git a/app/helpers/admin/item_helper.rb b/app/helpers/admin/items_helper.rb similarity index 98% rename from app/helpers/admin/item_helper.rb rename to app/helpers/admin/items_helper.rb index f5b8589a3..3ac6aed69 100644 --- a/app/helpers/admin/item_helper.rb +++ b/app/helpers/admin/items_helper.rb @@ -1,4 +1,4 @@ -module Admin::ItemHelper +module Admin::ItemsHelper def render_node_and_children(node) ret = '' diff --git a/app/helpers/admin/module_app_helper.rb b/app/helpers/admin/module_apps_helper.rb similarity index 94% rename from app/helpers/admin/module_app_helper.rb rename to app/helpers/admin/module_apps_helper.rb index 3ac82364f..1bf78ab58 100644 --- a/app/helpers/admin/module_app_helper.rb +++ b/app/helpers/admin/module_apps_helper.rb @@ -1,4 +1,4 @@ -module Admin::ModuleAppHelper +module Admin::ModuleAppsHelper def if_permit_to_delete(item) case item.downcase diff --git a/app/helpers/admin/page_content_helper.rb b/app/helpers/admin/page_content_helper.rb deleted file mode 100644 index 9f2b22e0a..000000000 --- a/app/helpers/admin/page_content_helper.rb +++ /dev/null @@ -1,18 +0,0 @@ -module Admin::PageContentHelper -include ActionView::Helpers::UrlHelper - - - def show_page_context_edit_auth_link(page_context) - type = 'Edit' -# debugger -# a=1 - oa = page_context.get_object_auth_by_title(type) - if oa.nil? - page_context.object_auths.new(title: type ).save rescue - oa = page_context.get_object_auth_by_title(type) - end -# link_to t('announcement.bulletin.cate_auth'), edit_admin_object_auth_path(oa) - link_to t('admin.page_context.ob_auth.edit'),admin_object_auth_ob_auth_path(oa) - end - -end \ No newline at end of file diff --git a/app/helpers/admin/plugin_helper.rb b/app/helpers/admin/plugins_helper.rb similarity index 96% rename from app/helpers/admin/plugin_helper.rb rename to app/helpers/admin/plugins_helper.rb index 3afa9d1ff..7d0bc5c36 100644 --- a/app/helpers/admin/plugin_helper.rb +++ b/app/helpers/admin/plugins_helper.rb @@ -1,4 +1,4 @@ -module Admin::PluginHelper +module Admin::PluginsHelper def render_plugin_list ret = '' diff --git a/app/helpers/admin/user_helper.rb b/app/helpers/admin/users_helper.rb similarity index 93% rename from app/helpers/admin/user_helper.rb rename to app/helpers/admin/users_helper.rb index 22da150ea..c6b72b530 100644 --- a/app/helpers/admin/user_helper.rb +++ b/app/helpers/admin/users_helper.rb @@ -1,4 +1,4 @@ -module Admin::UserHelper +module Admin::UsersHelper def show_attribute(object, field_id, locale = '') attribute = object.attribute_values.detect {|av| av.attribute_field_id.eql?(field_id) || av[locale.to_s].eql?(locale.to_s) } rescue nil diff --git a/app/helpers/admin/web_link_helper.rb b/app/helpers/admin/web_link_helper.rb deleted file mode 100644 index 0498f31b0..000000000 --- a/app/helpers/admin/web_link_helper.rb +++ /dev/null @@ -1,11 +0,0 @@ -module Admin::WebLinkHelper - def show_web_link_permission_link(web_link) - type = 'edit' - oa = web_link.get_object_auth_by_title(type) - if oa.nil? - web_link.object_auths.new(title: type ).save - oa = web_link.get_object_auth_by_title(type) - end - link_to t('web_resource.cate_auth'),admin_object_auth_ob_auth_path(oa) - end -end \ No newline at end of file diff --git a/app/helpers/attribute_field_helper.rb b/app/helpers/attribute_fields_helper.rb similarity index 99% rename from app/helpers/attribute_field_helper.rb rename to app/helpers/attribute_fields_helper.rb index 9d0999da4..dfc30ddd7 100644 --- a/app/helpers/attribute_field_helper.rb +++ b/app/helpers/attribute_fields_helper.rb @@ -1,6 +1,6 @@ # require ActionView::Helpers::FormTagHelper -module AttributeFieldHelper +module AttributeFieldsHelper include ActionView::Helpers::FormTagHelper include ActionView::Helpers::FormOptionsHelper include ActionView::Helpers::DateHelper diff --git a/app/helpers/calendar_helper.rb b/app/helpers/calendar_helper.rb deleted file mode 100644 index 880acc333..000000000 --- a/app/helpers/calendar_helper.rb +++ /dev/null @@ -1,24 +0,0 @@ -module CalendarHelper - def month_link(month_date) - link_to(I18n.localize(month_date, :format => "%B"), {:month => month_date.month, :year => month_date.year}) - end - - # custom options for this calendar - def event_calendar_opts - { - :year => @year, - :month => @month, - :event_strips => @event_strips, - :month_name_text => I18n.localize(@shown_month, :format => "%B %Y"), - :previous_month_text => "<< " + month_link(@shown_month.prev_month), - :next_month_text => month_link(@shown_month.next_month) + " >>" } - end - - def event_calendar - # args is an argument hash containing :event, :day, and :options - calendar event_calendar_opts do |args| - event = args[:event] - %(#{h(event.name)}) - end - end -end diff --git a/app/helpers/design_helper.rb b/app/helpers/design_helper.rb deleted file mode 100644 index c55eb2a09..000000000 --- a/app/helpers/design_helper.rb +++ /dev/null @@ -1,4 +0,0 @@ -module DesignHelper - - -end diff --git a/app/helpers/sites_helper.rb b/app/helpers/sites_helper.rb deleted file mode 100644 index 621069dbc..000000000 --- a/app/helpers/sites_helper.rb +++ /dev/null @@ -1,2 +0,0 @@ -module SitesHelper -end diff --git a/config/application.rb b/config/application.rb index 9faef5d4a..d6d9b6b41 100644 --- a/config/application.rb +++ b/config/application.rb @@ -34,6 +34,9 @@ module Orbit config.autoload_paths += %W(#{config.root}/app/models/purchase) config.autoload_paths += %W(#{config.root}/app/models/user) + # Include all helpers + # 'helper :all' must be removed in ApplicationController + config.action_controller.include_all_helpers = false # Only load the plugins named here, in the order given (default is alphabetical). # :all can be used as a placeholder for all plugins not explicitly named.