Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'master' into test-tags-fix

  • Loading branch information...
commit 52483d7cbed597f24ffb2c8d050cd7e28c9a7350 2 parents 6ad8575 + d913036
adahmash adahmash authored
Showing with 272 additions and 100 deletions.
  1. BIN  app/assets/images/template_previews/Double-One-Large-Two-Small.png
  2. BIN  app/assets/images/template_previews/Double-Two-Medium.png
  3. BIN  app/assets/images/template_previews/Single-Two-Small.png
  4. BIN  app/assets/images/template_previews/Triple-1-Large-4-Small.png
  5. BIN  app/assets/images/template_previews/Triple-Four-Small.png
  6. BIN  app/assets/images/template_previews/Triple-Three-Medium.png
  7. BIN  app/assets/images/template_previews/Triple-Two-Large.png
  8. BIN  app/assets/images/template_previews/single-col-ad-300x250.png
  9. BIN  app/assets/images/template_previews/single-col-custom-weather.png
  10. BIN  app/assets/images/template_previews/single-col-facebook-recommendations.png
  11. BIN  app/assets/images/template_previews/single-col-newest-items-with-pics.png
  12. BIN  app/assets/images/template_previews/single-col-twitter-standard.png
  13. BIN  app/assets/images/template_previews/single-col-universal-top-items-list.png
  14. BIN  app/assets/images/template_previews/single-col-user-images.png
  15. BIN  app/assets/images/template_previews/single-col-welcome-panel.png
  16. +17 −0 app/assets/stylesheets/admin.sass
  17. +24 −0 app/controllers/admin/branding_controller.rb
  18. +0 −1  app/controllers/admin/view_objects_controller.rb
  19. +1 −1  app/controllers/admin/widgets_controller.rb
  20. +5 −1 app/controllers/admin_controller.rb
  21. +17 −0 app/controllers/branding_controller.rb
  22. +5 −1 app/helpers/layout_helper.rb
  23. +13 −0 app/models/branding.rb
  24. +3 −0  app/models/metadata/custom_widget.rb
  25. +2 −0  app/models/view_object.rb
  26. +20 −0 app/views/admin/branding/show.html.haml
  27. +1 −0  app/views/admin/view_objects/edit.html.haml
  28. +15 −4 app/views/admin/view_objects/new.html.haml
  29. +3 −1 app/views/admin/view_objects/show.html.haml
  30. +1 −0  app/views/layouts/new_admin.html.haml
  31. +7 −0 app/views/shared/_header.html.haml
  32. +3 −1 config/routes/admin.rb
  33. +4 −1 config/routes/main.rb
  34. +11 −0 db/migrate/20120406052102_add_branding.rb
  35. +17 −0 db/migrate/20120408023719_change_view_object_template_names.rb
  36. +20 −0 db/migrate/20120409185035_remove_old_vo_templates.rb
  37. +6 −0 db/migrate/20120409195722_add_is_blockable_to_view_objects.rb
  38. +6 −0 db/migrate/20120409203626_add_is_blockable_to_metadatas.rb
  39. +41 −0 db/migrate/20120411203207_add_preview_to_view_object_templates.rb
  40. +28 −87 db/seeds.rb
  41. +2 −2 lib/view_tree.rb
