diff --git a/app/controllers/admin/ad_banners_controller.rb b/app/controllers/admin/ad_banners_controller.rb
index cd436a12..f43c19e5 100644
--- a/app/controllers/admin/ad_banners_controller.rb
+++ b/app/controllers/admin/ad_banners_controller.rb
@@ -1,7 +1,7 @@
class Admin::AdBannersController < OrbitBackendController
layout "new_admin"
before_filter :authenticate_user!
- before_filter :for_app_manager,:except => [:index,:show]
+ before_filter :for_app_manager,:except => [:index,:show,:update,:realtime_preview]
before_filter :for_app_sub_manager
def rename
diff --git a/app/controllers/admin/ad_images_controller.rb b/app/controllers/admin/ad_images_controller.rb
index 945629ed..e3cef303 100644
--- a/app/controllers/admin/ad_images_controller.rb
+++ b/app/controllers/admin/ad_images_controller.rb
@@ -1,8 +1,8 @@
-class Admin::AdImagesController < ApplicationController
+class Admin::AdImagesController < OrbitBackendController
layout 'new_admin'
before_filter :authenticate_user!
- before_filter :is_admin?
-
+ before_filter :for_app_sub_manager
+
def edit
@ad_banner = AdBanner.find params[:ad_banner_id]
@ad_image = @ad_banner.ad_images.find params[:id]
diff --git a/app/controllers/admin/asset_categories_controller.rb b/app/controllers/admin/asset_categories_controller.rb
index 22efd03f..9ce6bb48 100644
--- a/app/controllers/admin/asset_categories_controller.rb
+++ b/app/controllers/admin/asset_categories_controller.rb
@@ -17,7 +17,6 @@ class Admin::AssetCategoriesController < OrbitBackendController
def edit
@asset_category = AssetCategory.find(params[:id])
- @i18n_variable = @asset_category.i18n_variable
@url = admin_asset_categories_path(@asset_category)
end
diff --git a/app/controllers/admin/dashboards_controller.rb b/app/controllers/admin/dashboards_controller.rb
index 50bbd1aa..991f19af 100644
--- a/app/controllers/admin/dashboards_controller.rb
+++ b/app/controllers/admin/dashboards_controller.rb
@@ -30,7 +30,7 @@ class Admin::DashboardsController < ApplicationController
module_app_class = module_app.classify.constantize
objects = module_app_class.order_by(:updated_at, :desc).limit(10)
objects.each do |object|
- a.merge!(object => object.updated_at)
+ a.merge!(object => object.updated_at) unless (object.archived rescue nil)
end
end
sorted_objects = a.sort {|a,b| b[1]<=>a[1]}
@@ -43,7 +43,7 @@ class Admin::DashboardsController < ApplicationController
module_app_class = module_app.classify.constantize
objects = module_app_class.order_by(:view_count, :desc).limit(10)
objects.each do |object|
- a.merge!(object => object.view_count) if object.view_count > 0
+ a.merge!(object => object.view_count) if object.view_count > 0 && (!object.archived rescue true)
end
end
sorted_objects = a.sort {|a,b| b[1]<=>a[1]}
diff --git a/app/controllers/admin/infos_controller.rb b/app/controllers/admin/infos_controller.rb
index bc86b662..21306c6e 100644
--- a/app/controllers/admin/infos_controller.rb
+++ b/app/controllers/admin/infos_controller.rb
@@ -21,7 +21,6 @@ class Admin::InfosController < ApplicationController
def edit
@attribute = Info.find(params[:id])
- @i18n_variable = @attribute.i18n_variable
render :template => 'admin/attributes/edit'
end
diff --git a/app/controllers/admin/roles_controller.rb b/app/controllers/admin/roles_controller.rb
index 65c86f36..d02224a5 100644
--- a/app/controllers/admin/roles_controller.rb
+++ b/app/controllers/admin/roles_controller.rb
@@ -21,7 +21,6 @@ class Admin::RolesController < ApplicationController
def edit
@attribute = Role.find(params[:id])
- @i18n_variable = @attribute.i18n_variable
render :template => 'admin/attributes/edit'
end
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index fc93c29a..8f651392 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -181,7 +181,7 @@ module ApplicationHelper
end
def display_visitors(options={})
- Impression.where(options).distinct(:session_hash).count
+ Impression.where(options).and(:referrer.ne => nil).distinct(:session_hash).count
end
def display_visitors_today
diff --git a/app/views/admin/ad_banners/_ad_banner_tab.html.erb b/app/views/admin/ad_banners/_ad_banner_tab.html.erb
index ca98e42e..d65a17e0 100644
--- a/app/views/admin/ad_banners/_ad_banner_tab.html.erb
+++ b/app/views/admin/ad_banners/_ad_banner_tab.html.erb
@@ -7,6 +7,10 @@
<%= f.select :ad_fx ,AdBanner::FX_TYPES %>
<%= f.label :transition_sec, t('admin.ad.transition_sec') %>
<%= f.text_field :transition_sec,:placeholder=>t('admin.ad.sec_place_holder'),:class=> "span3" %> <%= t("admin.ad.trans_unit_sec") %>
+ <%if at_least_module_manager%>
+ <%= f.label :best_size, t('admin.ad.best_size') %>
+ <%= f.text_field :best_size %> Ex: 500px x 300px
+ <% end -%>
<%= f.submit t("admin.ad.update_banner"), :class => 'btn' %>
<%= f.submit t("cancel"),:type=>'reset', :class => 'btn' %>
diff --git a/app/views/admin/ad_banners/_modal_ad_banner_form.html.erb b/app/views/admin/ad_banners/_modal_ad_banner_form.html.erb
index cbc4de8e..68e0a9c6 100644
--- a/app/views/admin/ad_banners/_modal_ad_banner_form.html.erb
+++ b/app/views/admin/ad_banners/_modal_ad_banner_form.html.erb
@@ -21,6 +21,13 @@
<%= f.text_field :transition_sec %> <%= t("admin.ad.trans_unit_sec") %>
+
+
+ <%= f.label :best_size, t('admin.ad.best_size'),:class => "control-label" %>
+
+ <%= f.text_field :best_size %> Ex: 500px x 300px
+
+
<%= f.label :ad_fx, t('admin.ad.ab_fx') %>
diff --git a/app/views/admin/ad_banners/index.html.erb b/app/views/admin/ad_banners/index.html.erb
index b4be090f..92c78f5b 100644
--- a/app/views/admin/ad_banners/index.html.erb
+++ b/app/views/admin/ad_banners/index.html.erb
@@ -13,11 +13,16 @@
<% @ad_banners.each do |ab| %>
<%= content_tag :li ,:class => (ab == @active ? 'active' : nil) do %>
-
- <%= link_to(ab.title,"##{ab.title.dehumanize}",:contenteditable=>"false",:data=>{:toggle=>"tab" ,'edit-url' =>(admin_rename_ad_banner_path ab) } )%>
+ <%if at_least_module_manager%>
+
+ <%= link_to(ab.title,"##{ab.title.dehumanize}",:contenteditable=>"false",:data=>{:toggle=>"tab" ,'edit-url' =>(admin_rename_ad_banner_path ab) } )%>
+ <% else %>
+ <%= link_to(ab.title,"##{ab.title.dehumanize}",:data=>{:toggle=>"tab" } )%>
+ <% end -%>
<% end -%>
<% end -%>
- <%= content_tag :li,link_to(t("admin.ad.new_banner"),"#new-a-banner",:data=>{:toggle=>"modal"}),:id=>'new_ad_banner_tab_but',:class => (@active.nil? ? 'active' : nil ) %>
+
+ <%= content_tag :li,link_to(t("admin.ad.new_banner"),"#new-a-banner",:data=>{:toggle=>"modal"}),:id=>'new_ad_banner_tab_but',:class => (@active.nil? ? 'active' : nil ) if at_least_module_manager%>
diff --git a/app/views/admin/ad_images/_form.html.erb b/app/views/admin/ad_images/_form.html.erb
index 1513fa05..edbb2563 100644
--- a/app/views/admin/ad_images/_form.html.erb
+++ b/app/views/admin/ad_images/_form.html.erb
@@ -80,7 +80,10 @@
<%= image_tag @ad_image.file rescue ''%>
- <%= t("admin.ad.widget_info_for_ad_image_size",:best_size=> @ad_image.ad_banner.best_size) if !@ad_image.ad_banner.best_size.empty?%>
+ <% if !@ad_image.ad_banner.best_size.empty?%>
+ <%= t("admin.ad.widget_info_for_ad_image_size",:best_size=> @ad_image.ad_banner.best_size) %>
+
+ <% end -%>
- <%= bulletin.bulletin_category.i18n_variable[I18n.locale] %> |
+ <%= bulletin.bulletin_category.i18n_variable[I18n.locale] rescue nil %> |
<%= link_to bulletin.title[I18n.locale], panel_announcement_front_end_bulletin_path(bulletin, :category_id => bulletin.bulletin_category.id) rescue ''%>
diff --git a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/show.html.erb b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/show.html.erb
index 158e07d0..68634b9a 100644
--- a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/show.html.erb
+++ b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/show.html.erb
@@ -1,7 +1,7 @@
-
<%= t('announcement.category') %>
- <%= @bulletin.bulletin_category.i18n_variable[I18n.locale] %>
+ <%= @bulletin.bulletin_category.i18n_variable[I18n.locale] rescue nil %>
-
<%= t('announcement.postdate') %>
diff --git a/vendor/built_in_modules/announcement/app/views/panel/announcement/front_end/bulletins/index.html.erb b/vendor/built_in_modules/announcement/app/views/panel/announcement/front_end/bulletins/index.html.erb
index 16ac7d8b..6937a6c3 100644
--- a/vendor/built_in_modules/announcement/app/views/panel/announcement/front_end/bulletins/index.html.erb
+++ b/vendor/built_in_modules/announcement/app/views/panel/announcement/front_end/bulletins/index.html.erb
@@ -18,7 +18,7 @@
<% @bulletins.each do |post| %>
- <%= post.bulletin_category.i18n_variable[I18n.locale] %> |
+ <%= post.bulletin_category.i18n_variable[I18n.locale] rescue nil %> |
<%= link_to post.title[I18n.locale], panel_announcement_front_end_bulletin_path(post, :category_id => post.bulletin_category_id) %>
<%#= link_to post.title, panel_announcement_back_end_bulletin_path(post) %>
|
diff --git a/vendor/built_in_modules/announcement/app/views/panel/announcement/widget/bulletins/_index.html.erb b/vendor/built_in_modules/announcement/app/views/panel/announcement/widget/bulletins/_index.html.erb
index c0fe606f..daadc367 100644
--- a/vendor/built_in_modules/announcement/app/views/panel/announcement/widget/bulletins/_index.html.erb
+++ b/vendor/built_in_modules/announcement/app/views/panel/announcement/widget/bulletins/_index.html.erb
@@ -12,7 +12,7 @@
<% @bulletins.each do |post| %>
- <%= post.bulletin_category.i18n_variable[I18n.locale] %> |
+ <%= post.bulletin_category.i18n_variable[I18n.locale] rescue nil %> |
<%= link_to post.title[I18n.locale], panel_announcement_front_end_bulletin_path(post, :category_id => post.bulletin_category_id) %>
|
<%= post.postdate %> |
diff --git a/vendor/built_in_modules/news/app/controllers/panel/news/back_end/news_bulletin_categorys_controller.rb b/vendor/built_in_modules/news/app/controllers/panel/news/back_end/news_bulletin_categorys_controller.rb
index 956e98dc..e3ac7476 100644
--- a/vendor/built_in_modules/news/app/controllers/panel/news/back_end/news_bulletin_categorys_controller.rb
+++ b/vendor/built_in_modules/news/app/controllers/panel/news/back_end/news_bulletin_categorys_controller.rb
@@ -56,7 +56,6 @@ class Panel::News::BackEnd::NewsBulletinCategorysController < OrbitBackendContro
# GET /news_bulletins/1/edit
def edit
@news_bulletin_category = NewsBulletinCategory.find(params[:id])
- @i18n_variable = @news_bulletin_category.i18n_variable
@url = panel_news_back_end_news_bulletin_category_path(@news_bulletin_category)
diff --git a/vendor/built_in_modules/news/app/controllers/panel/news/back_end/news_bulletins_controller.rb b/vendor/built_in_modules/news/app/controllers/panel/news/back_end/news_bulletins_controller.rb
index e845cbd1..706e7663 100644
--- a/vendor/built_in_modules/news/app/controllers/panel/news/back_end/news_bulletins_controller.rb
+++ b/vendor/built_in_modules/news/app/controllers/panel/news/back_end/news_bulletins_controller.rb
@@ -43,7 +43,7 @@ class Panel::News::BackEnd::NewsBulletinsController < OrbitBackendController
@link_url = panel_news_back_end_news_bulletins_path
@news_bulletins.delete_if{ |news_bulletin|
- news_bulletin.is_pending == true && (!news_bulletin.bulletin_category.authed_users('fact_check').include?(current_user) || news_bulletin.create_user_id!=current_user.id)
+ news_bulletin.is_pending == true && ((!news_bulletin.bulletin_category.authed_users('fact_check').include?(current_user) rescue nil) || news_bulletin.create_user_id!=current_user.id)
}
@news_bulletin_file = NewsBulletinFile.new
diff --git a/vendor/built_in_modules/news/app/views/panel/news/back_end/news_bulletins/_news_bulletin.html.erb b/vendor/built_in_modules/news/app/views/panel/news/back_end/news_bulletins/_news_bulletin.html.erb
index 4274ecab..78a710cd 100644
--- a/vendor/built_in_modules/news/app/views/panel/news/back_end/news_bulletins/_news_bulletin.html.erb
+++ b/vendor/built_in_modules/news/app/views/panel/news/back_end/news_bulletins/_news_bulletin.html.erb
@@ -28,7 +28,7 @@
- <%= news_bulletin.news_bulletin_category.i18n_variable[I18n.locale] %> |
+ <%= news_bulletin.news_bulletin_category.i18n_variable[I18n.locale] rescue nil %> |
<%= link_to news_bulletin.title[I18n.locale], panel_news_front_end_news_bulletin_path(news_bulletin, :category_id => news_bulletin.news_bulletin_category.id) rescue ''%>
diff --git a/vendor/built_in_modules/news/app/views/panel/news/back_end/news_bulletins/show.html.erb b/vendor/built_in_modules/news/app/views/panel/news/back_end/news_bulletins/show.html.erb
index 343d3a94..1868c8fb 100644
--- a/vendor/built_in_modules/news/app/views/panel/news/back_end/news_bulletins/show.html.erb
+++ b/vendor/built_in_modules/news/app/views/panel/news/back_end/news_bulletins/show.html.erb
@@ -1,7 +1,7 @@
-
<%= t('news.category') %>
- <%= @news_bulletin.news_bulletin_category.i18n_variable[I18n.locale] %>
+ <%= @news_bulletin.news_bulletin_category.i18n_variable[I18n.locale] rescue nil %>
-
<%= t('news.postdate') %>
diff --git a/vendor/built_in_modules/web_resource/app/controllers/panel/web_resource/back_end/web_link_categorys_controller.rb b/vendor/built_in_modules/web_resource/app/controllers/panel/web_resource/back_end/web_link_categorys_controller.rb
index 8c961cba..a7d270a5 100644
--- a/vendor/built_in_modules/web_resource/app/controllers/panel/web_resource/back_end/web_link_categorys_controller.rb
+++ b/vendor/built_in_modules/web_resource/app/controllers/panel/web_resource/back_end/web_link_categorys_controller.rb
@@ -38,7 +38,6 @@ class Panel::WebResource::BackEnd::WebLinkCategorysController < OrbitBackendCont
# GET /web_links/1/edit
def edit
@web_link_category = WebLinkCategory.find(params[:id])
- @i18n_variable = @web_link_category.i18n_variable
@url = panel_web_resource_back_end_web_link_category_path(@web_link_category)
diff --git a/vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_links/_web_link.html.erb b/vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_links/_web_link.html.erb
index f7d70250..7efa3b72 100644
--- a/vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_links/_web_link.html.erb
+++ b/vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_links/_web_link.html.erb
@@ -19,7 +19,7 @@
|
- <%= web_link.web_link_category.i18n_variable[I18n.locale] %> |
+ <%= web_link.web_link_category.i18n_variable[I18n.locale] rescue nil %> |
<%= link_to web_link.name[I18n.locale], panel_web_resource_back_end_web_link_path(web_link) %>
diff --git a/vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_links/show.html.erb b/vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_links/show.html.erb
index f02d9156..e3734616 100644
--- a/vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_links/show.html.erb
+++ b/vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_links/show.html.erb
@@ -9,7 +9,7 @@
-
<%= t('announcement.category') %>
- <%= @bulletin.bulletin_category.i18n_variable[I18n.locale] %>
+ <%= @bulletin.bulletin_category.i18n_variable[I18n.locale] rescue nil %>
-
<%= t('announcement.postdate') %>
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 2c32f800..0d1626a5 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
@@ -15,7 +15,7 @@
<% @web_links.each do |post| %>
- <%= post.web_link_category.i18n_variable[I18n.locale] %> |
+ <%= post.web_link_category.i18n_variable[I18n.locale] rescue nil %> |
<%#= link_to post.name[I18n.locale], panel_web_resource_front_end_web_link_path(post) %>
<%= link_to post.name[I18n.locale], post.url, {:target => '_blank', :title => post.name[I18n.locale]} %>
diff --git a/vendor/built_in_modules/web_resource/app/views/panel/web_resource/front_end/web_links/show.html.erb b/vendor/built_in_modules/web_resource/app/views/panel/web_resource/front_end/web_links/show.html.erb
index 755766fe..a3381e5c 100644
--- a/vendor/built_in_modules/web_resource/app/views/panel/web_resource/front_end/web_links/show.html.erb
+++ b/vendor/built_in_modules/web_resource/app/views/panel/web_resource/front_end/web_links/show.html.erb
@@ -9,7 +9,7 @@
-
<%= t('announcement.category') %>
- <%= @bulletin.bulletin_category.i18n_variable[I18n.locale] %>
+ <%= @bulletin.bulletin_category.i18n_variable[I18n.locale] rescue nil %>
-
<%= t('announcement.postdate') %>
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 8eebc6ac..40d70aaa 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
@@ -14,7 +14,7 @@
|
<% @web_links.each do |post| %>
- <%= post.web_link_category.i18n_variable[I18n.locale] %> |
+ <%= post.web_link_category.i18n_variable[I18n.locale] rescue nil %> |
<%= link_to post.name[I18n.locale], post.url, {:target => '_blank', :title => post.name[I18n.locale]} %>
|
diff --git a/vendor/impressionist/lib/impressionist/models/mongoid/impression.rb b/vendor/impressionist/lib/impressionist/models/mongoid/impression.rb
index 5edc2edd..9a2d958c 100644
--- a/vendor/impressionist/lib/impressionist/models/mongoid/impression.rb
+++ b/vendor/impressionist/lib/impressionist/models/mongoid/impression.rb
@@ -27,11 +27,13 @@ class Impression
private
def update_impressions_counter_cache
- impressionable_class = self.impressionable_type.constantize
+ if self.referrer
+ impressionable_class = self.impressionable_type.constantize
- if impressionable_class.impressionist_counter_cache_options
- resouce = impressionable_class.find(self.impressionable_id)
- resouce.try(:update_impressionist_counter_cache)
+ if impressionable_class.impressionist_counter_cache_options
+ resouce = impressionable_class.find(self.impressionable_id)
+ resouce.try(:update_impressionist_counter_cache)
+ end
end
end
end
| |