BIN  app/assets/images/template_previews/Double-One-Large-Two-Small.png
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  app/assets/images/template_previews/Double-Two-Medium.png
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  app/assets/images/template_previews/Single-Two-Small.png
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  app/assets/images/template_previews/Triple-1-Large-4-Small.png
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  app/assets/images/template_previews/Triple-Four-Small.png
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  app/assets/images/template_previews/Triple-Three-Medium.png
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  app/assets/images/template_previews/Triple-Two-Large.png
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  app/assets/images/template_previews/single-col-ad-300x250.png
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  app/assets/images/template_previews/single-col-custom-weather.png
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  app/assets/images/template_previews/single-col-facebook-recommendations.png
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  app/assets/images/template_previews/single-col-newest-items-with-pics.png
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  app/assets/images/template_previews/single-col-twitter-standard.png
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  app/assets/images/template_previews/single-col-universal-top-items-list.png
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  app/assets/images/template_previews/single-col-user-images.png
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  app/assets/images/template_previews/single-col-welcome-panel.png
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 app/assets/stylesheets/admin.sass
View
@@ -252,3 +252,20 @@ ul.forums
display: inline-block
width: 100%
height: 100%
+
+.template-selection
+ height: 100px
+
+.template-select-column
+ width: 425px
+ margin-left: -20px
+ float: left
+ padding: 10px 10px 10px 0px
+
+.template-preview-column
+ width: 400px
+ float: right
+ margin-right: 25px
+ padding: 10px
+ img
+ max-width: 400px
24 app/controllers/admin/branding_controller.rb
View
@@ -0,0 +1,24 @@
+class Admin::BrandingController < AdminController
+ before_filter :set_current_tab
+
+ def create
+ if params[:logo]
+ Branding.main.update_attribute(:logo, params[:logo].read)
+ end
+ if params[:favicon]
+ Branding.main.update_attribute(:favicon, params[:favicon].read)
+ end
+ flash[:notice] = "Updated!"
+ redirect_to :action => 'show'
+ end
+
+ def show
+ end
+
+ private
+
+ def set_current_tab
+ @current_tab = 'settings'
+ end
+
+end
1  app/controllers/admin/view_objects_controller.rb
View
@@ -3,7 +3,6 @@ class Admin::ViewObjectsController < AdminController
admin_scaffold :view_object do |config|
config.index_fields = [:name, :view_object_template_id]
- #config.show_fields = [:name, :view_object_template_id]
config.actions = [:index]
config.associations = { :belongs_to => { :view_object_template => :view_object_template_id } }
config.order_by = "name asc"
2  app/controllers/admin/widgets_controller.rb
View
@@ -47,7 +47,7 @@ def newer_widgets
]
@page = ViewObject.find_by_name("home--index")
@view_objects = ViewObject.find(:all, :conditions => ["view_object_template_id is not null"])
- @editable_view_objects = ["v2_double_col_feature_triple_item", "v2_double_col_triple_item", "v2_triple_col_large_2"].map {|name| ViewObjectTemplate.find_by_name(name) }.map(&:view_objects).flatten.select {|vo| vo.setting.kommands.empty? }
+ #@editable_view_objects = ["v2_double_col_feature_triple_item", "v2_double_col_triple_item", "v2_triple_col_large_2"].map {|name| ViewObjectTemplate.find_by_name(name) }.map(&:view_objects).flatten.select {|vo| vo.setting.kommands.empty? }
@main = Widget.main
@sidebar = Widget.sidebar
if @page.present? and @page.edge_children.present?
6 app/controllers/admin_controller.rb
View
@@ -160,7 +160,11 @@ def find_moderatable_item
if name =~ /(.+)_id$/
# switch story requests to use the content model
klass = $1 == 'story' ? 'content' : $1
- return klass.classify.constantize.find(value)
+ if klass.classify == "CustomWidget"
+ return Metadata::CustomWidget.find(value)
+ else
+ return klass.classify.constantize.find(value)
+ end
end
end
nil
17 app/controllers/branding_controller.rb
View
@@ -0,0 +1,17 @@
+class BrandingController < ActionController::Base
+ def logo
+ send_file(Branding.logo)
+ end
+
+ def favicon
+ send_file(Branding.favicon)
+ end
+
+ private
+
+ def send_file data
+ if data.present?
+ send_data(data, :disposition => 'inline', :content_type => 'image/png')
+ end
+ end
+end
6 app/helpers/layout_helper.rb
View
@@ -40,7 +40,11 @@ def icon_fan_app_location
end
def icon_fan_app_url
- base_url(path_to_image(icon_fan_app_location))
+ if Branding.favicon
+ favicon_branding_url
+ else
+ base_url(path_to_image(icon_fan_app_location))
+ end
end
def item_page_title item
13 app/models/branding.rb
View
@@ -0,0 +1,13 @@
+class Branding < ActiveRecord::Base
+ def self.logo
+ main.logo
+ end
+
+ def self.favicon
+ main.favicon
+ end
+
+ def self.main
+ Branding.first || Branding.create!
+ end
+end
3  app/models/metadata/custom_widget.rb
View
@@ -1,4 +1,7 @@
class Metadata::CustomWidget < Metadata
+
+ acts_as_moderatable
+
metadata_keys :title, :custom_data, :content_type
scope :key_sub_type_name, lambda { |*args| { :conditions => ["key_sub_type = ? AND key_name = ?", args.first, args.second] } }
2  app/models/view_object.rb
View
@@ -1,5 +1,7 @@
class ViewObject < ActiveRecord::Base
+ acts_as_moderatable
+
belongs_to :view_object_template
belongs_to :parent, :class_name => "ViewObject", :foreign_key => :parent_id
has_one :setting, :class_name => "Metadata", :as => :metadatable
20 app/views/admin/branding/show.html.haml
View
@@ -0,0 +1,20 @@
+%h1 Site Branding
+
+= form_tag '', :multipart => true do
+
+ %p
+ = file_field_tag :logo
+ - if Branding.logo
+ = image_tag logo_branding_url
+ - else
+ No logo uploaded yet.
+
+ %p
+ = file_field_tag :favicon
+ - if Branding.favicon
+ = image_tag favicon_branding_url
+ - else
+ No favicon uploaded yet.
+
+
+ = submit_tag "Update Site Branding"
1  app/views/admin/view_objects/edit.html.haml
View
@@ -100,6 +100,7 @@
= label_tag 'view_object_setting[cache_disabled]', 'Disable Caching', :class => "label" do
= check_box_tag 'view_object_setting[cache_disabled]', 1, @view_object_setting.cache_disabled
Disable Caching
+ %li= link_to(@view_object.blocked? ? 'UnBlock' : 'Block', admin_block_path(@view_object.class.name.foreign_key.to_sym => @view_object))
= field_set_tag nil, :class => 'buttons' do
%ol
19 app/views/admin/view_objects/new.html.haml
View
@@ -41,6 +41,9 @@
var templateID = $(this).val();
var rangeOptions = optionsFromRange(rangeForTemplate(templateID));
$('#view_object_setting_kommand_limit').html(rangeOptions.join(''));
+ $('.preview').fadeOut();
+ var template_id = $('option:selected', this).val();
+ $('#preview-' + template_id).fadeIn();
});
$('#view_object_setting_klass_name').change(function(event) {
@@ -82,9 +85,18 @@
%li.input.string
= label_tag 'view_object_setting[locale_subtitle]', 'Locale Subtitle*', :class => "label"
= text_field_tag 'view_object_setting[locale_subtitle]', @view_object_setting.locale_subtitle
- %li.input.string
- = label_tag 'view_object[view_object_template_id]', 'Template*', :class => "label"
- = select_tag 'view_object[view_object_template_id]', options_for_select(select_view_object_template_options, @view_object.view_object_template_id)
+ %div.template-selection
+ %div.template-select-column
+ %li.input.string
+ = label_tag 'view_object[view_object_template_id]', 'Template*', :class => "label"
+ = select_tag 'view_object[view_object_template_id]', options_for_select(select_view_object_template_options, @view_object.view_object_template_id)
+ %div.template-preview-column
+ %h5 Template Preview
+ - ViewObjectTemplate.all.each do |t|
+ - if t.id == @view_object.view_object_template_id
+ .preview{:id => "preview-#{t.id}", :style => "display:block;"}= image_tag t.preview unless t.preview.nil?
+ - else
+ .preview{:id => "preview-#{t.id}", :style => "display:nil;"}= image_tag t.preview unless t.preview.nil?
%li.input.string
= label_tag 'view_object_setting[klass_name]', 'Model Resource*', :class => "label"
= select_tag 'view_object_setting[klass_name]', options_for_select(select_view_object_class_options, @view_object_setting.klass_name)
@@ -106,7 +118,6 @@
= label_tag 'view_object_setting[cache_disabled]', 'Disable Caching', :class => "label" do
= check_box_tag 'view_object_setting[cache_disabled]', 1, @view_object_setting.cache_disabled
Disable Caching
-
= field_set_tag nil, :class => 'buttons' do
%ol
%li
4 app/views/admin/view_objects/show.html.haml
View
@@ -9,7 +9,7 @@
%p== Locale Title Text: #{t(@view_object_setting.locale_title.try(:to_sym)) || @view_object_setting.locale_title}
- if @view_object_setting.locale_subtitle.present?
%p== Locale Subtitle Text: #{t(@view_object_setting.locale_subtitle.to_sym) || @view_object_setting.locale_subtitle}
- - unless @view_object_setting.is_curated
+ - unless @view_object_setting.is_curated or @view_object_setting.kommands.empty?
%p== Model Resource: #{@view_object_setting.klass_name.tableize.titleize}
- kommand = @view_object_setting.kommands.first
%p== Model Method: #{kommand[:method_name].titleize}
@@ -33,6 +33,8 @@
- else
= link_to "Edit", edit_admin_view_object_path(@view_object)
|
+ = link_to(@view_object.blocked? ? 'UnBlock' : 'Block', admin_block_path(@view_object.class.name.foreign_key.to_sym => @view_object))
+ |
= link_to "Clone", clone_admin_view_object_path(@view_object)
-#
%h2 Update View Object
1  app/views/layouts/new_admin.html.haml
View
@@ -169,6 +169,7 @@
%li= link_to 'Translations', admin_translations_path
%li= link_to 'Refresh changes', refresh_admin_locales_path
%li= link_to 'Menu Items', admin_menu_items_path
+ %li= link_to 'Logo / Favicon', admin_branding_path
%li
%a{:href => "#links"} Your Site
%ul
7 app/views/shared/_header.html.haml
View
@@ -4,6 +4,13 @@
%h1#site-name-wrap
%a#site-name{:title => "Front Page - #{get_setting('site_title').try(:value)}", :href => "#{root_url}"}= get_setting('site_title').try(:value)
+ - # Override css with custom logo if provided
+ - if Branding.logo
+ %style{:type => 'text/css'}
+ :sass
+ #site-name
+ background-image: url(#{logo_branding_url}) !important
+
#header-actions
- cache :google_search_header_html, :expires_in => 180.minute do
- if Metadata::Setting.find_setting('google_search_engine_id').present?
4 config/routes/admin.rb
View
@@ -7,6 +7,8 @@
match '/translations.:format' => 'translations#translations', :as => :translations
match '/asset_translations.:format' => 'translations#asset_translations', :as => :asset_translations
+ resource :branding, :controller => 'branding'
+
resources :activity_scores
resources :ad_layouts
resources :ads
@@ -94,7 +96,7 @@
post :save
end
end
-
+
resources :newswires
resources :prediction_groups do
member do
5 config/routes/main.rb
View
@@ -13,6 +13,9 @@
end
end
+ match '/branding/logo' => 'branding#logo', :as => :logo_branding
+ match '/favicon.ico' => 'branding#favicon', :as => :favicon_branding
+
resources :resource_sections do
resources :resources
member do
@@ -124,7 +127,7 @@
match '/classifieds/:id/set_status/:status.:format' => 'classifieds#set_status', :as => :set_status_classified
match '/classifieds/category/:category.:format' => 'classifieds#categories', :as => :categorized_classifieds
match '/classifieds/category/:category/page/:page.:format' => 'classifieds#categories', :as => :categorized_classifieds_with_page
-
+
match '/tags/suggest' => 'tags#suggest', :as => :tags_suggest
resources :users do
11 db/migrate/20120406052102_add_branding.rb
View
@@ -0,0 +1,11 @@
+class AddBranding < ActiveRecord::Migration
+ def up
+ create_table :brandings do |t|
+ t.binary :logo
+ t.binary :favicon
+ end
+ end
+
+ def down
+ end
+end
17 db/migrate/20120408023719_change_view_object_template_names.rb
View
@@ -0,0 +1,17 @@
+class ChangeViewObjectTemplateNames < ActiveRecord::Migration
+ def up
+ ViewObjectTemplate.all.each do |t|
+ pn = String.new(t.pretty_name)
+ pn = pn.replace(pn[10..100] + "(#{pn[0..8]})") unless !pn.match(/^Version.*/)
+ t.update_attribute :pretty_name, pn unless pn.nil?
+ end
+ end
+
+ def down
+ ViewObjectTemplate.all.each do |t|
+ pn = String.new(t.pretty_name)
+ pn = pn.replace(pn[(pn.length-10)..(pn.length-2)] + " " + pn[0,(pn.length-11)]) unless !pn.match(/.?\(Version 2|3\)$/)
+ t.update_attribute :pretty_name, pn unless pn.nil?
+ end
+ end
+end
20 db/migrate/20120409185035_remove_old_vo_templates.rb
View
@@ -0,0 +1,20 @@
+class RemoveOldVoTemplates < ActiveRecord::Migration
+ def up
+ template_names = ["v2_single_col_list",
+ "v2_triple_col_large_2",
+ "v2_double_col_feature",
+ "v2_single_col_small_list",
+ "v2_single_col_item",
+ "v2_double_col_item",
+ "v2_double_col_item_list",
+ "v2_double_col_triple_item",
+ "v2_double_col_feature_triple_item"]
+ template_names.each do |tn|
+ tn = ViewObjectTemplate.find_by_name(tn)
+ tn.destroy
+ end
+ end
+
+ def down
+ end
+end
6 db/migrate/20120409195722_add_is_blockable_to_view_objects.rb
View
@@ -0,0 +1,6 @@
+class AddIsBlockableToViewObjects < ActiveRecord::Migration
+ def change
+ add_column :view_objects, :is_blocked, :boolean, :default => false
+ add_index :view_objects, :is_blocked
+ end
+end
6 db/migrate/20120409203626_add_is_blockable_to_metadatas.rb
View
@@ -0,0 +1,6 @@
+class AddIsBlockableToMetadatas < ActiveRecord::Migration
+ def change
+ add_column :metadatas, :is_blocked, :boolean, :default => false
+ add_index :metadatas, :is_blocked
+ end
+end
41 db/migrate/20120411203207_add_preview_to_view_object_templates.rb
View
@@ -0,0 +1,41 @@
+class AddPreviewToViewObjectTemplates < ActiveRecord::Migration
+ def change
+ add_column :view_object_templates, :preview, :string, :default => nil
+
+ vt = ViewObjectTemplate.find_by_name "v3_double_col_1_large_2_small"
+ vt.update_attribute :preview, "template_previews/Double-One-Large-Two-Small.png"
+
+ vt = ViewObjectTemplate.find_by_name "v3_double_col_2_medium"
+ vt.update_attribute :preview, "template_previews/Double-Two-Medium.png"
+
+ vt = ViewObjectTemplate.find_by_name "v3_triple_col_1_large_4_small"
+ vt.update_attribute :preview, "template_previews/Triple-1-Large-4-Small.png"
+
+
+ vt = ViewObjectTemplate.find_by_name "v3_triple_col_4_small"
+ vt.update_attribute :preview, "template_previews/Triple-Four-Small.png"
+
+
+ vt = ViewObjectTemplate.find_by_name "v3_triple_col_3_medium"
+ vt.update_attribute :preview, "template_previews/Triple-Three-Medium.png"
+
+
+ vt = ViewObjectTemplate.find_by_name "v3_triple_col_2_large"
+ vt.update_attribute :preview, "template_previews/Triple-Two-Large.png"
+
+ vt = ViewObjectTemplate.find_by_name "v2_single_col_list_with_profile"
+ vt.update_attribute :preview, "template_previews/single-col-newest-items-with-pics.png"
+
+ vt = ViewObjectTemplate.find_by_name "v2_single_facebook_widget"
+ vt.update_attribute :preview, "template_previews/single-col-facebook-recommendations.png"
+
+ vt = ViewObjectTemplate.find_by_name "v3_single_col_item_list"
+ vt.update_attribute :preview, "template_previews/single-col-universal-top-items-list.png"
+
+ vt = ViewObjectTemplate.find_by_name "v2_single_col_user_list"
+ vt.update_attribute :preview, "template_previews/single-col-user-images.png"
+
+ vt = ViewObjectTemplate.find_by_name "v2_welcome_panel"
+ vt.update_attribute :preview, "template_previews/single-col-welcome-panel.png"
+ end
+end
115 db/seeds.rb
View
@@ -495,108 +495,49 @@
[
{
:name => "v2_welcome_panel",
- :pretty_name => "Version 2 Welcome Panel",
+ :pretty_name => "Welcome Panel (Version 2)",
:template => "shared/templates/single_col_welcome_panel",
:min_items => nil,
:max_items => nil
},
{
- :name => "v2_single_col_list",
- :pretty_name => "Version 2 Single Column List",
- :template => "shared/templates/single_col_list",
- :min_items => 1
- },
- {
:name => "v2_single_col_list_with_profile",
- :pretty_name => "Version 2 Single Column List With Profile",
+ :pretty_name => "Single Column List With Profile (Version 2)",
:template => "shared/templates/single_col_list_with_profile",
:min_items => 1
},
{
:name => "v2_single_facebook_widget",
- :pretty_name => "Version 2 Single Column Facebook Widget",
+ :pretty_name => "Single Column Facebook Widget (Version 2)",
:template => "shared/templates/single_col_facebook_widget",
:min_items => nil,
:max_items => nil
},
{
- :name => "v2_triple_col_large_2",
- :pretty_name => "Version 2 Triple Column Large Feature With 2 Sub Items",
- :template => "shared/templates/triple_col_large_2",
- :min_items => 3,
- :max_items => 3
- },
- {
- :name => "v2_double_col_feature",
- :pretty_name => "Version 2 Double Column Feature",
- :template => "shared/templates/double_col_feature",
- :min_items => 1,
- :max_items => 1
- },
- {
:name => "v2_single_col_user_list",
- :pretty_name => "Version 2 Single Column User List",
+ :pretty_name => "Single Column User List (Version 2)",
:template => "shared/templates/single_col_user_list",
:min_items => 1
},
{
- :name => "v2_single_col_small_list",
- :pretty_name => "Version 2 Single Column Small List",
- :template => "shared/templates/single_col_small_list",
- :min_items => 1
- },
- {
:name => "v2_single_col_gallery_strip",
- :pretty_name => "Version 2 Single Column Gallery Strip",
+ :pretty_name => "Single Column Gallery Strip (Version 2)",
:template => "shared/templates/single_col_gallery_strip",
:min_items => 1
},
{
- :name => "v2_single_col_item",
- :pretty_name => "Version 2 Single Column Item",
- :template => "shared/templates/single_col_item",
- :min_items => 1,
- :max_items => 1
- },
- {
- :name => "v2_double_col_item",
- :pretty_name => "Version 2 Double Column Item",
- :template => "shared/templates/double_col_item",
- :min_items => 1,
- :max_items => 1
- },
- {
- :name => "v2_double_col_item_list",
- :pretty_name => "Version 2 Double Column Item List",
- :template => "shared/templates/double_col_item_list",
- :min_items => 1
- },
- {
:name => "v2_single_col_gallery_big_image",
- :pretty_name => "Version 2 Single Column Gallery Big Image",
+ :pretty_name => "Single Column Gallery Big Image (Version 2)",
:template => "shared/templates/single_col_gallery_big_image",
:min_items => 1
},
{
:name => "v2_double_col_gallery_strip",
- :pretty_name => "Version 2 Double Column Gallery Strip",
+ :pretty_name => "Double Column Gallery Strip (Version 2)",
:template => "shared/templates/double_col_gallery_strip",
:min_items => 1
},
{
- :name => "v2_double_col_triple_item",
- :pretty_name => "Version 2 Double Column Triple Item",
- :template => "shared/templates/double_col_triple_item",
- :min_items => 3,
- :max_items => 3
- },
- {
- :name => "v2_double_col_feature_triple_item",
- :pretty_name => "Version 2 Double Column Feature With Triple Item",
- :template => "shared/templates/double_col_feature_triple_item",
- :min_items => 1
- },
- {
:name => "twitter_standard_list",
:pretty_name => "Twitter Standard List",
:template => "shared/sidebar/twitter_standard_list",
@@ -626,28 +567,28 @@
},
{
:name => "v2_ad_template",
- :pretty_name => "Version 2 Ad Template",
+ :pretty_name => "Ad Template (Version 2)",
:template => "shared/templates/ad_template",
:min_items => nil,
:max_items => nil
},
{
:name => "v2_single_col_custom_widget",
- :pretty_name => "Version 2 Single Column Custom Widget",
+ :pretty_name => "Single Column Custom Widget (Version 2)",
:template => "shared/templates/single_col_custom_widget",
:min_items => nil,
:max_items => nil
},
{
:name => "v2_double_col_custom_widget",
- :pretty_name => "Version 2 Double Column Custom Widget",
+ :pretty_name => "Double Column Custom Widget (Version 2)",
:template => "shared/templates/double_col_custom_widget",
:min_items => nil,
:max_items => nil
},
{
:name => "v2_triple_col_custom_widget",
- :pretty_name => "Version 2 Triple Column Custom Widget",
+ :pretty_name => "Triple Column Custom Widget (Version 2)",
:template => "shared/templates/triple_col_custom_widget",
:min_items => nil,
:max_items => nil
@@ -655,115 +596,115 @@
# V3 widgets
{
:name => "v3_triple_col_1_large_4_small",
- :pretty_name => "Version 3 Triple Column 1 Large 4 Small Widget",
+ :pretty_name => "Triple Column 1 Large 4 Small Widget (Version 3)",
:template => "shared/templates/v3/triple_col_1_large_4_small",
:min_items => 5,
:max_items => 5
},
{
:name => "v3_triple_col_2_large",
- :pretty_name => "Version 3 Triple Column 2 Large Widget",
+ :pretty_name => "Triple Column 2 Large Widget (Version 3)",
:template => "shared/templates/v3/triple_col_2_large",
:min_items => 2,
:max_items => 2
},
{
:name => "v3_triple_col_1_large_2_small_3_links",
- :pretty_name => "Version 3 Triple Column 1 Large 2 Small 3 Links Widget",
+ :pretty_name => "Triple Column 1 Large 2 Small 3 Links Widget (Version 3)",
:template => "shared/templates/v3/triple_col_1_large_2_small_3_links",
:min_items => 6,
:max_items => 6
},
{
:name => "v3_triple_col_2_medium_2_links",
- :pretty_name => "Version 3 Triple Column 2 medium 2 links",
+ :pretty_name => "Triple Column 2 medium 2 links (Version 3)",
:template => "shared/templates/v3/triple_col_2_medium_2_links",
:min_items => 4,
:max_items => 4
},
{
:name => "v3_double_col_1_large_2_small",
- :pretty_name => "Version 3 Double Column 1 Large 2 Small",
+ :pretty_name => "Double Column 1 Large 2 Small (Version 3)",
:template => "shared/templates/v3/double_col_1_large_2_small",
:min_items => 3,
:max_items => 3
},
{
:name => "v3_double_col_2_medium",
- :pretty_name => "Version 3 Double Column 2 Medium",
+ :pretty_name => "Double Column 2 Medium (Version 3)",
:template => "shared/templates/v3/double_col_2_medium",
:min_items => 2,
:max_items => 2
},
{
:name => "v3_double_col_2_small_3_medium_links",
- :pretty_name => "Version 3 Double Column 2 small 3 medium links",
+ :pretty_name => "Double Column 2 small 3 medium links (Version 3)",
:template => "shared/templates/v3/double_col_2_small_3_medium_links",
:min_items => 5,
:max_items => 5
},
{
:name => "v3_double_col_3_medium_links_2_small",
- :pretty_name => "Version 3 Double Column 3 Medium Links 2 Small",
+ :pretty_name => "Double Column 3 Medium Links 2 Small (Version 3)",
:template => "shared/templates/v3/double_col_3_medium_links_2_small",
:min_items => 5,
:max_items => 5
},
{
:name => "v3_double_col_2_medium_links_1_medium",
- :pretty_name => "Version 3 Double Column 2 Medium Links 1 Medium",
+ :pretty_name => "Double Column 2 Medium Links 1 Medium (Version 3)",
:template => "shared/templates/v3/double_col_2_medium_links_1_medium",
:min_items => 3,
:max_items => 3
},
{
:name => "v3_double_col_1_medium_2_medium_links",
- :pretty_name => "Version 3 Double Column 1 Medium 2 Medium Links",
+ :pretty_name => "Double Column 1 Medium 2 Medium Links (Version 3)",
:template => "shared/templates/v3/double_col_1_medium_2_medium_links",
:min_items => 3,
:max_items => 3
},
{
:name => "v3_double_col_item_list",
- :pretty_name => "Version 3 Double Column Item List",
+ :pretty_name => "Double Column Item List (Version 3)",
:template => "shared/templates/v3/double_col_item_list",
:min_items => 5
},
{
:name => "v3_single_col_featured_item",
- :pretty_name => "Version 3 Single Column Featured Item",
+ :pretty_name => "Single Column Featured Item (Version 3)",
:template => "shared/templates/v3/single_col_featured_item",
:min_items => 1,
:max_items => 1
},
{
:name => "v3_single_col_medium",
- :pretty_name => "Version 3 Single Column Medium",
+ :pretty_name => "Single Column Medium (Version 3)",
:template => "shared/templates/v3/single_col_medium",
:min_items => 1,
:max_items => 1
},
{
:name => "v3_single_col_item_list",
- :pretty_name => "Version 3 Single Column Item List",
+ :pretty_name => "Single Column Item List (Version 3)",
:template => "shared/templates/v3/single_col_item_list",
:min_items => 1
},
{
:name => "v3_single_col_post_story",
- :pretty_name => "Version 3 Single Column Post Story",
+ :pretty_name => "Single Column Post Story (Version 3)",
:template => "shared/templates/v3/single_col_post_story"
},
{
:name => "v3_triple_col_3_medium",
- :pretty_name => "Version 3 Triple Column 3 Medium Skybox",
+ :pretty_name => "Triple Column 3 Medium Skybox (Version 3)",
:template => "shared/templates/v3/triple_col_3_medium",
:min_items => 3,
:max_items => 3
},
{
:name => "v3_triple_col_4_small",
- :pretty_name => "Version 3 Triple Column 4 Small Skybox",
+ :pretty_name => "Triple Column 4 Small Skybox (Version 3)",
:template => "shared/templates/v3/triple_col_4_small",
:min_items => 4,
:max_items => 4
4 lib/view_tree.rb
View
@@ -73,11 +73,11 @@ def render_string
end
def render
- if @cache and out = Newscloud::Redcloud.redis.get(@cache_key_name) and out.present?
+ if @cache and out = Newscloud::Redcloud.redis.get(@cache_key_name) and out.present? and !out.is_blocked?
return out
else
load_view_object
- return '' unless @view_object
+ return '' unless @view_object and !@view_object.is_blocked?
uncache_it
end
Please sign in to comment.
Something went wrong with that request. Please try again.